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<bits/stdc++.h>
using namespace std;
#define X first
#define Y second
typedef pair<int,int> ii;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
int n; cin >> n;
int m; cin >> m;
vector<ii> Picts(n);
vector<int> Frame(m);
for(ii &p : Picts) cin >> p.Y >> p.X;
for(int&s : Frame) cin >> s;
sort(Picts.begin(),Picts.end(),greater<ii>());
sort(Frame.begin(),Frame.end(),greater<int>());
int p = 0;
for(int i = 0 ; i < m ; ++i, ++p) {
for(; p < n && Picts[p].Y > Frame[i] ; ++p);
if (p == n) {
cout << i;
exit(0);
}
}
cout << m << endl;
}
/*
8 8
508917604 35617051
501958939 840246141
485338402 32896484
957730250 357542366
904165504 137209882
684085683 775621730
552953629 20004459
125090903 607302990
433255278
979756183
28423637
856448848
276518245
314201319
666094038
149542543
*/
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |