結果

問題 No.45 回転寿司
ユーザー kept1994kept1994
提出日時 2022-05-07 01:47:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 90 ms / 5,000 ms
コード長 346 bytes
コンパイル時間 262 ms
コンパイル使用メモリ 87,336 KB
実行使用メモリ 75,744 KB
最終ジャッジ日時 2023-09-20 10:03:33
合計ジャッジ時間 5,460 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,376 KB
testcase_01 AC 90 ms
75,344 KB
testcase_02 AC 78 ms
75,704 KB
testcase_03 AC 78 ms
75,728 KB
testcase_04 AC 76 ms
75,372 KB
testcase_05 AC 71 ms
71,132 KB
testcase_06 AC 77 ms
75,268 KB
testcase_07 AC 78 ms
75,720 KB
testcase_08 AC 73 ms
71,572 KB
testcase_09 AC 77 ms
75,744 KB
testcase_10 AC 73 ms
71,292 KB
testcase_11 AC 73 ms
71,172 KB
testcase_12 AC 78 ms
75,520 KB
testcase_13 AC 73 ms
71,476 KB
testcase_14 AC 76 ms
71,332 KB
testcase_15 AC 77 ms
71,612 KB
testcase_16 AC 74 ms
71,444 KB
testcase_17 AC 73 ms
71,372 KB
testcase_18 AC 73 ms
71,488 KB
testcase_19 AC 78 ms
75,408 KB
testcase_20 AC 74 ms
71,280 KB
testcase_21 AC 77 ms
71,512 KB
testcase_22 AC 75 ms
71,380 KB
testcase_23 AC 71 ms
71,132 KB
testcase_24 AC 72 ms
71,572 KB
testcase_25 AC 70 ms
71,400 KB
testcase_26 AC 73 ms
71,376 KB
testcase_27 AC 75 ms
75,680 KB
testcase_28 AC 71 ms
71,388 KB
testcase_29 AC 76 ms
75,656 KB
testcase_30 AC 76 ms
75,444 KB
testcase_31 AC 71 ms
71,600 KB
testcase_32 AC 72 ms
71,564 KB
testcase_33 AC 78 ms
75,684 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
import sys
MOD = 998244353
def main():
    N = int(input())
    A = list(map(int, input().split()))
    dp = [[0 for _ in range(2)] for _ in range(N + 1)]
    for i in range(N):
        dp[i + 1][0] = max(dp[i])
        dp[i + 1][1] = dp[i][0] + A[i]
    print(max(dp[-1]))
    return

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