Submission #465108

#TimeUsernameProblemLanguageResultExecution timeMemory
465108BarayExhibition (JOI19_ho_t2)C++17
100 / 100
160 ms4392 KiB
#include <iostream> #include <vector> #include <set> #include <queue> #include <stack> #include <algorithm> #include <climits> #include <deque> using namespace std; #define ll long long ll n, m, x, y, ans; int main() { cin >> n >> m; vector<pair<int, int> > arr(n); vector<int> frames(m); for (int i = 0; i < n; i++) { cin >> x >> y; arr[i].first = y; arr[i].second = x; } for (int i = 0; i < m; i++) { cin >> frames[i]; } sort(arr.begin(), arr.end()); sort(frames.begin(), frames.end()); int cur = m - 1; for (int i = n - 1; i >= 0; i--) { if (arr[i].second <= frames[cur]) { cur--; ans++; if (cur < 0) { cout << ans; return 0; } } } cout << ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...