Problem segmenttree
User Informatics271
Submission Time 2026-09-01 16:05:07
Score 0
Max Time N/A
Max Memory N/A

Compile Error

segmenttree.cpp:5:59: error: expected unqualified-id before ‘)’ token
5 | using namespace std;const int INF=1e9+5;int N,Q;struct ST(){int s,e,m,d;int v=0;ST *l,*r;ST(int s,int e):s(s),e(e),m((s+e)/2),d(e-s+1),v(0){if (d==1) return;l=new ST(s,m),r=new ST(m+1,e);}void upd(int x,int a){if (d==1){v=a;return;}if (x>m) r->upd(x,a);else l->upd(x,a);v=min(l->v,r->v);}int qry(int x,int y){if (y<x||y<s||x>e) return INF;if (x<=s&&y>=e) return v;return min(l->qry(x,y),r->qry(x,y));}};int main(){ios::sync_with_stdio(0);cin.tie(0);cin>>N>>Q;auto st=new ST(0,N-1);for (int i=0;i<Q;i++){int t,a,b;cin>>t>>a>>b;if (t==1){st->upd(a,b);}else{cout<<st->qry(a,b)<<'\n';}}}
| ^
segmenttree.cpp: In function ‘int main()’:
segmenttree.cpp:5:480: error: invalid use of incomplete type ‘struct ST’
5 | using namespace std;const int INF=1e9+5;int