結果

問題 No.29 パワーアップ
ユーザー akun0716
提出日時 2018-12-01 22:34:14
言語 C++11
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 347 bytes
コンパイル時間 452 ms
コンパイル使用メモリ 55,488 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-27 00:04:29
合計ジャッジ時間 1,272 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
#define REP(i,n) for(int i=0;i<n;i++)
int main(){
cin.tie(0);
ios::sync_with_stdio(false);

	int N,ans=0;
	cin>>N;
	int a[10]={0};
	REP(i,N){
		int x,y,z;
		cin>>x>>y>>z;
		a[x-1]++;
		a[y-1]++;
		a[z-1]++;
	}
	int b=0;
	REP(i,10){
		ans+=a[i]/2;
		b+=a[i]%2;
	}
	ans+=b/4;
	
	cout<<ans<<endl;
	return 0;
}
0