# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1023888 | vjudge1 | Exhibition (JOI19_ho_t2) | C++17 | 38 ms | 4188 KiB |
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>
using namespace std;
#define ll long long
#define pb push_back
const int N = 1e6+5;
#define pii pair<int, int>
#define fi first
#define se second
int n, m, c[N];
pii a[N];
void sol() {
cin >> n >> m;
for (int i = 1; i <= n; ++i) cin >> a[i].fi >> a[i].se;
for (int i = 1; i <= m; ++i) cin >> c[i];
sort(c+1, c+m+1);
sort(a+1, a+n+1, [&](pii &p1, pii &p2) -> bool {
if (p1==p2) return 0;
else if (p1.se == p2.se) return p1.fi < p2.fi;
else return p1.se < p2.se;
});
int j = m;
for (int i = n; min(i, j) >= 1; --i)
if (a[i].fi <= c[j])
j--;
cout << m-j;
}
signed main() {
cin.tie(0) -> sync_with_stdio(0);
if (fopen("A.inp", "r")) freopen("A.inp", "r", stdin);
int tc = 1; // cin >> tc;
for (int test = 1; test <= tc; ++test) sol();
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |