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 <iostream>
#include <vector>
#include <algorithm>
using namespace std;
string can_place_wands_in_boxes(int N, vector<int>& wand_lengths, vector<int>& box_sizes) {
sort(wand_lengths.begin(), wand_lengths.end());
sort(box_sizes.begin(), box_sizes.end());
for (int i = 0; i < N; ++i) {
if (wand_lengths[i] > box_sizes[i]) {
return "NE";
}
}
return "DA";
}
int main() {
int N;
cin >> N;
vector<int> wand_lengths(N);
vector<int> box_sizes(N);
for (int i = 0; i < N; ++i) {
cin >> wand_lengths[i];
}
for (int i = 0; i < N; ++i) {
cin >> box_sizes[i];
}
string result = can_place_wands_in_boxes(N, wand_lengths, box_sizes);
cout << result << endl;
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... |