This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define rng_init mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
using namespace std;
using ll = long long;
const int MAXN = 1e5 + 5, INF = 1e9 + 5;
void solve() {
int n, m;
cin >> n >> m;
vector<pair<int, int>> pictures(n);
for (auto &[val, sz] : pictures)
cin >> sz >> val;
vector<int> frames(m);
for (auto &x : frames)
cin >> x;
sort(pictures.begin(), pictures.end(), greater<>());
sort(frames.begin(), frames.end());
int ans = 0;
for (const auto &[val, sz] : pictures)
ans += (frames[m - ans - 1] >= sz);
cout << ans;
}
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int tc = 1;
// cin >> tc;
while (tc--) solve();
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |