結果

問題 No.1231 Make a Multiple of Ten
ユーザー KudeKude
提出日時 2020-09-18 21:39:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 172 ms / 2,000 ms
コード長 242 bytes
コンパイル時間 298 ms
コンパイル使用メモリ 87,108 KB
実行使用メモリ 100,576 KB
最終ジャッジ日時 2023-09-05 18:11:43
合計ジャッジ時間 3,191 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,252 KB
testcase_01 AC 79 ms
71,308 KB
testcase_02 AC 85 ms
71,288 KB
testcase_03 AC 79 ms
71,148 KB
testcase_04 AC 123 ms
88,408 KB
testcase_05 AC 118 ms
86,536 KB
testcase_06 AC 96 ms
78,632 KB
testcase_07 AC 128 ms
89,264 KB
testcase_08 AC 106 ms
81,976 KB
testcase_09 AC 96 ms
77,316 KB
testcase_10 AC 127 ms
87,644 KB
testcase_11 AC 127 ms
89,748 KB
testcase_12 AC 167 ms
99,864 KB
testcase_13 AC 170 ms
100,168 KB
testcase_14 AC 81 ms
71,476 KB
testcase_15 AC 172 ms
100,576 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

dp = [-1] * 10
dp[0] = 0
input()
for a in map(int, input().split()):
    ndp = dp[:]
    for i in range(10):
        if dp[i] < 0:
            continue
        j = (i + a) % 10
        ndp[j] = max(ndp[j], dp[i] + 1)
    dp = ndp
print(dp[0])
0