結果

問題 No.1231 Make a Multiple of Ten
ユーザー 👑 H20H20
提出日時 2020-11-06 09:32:16
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 335 bytes
コンパイル時間 287 ms
コンパイル使用メモリ 87,212 KB
実行使用メモリ 119,848 KB
最終ジャッジ日時 2023-09-29 17:39:15
合計ジャッジ時間 3,316 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,276 KB
testcase_01 AC 70 ms
71,404 KB
testcase_02 AC 75 ms
71,504 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 85 ms
77,572 KB
testcase_10 AC 122 ms
94,448 KB
testcase_11 WA -
testcase_12 AC 201 ms
118,104 KB
testcase_13 AC 206 ms
119,848 KB
testcase_14 AC 70 ms
71,500 KB
testcase_15 AC 207 ms
119,804 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+1][(j+a)%10] ,TEN[i][j]+1)
        else:
            TEN[i+1][(j+a)%10] = TEN[i][(j+a)%10]
 
print(TEN[N][0])
0