Submission #99248

#TimeUsernameProblemLanguageResultExecution timeMemory
99248imeimi2000Exhibition (JOI19_ho_t2)C++17
100 / 100
84 ms1656 KiB
#include <iostream> #include <algorithm> #include <vector> #define fs first #define se second using namespace std; typedef pair<int, int> pii; int n, m; pii ps[100000]; int cs[100000]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cin >> n >> m; for (int i = 0; i < n; ++i) cin >> ps[i].se >> ps[i].fs; for (int i = 0; i < m; ++i) cin >> cs[i]; sort(ps, ps + n); sort(cs, cs + m); for (int i = m, j = n; i--; ) { while (j > 0 && cs[i] < ps[j - 1].se) --j; if (j-- == 0) { printf("%d\n", m - i - 1); return 0; } } printf("%d\n", m); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...