結果
| 問題 |
No.1231 Make a Multiple of Ten
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-03-15 16:42:39 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 136 ms / 2,000 ms |
| コード長 | 231 bytes |
| コンパイル時間 | 230 ms |
| コンパイル使用メモリ | 81,920 KB |
| 実行使用メモリ | 107,008 KB |
| 最終ジャッジ日時 | 2024-11-07 04:04:59 |
| 合計ジャッジ時間 | 3,195 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 13 |
ソースコード
n=int(input())
a=list(map(int,input().split()))
dp=[-1]*10
dp[0]=0
for x in a:
x%=10
ndp=[-1]*10
for d in range(10):
if dp[d]>=0:
ndp[(d+x)%10]=dp[d]+1
for d in range(10):
dp[d]=max(dp[d],ndp[d])
print(dp[0])