結果

問題 No.29 パワーアップ
ユーザー 🍡yurahuna🍡yurahuna
提出日時 2016-05-18 10:23:34
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 19 ms / 5,000 ms
コード長 249 bytes
コンパイル時間 1,103 ms
コンパイル使用メモリ 10,480 KB
実行使用メモリ 8,492 KB
最終ジャッジ日時 2023-07-28 14:23:06
合計ジャッジ時間 2,590 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,424 KB
testcase_01 AC 18 ms
8,380 KB
testcase_02 AC 18 ms
8,412 KB
testcase_03 AC 18 ms
8,412 KB
testcase_04 AC 18 ms
8,360 KB
testcase_05 AC 19 ms
8,364 KB
testcase_06 AC 18 ms
8,472 KB
testcase_07 AC 18 ms
8,416 KB
testcase_08 AC 18 ms
8,364 KB
testcase_09 AC 18 ms
8,416 KB
testcase_10 AC 19 ms
8,412 KB
testcase_11 AC 18 ms
8,472 KB
testcase_12 AC 18 ms
8,404 KB
testcase_13 AC 19 ms
8,492 KB
testcase_14 AC 18 ms
8,488 KB
testcase_15 AC 18 ms
8,456 KB
testcase_16 AC 18 ms
8,412 KB
testcase_17 AC 18 ms
8,388 KB
testcase_18 AC 18 ms
8,452 KB
testcase_19 AC 18 ms
8,408 KB
testcase_20 AC 18 ms
8,412 KB
testcase_21 AC 18 ms
8,444 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter
n = int(input())
cnt = Counter()
for i in range(n):
    c = map(int, input().split())
    cnt += Counter(c)

ans = 0
rem = 0
for v in cnt.values():
    ans += v // 2
    v %= 2
    rem += v
ans += rem // 4
print(ans)
0