Submission #49605573


Source Code Expand

import sys
input = sys.stdin.readline

N = int(input())
A = list(map(int, input().split()))
left, right = [1]*N, [1]*N

for i in range(1, N):
    left[i] = min(A[i], left[i-1]+1)

for i in range(N-2, -1, -1):
    right[i] = min(A[i], right[i+1]+1)

ans = 0

for i in range(N):
    ans = max(ans, min(left[i], right[i]))

print(ans)

Submission Info

Submission Time
Task D - Pyramid
User roaris_cp
Language Python (PyPy 3.10-v7.3.12)
Score 400
Code Size 349 Byte
Status AC
Exec Time 100 ms
Memory 115568 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
AC × 3
AC × 42
Set Name Test Cases
Sample example_00.txt, example_01.txt, example_02.txt
All example_00.txt, example_01.txt, example_02.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt, random_20.txt, random_21.txt, random_22.txt, random_23.txt, random_24.txt, random_25.txt, random_26.txt, random_27.txt, random_28.txt, random_29.txt, random_30.txt, random_31.txt, random_32.txt
Case Name Status Exec Time Memory
example_00.txt AC 64 ms 76188 KiB
example_01.txt AC 65 ms 76348 KiB
example_02.txt AC 64 ms 76028 KiB
hand_00.txt AC 100 ms 115568 KiB
hand_01.txt AC 89 ms 112048 KiB
hand_02.txt AC 94 ms 113736 KiB
hand_03.txt AC 94 ms 113688 KiB
hand_04.txt AC 96 ms 113520 KiB
hand_05.txt AC 96 ms 114028 KiB
random_00.txt AC 99 ms 115064 KiB
random_01.txt AC 95 ms 115100 KiB
random_02.txt AC 94 ms 115040 KiB
random_03.txt AC 92 ms 113524 KiB
random_04.txt AC 94 ms 113292 KiB
random_05.txt AC 94 ms 113752 KiB
random_06.txt AC 92 ms 113452 KiB
random_07.txt AC 94 ms 113468 KiB
random_08.txt AC 95 ms 113516 KiB
random_09.txt AC 95 ms 113524 KiB
random_10.txt AC 94 ms 113604 KiB
random_11.txt AC 93 ms 113408 KiB
random_12.txt AC 94 ms 113624 KiB
random_13.txt AC 96 ms 113564 KiB
random_14.txt AC 92 ms 113664 KiB
random_15.txt AC 94 ms 113396 KiB
random_16.txt AC 95 ms 113560 KiB
random_17.txt AC 92 ms 113504 KiB
random_18.txt AC 95 ms 113532 KiB
random_19.txt AC 92 ms 113460 KiB
random_20.txt AC 92 ms 113624 KiB
random_21.txt AC 94 ms 113436 KiB
random_22.txt AC 94 ms 113576 KiB
random_23.txt AC 91 ms 113428 KiB
random_24.txt AC 94 ms 113528 KiB
random_25.txt AC 90 ms 113332 KiB
random_26.txt AC 94 ms 113516 KiB
random_27.txt AC 92 ms 113756 KiB
random_28.txt AC 92 ms 113840 KiB
random_29.txt AC 91 ms 113696 KiB
random_30.txt AC 91 ms 113876 KiB
random_31.txt AC 91 ms 113936 KiB
random_32.txt AC 90 ms 113704 KiB