Submission #306483

#TimeUsernameProblemLanguageResultExecution timeMemory
306483TemmieExhibition (JOI19_ho_t2)C++17
100 / 100
60 ms1656 KiB
#include <bits/stdc++.h> int main() { std::ios::sync_with_stdio(0); std::cin.tie(0); int n, m, ans = 0; std::cin >> n >> m; std::vector <std::pair <int, int>> b(n); for (auto& p : b) std::cin >> p.second >> p.first; std::sort(b.begin(), b.end()); std::vector <int> a(m); for (int& x : a) std::cin >> x; std::sort(a.begin(), a.end()); for (int i = m - 1, cnt = n - 1; i >= 0; i--) { while (cnt >= 0 && b[cnt].second > a[i]) cnt--; ans += cnt >= 0, cnt -= cnt >= 0; } std::cout << ans << "\n"; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...