結果

問題 No.206 数の積集合を求めるクエリ
ユーザー agatanagatan
提出日時 2015-05-08 23:33:22
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 633 bytes
コンパイル時間 613 ms
コンパイル使用メモリ 76,484 KB
実行使用メモリ 179,328 KB
最終ジャッジ日時 2023-09-19 08:54:42
合計ジャッジ時間 28,808 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 4 ms
4,376 KB
testcase_06 AC 2,452 ms
97,296 KB
testcase_07 AC 2,998 ms
108,892 KB
testcase_08 AC 6,445 ms
179,328 KB
testcase_09 AC 6,793 ms
179,196 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 3 ms
4,376 KB
testcase_12 TLE -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <climits>
#include <unordered_set>
#include <set>

#define REP(i, n) for(int i=0;i<(n);i++)

using namespace std;


int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    int L, M, N;
    cin >> L >> M >> N;

    vector<int> A(L);
    REP(i, L) {
        cin >> A[i];
    }

    vector<int> B(M);
    REP(i, M) {
        cin >> B[i];
    }
    int Q;
    cin >> Q;

    multiset<int> C;
    for (int a: A) {
        for (int b: B) {
            C.insert(a - b);
        }
    }

    REP(i, Q) {
        cout << C.count(i) << endl;
    }

    return 0;
}
0