結果

問題 No.45 回転寿司
ユーザー tanon710tanon710
提出日時 2019-04-14 03:35:07
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 239 bytes
コンパイル時間 69 ms
コンパイル使用メモリ 10,572 KB
実行使用メモリ 8,016 KB
最終ジャッジ日時 2023-10-13 14:46:55
合計ジャッジ時間 3,507 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
7,976 KB
testcase_01 AC 69 ms
7,820 KB
testcase_02 WA -
testcase_03 AC 144 ms
7,776 KB
testcase_04 AC 78 ms
7,832 KB
testcase_05 AC 17 ms
7,884 KB
testcase_06 AC 57 ms
7,908 KB
testcase_07 AC 120 ms
7,816 KB
testcase_08 WA -
testcase_09 AC 129 ms
7,908 KB
testcase_10 AC 44 ms
7,880 KB
testcase_11 WA -
testcase_12 AC 141 ms
7,796 KB
testcase_13 AC 17 ms
7,740 KB
testcase_14 AC 16 ms
7,828 KB
testcase_15 AC 49 ms
7,792 KB
testcase_16 WA -
testcase_17 AC 42 ms
7,812 KB
testcase_18 AC 31 ms
7,820 KB
testcase_19 WA -
testcase_20 AC 16 ms
7,820 KB
testcase_21 AC 16 ms
7,944 KB
testcase_22 AC 14 ms
7,848 KB
testcase_23 WA -
testcase_24 AC 15 ms
7,864 KB
testcase_25 AC 15 ms
7,868 KB
testcase_26 AC 53 ms
7,820 KB
testcase_27 WA -
testcase_28 AC 55 ms
7,772 KB
testcase_29 AC 88 ms
7,844 KB
testcase_30 AC 89 ms
7,832 KB
testcase_31 AC 15 ms
7,900 KB
testcase_32 WA -
testcase_33 AC 168 ms
7,916 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
arr=list(map(int,input().split()))
dp=[0]*(n+1)
dp[1]=arr[0]
for i in range(2,n+1):
    limit=0
    for j in range(1,i):
        tmp=dp[i-j-1]+arr[i-j]
        if limit<tmp:
            limit=tmp
    dp[i]=limit
print(dp[n])
0