Submission #51039988


Source Code Expand

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (int)s; i < (int)(n); i++)
using namespace std;
using ll = long long;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main() {
  int N, M, L, Q;
  cin >> N;
  vector<int> A(N);
  rep(i, N) cin >> A[i];
  cin >> M;
  vector<int> B(M);
  rep(i, M) cin >> B[i];
  cin >> L;
  vector<int> C(L);
  rep(i, L) cin >> C[i];
  cin >> Q;
 
  set<ll> sum;
  rep(i, N) {
    rep(j, M) {
      rep(k, L) {
        sum.insert(A[i] + B[j] + C[k]);
      }
    }
  }

  rep(_, Q) {
    int X;
    cin >> X;
    cout << (sum.contains(X) ? "Yes" : "No") << endl;
  }
}

Submission Info

Submission Time
Task C - A+B+C
User yukikamome316
Language C++ 23 (gcc 12.2)
Score 250
Code Size 843 Byte
Status AC
Exec Time 919 ms
Memory 50524 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 1 ms 3488 KiB
random_01.txt AC 223 ms 5448 KiB
random_02.txt AC 70 ms 5128 KiB
random_03.txt AC 234 ms 4460 KiB
random_04.txt AC 701 ms 39648 KiB
random_05.txt AC 161 ms 11988 KiB
random_06.txt AC 48 ms 10468 KiB
random_07.txt AC 158 ms 7688 KiB
random_08.txt AC 750 ms 50252 KiB
random_09.txt AC 214 ms 4464 KiB
random_10.txt AC 204 ms 10716 KiB
random_11.txt AC 422 ms 20392 KiB
random_12.txt AC 919 ms 39756 KiB
random_13.txt AC 243 ms 5576 KiB
random_14.txt AC 600 ms 25056 KiB
random_15.txt AC 466 ms 25360 KiB
random_16.txt AC 873 ms 50196 KiB
random_17.txt AC 407 ms 50372 KiB
random_18.txt AC 417 ms 50360 KiB
random_19.txt AC 406 ms 50524 KiB
random_20.txt AC 419 ms 50364 KiB
random_21.txt AC 417 ms 50332 KiB
sample_01.txt AC 1 ms 3472 KiB