Submission #1098110

#TimeUsernameProblemLanguageResultExecution timeMemory
1098110vjudge1Bank (IZhO14_bank)C++17
0 / 100
23 ms43356 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[5000000]; 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(b[i]+b[j]==a[i] && b[j]+b[i]==a[j] || b[i]==a[i]){ q=true; } } } if(q){ cout << "YES"; } else{ cout << "NO"; } }

Compilation message (stderr)

bank.cpp: In function 'int main()':
bank.cpp:18:29: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   18 |          if(b[i]+b[j]==a[i] && b[j]+b[i]==a[j] || b[i]==a[i]){
      |             ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...