Submission #885500

#TimeUsernameProblemLanguageResultExecution timeMemory
885500Onur_IlgazExhibition (JOI19_ho_t2)C++17
100 / 100
46 ms5724 KiB
#include <bits/stdc++.h> #define fast cin.tie(0)->sync_with_stdio(0); #define int long long #define inf ((int)1e18) using namespace std; int32_t main(){ fast int n, m; cin >> n >> m; vector <pair<int,int> > arr(n); for(int i = 0; i < n; i++) { cin >> arr[i].first >> arr[i].second; } vector <int> frames(m); for(int i = 0; i < m; i++) { cin >> frames[i]; } sort(arr.begin(), arr.end(), [&](pair<int,int>&a, pair<int,int>&b) { if(a.second == b.second) return a.first < b.first; return a.second < b.second; }); int ans = 0; sort(frames.begin(), frames.end()); for(int i = n-1; i >= 0; i--) { if(frames.size() == 0) break; int frame = frames.back(); if(frame >= arr[i].first) { ans++; frames.pop_back(); } } cout << ans << "\n"; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...