Submission #1023638

#TimeUsernameProblemLanguageResultExecution timeMemory
1023638danglayloi1Exhibition (JOI19_ho_t2)C++17
100 / 100
44 ms4524 KiB
#include <bits/stdc++.h> #define ii pair<int, int> #define fi first #define se second #define inf 0x3f3f3f3f3f3f3f3f using namespace std; using ll = long long; const ll mod=1e9+7; const int nx=1e5+5; int n, m, f[nx], lim[nx], d, c, g, ans; ii a[nx]; bool cmp(ii a, ii b) { if(a.se==b.se) return a.fi>b.fi; return a.se>b.se; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin>>n>>m; for(int i = 1; i <= n; i++) cin>>a[i].fi>>a[i].se; sort(a+1, a+n+1, cmp); for(int i = 1; i <= m; i++) cin>>f[i]; sort(f+1, f+m+1, greater<int>()); ans=1; for(int i = 1; i <= n; i++) if(a[i].fi<=f[ans]) ans++; cout<<ans-1; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...