結果

問題 No.29 パワーアップ
ユーザー alcoholampalcoholamp
提出日時 2019-10-31 19:20:08
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
WA  
実行時間 -
コード長 405 bytes
コンパイル時間 206 ms
コンパイル使用メモリ 10,652 KB
実行使用メモリ 7,984 KB
最終ジャッジ日時 2023-10-13 00:09:45
合計ジャッジ時間 1,774 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,848 KB
testcase_01 AC 17 ms
7,672 KB
testcase_02 AC 16 ms
7,712 KB
testcase_03 WA -
testcase_04 AC 16 ms
7,772 KB
testcase_05 AC 16 ms
7,840 KB
testcase_06 AC 16 ms
7,716 KB
testcase_07 AC 15 ms
7,740 KB
testcase_08 WA -
testcase_09 AC 16 ms
7,860 KB
testcase_10 WA -
testcase_11 AC 16 ms
7,760 KB
testcase_12 WA -
testcase_13 AC 16 ms
7,760 KB
testcase_14 AC 16 ms
7,764 KB
testcase_15 AC 16 ms
7,764 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 16 ms
7,840 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

class Problem0029:
	def solve(this):
		n = int(input())
		res = {}
		for i in range(n):
			a,b,c = map(int, input().split())
			res[a] = res.get(a, 0) + 1
			res[b] = res.get(b, 0) + 1
			res[c] = res.get(c, 0) + 1
	
		cnt = 0
		remain = 0
		for v in res.values():
			cnt += v // 2
			remain += v % 2
		cnt += remain // 5
		print(cnt)

if __name__ == "__main__":
	problem = Problem0029()
	problem.solve()
0