Submission #1110155

#TimeUsernameProblemLanguageResultExecution timeMemory
1110155sunboiExhibition (JOI19_ho_t2)C++17
0 / 100
1 ms336 KiB
#include <bits/stdc++.h> using namespace std; #define int long long const int INF = 1e18; signed main(){ int n, m; cin >> n >> m; vector<pair<int, int>> a(n); vector<int> c(m); for (int i = 0; i < n; i++){ cin >> a[i].second >> a[i].first; } sort(a.begin(), a.end()); for (int i = 0; i < m; i++){ cin >> c[i]; } sort(c.begin(), c.end()); int ans = 0; for (int i = 0; i < m; i++){ int cur = 0; int last = -1; for (int j = i; j < m; j++){ int k = 0; while(k < n && (last == -1 || a[k].first >= a[last].first)){ if (a[k].second <= c[j]){ cur++; last = k; break; } k++; } } ans = max(ans, cur); } cout << ans << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...