結果
問題 | No.1231 Make a Multiple of Ten |
ユーザー | toyuzuko |
提出日時 | 2020-09-21 22:53:15 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 1,545 ms / 2,000 ms |
コード長 | 291 bytes |
コンパイル時間 | 97 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 33,056 KB |
最終ジャッジ日時 | 2024-06-24 21:43:03 |
合計ジャッジ時間 | 10,690 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 |
ソースコード
N = int(input()) A = list(map(int, input().split())) rem = [-1] * 10 rem[0] = 0 for i in range(N): a = A[i] % 10 tmp = rem.copy() for j in range(10): if rem[(j - a) % 10] != -1: tmp[j] = max(rem[j], rem[(j - a) % 10] + 1) rem = tmp.copy() print(rem[0])