# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
46422 | SpaimaCarpatilor | Port Facility (JOI17_port_facility) | C++17 | 3896 ms | 656108 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;
const int NMAX = 1000009;
int N, M, a[NMAX], b[NMAX], p[2 * NMAX], pos[2 * NMAX], ap[NMAX];
const int mod = 1e9 + 7;
int ansMi, ansMa, hansMi, hansMa, mi[5 * NMAX], ma[5 * NMAX], hmi[5 * NMAX], hma[5 * NMAX];
void refresh (int nod, int f1, int f2)
{
mi[nod] = min (mi[f1], mi[f2]);
ma[nod] = max (ma[f1], ma[f2]);
hmi[nod] = (mi[nod] == mi[f1] ? hmi[f1] : hmi[f2]);
hma[nod] = (ma[nod] == ma[f1] ? hma[f1] : hma[f2]);
}
void build (int nod, int st, int dr)
{
if (st == dr)
{
if (p[st] == 0) mi[nod] = 4 * N, ma[nod] = 0;
else mi[nod] = ma[nod] = p[st];
hmi[nod] = hma[nod] = st;
return ;
}
int mij = (st + dr) >> 1, f1 = nod << 1, f2 = f1 | 1;
build (f1, st, mij);
build (f2, mij + 1, dr);
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |