1 solutions
-
0
#include<bits/stdc++.h> using namespace std; const int N=110; typedef long long LL; LL a[N],b[N],c[N]; int main() { int n,m,l,q; cin>>n; for(int i=1;i<=n;i++) cin>>a[i]; cin>>m; for(int i=1;i<=m;i++) cin>>b[i]; cin>>l; for(int i=1;i<=l;i++) cin>>c[i]; set<LL> s; for(int i=1;i<=n;i++) { for(int j=1;j<=m;j++) { for(int k=1;k<=l;k++) { s.insert(a[i]+b[j]+c[k]); } } } cin>>q; while(q--) { int x; cin>>x; if(s.count(x)) cout<<"Yes"<<endl; else cout<<"No"<<endl; } return 0; }
- 1
Information
- ID
- 2736
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 3
- Tags
- # Submissions
- 9
- Accepted
- 3
- Uploaded By