結果
| 問題 | No.29 パワーアップ | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2017-08-27 20:11:50 | 
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 29 ms / 5,000 ms | 
| コード長 | 438 bytes | 
| コンパイル時間 | 138 ms | 
| コンパイル使用メモリ | 12,416 KB | 
| 実行使用メモリ | 10,496 KB | 
| 最終ジャッジ日時 | 2025-10-24 21:02:43 | 
| 合計ジャッジ時間 | 1,360 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 22 | 
ソースコード
def main():
    N = int(input())
    A = tuple(tuple(map(int, input().split())) for _ in range(N))
    num = dict()
    for a, b, c in A:
        num[a] = num.get(a, 0) + 1
        num[b] = num.get(b, 0) + 1
        num[c] = num.get(c, 0) + 1
    powerup = 0
    item = 0
    for val in num.values():
        div_, mod_ = divmod(val, 2)
        powerup += div_
        item += mod_
    ans = powerup + item // 4
    print(ans)
main()
            
            
            
        