# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
638698 | ggoh | Wall (IOI14_wall) | C++14 | 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<bits/stdc++.h>
using namespace std;
typedef long long lint;
int n,m,op,x,y,z,B=1;
int h[1<<22],d[1<<22],u[1<<22];
void pushhard(int num)
{
h[num*2]=h[num*2+1]=h[num];
u[num*2]=u[num*2+1]=u[num];
d[num*2]=d[num*2+1]=d[num];
}
void pushsoft(int num)
{
int t=num*2;
if(h[t]==0)
{
h[t]=3;u[t]=u[num];d[t]=d[num];
}
else if(h[t]==1)
{
u[t]=max(u[t],u[num]);
if(u[t]>d[num]){
h[t]=2;d[t]=d[num];
}
}
else if(h[t]==2)
{
d[t]=min(d[t],d[num]);
if(d[t]<u[num]){
h[t]=1;u[t]=u[num];