結果

問題 No.1231 Make a Multiple of Ten
ユーザー marroncastlemarroncastle
提出日時 2020-09-18 21:53:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 180 ms / 2,000 ms
コード長 208 bytes
コンパイル時間 269 ms
コンパイル使用メモリ 86,920 KB
実行使用メモリ 100,748 KB
最終ジャッジ日時 2023-09-05 18:18:23
合計ジャッジ時間 3,289 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,388 KB
testcase_01 AC 75 ms
71,256 KB
testcase_02 AC 76 ms
71,232 KB
testcase_03 AC 77 ms
71,540 KB
testcase_04 AC 129 ms
90,076 KB
testcase_05 AC 119 ms
88,164 KB
testcase_06 AC 100 ms
80,120 KB
testcase_07 AC 126 ms
91,732 KB
testcase_08 AC 107 ms
83,596 KB
testcase_09 AC 92 ms
77,700 KB
testcase_10 AC 122 ms
90,084 KB
testcase_11 AC 128 ms
92,016 KB
testcase_12 AC 174 ms
100,748 KB
testcase_13 AC 180 ms
100,624 KB
testcase_14 AC 77 ms
71,484 KB
testcase_15 AC 180 ms
100,748 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))
dp = [-100]*10
dp[0] = 0
for i in range(N):
  new_dp = [0]*10
  for j in range(10):
    new_dp[j] = max(dp[j],dp[(j-A[i])%10]+1)
  dp = new_dp
print(dp[0])
0