Submission #306653

#TimeUsernameProblemLanguageResultExecution timeMemory
306653juggernaut벽 (IOI14_wall)C++14
Compilation error
0 ms0 KiB
#include"wall.h" #include<bits/stdc++.h> using namespace std; int treel[8000000],treer[8000000]; void update2(int v,int qd,int qu){ treel[v]=min(qd,max(treel[v],qu)); treer[v]=min(qd,max(treer[v],qu)); } void push(int v,int l,int r){ if(l!=r){ update2(v<<1,treel[v],treer[v]); update2((v<<1)+1,treel[v],treer[v]); } treel[v]=0; treer[v]=2e9; } void update(int v,int l,int r,int ql,int qr,int qd,int qu){ if(ql<=l&&r<=qr){ update2(v,qd,qu); return; } int mid=(l+r)>>1; push(i,l,r); if(ql<=mid)update(v<<1,l,mid,ql,qr,qd,qu); if(mid<qr)update((v<<1)+1,mid+1,r,ql,qr,qd,qu); } void buildWall(int n,int k,int* type,int* l,int* r,int* h,int* res){ for(int i=0;i<k;i++)update(1,0,n-1,l[i],r[i],type[i]&1?h[i]:0,op[i]&2?h[i]:2e9); build(1,0,n-1,res); }

Compilation message (stderr)

wall.cpp: In function 'void update(int, int, int, int, int, int, int)':
wall.cpp:23:10: error: 'i' was not declared in this scope
   23 |     push(i,l,r);
      |          ^
wall.cpp: In function 'void buildWall(int, int, int*, int*, int*, int*, int*)':
wall.cpp:28:67: error: 'op' was not declared in this scope
   28 |     for(int i=0;i<k;i++)update(1,0,n-1,l[i],r[i],type[i]&1?h[i]:0,op[i]&2?h[i]:2e9);
      |                                                                   ^~
wall.cpp:29:5: error: 'build' was not declared in this scope
   29 |     build(1,0,n-1,res);
      |     ^~~~~