結果

問題 No.29 パワーアップ
ユーザー ioryyyyzioryyyyz
提出日時 2015-07-25 04:45:10
言語 Python2
(2.7.18)
結果
AC  
実行時間 14 ms / 5,000 ms
コード長 493 bytes
コンパイル時間 801 ms
コンパイル使用メモリ 6,616 KB
実行使用メモリ 6,460 KB
最終ジャッジ日時 2023-09-23 04:33:21
合計ジャッジ時間 2,808 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
6,428 KB
testcase_01 AC 13 ms
6,380 KB
testcase_02 AC 13 ms
6,428 KB
testcase_03 AC 13 ms
6,308 KB
testcase_04 AC 13 ms
6,356 KB
testcase_05 AC 14 ms
6,356 KB
testcase_06 AC 14 ms
6,384 KB
testcase_07 AC 13 ms
6,444 KB
testcase_08 AC 14 ms
6,384 KB
testcase_09 AC 13 ms
6,312 KB
testcase_10 AC 14 ms
6,380 KB
testcase_11 AC 14 ms
6,432 KB
testcase_12 AC 13 ms
6,352 KB
testcase_13 AC 14 ms
6,312 KB
testcase_14 AC 14 ms
6,348 KB
testcase_15 AC 13 ms
6,460 KB
testcase_16 AC 14 ms
6,368 KB
testcase_17 AC 13 ms
6,444 KB
testcase_18 AC 13 ms
6,380 KB
testcase_19 AC 14 ms
6,428 KB
testcase_20 AC 13 ms
6,428 KB
testcase_21 AC 13 ms
6,388 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python
# -*- coding:utf-8 -*-

from collections import defaultdict

def main():
    N = input()
    d = defaultdict(int)
    for _ in range(N):
        a, b, c = map(int, raw_input().split())
        d[a] += 1
        d[b] += 1
        d[c] += 1
    powerup_cnt = 0
    remain_items = 0
    for index in d:
        powerup_cnt += d[index] / 2
        remain_items += d[index] % 2
    powerup_cnt += remain_items / 4
    print(powerup_cnt)

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