/in/foo.cc:2:5: error: expected unqualified-id before 'if'
if(ql<=mid)ls=query(lson,l,mid,ql,qr),qwq+=1;
^~
/in/foo.cc:3:5: error: expected unqualified-id before 'if'
if(qr>mid)rs=query(rson,mid+1,r,ql,qr),qwq+=2;
^~
/in/foo.cc:4:5: error: expected unqualified-id before 'if'
if(qwq==1)return ls;
^~
/in/foo.cc:5:5: error: expected unqualified-id before 'if'
if(qwq==2)return rs;
^~
/in/foo.cc:6:5: error: 'ret' does not name a type
ret.sm=ls.sm+rs.sm;ret.mx=max(max(ls.mx,rs.mx),ls.rm+rs.lm);
^~~
/in/foo.cc:6:24: error: 'ret' does not name a type
ret.sm=ls.sm+rs.sm;ret.mx=max(max(ls.mx,rs.mx),ls.rm+rs.lm);
^~~
/in/foo.cc:7:5: error: 'ret' does not name a type
ret.lm=max(ls.lm,ls.sm+rs.lm);
^~~
/in/foo.cc:8:5: error: 'ret' does not name a type
ret.rm=max(rs.rm,rs.sm+ls.rm);
^~~
/in/foo.cc:9:5: error: expected unqualified-id before 'return'
return ret;
^~~~~~
/in/foo.cc:10:1: error: expected declaration before '}' token
}
^