Submission #101701

#TimeUsernameProblemLanguageResultExecution timeMemory
101701KCSCExhibition (JOI19_ho_t2)C++14
100 / 100
204 ms4516 KiB
#include <bits/stdc++.h> using namespace std; const int DIM = 100005; int frm[DIM]; pair<int, int> pic[DIM]; int main(void) { #ifdef HOME freopen("exhibition.in", "r", stdin); freopen("exhibition.out", "w", stdout); #endif int n, m; cin >> n >> m; for (int i = 1; i <= n; ++i) { cin >> pic[i].second >> pic[i].first; } for (int i = 1; i <= m; ++i) { cin >> frm[i]; } sort(pic + 1, pic + n + 1); sort(frm + 1, frm + m + 1); int ans = 0; for (int i = m, it = n; i >= 1; --i) { while (it > 0 and frm[i] < pic[it].second) { --it; } if (!it) { break; } else { ++ans; --it; } } cout << ans; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...