結果

問題 No.29 パワーアップ
ユーザー alcoholamp
提出日時 2019-10-31 19:20:08
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 405 bytes
コンパイル時間 78 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-09-14 22:08:51
合計ジャッジ時間 1,651 ms
ジャッジサーバーID
(参考情報)
judge2 / judge6
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 13 WA * 9
権限があれば一括ダウンロードができます

ソースコード

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