結果

問題 No.3016 unordered_mapなるたけ落とすマン
ユーザー snteasntea
提出日時 2017-02-24 05:49:42
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,628 bytes
コンパイル時間 1,906 ms
コンパイル使用メモリ 174,168 KB
実行使用メモリ 9,848 KB
最終ジャッジ日時 2023-08-30 22:55:14
合計ジャッジ時間 5,993 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
8,756 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 65 ms
9,508 KB
testcase_04 AC 69 ms
9,744 KB
testcase_05 AC 68 ms
9,564 KB
testcase_06 AC 66 ms
9,640 KB
testcase_07 AC 70 ms
9,776 KB
testcase_08 AC 68 ms
9,512 KB
testcase_09 AC 64 ms
9,648 KB
testcase_10 AC 66 ms
9,512 KB
testcase_11 AC 67 ms
9,644 KB
testcase_12 AC 70 ms
9,644 KB
testcase_13 AC 69 ms
9,712 KB
testcase_14 AC 67 ms
9,564 KB
testcase_15 AC 66 ms
9,512 KB
testcase_16 AC 74 ms
9,644 KB
testcase_17 AC 66 ms
9,644 KB
testcase_18 AC 65 ms
9,640 KB
testcase_19 AC 62 ms
9,560 KB
testcase_20 AC 64 ms
9,848 KB
testcase_21 AC 66 ms
9,560 KB
testcase_22 AC 64 ms
9,788 KB
testcase_23 AC 67 ms
9,508 KB
testcase_24 AC 65 ms
9,708 KB
testcase_25 AC 62 ms
9,580 KB
testcase_26 AC 67 ms
9,580 KB
testcase_27 AC 62 ms
9,716 KB
testcase_28 AC 64 ms
9,560 KB
testcase_29 AC 62 ms
9,780 KB
testcase_30 AC 66 ms
9,644 KB
testcase_31 AC 70 ms
9,708 KB
testcase_32 AC 61 ms
9,644 KB
testcase_33 AC 61 ms
9,836 KB
testcase_34 AC 60 ms
9,712 KB
testcase_35 AC 58 ms
9,640 KB
testcase_36 TLE -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
testcase_48 -- -
testcase_49 -- -
testcase_50 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#ifdef LOCAL111
#else
	#define NDEBUG
#endif
#include <bits/stdc++.h>

using namespace std;

#define endl '\n'
#define ALL(a)  (a).begin(),(a).end()
#define SZ(a) int((a).size())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define RBP(i,a) for(auto& i : a)
#ifdef LOCAL111
	#define DEBUG(x) cout<<#x<<": "<<(x)<<endl
#else
	#define DEBUG(x) true
#endif
#define F first
#define S second
#define SNP string::npos
#define WRC(hoge) cout << "Case #" << (hoge)+1 << ": "
#define INF 1e8
template<typename T> void pite(T a, T b){ for(T ite = a; ite != b; ite++) cout << (ite == a ? "" : " ") << *ite; cout << endl;}
template<typename T> bool chmax(T& a, T b){if(a < b){a = b; return true;} return false;}
template<typename T> bool chmin(T& a, T b){if(a > b){a = b; return true;} return false;}

typedef pair<int,int> P;
typedef long long int LL;
typedef unsigned long long ULL;
typedef pair<LL,LL> LP;

void ios_init(){
	//cout.setf(ios::fixed);
	//cout.precision(12);
#ifdef LOCAL111
	return;
#endif
	ios::sync_with_stdio(false); cin.tie(0);	
}

class MyHash {
public:
	random_device rnd;
	int shift1 = rnd()%64;
	int shift2 = rnd()%64;
	int shift3 = rnd()%64;

	size_t operator()(LL x) const{
		x = x^(x<<shift1);
		x = x^(x>>shift2);
		x = x^(x<<shift3);
		return x;
	}
};

int main()
{
	ios_init();
	int n,m;
	cin >> n >> m;
	unordered_map<LL,int,MyHash> mp;
	REP(i,n){
		LL a;
		cin >> a;
		mp[a]++;
	}
	vector<int> ans(m);
	REP(i,m){
		LL b;
		cin >> b;
		ans[i] = mp[b];
	}
	pite(ALL(ans));
	return 0;
}
0