Submission #1119713

#TimeUsernameProblemLanguageResultExecution timeMemory
1119713wellthen_Exhibition (JOI19_ho_t2)C++17
100 / 100
113 ms4912 KiB
#include <bits/stdc++.h> using namespace std; int main(){ int n, m; cin >> n >> m; vector<pair<int, int>> pictures(n); for(int i = 0; i<n; i++){ cin >> pictures[i].first >> pictures[i].second; swap(pictures[i].first, pictures[i].second); } sort(pictures.begin(), pictures.end(), greater<pair<int, int>>()); vector<int> vals(n); for(int i = 0; i < n; i++) { vals[i] = pictures[i].second; } vector<int> frames(m); for(int i = 0; i<m; i++){ cin >> frames[i]; } sort(frames.begin(), frames.end(), greater<int>()); int ans = 0, ptr = 0; for(int i = 0; i<m; i++){ while(ptr<n && vals[ptr] > frames[i]){ ptr++; } ptr++; if(ptr > n) break; ans++; } cout << ans << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...