結果

問題 No.29 パワーアップ
ユーザー MitI_7MitI_7
提出日時 2015-10-31 22:24:53
言語 Python3
(3.10.1 + numpy 1.22.3 + scipy 1.8.0)
結果
AC  
実行時間 18 ms / 5,000 ms
コード長 389 bytes
コンパイル時間 65 ms
使用メモリ 9,820 KB
最終ジャッジ日時 2023-02-25 01:04:26
合計ジャッジ時間 2,259 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 17 ms
7,976 KB
testcase_01 AC 15 ms
8,032 KB
testcase_02 AC 16 ms
9,820 KB
testcase_03 AC 16 ms
9,772 KB
testcase_04 AC 16 ms
7,836 KB
testcase_05 AC 18 ms
7,972 KB
testcase_06 AC 17 ms
9,692 KB
testcase_07 AC 17 ms
8,100 KB
testcase_08 AC 17 ms
7,872 KB
testcase_09 AC 15 ms
8,076 KB
testcase_10 AC 16 ms
8,032 KB
testcase_11 AC 16 ms
7,960 KB
testcase_12 AC 15 ms
9,752 KB
testcase_13 AC 16 ms
7,980 KB
testcase_14 AC 16 ms
7,928 KB
testcase_15 AC 17 ms
8,036 KB
testcase_16 AC 17 ms
9,708 KB
testcase_17 AC 16 ms
7,848 KB
testcase_18 AC 17 ms
7,928 KB
testcase_19 AC 16 ms
9,632 KB
testcase_20 AC 18 ms
8,088 KB
testcase_21 AC 16 ms
7,920 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict


def main():
    n = int(input())
    d = defaultdict(int)
    for _ in range(n):
        a, b, c = map(int, input().split())
        d[a] += 1
        d[b] += 1
        d[c] += 1

    ans = 0
    left = 0
    for k, v in d.items():
        ans += v // 2
        left += v % 2
    ans += left // 4
    print(ans)

if __name__ == '__main__':
    main()
0