Submission #1100085

#TimeUsernameProblemLanguageResultExecution timeMemory
1100085owieczkaExhibition (JOI19_ho_t2)C++17
100 / 100
54 ms4560 KiB
#include <bits/stdc++.h> using namespace std; int frames[200'001]; pair <int, int> pictures[100'001]; bool war(int x, int n, int m) { int it = m - x; for (int i = 0; i < n; i++) { if (pictures[i].second <= frames[it]) { it ++; } } if (it >= m) { return true; } return false; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n, m; cin >> n >> m; for (int i = 0; i < n; i++) { cin >> pictures[i].second >> pictures[i].first; } sort (pictures, pictures + n); for (int i = 0; i < m; i++) { cin >> frames[i]; } sort (frames, frames + m); int beg = 0; int en = m; while (en > beg) { int x = (beg + en + 1)/2; if (war(x, n, m)) { beg = x; } else { en = x - 1; } } cout << beg << '\n'; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...