結果
| 問題 |
No.29 パワーアップ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-09-04 19:17:26 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 39 ms / 5,000 ms |
| コード長 | 692 bytes |
| コンパイル時間 | 171 ms |
| コンパイル使用メモリ | 12,160 KB |
| 実行使用メモリ | 10,624 KB |
| 最終ジャッジ日時 | 2025-10-24 21:15:52 |
| 合計ジャッジ時間 | 1,674 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
ソースコード
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_3) 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 #ans print(p_1s + p_2s + p_5s)