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<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<stack>
#include<map>
#include<utility>
#define int long long
#define INF 10000000000000000
#define MOD 1000000007
#define pii pair<long long, long long>
using namespace std;
signed main() {
int n, m;
cin >> n >> m;
vector<pii>v(n);
vector<int>f(m);
for (auto &i : v) cin >> i.second >> i.first;
for (auto &i : f) cin >> i;
sort(v.begin(), v.end());
sort(f.begin(), f.end());
int k = m-1;
for (int i = n-1 ; i >= 0 ; i--) {
if (k == -1) break;
if (v[i].second <= f[k]) {
k--;
}
}
cout << m-k-1 << endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |