Submission #51232405


Source Code Expand

#include <bits/stdc++.h>
#ifdef LOCAL
#include "debug.h"
#else
#define debug(...)
#endif
using int64 = long long;
using uint = unsigned int;
using uint64 = unsigned long long;
bool ckmin(auto& a, auto b) { return b < a ? a = b, 1 : 0; }
bool ckmax(auto& a, auto b) { return b > a ? a = b, 1 : 0; }
using namespace std;

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

  int N, M, L, Q;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) cin >> A[i];
  cin >> M;
  vector<int> B(M);
  for (int i = 0; i < M; i++) cin >> B[i];
  cin >> L;
  vector<int> C(L);
  for (int i = 0; i < L; i++) cin >> C[i];
  set<int> s;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < M; j++) {
      for (int k = 0; k < L; k++) {
        s.insert(A[i] + B[j] + C[k]);
      }
    }
  }
  cin >> Q;
  while (Q--) {
    int x;
    cin >> x;
    cout << (s.contains(x) ? "Yes" : "No") << '\n';
  }

  return 0;
}

Submission Info

Submission Time
Task C - A+B+C
User xindubawukong
Language C++ 20 (gcc 12.2)
Score 250
Code Size 968 Byte
Status AC
Exec Time 500 ms
Memory 50380 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 250 / 250
Status
AC × 1
AC × 23
Set Name Test Cases
Sample sample_01.txt
All min.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt, random_20.txt, random_21.txt, sample_01.txt
Case Name Status Exec Time Memory
min.txt AC 8 ms 3464 KiB
random_01.txt AC 36 ms 5424 KiB
random_02.txt AC 14 ms 5156 KiB
random_03.txt AC 29 ms 4484 KiB
random_04.txt AC 411 ms 39596 KiB
random_05.txt AC 61 ms 11732 KiB
random_06.txt AC 34 ms 10552 KiB
random_07.txt AC 41 ms 7644 KiB
random_08.txt AC 469 ms 50184 KiB
random_09.txt AC 32 ms 4300 KiB
random_10.txt AC 64 ms 10684 KiB
random_11.txt AC 169 ms 20256 KiB
random_12.txt AC 495 ms 39728 KiB
random_13.txt AC 44 ms 5528 KiB
random_14.txt AC 237 ms 25136 KiB
random_15.txt AC 202 ms 25448 KiB
random_16.txt AC 500 ms 50216 KiB
random_17.txt AC 187 ms 50264 KiB
random_18.txt AC 192 ms 50380 KiB
random_19.txt AC 186 ms 50280 KiB
random_20.txt AC 187 ms 50288 KiB
random_21.txt AC 180 ms 50280 KiB
sample_01.txt AC 1 ms 3472 KiB