Submission #916516

#TimeUsernameProblemLanguageResultExecution timeMemory
916516AiperiiiExhibition (JOI19_ho_t2)C++14
0 / 100
1 ms348 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define all(x) x.begin(),x.end() #define ff first #define ss second #define pb push_back signed main(){ int n,m; cin>>n>>m; vector < pair <int,int> > v; for(int i=0;i<n;i++){ int x,y; cin>>x>>y; v.pb({y,x}); } sort(all(v)); vector <int> c(m); for(int i=0;i<m;i++){ cin>>c[i]; } sort(all(c)); vector <int >pos; for(int i=0;i<n;i++){ auto x=lower_bound(all(c),v[i].ss)-c.begin(); pos.pb(x); } int p=-1,cnt=0; for(auto i : pos){ if(p==m-1)break; if(i>=m)continue; p=max(p+1,i); cnt++; } cout<<cnt<<"\n"; } /* */
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...