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;
typedef long long ll;
typedef long double ld;
multiset <pair <int, int>> q;
int frame[100005];
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.precision(10);
cout << fixed;
int n, m;
cin >> n >> m;
for(int i=1; i<=n; i++){
int a, b;
cin >> a >> b;
q.insert({-b, -a});
}
for(int i=1; i<=m; i++){
cin >> frame[i];
}
sort(frame+1, frame+1+m);
int res = 0;
for(int i=m; i>=1; i--){
while(!q.empty()){
pair <int, int> par = *q.begin();
q.erase(q.begin());
if(-par.second > frame[i]) continue;
res++;
break;
}
}
cout << res;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |