結果

問題 No.206 数の積集合を求めるクエリ
ユーザー bokusunnybokusunny
提出日時 2022-04-01 23:01:00
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 231 ms / 7,000 ms
コード長 590 bytes
コンパイル時間 3,377 ms
コンパイル使用メモリ 231,584 KB
実行使用メモリ 13,232 KB
最終ジャッジ日時 2023-08-12 20:28:02
合計ジャッジ時間 7,664 ms
ジャッジサーバーID
(参考情報)
judge13 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,384 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,384 KB
testcase_03 AC 2 ms
4,384 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 2 ms
4,384 KB
testcase_06 AC 4 ms
4,380 KB
testcase_07 AC 4 ms
4,380 KB
testcase_08 AC 4 ms
4,380 KB
testcase_09 AC 4 ms
4,380 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 8 ms
4,384 KB
testcase_13 AC 8 ms
4,384 KB
testcase_14 AC 8 ms
4,380 KB
testcase_15 AC 8 ms
4,380 KB
testcase_16 AC 8 ms
4,380 KB
testcase_17 AC 104 ms
13,200 KB
testcase_18 AC 96 ms
12,976 KB
testcase_19 AC 103 ms
12,988 KB
testcase_20 AC 95 ms
13,024 KB
testcase_21 AC 98 ms
12,928 KB
testcase_22 AC 97 ms
13,232 KB
testcase_23 AC 103 ms
13,052 KB
testcase_24 AC 231 ms
13,048 KB
testcase_25 AC 230 ms
12,996 KB
testcase_26 AC 219 ms
12,940 KB
testcase_27 AC 186 ms
13,024 KB
testcase_28 AC 223 ms
12,924 KB
testcase_29 AC 223 ms
13,132 KB
testcase_30 AC 220 ms
13,000 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define bokusunny ios::sync_with_stdio(false), cin.tie(nullptr);

#include <atcoder/convolution>
using namespace atcoder;

void solve() {
  int L, M, N;
  cin >> L >> M >> N;
  vector<long long> A(N + 1), B(N + 1);
  for (int i = 0; i < L; i++) {
    int a;
    cin >> a;
    A[a] = 1;
  }
  for (int i = 0; i < M; i++) {
    int b;
    cin >> b;
    B[N - b] = 1;
  }
  auto C = convolution_ll(A, B);
  int Q;
  cin >> Q;
  for (int v = 0; v < Q; v++) {
    cout << C[N + v] << endl;
  }
}

int main() {
  bokusunny;
  solve();

  return 0;
}
0