# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
798221 | hungnt | Non-boring sequences (CERC12_D) | C++14 | 284 ms | 17096 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 N = 200005;
int n;
int a[N], b[N], pos[N];
int low[N], high[N];
bool boring(int L, int R)
{
if(L >= R) return 0;
int curL = L, curR = R;
bool x = 0;
while(curL <= curR)
{
if (!x)
{
if (low[curL] < L && high[curL] > R)
return boring(L, curL - 1) || boring(curL + 1, R);
++curL;
}
else {
if (low[curR] < L && high[curR] > R)
return boring(L, curR - 1) || boring(curR + 1, R);
--curR;
}
x ^= 1;
}
return 1;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |