Submission #51043485


Source Code Expand

#include <bits/stdc++.h>
using namespace std;

#define fio ios::sync_with_stdio(0);cin.tie(0)
#define For(i,n) for (int i=1;i<=(int)(n);i++)
#define rep(i,n) for (int i=0;i<(int)(n);i++)
#define all(x) (x).begin(),(x).end()
#define clr(i) memset(i,0,sizeof(i))
#define Max(a,b,c) max(a,max(b,c))
#define Min(a,b,c) min(a,min(b,c))
#define fore(i,x) for (auto &i:x)
#define pii pair <int,int>
#define vi vector <int>
#define pb push_back
#define ll long long
#define endl '\n'
#define re return
#define se second
#define fi first

const int INF=0x7fffffff;
const int MAXN=+3;

int main(){
	unordered_set <ll> s;
	vi a, b, c;
	int na, nb, nc;
	cin >> na;
	a.resize(na);
	fore(i, a) cin >> i;

	cin >> nb;
	b.resize(nb);
	fore(i, b) cin >> i;

	cin >> nc;
	c.resize(nc);
	fore(i, c) cin >> i;

	fore(i, a) {
		fore(j, b) {
			fore(k, c) {
				s.insert(1ll * i + j + k);
			}
		}
	}

	int nq;
	cin >> nq;
	while (nq--) {
		ll x;
		cin >> x;
		if (s.count(x)) {
			cout << "Yes" << endl;
		} else {
			cout << "No" << endl;
		}
	}
	return 0;
}

Submission Info

Submission Time
Task C - A+B+C
User Scrap
Language C++ 20 (gcc 12.2)
Score 250
Code Size 1097 Byte
Status AC
Exec Time 402 ms
Memory 45848 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 3508 KiB
random_01.txt AC 211 ms 5636 KiB
random_02.txt AC 63 ms 4708 KiB
random_03.txt AC 226 ms 4180 KiB
random_04.txt AC 254 ms 42240 KiB
random_05.txt AC 104 ms 12536 KiB
random_06.txt AC 23 ms 9068 KiB
random_07.txt AC 125 ms 7816 KiB
random_08.txt AC 198 ms 45472 KiB
random_09.txt AC 197 ms 4140 KiB
random_10.txt AC 148 ms 9368 KiB
random_11.txt AC 249 ms 22532 KiB
random_12.txt AC 402 ms 42148 KiB
random_13.txt AC 208 ms 5548 KiB
random_14.txt AC 329 ms 23212 KiB
random_15.txt AC 241 ms 23524 KiB
random_16.txt AC 270 ms 45544 KiB
random_17.txt AC 303 ms 45840 KiB
random_18.txt AC 331 ms 45732 KiB
random_19.txt AC 317 ms 45848 KiB
random_20.txt AC 323 ms 45740 KiB
random_21.txt AC 337 ms 45804 KiB
sample_01.txt AC 1 ms 3472 KiB