# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
255657 | islingr | Examination (JOI19_examination) | C++17 | 828 ms | 9848 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 rep(i, a, b) for (auto i = (a); i < (b); ++i)
const int N = 1 << 17;
int n, ans[N];
struct P { int x, y, z, i; bool first; } a[2 * N], tmp[2 * N];
void cdq2(int l, int r) {
if (r - l == 1) return;
int m = (l + r) / 2;
cdq2(l, m); cdq2(m, r);
int i = l, j = m, k = l, cnt = 0;
while (i < m && j < r) {
if (a[j].z <= a[i].z) {
if (!a[i].i && a[i].first) ++cnt;
tmp[k++] = a[i++];
} else {
if (a[j].i && !a[j].first) ans[a[j].i] += cnt;
tmp[k++] = a[j++];
}
}
while (i < m) tmp[k++] = a[i++];
while (j < r) {
if (a[j].i && !a[j].first) ans[a[j].i] += cnt;
tmp[k++] = a[j++];
}
rep(i, l, r) a[i] = tmp[i];
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |