# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
151227 | Bodo171 | Ancient Books (IOI17_books) | C++14 | 314 ms | 26776 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 "books.h"
#include <iostream>
using namespace std;
const int nmax=1000*1000+5;
int st[nmax],dr[nmax],viz[nmax];
int n,to_l,to_r,l,r,i,x,l1,l2,r1,r2,oldl,oldr,steps_left,steps_right;
long long abss(long long x)
{
if(x<0) return -x;
return x;
}
void ext(int &L,int &R,int oldL,int oldR)
{
int nxtL,nxtR;
while(oldL!=L||oldR!=R)
{
nxtL=L;nxtR=R;
for(int it=oldL-1;it>=L;it--)
{
nxtL=min(nxtL,st[it]);
nxtR=max(nxtR,dr[it]);
}
for(int it=oldR+1;it<=R;it++)
{
nxtL=min(nxtL,st[it]);
nxtR=max(nxtR,dr[it]);
}
oldL=L;oldR=R;
L=nxtL;R=nxtR;
}
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |