結果
問題 |
No.1231 Make a Multiple of Ten
|
ユーザー |
|
提出日時 | 2020-09-23 17:33:15 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 659 bytes |
コンパイル時間 | 208 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 32,988 KB |
最終ジャッジ日時 | 2024-06-27 22:50:04 |
合計ジャッジ時間 | 3,215 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 1 WA * 12 |
ソースコード
n = int(input()) alst = list(map(int, input().split())) ans = 0 cnt = [0 for _ in range(10)] for a in alst: cnt[a % 10] += 1 for i in range(10): if i == 0: ans += cnt[i] cnt[i] = 0 elif i % 2 == 0: ans += cnt[i] // 5 cnt[i] %= 5 elif i == 5: ans += cnt[i] // 2 cnt[i] %= 2 else: ans += cnt[i] // 10 cnt[i] %= 10 sub = 0 def solve(num = 1, n = 0, total = 0): global sub if num == 10: if total % 10 == 0: sub = max(n, sub) return for i in range(cnt[num] + 1): solve(num + 1, n + i, total + i * num) solve() print(ans + sub)