이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |