結果

問題 No.29 パワーアップ
ユーザー Mayimg
提出日時 2018-12-23 00:51:29
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 468 bytes
コンパイル時間 1,561 ms
コンパイル使用メモリ 167,368 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-25 10:20:58
合計ジャッジ時間 2,367 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 5 WA * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);  
	vector<int> v(10);
	int n;
	cin >> n;
	for(int i = 0; i < n; i++) {
		int a, b, c;
		cin >> a >> b >> c;
		v[a]++;
		v[b]++;
		v[c]++;
	}
	int ans = 0;
	for(int i = 0; i < 10; i++) {
		ans += v[i] / 2;
		v[i] %= 2;
	}
	int rem = 0;
	for(int i = 0; i < 10; i++) {
		rem += v[i];
	}
	ans += rem / 4;
	cout << ans << endl;
	return 0;	
}
0