結果

問題 No.3016 unordered_mapなるたけ落とすマン
ユーザー aogeraaogera
提出日時 2024-03-06 18:57:32
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 280 ms / 1,000 ms
コード長 1,352 bytes
コンパイル時間 3,972 ms
コンパイル使用メモリ 235,024 KB
実行使用メモリ 9,728 KB
最終ジャッジ日時 2024-03-06 18:57:51
合計ジャッジ時間 18,161 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,548 KB
testcase_01 AC 2 ms
6,548 KB
testcase_02 AC 2 ms
6,548 KB
testcase_03 AC 254 ms
9,728 KB
testcase_04 AC 278 ms
9,728 KB
testcase_05 AC 280 ms
9,728 KB
testcase_06 AC 263 ms
9,728 KB
testcase_07 AC 263 ms
9,728 KB
testcase_08 AC 263 ms
9,728 KB
testcase_09 AC 264 ms
9,728 KB
testcase_10 AC 277 ms
9,728 KB
testcase_11 AC 265 ms
9,728 KB
testcase_12 AC 265 ms
9,728 KB
testcase_13 AC 255 ms
9,728 KB
testcase_14 AC 276 ms
9,728 KB
testcase_15 AC 257 ms
9,728 KB
testcase_16 AC 254 ms
9,728 KB
testcase_17 AC 249 ms
9,728 KB
testcase_18 AC 254 ms
9,728 KB
testcase_19 AC 270 ms
9,728 KB
testcase_20 AC 252 ms
9,728 KB
testcase_21 AC 249 ms
9,728 KB
testcase_22 AC 250 ms
9,728 KB
testcase_23 AC 248 ms
9,728 KB
testcase_24 AC 265 ms
9,728 KB
testcase_25 AC 249 ms
9,728 KB
testcase_26 AC 247 ms
9,728 KB
testcase_27 AC 247 ms
9,728 KB
testcase_28 AC 245 ms
9,728 KB
testcase_29 AC 275 ms
9,728 KB
testcase_30 AC 247 ms
9,728 KB
testcase_31 AC 238 ms
9,728 KB
testcase_32 AC 246 ms
9,728 KB
testcase_33 AC 250 ms
9,728 KB
testcase_34 AC 237 ms
9,728 KB
testcase_35 AC 232 ms
9,728 KB
testcase_36 AC 234 ms
9,728 KB
testcase_37 AC 233 ms
9,728 KB
testcase_38 AC 229 ms
9,728 KB
testcase_39 AC 230 ms
9,600 KB
testcase_40 AC 233 ms
9,600 KB
testcase_41 AC 2 ms
6,548 KB
testcase_42 AC 2 ms
6,548 KB
testcase_43 AC 2 ms
6,548 KB
testcase_44 AC 21 ms
6,548 KB
testcase_45 AC 19 ms
6,548 KB
testcase_46 AC 20 ms
6,548 KB
testcase_47 AC 224 ms
7,296 KB
testcase_48 AC 210 ms
7,680 KB
testcase_49 AC 228 ms
7,680 KB
testcase_50 AC 228 ms
6,548 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'void in(T& ...)':
main.cpp:15:53: warning: fold-expressions only available with '-std=c++17' or '-std=gnu++17' [-Wc++17-extensions]
   15 | template<class... T>void in(T&... a){(cin >> ... >> a);}
      |                                                     ^
main.cpp: In function 'void out(const T&, const Ts& ...)':
main.cpp:16:100: warning: fold-expressions only available with '-std=c++17' or '-std=gnu++17' [-Wc++17-extensions]
   16 | template<class T, class... Ts>void out(const T& a, const Ts&... b){cout << a;((cout << ' ' <<  b), ...);cout << '\n';}
      |                                                                                                    ^~~

ソースコード

diff #

#include<bits/stdc++.h>
#include <atcoder/all>
using namespace std;using namespace atcoder;using vst = vector<string>;using ll = long long;
using ld = long double;using pll = pair<ll,ll>;using vll = vector<ll>;using vvll = vector<vll>;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define repp(i,k,n) for (ll i = k; i < n; i++)
#define per(i,s,e) for(ll i = s; i >= e; i--)
#define all(v) v.begin(),v.end()
#define no() {cout << "No" << endl; return 0;}
#define yes() {cout << "Yes" << endl;return 0;}
#define CHECK(a) a ? cout << "Yes" << endl : cout << "No" << endl
#define UNOmap unordered_map
#define UNOset unordered_set
#define ASC(T) T,vector<T>,greater<T>
template<class... T>void in(T&... a){(cin >> ... >> a);}
template<class T, class... Ts>void out(const T& a, const Ts&... b){cout << a;((cout << ' ' <<  b), ...);cout << '\n';}
void vin(vll &v){for(ll i = 0; i < (ll)v.size(); i++)in(v[i]);}
void vout(vll &v){for(ll i = 0; i < (ll)v.size(); i++) cout << v[i] << ' ';}
ll INF = 1LL << 62;ll MODD = 998244353;ll MOD = 1000000007;
// using mint = modint998244353;
// using mint = modint1000000007;
//using mint = modint;

//----------------------------------------------


int main(){
  ll N,M;
  in(N,M);
  map<ll,ll> cnt;
  rep(i,N){
    ll a;
    in(a);
    cnt[a]++;
  }
  rep(i,M){
    ll b;
    in(b);
    cout << cnt[b] << ' ';
  }

 }
0