結果

問題 No.29 パワーアップ
ユーザー S Y
提出日時 2024-09-28 12:44:08
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 31 ms / 5,000 ms
コード長 385 bytes
コンパイル時間 342 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-09-28 12:44:10
合計ジャッジ時間 1,643 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())

num_dict = {}
for i in range(n):
    a_b_c = list(map(int, input().split(' ')))
    for item in a_b_c:
        if item in num_dict.keys():
            num_dict[item] += 1
        else:
            num_dict[item] = 1
            
cnt = 0
left = 0
for value in num_dict.values():
    left += value%2
    cnt += (value-value%2)/2

cnt += (left-left%4)/4

print(int(cnt))
0