Submission #919547

#TimeUsernameProblemLanguageResultExecution timeMemory
919547iskhakkutbilimExhibition (JOI19_ho_t2)C++17
100 / 100
54 ms5720 KiB
#include <bits/stdc++.h> using namespace std; #define ff first #define ss second #define all(a) a.begin(), a.end() const int mod = 1e9 + 7; const int N = 1e5; #define int long long signed main(){ ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, m; cin >> n >> m; vector< array<int, 2> > a(n); for(int i = 0;i < n; i++){ cin >> a[i][0] >> a[i][1]; } sort(all(a), [&](auto A, auto B){ if(A[1] == B[1]) return A[0] < B[0]; return A[1] < B[1]; }); vector<int> frame(m); for(auto &e : frame) cin >> e; sort(all(frame)); reverse(all(frame)); int ans = 0; for(int i = 0;i < m; i++){ while(a.empty() == false && a.back()[0] > frame[i]) a.pop_back(); if(a.empty()) break; ans++; a.pop_back(); } cout << ans; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...