結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,288 KB
testcase_01 AC 77 ms
71,152 KB
testcase_02 AC 77 ms
71,312 KB
testcase_03 AC 76 ms
71,328 KB
testcase_04 AC 126 ms
89,816 KB
testcase_05 AC 123 ms
88,040 KB
testcase_06 AC 101 ms
79,952 KB
testcase_07 AC 127 ms
91,688 KB
testcase_08 AC 110 ms
83,032 KB
testcase_09 AC 95 ms
78,040 KB
testcase_10 AC 123 ms
89,668 KB
testcase_11 AC 130 ms
91,992 KB
testcase_12 AC 191 ms
100,356 KB
testcase_13 AC 177 ms
100,512 KB
testcase_14 AC 75 ms
71,196 KB
testcase_15 AC 179 ms
100,536 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))
dp = [-10**6 for _ in range(10)]
dp[0] = 0
for x in a:
	x %= 10
	tmp = [-10**6 for _ in range(10)]
	for i in range(10):
		tmp[i] = max(dp[i], dp[(i-x)%10] + 1)
	dp = tmp
print(dp[0])
0