Submission #954795

#TimeUsernameProblemLanguageResultExecution timeMemory
9547954QT0RExhibition (JOI19_ho_t2)C++17
100 / 100
50 ms4572 KiB
#include <bits/stdc++.h> using namespace std; #define pii pair<int,int> pii pic[100003]; int fra[100003]; void init(int &n, int &m){ cin >> n >> m; for (int i = 1; i<=n; i++){ cin >> pic[i].second >> pic[i].first; } for (int i = 1; i<=m; i++){ cin >> fra[i]; } sort(pic+1,pic+n+1); sort(fra+1,fra+m+1); } int main(){ ios_base::sync_with_stdio(0); cin.tie(0); int n,m; init(n,m); int ans=0,frames=m; for (int i = n; i>=1; i--){ if (frames>0 && fra[frames]>=pic[i].second){ frames--; ans++; } } cout << ans << '\n'; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...