結果

問題 No.8016 unordered_mapなるたけ落とすマン
ユーザー Kmcode1
提出日時 2016-05-22 00:49:31
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 957 bytes
コンパイル時間 863 ms
コンパイル使用メモリ 106,016 KB
実行使用メモリ 12,952 KB
最終ジャッジ日時 2024-10-07 05:46:49
合計ジャッジ時間 5,685 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9 WA * 4 TLE * 1 -- * 34
権限があれば一括ダウンロードができます
コンパイルメッセージ
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(n);
	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