結果

問題 No.3016 unordered_mapなるたけ落とすマン
ユーザー trineutrontrineutron
提出日時 2020-09-21 15:47:00
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 366 ms / 1,000 ms
コード長 557 bytes
コンパイル時間 2,500 ms
コンパイル使用メモリ 204,708 KB
実行使用メモリ 9,312 KB
最終ジャッジ日時 2023-09-06 17:11:28
合計ジャッジ時間 17,725 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 237 ms
9,020 KB
testcase_04 AC 280 ms
9,084 KB
testcase_05 AC 277 ms
9,008 KB
testcase_06 AC 269 ms
8,924 KB
testcase_07 AC 276 ms
8,964 KB
testcase_08 AC 278 ms
9,084 KB
testcase_09 AC 278 ms
8,964 KB
testcase_10 AC 275 ms
9,116 KB
testcase_11 AC 278 ms
9,124 KB
testcase_12 AC 270 ms
9,312 KB
testcase_13 AC 273 ms
9,084 KB
testcase_14 AC 268 ms
8,952 KB
testcase_15 AC 366 ms
9,016 KB
testcase_16 AC 263 ms
8,948 KB
testcase_17 AC 280 ms
9,020 KB
testcase_18 AC 261 ms
9,076 KB
testcase_19 AC 270 ms
8,952 KB
testcase_20 AC 262 ms
8,960 KB
testcase_21 AC 264 ms
9,004 KB
testcase_22 AC 270 ms
9,024 KB
testcase_23 AC 265 ms
8,928 KB
testcase_24 AC 264 ms
8,928 KB
testcase_25 AC 262 ms
9,124 KB
testcase_26 AC 262 ms
8,984 KB
testcase_27 AC 264 ms
9,160 KB
testcase_28 AC 244 ms
9,016 KB
testcase_29 AC 243 ms
8,972 KB
testcase_30 AC 243 ms
9,116 KB
testcase_31 AC 234 ms
8,948 KB
testcase_32 AC 227 ms
8,984 KB
testcase_33 AC 221 ms
9,112 KB
testcase_34 AC 227 ms
9,016 KB
testcase_35 AC 222 ms
8,928 KB
testcase_36 AC 227 ms
8,924 KB
testcase_37 AC 222 ms
8,948 KB
testcase_38 AC 225 ms
8,964 KB
testcase_39 AC 222 ms
9,088 KB
testcase_40 AC 221 ms
9,116 KB
testcase_41 AC 2 ms
4,380 KB
testcase_42 AC 2 ms
4,380 KB
testcase_43 AC 2 ms
4,380 KB
testcase_44 AC 21 ms
4,380 KB
testcase_45 AC 17 ms
4,380 KB
testcase_46 AC 19 ms
4,376 KB
testcase_47 AC 209 ms
6,656 KB
testcase_48 AC 195 ms
6,944 KB
testcase_49 AC 217 ms
6,868 KB
testcase_50 AC 239 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

struct h {
    size_t operator()(long k) const {
        __uint128_t n = k;
        return (n * 0x123456789abcdef) >> 64;
    }
};

int main() {
    int n, m;
    cin >> n >> m;
    unordered_map<long, int, h> a;
    for (int i = 0; i < n; i++) {
        long a_i;
        cin >> a_i;
        a[a_i]++;
    }
    for (int i = 0; i < m; i++) {
        long b;
        cin >> b;
        cout << a[b];
        if (i < m - 1) {
            cout << " ";
        } else {
            cout << endl;
        }
    }
}
0