結果

問題 No.1231 Make a Multiple of Ten
ユーザー convexineqconvexineq
提出日時 2021-02-13 20:27:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 157 ms / 2,000 ms
コード長 205 bytes
コンパイル時間 265 ms
コンパイル使用メモリ 87,124 KB
実行使用メモリ 108,436 KB
最終ジャッジ日時 2023-09-28 05:49:55
合計ジャッジ時間 3,963 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
71,380 KB
testcase_01 AC 60 ms
71,296 KB
testcase_02 AC 59 ms
71,380 KB
testcase_03 AC 62 ms
71,116 KB
testcase_04 AC 104 ms
92,012 KB
testcase_05 AC 97 ms
89,824 KB
testcase_06 AC 79 ms
80,192 KB
testcase_07 AC 107 ms
93,716 KB
testcase_08 AC 87 ms
84,768 KB
testcase_09 AC 73 ms
77,840 KB
testcase_10 AC 99 ms
91,640 KB
testcase_11 AC 109 ms
94,320 KB
testcase_12 AC 155 ms
107,288 KB
testcase_13 AC 157 ms
108,160 KB
testcase_14 AC 62 ms
71,300 KB
testcase_15 AC 157 ms
108,436 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
*a, = map(int,input().split())
dp = [0]+[-1<<30]*9
for ai in a:
    ndp = dp[:]
    for i in range(10):
        v = (i+ai)%10
        ndp[v] = max(ndp[v],dp[i]+1)
    dp = ndp
print(dp[0])
0