Submission #384303

#TimeUsernameProblemLanguageResultExecution timeMemory
384303IwanttobreakfreeExhibition (JOI19_ho_t2)C++17
100 / 100
166 ms1664 KiB
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main(){ long long int n,m,sol=0,cont=0; cin>>n>>m; vector<pair<int,int> >v(n); vector<int> frame(m); for(int i=0;i<n;i++)cin>>v[i].second>>v[i].first; for(int i=0;i<m;i++)cin>>frame[i]; sort(v.rbegin(),v.rend()); sort(frame.rbegin(),frame.rend()); for(int i=0;i<m;i++){ while(v[cont].second>frame[i]){ cont++; if(cont==n)break; } if(cont==n)break; sol++; cont++; if(cont==n)break; } cout<<sol; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...