Submission #465077

#TimeUsernameProblemLanguageResultExecution timeMemory
465077ohasanovExhibition (JOI19_ho_t2)C++17
100 / 100
72 ms4916 KiB
#include "bits/stdc++.h" using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); vector<pair<int,int>> listvalue; vector<int> intejir; int n,m; cin >> n >> m; for(int i = 0; i < n; i++){ int s,v; cin >> s >> v; listvalue.push_back(make_pair(v,s)); } sort(listvalue.begin(), listvalue.end()); for(int i = 0; i < m; i++){ int s; cin >> s; intejir.push_back(s); } sort(intejir.begin(), intejir.end()); int ans = 0; int j = intejir.size()-1; for(int i = listvalue.size()-1; i >= 0; i--){ if (j < 0) break; if (listvalue[i].second <= intejir[j]){ ans++; j--; } } cout << ans << endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...