Submission #1023694

#TimeUsernameProblemLanguageResultExecution timeMemory
1023694trandangquangExhibition (JOI19_ho_t2)C++14
100 / 100
101 ms4992 KiB
#include <bits/stdc++.h> using namespace std; using ll=long long; int main(){ int N, M; cin >> N >> M; vector<pair<int, int>> SV; for(int i=0;i<N;i++){ int s, v; cin >> s >> v; SV.push_back({v, s}); } vector<ll> C(M); for(int i=0;i<M;i++){ cin >> C[i]; } sort(SV.begin(), SV.end()); sort(C.begin(), C.end()); int now=M-1; int ans=0; for(int i=N-1;i>-1;i--){ if(SV[i].second<=C[now]){ ans++; now--; } if(now<0){ break; } } cout << ans << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...