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;
#define int long long
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n;
cin >> n;
vector<int> wands(n), boxes(n);
for (int i = 0; i < n; ++i)
{
cin >> wands[i];
}
for (int i = 0; i < n; ++i)
{
cin >> boxes[i];
}
sort(wands.begin(), wands.end());
sort(boxes.begin(), boxes.end());
for (int i = 0; i < n; ++i)
{
auto it = lower_bound(boxes.begin(), boxes.end(), wands[i]);
if(it != boxes.end()){
boxes.erase(it);
}
else{
cout << "NE\n";
return 0;
}
}
cout << "DA\n";
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... |