Submission #1129592

#TimeUsernameProblemLanguageResultExecution timeMemory
1129592NewtonabcExhibition (JOI19_ho_t2)C++17
100 / 100
120 ms1600 KiB
#include<bits/stdc++.h> #define mp make_pair using namespace std; const int N=2e5+10; pair<int,int> pic[N]; vector<int> arr; int f[N]; //value size int main(){ int n,m; cin>>n >>m; for(int i=1;i<=n;i++){ cin>>pic[i].second >>pic[i].first; } for(int i=1;i<=m;i++) cin>>f[i]; sort(f+1,f+m+1,greater<int>()); sort(pic+1,pic+n+1,greater<pair<int,int>>()); int cur=1,ans=0; for(int i=1;i<=n;i++){ if(f[cur]>=pic[i].second){ ans++; cur++; } } cout<<ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...