Submission #1036765

#TimeUsernameProblemLanguageResultExecution timeMemory
1036765andrewpExhibition (JOI19_ho_t2)C++14
100 / 100
37 ms4448 KiB
//Dedicated to my love, ivaziva #include <bits/stdc++.h> using namespace std; using pii = pair<int, int>; using ll = int64_t; #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define dbg(x) cerr << #x << ": " << x << '\n'; int32_t main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); cerr.tie(nullptr); int n, m; cin >> n >> m; vector<pii> a(n); for (int i = 0; i < n; i++) { cin >> a[i].first >> a[i].second; swap(a[i].first, a[i].second); } sort(all(a)); vector<int> b(m); for (int i = 0; i < m; i++) { cin >> b[i]; } sort(all(b)); int ans = 0, pt1 = n - 1, pt2 = m - 1; // vector<pii> dp(n); while (pt1 >= 0 && pt2 >= 0) { if (b[pt2] >= a[pt1].second) { pt2--; ans++; } pt1--; } cout << ans << '\n'; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...