#include <bits/stdc++.h>
#define int long long
#define fi first
#define se second
#define keish ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
using namespace std;
int n, m;
signed main(){
keish;
cin >> n >> m;
vector<pair<int ,int>> a(n);
for(int i = 0; i < n; i++) cin >> a[i].se >> a[i].fi;
vector<int> c(m);
for(int i = 0; i < n; i++) cin >> c[i];
sort(a.begin(), a.end());
sort(c.begin(), c.end());
int prv = 0, ans = 0;
for(int i = 0; i < n; i++){
if(prv < a[i].se){
prv = a[i].se;
ans++;
}
}
cout << ans << '\n';
}
// 1 5
// 5 3
// 20 10
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |