Submission #1015253

#TimeUsernameProblemLanguageResultExecution timeMemory
1015253snpmrnhlolExhibition (JOI19_ho_t2)C++17
100 / 100
113 ms4904 KiB
#include<bits/stdc++.h> using namespace std; const int N = 2e5; int picval[N],picsz[N],p[N],framesz[N]; int main(){ int n,m; cin>>n>>m; for(int i = 0;i < n;i++){ cin>>picsz[i]>>picval[i]; p[i] = i; } for(int i = 0;i < m;i++){ cin>>framesz[i]; } sort(framesz,framesz + m); sort(p,p + n,[&](int a,int b){ if(picval[a] == picval[b])return picsz[a] < picsz[b]; return picval[a] < picval[b]; }); int pt = m - 1; for(int i = n - 1;i >= 0;i--){ int id = p[i]; if(pt != -1 && picsz[id] <= framesz[pt]){ pt--; } } cout<<m - 1 - pt; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...