제출 #1205508

#제출 시각아이디문제언어결과실행 시간메모리
1205508minhpkExhibition (JOI19_ho_t2)C++20
100 / 100
35 ms2868 KiB
#include <bits/stdc++.h> #define int long long using namespace std; int a,b; int z[1000005]; multiset<int> s; priority_queue<pair<int,int>> q; bool cmp(pair<int,int> a,pair<int,int> b){ return a.second<b.second; } signed main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cin >> a >> b; for (int i=1;i<=a;i++){ int x,y; cin >> x >> y; q.push({y,x}); } for (int i=1;i<=b;i++){ cin >> z[i]; } sort(z+1,z+1+b); int ans=0; for (int i=b;i>=1;i--){ while (q.size() && q.top().second>z[i]){ q.pop(); } if (q.size()){ ans++; q.pop(); }else{ break; } } cout << ans << " "; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...