Submission #333526

#TimeUsernameProblemLanguageResultExecution timeMemory
333526a_playerExhibition (JOI19_ho_t2)C++14
100 / 100
150 ms4472 KiB
#include <bits/stdc++.h> #define f first #define s second using namespace std; int main(){ int n,m; cin>>n>>m; vector<pair<int,int> > p(n); vector<int> c(m); for(auto &x:p)cin>>x.s>>x.f; for(int &x:c)cin>>x; sort(c.begin(),c.end(),greater<int>()); sort(p.begin(),p.end()); int j=0; int sol=0; for(int i=n-1;i>=0;i--){ if(j<m&&c[j]>=p[i].s)sol++,j++; } cout<<sol<<endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...