結果

問題 No.3016 unordered_mapなるたけ落とすマン
ユーザー trineutrontrineutron
提出日時 2020-09-21 15:44:45
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 392 ms / 1,000 ms
コード長 541 bytes
コンパイル時間 2,495 ms
コンパイル使用メモリ 203,840 KB
実行使用メモリ 9,276 KB
最終ジャッジ日時 2023-09-06 17:11:07
合計ジャッジ時間 16,121 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 255 ms
9,104 KB
testcase_04 AC 263 ms
8,916 KB
testcase_05 AC 258 ms
8,928 KB
testcase_06 AC 269 ms
9,036 KB
testcase_07 AC 268 ms
9,040 KB
testcase_08 AC 260 ms
9,040 KB
testcase_09 AC 259 ms
9,008 KB
testcase_10 AC 260 ms
9,020 KB
testcase_11 AC 258 ms
9,036 KB
testcase_12 AC 251 ms
9,028 KB
testcase_13 AC 252 ms
9,016 KB
testcase_14 AC 258 ms
9,104 KB
testcase_15 AC 254 ms
9,056 KB
testcase_16 AC 253 ms
9,056 KB
testcase_17 AC 249 ms
8,980 KB
testcase_18 AC 253 ms
8,912 KB
testcase_19 AC 250 ms
9,016 KB
testcase_20 AC 254 ms
8,976 KB
testcase_21 AC 249 ms
9,104 KB
testcase_22 AC 251 ms
9,040 KB
testcase_23 AC 245 ms
8,972 KB
testcase_24 AC 243 ms
9,116 KB
testcase_25 AC 246 ms
9,104 KB
testcase_26 AC 251 ms
8,976 KB
testcase_27 AC 246 ms
8,980 KB
testcase_28 AC 252 ms
9,104 KB
testcase_29 AC 243 ms
8,968 KB
testcase_30 AC 240 ms
9,040 KB
testcase_31 AC 233 ms
8,972 KB
testcase_32 AC 232 ms
9,116 KB
testcase_33 AC 229 ms
8,924 KB
testcase_34 AC 233 ms
8,980 KB
testcase_35 AC 237 ms
8,920 KB
testcase_36 AC 247 ms
9,104 KB
testcase_37 AC 265 ms
8,920 KB
testcase_38 AC 291 ms
9,276 KB
testcase_39 AC 327 ms
9,072 KB
testcase_40 AC 392 ms
8,920 KB
testcase_41 AC 2 ms
4,380 KB
testcase_42 AC 2 ms
4,380 KB
testcase_43 AC 2 ms
4,376 KB
testcase_44 AC 26 ms
4,380 KB
testcase_45 AC 23 ms
4,380 KB
testcase_46 AC 23 ms
4,376 KB
testcase_47 AC 206 ms
6,648 KB
testcase_48 AC 183 ms
6,832 KB
testcase_49 AC 201 ms
6,944 KB
testcase_50 AC 236 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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

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