This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int n, m; cin >> n >> m;
vector<pair<int, int>> v1(n);
vector<int> v2(m);
for(auto &p : v1) cin >> p.second >> p.first;
sort(v1.rbegin(), v1.rend());
for(int &p : v2) cin >> p;
sort(v2.rbegin(), v2.rend());
int id = 0;
for (int i = 0; i < n and id < m; i++) {
if (v1[i].second > v2[id]) continue;
id++;
}
cout << id << '\n';
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |