Submission #1093359

#TimeUsernameProblemLanguageResultExecution timeMemory
1093359ortsacExhibition (JOI19_ho_t2)C++17
100 / 100
89 ms4688 KiB
#include <bits/stdc++.h> using namespace std; #define pii pair<int, int> #define fr first #define se second int32_t main() { //freopen("in", "r", stdin); int n, m; cin >> n >> m; vector<pii> p(n); vector<int> c(m); for (int i = 0; i < n; i++) { cin >> p[i].se >> p[i].fr; } for (int i = 0; i < m; i++) { cin >> c[i]; } sort(p.begin(), p.end()); sort(c.begin(), c.end()); int ans = 0; for (int i = m - 1; i >= 0; i--) { while (!p.empty() && (p.back().se > c[i])) p.pop_back(); if (p.empty()) break; ans++; p.pop_back(); } cout << ans << "\n"; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...