Submission #6450852


Source Code Expand

Copy
def main():
    import sys
    input = sys.stdin.readline
    
    n = int(input())
    arr = [0] * n
    for i in range(n):
        arr[i] = int(input())
    
    l = [0] * n
    r = [0] * n
    
    l[0] = arr[0]
    r[~0] = arr[~0]
    for i in range(1, n):
        l[i] = max(l[i - 1], arr[i])
        r[~i] = max(r[~(i - 1)], arr[~i])
    
    print(r[1])
    for i in range(1, n - 1):
        print(max(l[i - 1], r[i + 1]))
    print(l[~1])
    
    return 0

main()

Submission Info

Submission Time
Task C - Exception Handling
User keima915
Language Python (3.4.3)
Score 300
Code Size 497 Byte
Status AC
Exec Time 404 ms
Memory 15676 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 2
AC × 12
Set Name Test Cases
Sample a01, a02
All a01, a02, b03, b04, b05, b06, b07, b08, b09, b10, b11, b12
Case Name Status Exec Time Memory
a01 AC 17 ms 3064 KB
a02 AC 17 ms 3064 KB
b03 AC 17 ms 3064 KB
b04 AC 17 ms 3064 KB
b05 AC 17 ms 3064 KB
b06 AC 393 ms 15676 KB
b07 AC 376 ms 8816 KB
b08 AC 404 ms 15676 KB
b09 AC 380 ms 15516 KB
b10 AC 382 ms 15628 KB
b11 AC 387 ms 15676 KB
b12 AC 396 ms 15516 KB