結果

問題 No.29 パワーアップ
ユーザー alcoholampalcoholamp
提出日時 2019-11-01 10:37:54
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 513 bytes
コンパイル時間 448 ms
コンパイル使用メモリ 10,800 KB
実行使用メモリ 7,956 KB
最終ジャッジ日時 2023-10-13 00:38:37
合計ジャッジ時間 1,904 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 15 ms
7,816 KB
testcase_02 WA -
testcase_03 AC 15 ms
7,844 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 15 ms
7,808 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 16 ms
7,952 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 16 ms
7,748 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 15 ms
7,776 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 15 ms
7,748 KB
testcase_21 AC 15 ms
7,748 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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