結果

問題 No.29 パワーアップ
ユーザー otsunekootsuneko
提出日時 2021-05-06 15:58:41
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 77 ms / 5,000 ms
コード長 276 bytes
コンパイル時間 615 ms
コンパイル使用メモリ 87,220 KB
実行使用メモリ 71,648 KB
最終ジャッジ日時 2023-10-12 08:23:27
合計ジャッジ時間 3,063 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,416 KB
testcase_01 AC 72 ms
71,324 KB
testcase_02 AC 74 ms
71,440 KB
testcase_03 AC 74 ms
71,384 KB
testcase_04 AC 76 ms
71,408 KB
testcase_05 AC 76 ms
71,584 KB
testcase_06 AC 75 ms
71,356 KB
testcase_07 AC 75 ms
71,568 KB
testcase_08 AC 76 ms
71,380 KB
testcase_09 AC 76 ms
71,332 KB
testcase_10 AC 77 ms
71,296 KB
testcase_11 AC 77 ms
71,508 KB
testcase_12 AC 75 ms
71,648 KB
testcase_13 AC 77 ms
71,580 KB
testcase_14 AC 76 ms
71,128 KB
testcase_15 AC 76 ms
71,636 KB
testcase_16 AC 76 ms
71,256 KB
testcase_17 AC 73 ms
71,440 KB
testcase_18 AC 75 ms
71,600 KB
testcase_19 AC 76 ms
71,528 KB
testcase_20 AC 74 ms
71,276 KB
testcase_21 AC 74 ms
71,500 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
item_cnt = [0]*10
for _ in range(N):
    item = list(map(int,input().split()))
    for i in item:
        item_cnt[i-1] += 1

ans = 0
cnt = 0
for i in range(10):
    ans += item_cnt[i]//2
    if item_cnt[i]%2:
        cnt += 1

print(ans+cnt//4)
0