Submission #1126450

#TimeUsernameProblemLanguageResultExecution timeMemory
1126450tselmeg_tExhibition (JOI19_ho_t2)C++17
100 / 100
141 ms2104 KiB
#include <iostream> #include <vector> #include <algorithm> using namespace std; vector<int> jaaz; vector<pair<int, int>> z; int main() { int n, m; cin >> n >> m; for(int i = 0; i < n; i++){ int s, v; cin >> s >> v; z.push_back({v, s}); } for(int i = 0; i < m; i++){ int j; cin >> j; jaaz.push_back(j); } sort(z.begin(), z.end()); sort(jaaz.begin(), jaaz.end()); int i = n - 1, j = m - 1; int ans = 0; while(i >= 0 && j >= 0){ if(z[i].second <= jaaz[j]){ i--; j--; ans++; }else{ i--; } } cout << ans << '\n'; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...