Submission #889313

#TimeUsernameProblemLanguageResultExecution timeMemory
889313Perl32Exhibition (JOI19_ho_t2)C++14
100 / 100
45 ms4784 KiB
//I wrote this code 4 u <3 #include <bits/stdc++.h> using namespace std; using ll = long long; #ifdef LOCAL #include "algo/debug.h" #else #define debug(...) 42 #endif signed main(int32_t argc, char *argv[]) { ios_base::sync_with_stdio(false); cin.tie(nullptr); int n, m; cin >> n >> m; vector<pair<int, int>> a(n); for (int i = 0; i < n; ++i) { cin >> a[i].first >> a[i].second; } vector<int> b(m); for (int i = 0; i < m; ++i) { cin >> b[i]; } sort(a.begin(), a.end(), [&](const pair<int, int> &fir, const pair<int, int> &sec) { return fir.second > sec.second || (fir.second == sec.second && fir.first > sec.first); }); sort(b.rbegin(), b.rend()); int ans = 0; for (int i = 0; i < n; ++i) { if (b[ans] >= a[i].first) { ans++; } } cout << ans; } /* */
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...