結果

問題 No.29 パワーアップ
ユーザー cielciel
提出日時 2014-11-16 19:04:09
言語 C++11
(gcc 8.5.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 273 bytes
コンパイル時間 381 ms
実行使用メモリ 6,952 KB
最終ジャッジ日時 2023-01-17 02:37:10
合計ジャッジ時間 1,577 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,952 KB
testcase_01 AC 1 ms
4,900 KB
testcase_02 AC 2 ms
6,948 KB
testcase_03 AC 1 ms
4,908 KB
testcase_04 AC 1 ms
6,948 KB
testcase_05 AC 1 ms
4,900 KB
testcase_06 AC 1 ms
6,952 KB
testcase_07 AC 1 ms
6,952 KB
testcase_08 AC 1 ms
4,904 KB
testcase_09 AC 1 ms
4,900 KB
testcase_10 AC 1 ms
4,904 KB
testcase_11 AC 1 ms
4,904 KB
testcase_12 AC 1 ms
4,900 KB
testcase_13 AC 1 ms
4,908 KB
testcase_14 AC 1 ms
6,948 KB
testcase_15 AC 1 ms
4,904 KB
testcase_16 AC 1 ms
4,904 KB
testcase_17 AC 1 ms
4,904 KB
testcase_18 AC 1 ms
4,904 KB
testcase_19 AC 1 ms
6,952 KB
testcase_20 AC 1 ms
4,904 KB
testcase_21 AC 1 ms
4,900 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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