Submission #930588

#TimeUsernameProblemLanguageResultExecution timeMemory
930588aykhnExhibition (JOI19_ho_t2)C++17
0 / 100
1 ms600 KiB
#include <bits/stdc++.h> using namespace std; #define int long long signed main() { ios_base::sync_with_stdio(0); cin.tie(nullptr); int n, m; cin >> n >> m; int b[m]; array<int, 2> a[n]; multiset<int> s; for (array<int, 2> &x : a) cin >> x[0] >> x[1], s.insert(x[1]); for (int &i : b) cin >> i; sort(b, b + m); sort(a, a + n); int j = n - 1, res = 0; for (int i = m - 1; i >= 0; i--) { while (j >= 0 && b[i] < a[j][0]) { if (s.find(a[j][1]) != s.end()) s.erase(s.find(a[j][1])); j--; } if (!s.empty()) res++, s.erase(--s.end()); } cout << res << '\n'; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...