Submission #129369

#TimeUsernameProblemLanguageResultExecution timeMemory
129369DajuncticExhibition (JOI19_ho_t2)C++17
100 / 100
245 ms2812 KiB
/* _ ________ ___ __ ___ _ _ _ | | / /| _ \ / _ \ / // _ \ | | | |(_) | |/ / | | | |/ /_\ \ / // /_\ \| | __ __ _ | | _ | \ | | | || _ | / / | _ || |/ // _` || || | | |\ \| |/ / | | | | / / | | | || <| (_| || || | \_| \_/|___/ \_| |_//_/ \_| |_/|_|\_\\__,_||_||_| */ #include<bits/stdc++.h> using namespace std; #define int long long const int N = 1e5+50; const int mod = 1e9+7; #define size sdkdsf #define pb push_back const int in = 1e9+9; typedef pair<int,int> ii; int n, m; struct Exhibition{ int s, v; } Pictures[N]; int size[N]; #define fi first #define se second signed main(){ cin >> n >> m; for(int i=1;i<=n;i++){ cin >> Pictures[i].s >> Pictures[i].v; } for(int i=1;i<=m;i++) cin >> size[i]; sort(Pictures+1,Pictures+n+1,[](Exhibition _a,Exhibition _b){return _a.v > _b.v or (_a.v == _b.v and _a.s > _b.s);}); sort(size+1,size+m+1,greater<int>()); int it = 1; for(int i=1;i<=n;i++){ if(it<=m and Pictures[i].s <= size[it]) it++; } cout << it-1; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...