# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
472689 | Haidara | Wall (IOI14_wall) | C++17 | 0 ms | 0 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<algorithm>
#include"wall.h"
#define FOR(i,n) for(int i=0;i<n;i++)
using namespace std;
const int maxn=2000001;
int n;
const int inf=0x7fffffff;
struct node
{
int mx=0x7fffffff,mn=0;
} st[maxn*4];
bool add=0;
int ul,ur,val;
void update(int l=1,int r=n,int inx=1)
{
if(ul<=l&&r<=ur)
{
if(add)
{
st[inx].mn=max(st[inx].mn,val);
st[inx].mx=max(st[inx].mn,st[inx].mx);
}
else
{
st[inx].mx=min(st[inx].mx,val);
st[inx].mn=min(st[inx].mn,st[inx].mx);
}
if(l!=r)
{
st[inx*2].mn=max(st[inx*2].mn,st[inx].mn);