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;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int n, m = 0, ok = 1, t = 0;
cin >> n;
long long x[n], y[n];
for(long long i = 0; i < n; ++i) cin >> x[i];
for(long long i = 0; i < n; ++i) cin >> y[i];
for(long long i = 0; i < n; ++i){
while(x[i] > y[t] and t < n) ++t;
m = t - 1;
for(long long j = t; j < n; ++j){
if(x[i] <= y[j] and x[i] > y[m]) m = j;
if(x[i] == y[j]) j = n;
}
y[m] = 0;
if(m == n) ok = 0;
m = 0;
t = 0;
}
if(ok) cout << "Da";
else cout << "Ne";
return 0;
}
# | 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... |
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |