Submission #1098124

#TimeUsernameProblemLanguageResultExecution timeMemory
1098124vjudge1Bank (IZhO14_bank)C++17
0 / 100
7 ms8064 KiB
#include <bits/stdc++.h> #define int unsigned long using namespace std; signed main() { int n,m; cin >> n >> m; bool q=false; int a[500000],b[500000]; for(int i=0;i<n;i++){ cin >> a[i]; } for(int i=0;i<m;i++){ cin >> b[i]; } for(int i=0;i<m;i++){ for(int j=i;j<m;j++){ if(a[i]==b[j]){ q=true; break; } for(int z=j;z<m;z++){ if(b[j]+b[z]==a[i]){ q=true; break; } } if(q){ break; } } if(q){ break; } } if(q){ cout << "YES"; } else{ cout << "NO"; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...