Submission #1180828

#TimeUsernameProblemLanguageResultExecution timeMemory
1180828patgraExhibition (JOI19_ho_t2)C++20
100 / 100
34 ms1476 KiB
#include <bits/stdc++.h> #define rep(a,b,c) for(auto a = (b); a != (c); a++) #define repD(a,b,c) for(auto a = (b); a != (c); a--) #define repIn(a, b) for(auto& a : (b)) #define repIn2(a, b, c) for(auto& [a, b] : (c)) constexpr bool dbg = 1; #define DEBUG if constexpr(dbg) #define DC DEBUG std::cerr #define eol std::endl #define ll long long #define pb push_back using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int n, m; cin >> n >> m; priority_queue<pair<int, int>> q; rep(i, 0, n) { int x, y; cin >> x >> y; q.push({y, x}); } vector<int> frames(m); rep(i, 0, m) cin >> frames[i]; ranges::sort(frames); ll ans = 0; repD(i, m - 1, -1) { while(!q.empty() && q.top().second > frames[i]) q.pop(); if(q.empty()) break; ans++; q.pop(); } cout << ans << '\n'; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...