Submission #129365

#TimeUsernameProblemLanguageResultExecution timeMemory
129365tuanasanhExhibition (JOI19_ho_t2)C++11
100 / 100
70 ms5120 KiB
#include<bits/stdc++.h> #pragma GCC optimize ("O3") #pragma GCC target ("sse4") #define ii pair<int,int> using namespace std; int n,m,v,s; vector<ii> r; vector<int> c; signed main(){ // freopen(".inp","r",stdin); // freopen(".out","w",stdout); ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin>>n>>m; for(int i=0;i<n;i++){ cin>>s>>v; r.push_back({v,s}); } for(int i=0;i<m;i++){ cin>>s; c.push_back(s); } sort(r.begin(),r.end()); sort(c.begin(),c.end()); int lst=m-1; for(int i=n-1;i>=0;i--){ if(r[i].second<=c[lst]) lst--; if(lst<0) break; } cout<<m-lst-1; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...