結果

問題 No.29 パワーアップ
ユーザー ktshunktshun
提出日時 2015-06-01 14:25:34
言語 Python2
(2.7.18)
結果
AC  
実行時間 13 ms / 5,000 ms
コード長 315 bytes
コンパイル時間 36 ms
使用メモリ 6,680 KB
最終ジャッジ日時 2023-02-09 07:27:38
合計ジャッジ時間 1,671 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 12 ms
6,376 KB
testcase_01 AC 12 ms
6,392 KB
testcase_02 AC 12 ms
6,520 KB
testcase_03 AC 12 ms
6,464 KB
testcase_04 AC 12 ms
6,468 KB
testcase_05 AC 12 ms
6,460 KB
testcase_06 AC 13 ms
6,632 KB
testcase_07 AC 12 ms
6,524 KB
testcase_08 AC 11 ms
6,632 KB
testcase_09 AC 12 ms
6,628 KB
testcase_10 AC 12 ms
6,524 KB
testcase_11 AC 12 ms
6,672 KB
testcase_12 AC 12 ms
6,468 KB
testcase_13 AC 12 ms
6,392 KB
testcase_14 AC 12 ms
6,600 KB
testcase_15 AC 12 ms
6,404 KB
testcase_16 AC 12 ms
6,632 KB
testcase_17 AC 11 ms
6,676 KB
testcase_18 AC 12 ms
6,460 KB
testcase_19 AC 12 ms
6,464 KB
testcase_20 AC 12 ms
6,680 KB
testcase_21 AC 12 ms
6,516 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding:utf-8 -*-
import collections

if __name__ == "__main__":
	n = input()
	items = []
	for i in xrange(n):
		items += map(int,raw_input().split())
	count = collections.Counter(items)
	ans = 0
	amari = 0
	for item, cnt in count.most_common():
		ans += cnt //2
		amari += cnt % 2
	ans += amari //4
	print ans
0