結果

問題 No.3016 unordered_mapなるたけ落とすマン
ユーザー kongarishisyamokongarishisyamo
提出日時 2016-05-22 01:44:20
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 304 ms / 1,000 ms
コード長 399 bytes
コンパイル時間 670 ms
コンパイル使用メモリ 68,700 KB
実行使用メモリ 9,728 KB
最終ジャッジ日時 2024-04-16 12:01:51
合計ジャッジ時間 14,809 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 2 ms
5,248 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 292 ms
9,728 KB
testcase_04 AC 304 ms
9,728 KB
testcase_05 AC 300 ms
9,728 KB
testcase_06 AC 303 ms
9,600 KB
testcase_07 AC 296 ms
9,600 KB
testcase_08 AC 287 ms
9,728 KB
testcase_09 AC 296 ms
9,728 KB
testcase_10 AC 292 ms
9,728 KB
testcase_11 AC 288 ms
9,600 KB
testcase_12 AC 296 ms
9,728 KB
testcase_13 AC 293 ms
9,600 KB
testcase_14 AC 286 ms
9,728 KB
testcase_15 AC 298 ms
9,728 KB
testcase_16 AC 292 ms
9,600 KB
testcase_17 AC 289 ms
9,728 KB
testcase_18 AC 292 ms
9,728 KB
testcase_19 AC 283 ms
9,728 KB
testcase_20 AC 279 ms
9,728 KB
testcase_21 AC 287 ms
9,728 KB
testcase_22 AC 285 ms
9,600 KB
testcase_23 AC 281 ms
9,728 KB
testcase_24 AC 277 ms
9,600 KB
testcase_25 AC 288 ms
9,600 KB
testcase_26 AC 272 ms
9,728 KB
testcase_27 AC 272 ms
9,728 KB
testcase_28 AC 265 ms
9,728 KB
testcase_29 AC 273 ms
9,728 KB
testcase_30 AC 272 ms
9,728 KB
testcase_31 AC 270 ms
9,728 KB
testcase_32 AC 272 ms
9,728 KB
testcase_33 AC 265 ms
9,728 KB
testcase_34 AC 253 ms
9,728 KB
testcase_35 AC 256 ms
9,600 KB
testcase_36 AC 260 ms
9,600 KB
testcase_37 AC 255 ms
9,600 KB
testcase_38 AC 248 ms
9,600 KB
testcase_39 AC 252 ms
9,600 KB
testcase_40 AC 245 ms
9,600 KB
testcase_41 AC 2 ms
5,376 KB
testcase_42 AC 1 ms
5,376 KB
testcase_43 AC 1 ms
5,376 KB
testcase_44 AC 21 ms
5,376 KB
testcase_45 AC 18 ms
5,376 KB
testcase_46 AC 20 ms
5,376 KB
testcase_47 AC 218 ms
5,376 KB
testcase_48 AC 228 ms
6,272 KB
testcase_49 AC 236 ms
5,760 KB
testcase_50 AC 235 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<map>

using namespace std;

#define NMAX 1000

int main(){

	int N,M;
	long long A,B;
	map<long long,int> c;

	cin>>N>>M;

	for(int i=0;i<N;i++){
		cin>>A;
		if(c.empty()||c.find(A)==c.end()) c.insert(pair<long long, int>(A,1));
		else c[A]++;
	}

	for(int i=0;i<M;i++){
		cin>>B;
		if(c.find(B)==c.end()) cout<<"0";
		else cout<<c[B];
		cout<<(i==M-1?"\n":" ");
	}


}

0