Submission #161356

#TimeUsernameProblemLanguageResultExecution timeMemory
161356jovan_bExhibition (JOI19_ho_t2)C++17
100 / 100
157 ms8508 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; multiset <pair <int, int>> q; int frame[100005]; int main(){ ios_base::sync_with_stdio(false); cin.tie(0); cout.precision(10); cout << fixed; int n, m; cin >> n >> m; for(int i=1; i<=n; i++){ int a, b; cin >> a >> b; q.insert({-b, -a}); } for(int i=1; i<=m; i++){ cin >> frame[i]; } sort(frame+1, frame+1+m); int res = 0; for(int i=m; i>=1; i--){ while(!q.empty()){ pair <int, int> par = *q.begin(); q.erase(q.begin()); if(-par.second > frame[i]) continue; res++; break; } } cout << res; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...