結果

問題 No.29 パワーアップ
コンテスト
ユーザー kutsutama
提出日時 2018-03-27 12:46:49
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 35 ms / 5,000 ms
コード長 330 bytes
コンパイル時間 124 ms
コンパイル使用メモリ 12,032 KB
実行使用メモリ 10,368 KB
最終ジャッジ日時 2025-10-24 21:05:56
合計ジャッジ時間 1,333 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
res = 0
dic = {}
for i in range(n):
  abc = [int(x) for x in input().split()]
  for key in abc:
    if key in dic:
      dic[key] += 1
    else:
      dic[key] = 1
    
    if dic[key] == 2:
      res += 1
      dic[key] -= 2

cnt = 0
for k,v in dic.items():
  if v >= 1:
    cnt += 1
res += cnt // 4

print(res)
0