Submission #548961

# Submission time Handle Problem Language Result Execution time Memory
548961 2022-04-14T20:33:08 Z beaconmc Just Long Neckties (JOI20_ho_t1) PyPy 3
0 / 100
45 ms 18220 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)
# Verdict Execution time Memory Grader output
1 Incorrect 45 ms 18220 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 45 ms 18220 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 45 ms 18220 KB Output isn't correct
2 Halted 0 ms 0 KB -