結果

問題 No.29 パワーアップ
ユーザー fura
提出日時 2020-01-09 18:16:06
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 311 bytes
コンパイル時間 1,528 ms
コンパイル使用メモリ 165,324 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-23 04:00:06
合計ジャッジ時間 1,919 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

int main(){
	int n; scanf("%d",&n);
	int cnt[11]={};
	rep(i,n) rep(j,3) {
		int a; scanf("%d",&a);
		cnt[a]++;
	}

	int ans=0,sum=0;
	rep(x,11) ans+=cnt[x]/2, sum+=cnt[x]%2;
	ans+=sum/4;
	printf("%d\n",ans);

	return 0;
}
0