結果

問題 No.3016 unordered_mapなるたけ落とすマン
ユーザー Kmcode1Kmcode1
提出日時 2016-05-22 00:46:18
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 985 bytes
コンパイル時間 1,058 ms
コンパイル使用メモリ 104,424 KB
実行使用メモリ 8,652 KB
最終ジャッジ日時 2024-04-16 11:46:11
合計ジャッジ時間 7,783 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 104 ms
8,520 KB
testcase_04 WA -
testcase_05 AC 122 ms
8,480 KB
testcase_06 WA -
testcase_07 AC 125 ms
8,484 KB
testcase_08 AC 118 ms
8,396 KB
testcase_09 AC 119 ms
8,524 KB
testcase_10 AC 120 ms
8,400 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 113 ms
8,520 KB
testcase_14 AC 108 ms
8,528 KB
testcase_15 AC 103 ms
8,392 KB
testcase_16 AC 105 ms
8,396 KB
testcase_17 AC 106 ms
8,396 KB
testcase_18 AC 106 ms
8,396 KB
testcase_19 AC 108 ms
8,480 KB
testcase_20 AC 103 ms
8,392 KB
testcase_21 AC 106 ms
8,396 KB
testcase_22 AC 101 ms
8,480 KB
testcase_23 AC 101 ms
8,524 KB
testcase_24 AC 103 ms
8,396 KB
testcase_25 AC 102 ms
8,352 KB
testcase_26 AC 99 ms
8,396 KB
testcase_27 AC 101 ms
8,396 KB
testcase_28 AC 102 ms
8,524 KB
testcase_29 AC 100 ms
8,524 KB
testcase_30 AC 102 ms
8,524 KB
testcase_31 AC 103 ms
8,396 KB
testcase_32 AC 101 ms
8,396 KB
testcase_33 AC 103 ms
8,396 KB
testcase_34 AC 99 ms
8,400 KB
testcase_35 AC 99 ms
8,396 KB
testcase_36 AC 98 ms
8,396 KB
testcase_37 AC 98 ms
8,396 KB
testcase_38 AC 96 ms
8,396 KB
testcase_39 AC 98 ms
8,432 KB
testcase_40 AC 98 ms
8,416 KB
testcase_41 AC 2 ms
5,376 KB
testcase_42 AC 2 ms
5,376 KB
testcase_43 AC 2 ms
5,376 KB
testcase_44 AC 8 ms
5,376 KB
testcase_45 AC 7 ms
5,376 KB
testcase_46 AC 8 ms
5,376 KB
testcase_47 AC 73 ms
6,528 KB
testcase_48 WA -
testcase_49 AC 79 ms
6,792 KB
testcase_50 AC 47 ms
5,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:46:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   46 |                 scanf("%d", &a);
      |                 ~~~~~^~~~~~~~~~
main.cpp:55:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   55 |                 scanf("%d", &b);
      |                 ~~~~~^~~~~~~~~~

ソースコード

diff #

#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<cctype>
#include<cstdlib>
#include<algorithm>
#include<bitset>
#include<cstdio>
#include<cstring>
#include<string>
#include<cctype>
#include<cstdlib>
#include<algorithm>
#include<bitset>
#include<vector>
#include<list>
#include<deque>
#include<queue>
#include<map>
#include<set>
#include<stack>
#include<cmath>
#include<sstream>
#include<fstream>
#include<iomanip>
#include<ctime>
#include<complex>
#include<functional>
#include<climits>
#include<cassert>
#include<iterator>
#include<unordered_map>
using namespace std;

map<int, int> mp;

int n;
int m;

vector<int> v;
int main(){
	cin >> n >> m;
	for (int i = 0; i < n; i++){
		int a;
		scanf("%d", &a);
		v.push_back(a);
	}
	random_shuffle(v.begin(), v.end());
	for (int i = 0; i < v.size(); i++){
		mp[v[i]]++;
	}
	for (int i = 0; i < m; i++){
		int b;
		scanf("%d", &b);
		if (i){
			printf(" ");
		}
		printf("%d", mp[b]);
	}
	puts("");
	return 0;
}
0