Submission #367359

#TimeUsernameProblemLanguageResultExecution timeMemory
367359arborExhibition (JOI19_ho_t2)C++17
0 / 100
1 ms364 KiB
#include <bits/stdc++.h> #define all(x) begin(x), end(x) #define sz(x) int((x).size()) #define eb emplace_back #define pb push_back using namespace std; using ll = long long; using pii = pair<int, int>; using vi = vector<int>; const int MN = 1e5 + 5; int N, M, c[MN]; int main() { ios_base::sync_with_stdio(0), cin.tie(0); cin >> N >> M; vector<pii> a; for (int i = 0; i < N; i++) { int s, v; cin >> s >> v; a.eb(v, s); } for (int i = 0; i < M; i++) cin >> c[i]; sort(all(a)); sort(c, c + N); int ans = 0; for (int i = N - 1; i >= 0 && ans < M; i--) { if (c[M - 1 - ans] >= a[i].second) ans++; } cout << ans << '\n'; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...