for i in range(N): dungchi_list.append(list(map(int, input().split())))
for i in range(len(dungchi_list)): # 현재 덩치 count = 1 for j in range(len(dungchi_list)): # 비교할 덩치들 if dungchi_list[i][0] < dungchi_list[j][0]: # 몸무게도 크고 if dungchi_list[i][1] < dungchi_list[j][1]: # 키도 크다면 count = count + 1 answer.append(count)
print(' '.join(map(str, answer)))
References 1 (출처)
1 2 3 4 5 6 7 8 9 10 11 12 13
num_student = int(input()) student_list = []
for _ in range(num_student): weight, height = map(int, input().split()) student_list.append((weight, height))
for i in student_list: rank = 1 for j in student_list: if i[0] < j[0] and i[1] < j[1]: rank += 1 print(rank, end = " ")