Rating changes for last rounds are temporarily rolled back. They will be returned soon. ×

 
 
 
 
General
 
 
# Author Problem Lang Verdict Time Memory Sent Judged  
181979443 Contestant:
yuycoding
1760C - 37 PyPy 3-64 Accepted 327 ms 26924 KB 2022-11-21 18:39:08 2022-11-22 13:19:03
→ Source
t = int(input())

for _ in range(t):
    n = int(input())
    s = list(map(int, input().split()))

    max_val, sec_val = 0, 0

    for x in s:
        if x >= max_val:
            sec_val, max_val = max_val, x
        elif x >= sec_val:
            sec_val = x

    for x in s:
        other = sec_val if x == max_val else max_val
        print(x - other, sep='', end=' ')
    print()
?
Time: ? ms, memory: ? KB
Verdict: ?
Input
?
Participant's output
?
Jury's answer
?
Checker comment
?
Diagnostics
?
Click to see test details