Submission #102698

#TimeUsernameProblemLanguageResultExecution timeMemory
102698dsjongExhibition (JOI19_ho_t2)C++14
100 / 100
71 ms4736 KiB
#include<bits/stdc++.h> using namespace std; int c[100005]; int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int N,M; cin>>N>>M; vector<pair<int,int>>v; for(int i=0;i<N;i++){ int S,V; cin>>S>>V; v.push_back({V,S}); } for(int i=0;i<M;i++){ cin>>c[i]; } sort(v.begin(),v.end()); sort(c,c+M); int ans=0; for(int i=N-1;i>=0;i--){ if(c[M-ans-1]>=v[i].second){ ans++; } if(ans==M) break; } cout<<ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...