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;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
vector<pair<int,int>> listvalue;
vector<int> intejir;
int n,m;
cin >> n >> m;
for(int i = 0; i < n; i++){
int s,v;
cin >> s >> v;
listvalue.push_back(make_pair(v,s));
}
sort(listvalue.begin(), listvalue.end());
for(int i = 0; i < m; i++){
int s;
cin >> s;
intejir.push_back(s);
}
sort(intejir.begin(), intejir.end());
int ans = 0;
int j = intejir.size()-1;
for(int i = listvalue.size()-1; i >= 0; i--){
if (j < 0) break;
if (listvalue[i].second <= intejir[j]){
ans++;
j--;
}
}
cout << ans << endl;
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... |