답안 #548960

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
548960 2022-04-14T20:30:23 Z beaconmc Just Long Neckties (JOI20_ho_t1) PyPy 3
0 / 100
34 ms 18228 KB
n = int(input())

ties = list(map(int, input().split()))
realsus = list(ties)
employees = list(map(int, input().split()))
temp = sorted(ties)
employees.sort()
tiesmap = dict()
for i in range(len(temp)):
    tiesmap[temp[i]] = i

sussies = dict()
ties = list(temp)

max1 = [ties[i]-employees[i] for i in range(n)]
max2 = [ties[i]-employees[i-1] for i in range(1, n+1)]

for i in range(1,n):
    max1[i] = max(max1[i-1], max1[i])
for i in range(n-2, 1, -1):
    max2[i] = max(max2[i-1], max2[i])

sussies[0] = max2[0]
sussies[n] = max1[-1]

for i in range(1,n):
    sussies[i] = max(max1[i-1], max2[i])
realsus = [sussies[tiesmap[i]] for i in realsus]
print(*realsus)
# 결과 실행 시간 메모리 Grader output
1 Incorrect 34 ms 18228 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 34 ms 18228 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 34 ms 18228 KB Output isn't correct
2 Halted 0 ms 0 KB -