Submission #209878

#TimeUsernameProblemLanguageResultExecution timeMemory
209878sevlllExhibition (JOI19_ho_t2)C++14
100 / 100
75 ms5664 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define pb push_back #define ld long double signed main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int n, m; cin >> n >> m; vector<pair<int, int>> K(n); for (int i = 0; i < n; i++) cin >> K[i].second >> K[i].first; vector<int> R(m); for (int i = 0; i < m; i++) cin >> R[i]; int l = -1, r = min(n, m); sort(K.begin(), K.end()); sort(R.begin(), R.end()); while (r - l > 1) { int mid = (l + r) / 2; int uk = m - mid - 1; bool f = false; for (auto p : K) { if (p.second <= R[uk]) { uk++; if (uk == m) { f = true; break; } } } if (f) { l = mid; } else { r = mid; } } cout << l + 1; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...