結果

問題 No.29 パワーアップ
コンテスト
ユーザー alcoholamp
提出日時 2019-11-01 10:37:54
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
WA  
実行時間 -
コード長 513 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 289 ms
コンパイル使用メモリ 21,540 KB
実行使用メモリ 15,996 KB
最終ジャッジ日時 2026-07-15 22:22:50
合計ジャッジ時間 3,871 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 8 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

class Problem0029:
    def solve(this):
        n = int(input())
        res = {}
        for i in range(n):
            a,b,c = map(int, input().split())
            res[a] = res.get(a, 0) + 1
            res[b] = res.get(b, 0) + 1
            res[c] = res.get(c, 0) + 1

        cnt = 0
        remain = 0
        for v in res.values():
            cnt += v // 2
            remain += v % 2
            cnt += remain // 4
        print(cnt)

if __name__ == "__main__":
	problem = Problem0029()
	problem.solve()
0