This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
//Amenov Omar
const int N=1e5+1;
using ll=long long;
bool used[N];
int main(){
ios::sync_with_stdio(false);
cin.tie(NULL);
ll n,m;
cin>>n>>m;
ll a[n+1],b[m+1];
ll ans=0;
for(ll i=1;i<=n;i++) {
cin>>a[i];
}
for(ll j=1;j<=m;j++) {
cin>>b[j];
}
for(ll j=1;j<=m;j++) {
for(ll i=1;i<=m;i++) {
if(i!=j) {
if(b[j]+b[i]==a[1]) ans++;
}
}
}
if(ans>=1) cout<<"Yes";
else cout<<"No ";
}
//01.12.2010
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |