This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#ifdef DEBUG
#include "debug.hpp"
#else
#pragma GCC optimize("Ofast")
#define trace(...)
#include <bits/stdc++.h>
#define endl '\n'
#endif
using namespace std;
using ll = long long;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
int n, m;
cin >> n >> m;
vector<pair<ll, ll>> val_sz(n);
vector<ll> frame_sz(m);
for (int i = 0; i < n; ++i) {
cin >> val_sz[i].second >> val_sz[i].first;
}
for (int i = 0; i < m; ++i) {
cin >> frame_sz[i];
}
sort(val_sz.begin(), val_sz.end());
sort(frame_sz.begin(), frame_sz.end());
int ans = 0;
while (!val_sz.empty() && !frame_sz.empty()) {
if (val_sz.back().second <= frame_sz.back()) {
++ans;
frame_sz.pop_back();
}
val_sz.pop_back();
}
cout << ans << endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |