# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
958310 | JwFXoiz | Xylophone (JOI18_xylophone) | C++14 | 125 ms | 175604 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>
#include "xylophone.h"
using namespace std;
int a[5001], qq[5001][5001];
int C = 0;
int ask(int l, int r)
{
assert(++C <= 10000);
if (qq[l][r] != -1) return qq[l][r];
return qq[l][r] = query(l, r);
}
void calc(int l, int r, int f, int up)
{
if (r - l <= 1) return;
if (!f)
{
int x = ask(l + 1, r);
int lx = l + 1, rx = r - 1;
while (lx < rx)
{
int mid = (lx + rx + 1) >> 1;
int y = ask(mid, r);
if (x == y) lx = mid;
else rx = mid - 1;
}
if (up) a[lx] = a[r] + x;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |