結果
| 問題 | No.29 パワーアップ |
| コンテスト | |
| ユーザー |
ioryyyyz
|
| 提出日時 | 2015-07-25 04:45:10 |
| 言語 | Python2 (2.7.18) |
| 結果 |
AC
|
| 実行時間 | 15 ms / 5,000 ms |
| コード長 | 493 bytes |
| コンパイル時間 | 66 ms |
| コンパイル使用メモリ | 7,840 KB |
| 実行使用メモリ | 7,716 KB |
| 最終ジャッジ日時 | 2025-10-24 20:53:34 |
| 合計ジャッジ時間 | 1,264 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
ソースコード
#!/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()
ioryyyyz