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>
#define int long long
#define pb push_back
#define io ios_base::sync_with_stdio(0),cin.tie(0);
#define str string
using namespace std;
const int maxn=1e6+2;
int t, n , m, a[maxn],b[maxn],sum;
signed main() {
io;
cin >> n>> m;
for(int i = 1; i <= n ; i++){
cin >> a[i];
}
for(int i = 1; i <= m ;i++){
cin >> b[i];
}
for(int i = 1 ; i <= n ; i++){
if(a[i] == b[i]){
sum++;
}
}
if(sum != 0){
cout << "YES";
}else{
cout << "NO";
}
}
# | 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... |