Submission #774416

#TimeUsernameProblemLanguageResultExecution timeMemory
774416stefanneaguExhibition (JOI19_ho_t2)C++17
100 / 100
112 ms4392 KiB
#include <iostream> #include <algorithm> #include <vector> using namespace std; vector<pair<int, int>> v; vector<int> sz; int main() { int n, m; cin >> n >> m; v.resize(n + 1); sz.resize(m + 1); for(int i = 1; i <= n; i ++) { cin >> v[i].second >> v[i].first; } sort(v.begin() + 1, v.end()); for(int i = 1; i <= m; i ++) { cin >> sz[i]; } sort(sz.begin() + 1, sz.end()); int cnt = 0; for(int i = n; i >= 1 && cnt < m; i --) { if(sz[m - cnt] >= v[i].second) { cnt ++; } } cout << cnt; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...