# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
99005 | ainta | Exhibition (JOI19_ho_t2) | C++17 | 95 ms | 1656 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<cstdio>
#include<algorithm>
using namespace std;
#define N_ 101000
int C[N_];
struct point {
int a, b;
bool operator<(const point &p)const {
return b != p.b ? b < p.b : a < p.a;
}
}w[N_];
int n, m, res;
int main() {
int i, j;
scanf("%d%d", &n, &m);
for (i = 1; i <= n; i++) {
scanf("%d%d", &w[i].a, &w[i].b);
}
for (i = 1; i <= m; i++)scanf("%d", &C[i]);
sort(w + 1, w + n + 1);
sort(C + 1, C + m + 1);
int pv = n;
for (i = m; i >= 1; i--) {
while (pv >= 1 && w[pv].a > C[i])pv--;
if (pv) {
res++;
pv--;
}
}
printf("%d\n", res);
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... |