結果

問題 No.29 パワーアップ
ユーザー btk
提出日時 2015-05-07 19:44:35
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 345 bytes
コンパイル時間 404 ms
コンパイル使用メモリ 56,444 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-05 19:56:06
合計ジャッジ時間 1,191 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>
using namespace std;
int main(void){
	int N,res = 0,p;
	int item[11] = { 0 };
	cin >> N;
	while (N--){
		cin >> p; item[p]++;
		cin >> p; item[p]++;
		cin >> p; item[p]++;
	}
	p = 0;
	for (int i = 1; i < 11; i++){
		res += item[i]>>1; p += item[i] & 1;
	}
	res += p / 4;
	cout << res << endl;
	return 0;
}
0