#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
using ll = long long;
using ld = long double;
void solve(int T);
void pre();
const int N = 1e5 + 5;
const int M = 405;
const int SQRT = 500;
const int LOG = 20;
const int INF = 1e18;
const int MOD = 1e9+7;
const ld EPS = 1e-9;
void pre(){
#ifdef ONLINE_JUDGE
ios::sync_with_stdio(false);
cin.tie(0);
#endif
}
int32_t main(){
pre();
int tt = 1;
//cin>>tt;
for(int i = 1;i<=tt;i++){
cerr<<"Case "<<i<<": "<<endl;
solve(i);
}
return 0;
}
void solve(int T){
int n,m;
cin>>n>>m;
int F[m];
pair<int,int> A[n];
for(int i = 0;i<n;i++)cin>>A[i].second>>A[i].first;
sort(A, A+n);
reverse(A, A+n);
for(int i = 0;i<m;i++)cin>>F[i];
sort(F, F+n);
reverse(F, F+n);
int ans = 0;
for(int i = 0;i<n;i++){
if(ans >= m){
break;
}
if(A[i].second <= F[k]){
ans++;
}
}
cout<<ans<<endl;
}
Compilation message
joi2019_ho_t2.cpp: In function 'void solve(long long int)':
joi2019_ho_t2.cpp:74:23: error: 'k' was not declared in this scope
74 | if(A[i].second <= F[k]){
| ^