結果

問題 No.206 数の積集合を求めるクエリ
ユーザー agatanagatan
提出日時 2015-05-08 23:31:17
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 635 bytes
コンパイル時間 573 ms
コンパイル使用メモリ 71,780 KB
実行使用メモリ 20,492 KB
最終ジャッジ日時 2023-09-19 08:53:50
合計ジャッジ時間 9,683 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 13 ms
11,336 KB
testcase_07 AC 18 ms
20,492 KB
testcase_08 AC 22 ms
19,896 KB
testcase_09 AC 23 ms
19,724 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 2 ms
4,380 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>

#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;

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

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

    return 0;
}
0