Submission #197457

#TimeUsernameProblemLanguageResultExecution timeMemory
197457JuneyExhibition (JOI19_ho_t2)C++14
100 / 100
76 ms4720 KiB
#include <bits/stdc++.h> using namespace std; #define fi first #define se second typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int MAXN = 1e5 + 5; int N, M, C[MAXN], ans; pii A[MAXN]; priority_queue<pii> pq; int main() { ios::sync_with_stdio(0); cin.tie(0); cin >> N >> M; for(int i=1; i<=N; i++) { int s, v; cin >> s >> v; pq.push(pii(v, s)); } for(int i=1; i<=M; i++) cin >> C[i]; sort(C+1, C+1+M); for(int i=M; i>=1; i--) { while(!pq.empty() && pq.top().se > C[i]) pq.pop(); if(pq.empty()) break; pq.pop(); ans++; } cout << ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...