結果

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

ソースコード

diff #

def count(d):
    result = 0
    for it in filter(lambda it: it[1] > 1, d.items()):
        q, r = divmod(it[1], 2)
        result += q
        d[it[0]] = r
    result += (sum(d.values()) // 4)
    return result

N = int(input())

D = {}
for _ in range(N):
    lst = input().split()
    for c in lst:
        if c in D:
            D[c] += 1
        else:
            D[c] = 1

print(count(D))
0