結果
| 問題 | No.29 パワーアップ |
| コンテスト | |
| ユーザー |
ryo_n
|
| 提出日時 | 2020-06-23 21:54:44 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 29 ms / 5,000 ms |
| コード長 | 484 bytes |
| コンパイル時間 | 158 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 10,240 KB |
| 最終ジャッジ日時 | 2025-10-24 21:15:07 |
| 合計ジャッジ時間 | 1,645 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
ソースコード
import sys
import collections
sys.setrecursionlimit(10 ** 8)
input = sys.stdin.readline
def main():
N = int(input())
ABC = [[int(x) for x in input().split()] for _ in range(N)]
cnt = collections.Counter()
for a, b, c in ABC:
cnt[a] += 1
cnt[b] += 1
cnt[c] += 1
ans = 0
mod = 0
for k in cnt.keys():
ans += cnt[k] // 2
mod += cnt[k] % 2
print(ans + mod // 4)
if __name__ == '__main__':
main()
ryo_n