# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
129399 | gaoxam123 | Exhibition (JOI19_ho_t2) | C++14 | 65 ms | 2808 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;
#pragma GCC Optimize (O3)
#pragma GCC targets (sse4)
#define int long long
int n,m,ans;
pair<int,int> a[100005];
int c[100005];
signed main(){
ios_base::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
cin>>n>>m;
for(int i=1;i<=n;i++){
cin>>a[i].second>>a[i].first;
}
for(int i=1;i<=m;i++){
cin>>c[i];
}
int cnt=n;
sort(a+1,a+n+1);
sort(c+1,c+m+1);
for(int i=m;i>=1;i--){
while(cnt>0&&a[cnt].second>c[i]){
cnt--;
}
if(cnt){
ans++;
cnt--;
}
}
cout<<ans;
}
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... |