문제 확인하기
2. 정답 코드 (Python, memory: 31120KB, time: 40ms)
import sys
def get_input():
return sys.stdin.readline()
input_func = get_input
num_cases = int(input_func())
points = []
count = 0
for _ in range(num_cases):
points.append(list(map(int, input_func().split())))
points = sorted(points, key=lambda x: -x[2])
print(points[0][0], points[0][1])
print(points[1][0], points[1][1])
if points[0][0] == points[1][0]:
count = 1
for i in range(2, num_cases):
if count == 0:
print(points[i][0], points[i][1])
break
else:
if points[1][0] != points[i][0]:
print(points[i][0], points[i][1])
break