# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
572076 | 1ne | Exhibition (JOI19_ho_t2) | C++14 | 54 ms | 5588 KiB |
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;
const long long mxn = 1e12;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
long long n,m;cin>>n>>m;
vector<pair<long long ,long long>>arr(n);
for (int i = 0;i<n;++i){
cin>>arr[i].second>>arr[i].first;
}
vector<long long >brr(m);
for (int i = 0;i<m;++i)cin>>brr[i];
sort(brr.begin(),brr.end());
sort(arr.begin(),arr.end());
//find a longest subsequence that arr[j].first<=brr[i]
int ans = m - 1;
for (int i = n - 1;i>=0;--i){
if (ans<0)break;
if (arr[i].second<=brr[ans]){
--ans;
}
}
cout<<m - ans - 1<<'\n';
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |