結果

問題 No.484 収穫
ユーザー gew1fw
提出日時 2025-06-12 14:46:58
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 706 bytes
コンパイル時間 211 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 76,268 KB
最終ジャッジ日時 2025-06-12 14:48:41
合計ジャッジ時間 2,593 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    import sys
    input = sys.stdin.read().split()
    N = int(input[0])
    A = list(map(int, input[1:N+1]))
    
    min_time = float('inf')
    
    for s in range(1, N + 1):
        left_max = 0
        for i in range(1, s + 1):
            temp = A[i - 1] + (s - i)
            if temp > left_max:
                left_max = temp
        
        right_max = 0
        for i in range(s, N + 1):
            temp = A[i - 1] + (i - s)
            if temp > right_max:
                right_max = temp
        
        current_max = max(left_max, right_max)
        if current_max < min_time:
            min_time = current_max
    
    print(min_time)

if __name__ == "__main__":
    main()
0