Submission #30842751


Source Code Expand

n = int(input())
a = [0] * n
for i in range(n):
    a[i] = int(input())
s = [-1] * (n + 1)
for i in range(1, n + 1):
    s[i] = max(s[i - 1], a[i - 1])
t = [-1] * (n + 1)
for i in range(n - 1, -1, -1):
# n - 1 から 0 まで減らしながら繰り返す:
    t[i] = max(t[i + 1], a[i])
for i in range(n):
    print(max(s[i], t[i + 1]))

Submission Info

Submission Time
Task C - Exception Handling
User Pro_ktmr
Language PyPy3 (7.3.0)
Score 300
Code Size 349 Byte
Status AC
Exec Time 280 ms
Memory 81960 KiB

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 62 ms 61384 KiB
a02 AC 50 ms 61284 KiB
b03 AC 49 ms 61552 KiB
b04 AC 51 ms 61396 KiB
b05 AC 51 ms 61388 KiB
b06 AC 280 ms 80192 KiB
b07 AC 271 ms 81960 KiB
b08 AC 275 ms 80248 KiB
b09 AC 277 ms 80104 KiB
b10 AC 280 ms 80356 KiB
b11 AC 276 ms 80120 KiB
b12 AC 273 ms 80316 KiB