結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 10 ms
13,184 KB
testcase_01 AC 10 ms
13,056 KB
testcase_02 AC 10 ms
13,056 KB
testcase_03 AC 78 ms
16,652 KB
testcase_04 WA -
testcase_05 AC 79 ms
16,524 KB
testcase_06 WA -
testcase_07 AC 79 ms
16,648 KB
testcase_08 AC 86 ms
16,652 KB
testcase_09 AC 467 ms
16,652 KB
testcase_10 AC 80 ms
16,528 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 79 ms
16,524 KB
testcase_14 AC 79 ms
16,528 KB
testcase_15 AC 78 ms
16,524 KB
testcase_16 AC 79 ms
16,524 KB
testcase_17 AC 81 ms
16,524 KB
testcase_18 AC 78 ms
16,524 KB
testcase_19 AC 78 ms
16,524 KB
testcase_20 AC 77 ms
16,524 KB
testcase_21 AC 78 ms
16,656 KB
testcase_22 AC 77 ms
16,656 KB
testcase_23 AC 76 ms
16,528 KB
testcase_24 AC 77 ms
16,528 KB
testcase_25 AC 78 ms
16,652 KB
testcase_26 AC 77 ms
16,656 KB
testcase_27 AC 75 ms
16,524 KB
testcase_28 AC 77 ms
16,524 KB
testcase_29 AC 76 ms
16,520 KB
testcase_30 AC 78 ms
16,520 KB
testcase_31 AC 77 ms
16,644 KB
testcase_32 AC 76 ms
16,644 KB
testcase_33 AC 78 ms
16,520 KB
testcase_34 AC 80 ms
16,512 KB
testcase_35 AC 74 ms
16,516 KB
testcase_36 AC 74 ms
16,516 KB
testcase_37 AC 75 ms
16,512 KB
testcase_38 AC 76 ms
16,512 KB
testcase_39 AC 74 ms
16,636 KB
testcase_40 AC 74 ms
16,624 KB
testcase_41 AC 10 ms
13,056 KB
testcase_42 AC 11 ms
13,056 KB
testcase_43 AC 10 ms
13,056 KB
testcase_44 AC 15 ms
13,312 KB
testcase_45 AC 15 ms
13,440 KB
testcase_46 AC 15 ms
13,440 KB
testcase_47 AC 61 ms
15,232 KB
testcase_48 WA -
testcase_49 AC 64 ms
15,496 KB
testcase_50 AC 56 ms
13,696 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:47:27: warning: format ‘%lld’ expects argument of type ‘long long int*’, but argument 2 has type ‘int*’ [-Wformat=]
   47 |                 scanf("%lld", &a);
      |                        ~~~^   ~~
      |                           |   |
      |                           |   int*
      |                           long long int*
      |                        %d
main.cpp:53:27: warning: format ‘%lld’ expects argument of type ‘long long int*’, but argument 2 has type ‘int*’ [-Wformat=]
   53 |                 scanf("%lld", &b);
      |                        ~~~^   ~~
      |                           |   |
      |                           |   int*
      |                           long long int*
      |                        %d
main.cpp:47:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   47 |                 scanf("%lld", &a);
      |                 ~~~~~^~~~~~~~~~~~
main.cpp:53:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   53 |                 scanf("%lld", &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;

unordered_map<long long int, long long int> mp;

int n;
int m;

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