Submission #988923

#TimeUsernameProblemLanguageResultExecution timeMemory
988923carriewangExhibition (JOI19_ho_t2)C++17
100 / 100
41 ms5728 KiB
//#pragma GCC optimize("O3,Ofast,unroll-loops,no-stack-protector") //#pragma GCC target("avx2") #include <bits/stdc++.h> #include <bits/extc++.h> #define int long long #define double long double using namespace std; using namespace __gnu_pbds; using vi=vector<int>; using vvi=vector<vi>; using pii=pair<int,int>; #define sz(x) x.size() #define all(x) x.begin(),x.end() #define eb emplace_back #define mp make_pair #define UNTIEIO ios::sync_with_stdio(0),cin.tie(0); int n,m; signed main(){ UNTIEIO; cin >> n >> m; vi c(m); vector<pii> p(n); for(int i=0;i<n;i++) cin >> p[i].second >> p[i].first; for(int i=0;i<m;i++) cin >> c[i]; sort(all(p)); sort(all(c)); int now=n-1,ans=0; for(int i=m-1;i>=0;i--){ while(now>=0 && p[now].second>c[i]) now--; if(now>=0){ ans++; now--; } } cout << ans << "\n"; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...