Submission #1019548

#TimeUsernameProblemLanguageResultExecution timeMemory
1019548vjudge1Olivander (COCI18_olivander)C++17
50 / 50
1 ms604 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...