結果

問題 No.29 パワーアップ
ユーザー neko_the_shadow
提出日時 2017-01-15 18:07:05
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 38 ms / 5,000 ms
コード長 355 bytes
コンパイル時間 124 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-12-21 13:45:21
合計ジャッジ時間 1,967 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections

if __name__ == '__main__':
    stock = collections.defaultdict(int)

    n = int(input())
    for _ in range(n):
        items = map(int, input().split())
        for item in items: stock[item] += 1
    
    ans = rest = 0
    for ky in stock:
        ans += stock[ky] // 2
        rest += stock[ky] % 2
    
    print(ans + rest // 4)
0