結果

問題 No.29 パワーアップ
ユーザー shiratama
提出日時 2016-08-11 23:01:42
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 395 bytes
コンパイル時間 534 ms
コンパイル使用メモリ 54,696 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-07 11:07:31
合計ジャッジ時間 1,298 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

auto main() -> int {
	int counts[11] = {};

	int n;
	int a, b, c;
	std::cin >> n;
	for (int i = 0; i < n; ++i) {
		std::cin >> a >> b >> c;
		counts[a]++;
		counts[b]++;
		counts[c]++;
	}

	int n_raises = 0;
	int n_rests  = 0;
	for (int count : counts) {
		n_raises += count / 2;
		n_rests  += count % 2;
	}
	n_raises += n_rests / 4;

	std::cout << n_raises << std::endl;
}
0