結果
| 問題 | No.29 パワーアップ | 
| コンテスト | |
| ユーザー |  lam6er | 
| 提出日時 | 2025-03-26 15:56:28 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 36 ms / 5,000 ms | 
| コード長 | 451 bytes | 
| コンパイル時間 | 169 ms | 
| コンパイル使用メモリ | 82,240 KB | 
| 実行使用メモリ | 53,840 KB | 
| 最終ジャッジ日時 | 2025-10-24 21:21:36 | 
| 合計ジャッジ時間 | 1,768 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 22 | 
ソースコード
n = int(input())
counts = [0] * 11  # Using 1-based index for items 1-10
for _ in range(n):
    a, b, c = map(int, input().split())
    counts[a] += 1
    counts[b] += 1
    counts[c] += 1
total_power = 0
# Calculate power-ups from pairs
for i in range(1, 11):
    total_power += counts[i] // 2
    counts[i] %= 2
# Calculate power-ups from remaining items (groups of four)
remaining = sum(counts)
total_power += remaining // 4
print(total_power)
            
            
            
        