Submission #110689

#TimeUsernameProblemLanguageResultExecution timeMemory
110689kuroniExhibition (JOI19_ho_t2)C++17
100 / 100
87 ms4524 KiB
#include <iostream> #include <cstdio> #include <algorithm> #define fi first #define se second using namespace std; const int N = 100005, M = 100005; int n, m, ans = 0, c[M]; pair<int, int> a[N]; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cin >> n >> m; for (int i = 1; i <= n; i++) cin >> a[i].se >> a[i].fi; for (int i = 1; i <= m; i++) cin >> c[i]; sort(a + 1, a + n + 1, greater<pair<int, int>>()); sort(c + 1, c + m + 1, greater<int>()); for (int i = 1; i <= n; i++) ans = max(ans, min(ans + 1, (int)distance(c + 1, upper_bound(c + 1, c + m + 1, a[i].se, greater<int>())))); cout << ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...