結果

問題 No.1231 Make a Multiple of Ten
ユーザー 👑 H20H20
提出日時 2020-11-06 09:35:36
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 224 ms / 2,000 ms
コード長 333 bytes
コンパイル時間 273 ms
コンパイル使用メモリ 87,184 KB
実行使用メモリ 120,124 KB
最終ジャッジ日時 2023-09-29 17:39:19
合計ジャッジ時間 3,412 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,264 KB
testcase_01 AC 75 ms
71,276 KB
testcase_02 AC 73 ms
71,252 KB
testcase_03 AC 75 ms
71,376 KB
testcase_04 AC 136 ms
94,260 KB
testcase_05 AC 134 ms
92,948 KB
testcase_06 AC 110 ms
85,212 KB
testcase_07 AC 136 ms
95,648 KB
testcase_08 AC 120 ms
90,848 KB
testcase_09 AC 93 ms
78,072 KB
testcase_10 AC 135 ms
94,176 KB
testcase_11 AC 153 ms
95,728 KB
testcase_12 AC 217 ms
118,568 KB
testcase_13 AC 224 ms
119,856 KB
testcase_14 AC 73 ms
71,260 KB
testcase_15 AC 222 ms
120,124 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split())) 
TEN = [[0] * 10 for i in range(N+1)]
for i in range(N):
    a = A[i]%10
    for j in range(10):
        if TEN[i][j]!=0 or j==0:
            TEN[i+1][(j+a)%10] = max(TEN[i][(j+a)%10] ,TEN[i][j]+1)
        else:
            TEN[i+1][(j+a)%10] = TEN[i][(j+a)%10]
 
print(TEN[N][0])
0