Submission #1019548

# Submission time Handle Problem Language Result Execution time Memory
1019548 2024-07-11T03:31:25 Z vjudge1 Olivander (COCI18_olivander) C++17
50 / 50
1 ms 604 KB
#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
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 604 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 604 KB Output is correct
2 Correct 0 ms 348 KB Output is correct