結果

問題 No.29 パワーアップ
ユーザー umaumax
提出日時 2017-05-05 01:26:04
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 390 bytes
コンパイル時間 595 ms
コンパイル使用メモリ 66,872 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-14 07:18:47
合計ジャッジ時間 1,403 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <map>

using namespace std;

int main(int argc, const char* argv[])
{
	int N;
	cin >> N;
	map<int, int> m;
	for (int i = 0; i < N; i++) {
		int a, b, c;
		cin >> a >> b >> c;
		m[a]++;
		m[b]++;
		m[c]++;
	}
	int cnt	= 0;
	int others = 0;
	for (auto&& v : m) {
		cnt += v.second / 2;
		others += v.second % 2;
	}
	cout << cnt + others / 4 << endl;
	return 0;
}
0