結果
| 問題 | No.29 パワーアップ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-09-04 19:08:08 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 687 bytes |
| 記録 | |
| コンパイル時間 | 292 ms |
| コンパイル使用メモリ | 21,412 KB |
| 実行使用メモリ | 15,996 KB |
| 最終ジャッジ日時 | 2026-07-15 22:34:00 |
| 合計ジャッジ時間 | 3,735 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 WA * 12 |
ソースコード
n = int(input()) itm = [] for i in range(n): itm += (list(map(int, input().split()))) #偶数個あるアイテムでのパワーアップ p_1 = [itm.count(i) // 2 for i in set(itm) if itm.count(i) % 2 == 0] p_1s = sum(p_1) #奇数個あるアイテムでのパワーアップ(1個は数えず) p_2 = [itm.count(i) // 2 for i in set(itm) if itm.count(i) % 2 == 1 and itm.count(i) != 1] p_2s = sum(p_2) #その他でのパワーアップ p_3 = [itm.count(i) % 2 for i in set(itm) if itm.count(i) % 2 == 1 and itm.count(i) != 1] p_3s = sum(p_2) p_4 = [itm.count(i) for i in set(itm) if itm.count(i) == 1] p_4s = sum(p_4) p_5s = (p_3s + p_4s) // 4 print(p_1s + p_2s + p_5s)