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;
vector<pair<int, int>> v1;
vector<int> v2;
int main() {
ios_base::sync_with_stdio(false); cin.tie(NULL);
int n, m;
cin >> n >> m;
for (int i = 0; i < n; i++) {
int a, b;
cin >> a >> b;
v1.push_back({b, a});
}
sort(v1.rbegin(), v1.rend());
for (int i = 0; i < m; i++) {
int a;
cin >> a;
v2.push_back(a);
}
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... |