Submission #108563

#TimeUsernameProblemLanguageResultExecution timeMemory
108563DiuvenExhibition (JOI19_ho_t2)C++14
100 / 100
77 ms4728 KiB
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> pii; const int MAX = 1e5+10; int n, m; int C[MAX]; pii P[MAX]; int cnt[MAX]; int main(){ ios::sync_with_stdio(0); cin.tie(0); cin>>n>>m; for(int i=1; i<=n; i++) cin>>P[i].second>>P[i].first; for(int i=1; i<=m; i++) cin>>C[i]; sort(C+1, C+m+1); sort(P+1, P+n+1); reverse(P+1, P+n+1); reverse(C+1, C+m+1); int frt = 0; for(int i=1; i<=n; i++){ if(C[frt+1] >= P[i].second) frt++; } cout<<frt<<'\n'; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...