Submission #470969

#TimeUsernameProblemLanguageResultExecution timeMemory
470969Sad_BusOlivander (COCI18_olivander)C++14
50 / 50
1 ms312 KiB
#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 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...