#include <bits/stdc++.h>
using namespace std;
#define int long long int
bool comp(pair<int,int>&a, pair<int,int>&b) {
return a.second<b.second;
}
int32_t main() {
int n,m; cin >> n >> m;
vector<pair<int,int>> paintings(n);
vector<int> frames(m);
for (int i=0;i<n;i++) {
cin >> paintings[i].first >> paintings[i].second;
}
for (int i=0;i<m;i++) {
cin >> frames[i];
}
sort(frames.begin(),frames.end());
sort(paintings.begin(),paintings.end(),comp);
int sus;
vector<int> bruh;
for (int i=0;i<n;i++) {
sus=lower_bound(frames.begin(),frames.end(),paintings[i].first)-frames.begin();
bruh.push_back(sus);
}
int ans=0;
for (int i=n-1;i>-1;i--) {
if (bruh[i]<m) {
ans++; m--;
}
}
cout << ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |