結果

問題 No.29 パワーアップ
コンテスト
ユーザー ciel
提出日時 2014-11-16 19:04:09
言語 C++11
(gcc 15.2.0 + boost 1.90.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 5,000 ms
+ 288µs
コード長 273 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 234 ms
コンパイル使用メモリ 61,824 KB
実行使用メモリ 5,888 KB
最終ジャッジ日時 2026-07-15 21:23:37
合計ジャッジ時間 1,425 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <map>
#include <cstdio>
int main(){
	std::map<int,int>se;
	int i=0,n,x,c=0,r=0;
	for(scanf("%d",&n);i<3*n;i++)scanf("%d",&x),se[x]++;
	for(std::map<int,int>::iterator it=se.begin();it!=se.end();++it)r+=it->second/2,c+=it->second%2;
	printf("%d\n",r+c/4);
}
0