結果

問題 No.29 パワーアップ
ユーザー tarotaro789tarotaro789
提出日時 2017-10-27 17:16:42
言語 Python3
(3.10.1 + numpy 1.22.3 + scipy 1.8.0)
結果
AC  
実行時間 18 ms / 5,000 ms
コード長 266 bytes
コンパイル時間 64 ms
使用メモリ 8,036 KB
最終ジャッジ日時 2022-12-27 11:25:26
合計ジャッジ時間 2,169 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 17 ms
7,972 KB
testcase_01 AC 17 ms
7,976 KB
testcase_02 AC 18 ms
7,976 KB
testcase_03 AC 18 ms
8,036 KB
testcase_04 AC 17 ms
8,024 KB
testcase_05 AC 17 ms
7,936 KB
testcase_06 AC 17 ms
7,836 KB
testcase_07 AC 17 ms
7,840 KB
testcase_08 AC 17 ms
8,016 KB
testcase_09 AC 18 ms
7,980 KB
testcase_10 AC 18 ms
7,840 KB
testcase_11 AC 17 ms
7,836 KB
testcase_12 AC 18 ms
8,032 KB
testcase_13 AC 17 ms
7,984 KB
testcase_14 AC 17 ms
8,032 KB
testcase_15 AC 17 ms
7,976 KB
testcase_16 AC 17 ms
7,840 KB
testcase_17 AC 18 ms
7,876 KB
testcase_18 AC 18 ms
7,972 KB
testcase_19 AC 17 ms
7,836 KB
testcase_20 AC 17 ms
8,012 KB
testcase_21 AC 18 ms
7,984 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter

    #inp
n=int(input())
items=[]
up=0

for _ in range(n):
    items+=input().split()

#exe
dic_items=Counter(items)

for (i,j) in dic_items.items():
    up+=j//2
    dic_items[i]=j%2

up+=sum(list(dic_items.values())) //4

print(up)
0