#include<bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define int long long
using namespace std;
const int md = 1e9 + 7;
const int maxn = 5e5;
signed main(){
int n, m;
cin >> n >> m;
vector<array<int, 2>> T(n);
for(int i = 0; i < n; i++){
cin >> T[i][1] >> T[i][0];
}
vector<int> Q(m);
for(int i = 0; i < m; i++){
cin >> Q[i];
}
sort(T.rbegin(), T.rend());
sort(Q.rbegin(), Q.rend());
int j = 0;
for(int i = 0; i < n; i++){
if(T[i][1] <= Q[j]){
j += 1;
}
}
cout << j;
return 0;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |