結果
| 問題 | No.29 パワーアップ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-05-06 15:55:50 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 35 ms / 5,000 ms |
| コード長 | 354 bytes |
| 記録 | |
| コンパイル時間 | 392 ms |
| コンパイル使用メモリ | 82,356 KB |
| 実行使用メモリ | 54,072 KB |
| 最終ジャッジ日時 | 2025-10-24 21:17:08 |
| 合計ジャッジ時間 | 1,667 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
ソースコード
N = int(input())
item_cnt = [0]*10
for _ in range(N):
item = list(map(int,input().split()))
for i in item:
item_cnt[i-1] += 1
ans = 0
for i in range(10):
power = item_cnt[i]//2
ans += power
item_cnt[i] -= power*2
if item_cnt.count(1) >= 8:
ans += 2
elif item_cnt.count(1) >= 4:
ans += 1
print(ans)