結果

問題 No.29 パワーアップ
ユーザー zombietanzombietan
提出日時 2016-04-29 17:54:47
言語 Python3
(3.10.1 + numpy 1.22.3 + scipy 1.8.0)
結果
AC  
実行時間 20 ms / 5,000 ms
コード長 285 bytes
コンパイル時間 63 ms
使用メモリ 8,052 KB
最終ジャッジ日時 2022-11-28 01:10:37
合計ジャッジ時間 1,696 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 18 ms
8,036 KB
testcase_01 AC 18 ms
7,876 KB
testcase_02 AC 18 ms
8,020 KB
testcase_03 AC 18 ms
7,924 KB
testcase_04 AC 18 ms
7,976 KB
testcase_05 AC 18 ms
7,868 KB
testcase_06 AC 18 ms
7,944 KB
testcase_07 AC 18 ms
7,992 KB
testcase_08 AC 17 ms
7,856 KB
testcase_09 AC 18 ms
8,040 KB
testcase_10 AC 19 ms
8,040 KB
testcase_11 AC 18 ms
8,004 KB
testcase_12 AC 17 ms
7,924 KB
testcase_13 AC 18 ms
7,996 KB
testcase_14 AC 18 ms
7,852 KB
testcase_15 AC 18 ms
8,052 KB
testcase_16 AC 17 ms
7,852 KB
testcase_17 AC 18 ms
7,972 KB
testcase_18 AC 18 ms
7,996 KB
testcase_19 AC 18 ms
7,992 KB
testcase_20 AC 20 ms
7,928 KB
testcase_21 AC 18 ms
7,844 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter
N = int(input())
items = [input().split() for x in range(N)]
number = [str(i) for i in range(1,11)]
cnt = Counter()
for item in items:
    cnt.update(item)
a, b = 0, 0
for n in number:
    i2, i1 = divmod(cnt[n], 2)
    a += i2
    b += i1
print(a+b//4)
0