cs icon indicating copy to clipboard operation
cs copied to clipboard

Simpler soution for uva10026

Open pronoym99 opened this issue 3 years ago • 0 comments

The following is a much simpler solution in Python3.x

def result(jobs):
  return ' '.join(str(x[1]) for x in sorted(jobs))

jqs = []
for _ in range(int(input())):
  input()
  jobs = []
  for i in range(1, int(input()) + 1):
    T, S = map(int, input().split())
    jobs.append((T / S, i))
  jqs.append(jobs)

print('\n\n'.join(result(jobs) for jobs in jqs))

pronoym99 avatar Jun 22 '22 15:06 pronoym99