@[Jerry_heng](/user/763878) tree要开8倍大 `<< 3`
by Chinshyo @ 2023-08-28 20:24:33
`#define int long longa` 是啥玩意
by Chinshyo @ 2023-08-28 20:26:24
不是哥,你写个代码怎么到处CE啊
```
/tmp/compiler_uggymdt7/src:4:11: 错误:expected initializer before ‘mxn’
4 | const int mxn=1e5+10;
| ^~~
/tmp/compiler_uggymdt7/src:5:5: 错误:expected initializer before ‘n’
5 | int n,w,h,t,a[mxn<<1],cnt,mx[mxn<<2],laz[mxn<<2],ans;
| ^
/tmp/compiler_uggymdt7/src:2:18: 错误:expected ‘;’ at end of member declaration
2 | #define int long longa
| ^~~~~
/tmp/compiler_uggymdt7/src:7:5: 附注:in expansion of macro ‘int’
7 | int y1,y2,x,val;
| ^~~
/tmp/compiler_uggymdt7/src:7:9: 错误:‘y1’不是一个类型名
7 | int y1,y2,x,val;
| ^~
/tmp/compiler_uggymdt7/src:8:7: 错误:‘mxn’在此作用域中尚未声明
8 | }tree[mxn<<2];
| ^~~
/tmp/compiler_uggymdt7/src: 在函数‘bool cmp(node, node)’中:
/tmp/compiler_uggymdt7/src:10:14: 错误:‘struct node’ has no member named ‘x’
10 | return x.x<y.x||x.x==y.x&&x.val>y.val;
| ^
/tmp/compiler_uggymdt7/src:10:18: 错误:‘struct node’ has no member named ‘x’
10 | return x.x<y.x||x.x==y.x&&x.val>y.val;
| ^
/tmp/compiler_uggymdt7/src:10:23: 错误:‘struct node’ has no member named ‘x’
10 | return x.x<y.x||x.x==y.x&&x.val>y.val;
| ^
/tmp/compiler_uggymdt7/src:10:28: 错误:‘struct node’ has no member named ‘x’
10 | return x.x<y.x||x.x==y.x&&x.val>y.val;
| ^
/tmp/compiler_uggymdt7/src:10:33: 错误:‘struct node’ has no member named ‘val’
10 | return x.x<y.x||x.x==y.x&&x.val>y.val;
| ^~~
/tmp/compiler_uggymdt7/src:10:39: 错误:‘struct node’ has no member named ‘val’
10 | return x.x<y.x||x.x==y.x&&x.val>y.val;
| ^~~
/tmp/compiler_uggymdt7/src: 在全局域:
/tmp/compiler_uggymdt7/src:12:5: 错误:expected initializer before ‘query’
12 | int query(int x){
| ^~~~~
/tmp/compiler_uggymdt7/src:15:19: 错误:expected ‘,’ or ‘...’ before ‘o’
15 | void pushdown(int o){
| ^
/tmp/compiler_uggymdt7/src: 在函数‘void pushdown(long int)’中:
/tmp/compiler_uggymdt7/src:16:5: 错误:‘laz’在此作用域中尚未声明
16 | laz[o*2]+=laz[o],laz[o*2+1]+=laz[o];
| ^~~
/tmp/compiler_uggymdt7/src:16:9: 错误:‘o’在此作用域中尚未声明
16 | laz[o*2]+=laz[o],laz[o*2+1]+=laz[o];
| ^
/tmp/compiler_uggymdt7/src:17:5: 错误:‘mx’在此作用域中尚未声明
17 | mx[o*2]+=laz[o],mx[o*2+1]+=laz[o];
| ^~
/tmp/compiler_uggymdt7/src: 在全局域:
/tmp/compiler_uggymdt7/src:20:17: 错误:expected ‘,’ or ‘...’ before ‘o’
20 | void update(int o,int l,int r,int L,int R,int v){
| ^
/tmp/compiler_uggymdt7/src: 在函数‘void update(long int)’中:
/tmp/compiler_uggymdt7/src:21:8: 错误:‘L’在此作用域中尚未声明
21 | if(L<=l&&r<=R){
| ^
/tmp/compiler_uggymdt7/src:21:11: 错误:‘l’在此作用域中尚未声明
21 | if(L<=l&&r<=R){
| ^
/tmp/compiler_uggymdt7/src:21:14: 错误:‘r’在此作用域中尚未声明
21 | if(L<=l&&r<=R){
| ^
/tmp/compiler_uggymdt7/src:21:17: 错误:‘R’在此作用域中尚未声明
21 | if(L<=l&&r<=R){
| ^
/tmp/compiler_uggymdt7/src:22:9: 错误:‘laz’在此作用域中尚未声明
22 | laz[o]+=v;
| ^~~
/tmp/compiler_uggymdt7/src:22:13: 错误:‘o’在此作用域中尚未声明
22 | laz[o]+=v;
| ^
/tmp/compiler_uggymdt7/src:22:17: 错误:‘v’在此作用域中尚未声明
22 | laz[o]+=v;
| ^
/tmp/compiler_uggymdt7/src:23:9: 错误:‘mx’在此作用域中尚未声明
23 | mx[o]+=v;
| ^~
/tmp/compiler_uggymdt7/src:26:14: 错误:‘o’在此作用域中尚未声明
26 | pushdown(o);
| ^
/tmp/compiler_uggymdt7/src:27:9: 错误:expected initializer before ‘mid’
27 | int mid=(l+r)>>1;
| ^~~
/tmp/compiler_uggymdt7/src:28:8: 错误:‘L’在此作用域中尚未声明
28 | if(L<=mid)update(o*2,l,mid,L,R,v);
| ^
/tmp/compiler_uggymdt7/src:28:11: 错误:‘mid’在此作用域中尚未声明
28 | if(L<=mid)update(o*2,l,mid,L,R,v);
| ^~~
/tmp/compiler_uggymdt7/src:28:26: 错误:‘l’在此作用域中尚未声明
28 | if(L<=mid)update(o*2,l,mid,L,R,v);
| ^
/tmp/compiler_uggymdt7/src:28:34: 错误:‘R’在此作用域中尚未声明
28 | if(L<=mid)update(o*2,l,mid,L,R,v);
| ^
/tmp/compiler_uggymdt7/src:28:36: 错误:‘v’在此作用域中尚未声明
28 | if(L<=mid)update(o*2,l,mid,L,R,v);
| ^
/tmp/compiler_uggymdt7/src:29:8: 错误:‘R’在此作用域中尚未声明
29 | if(R>mid)update(o*2+1,mid+1,r,L,R,v);
| ^
/tmp/compiler_uggymdt7/src:29:10: 错误:‘mid’在此作用域中尚未声明
29 | if(R>mid)update(o*2+1,mid+1,r,L,R,v);
| ^~~
/tmp/compiler_uggymdt7/src:29:33: 错误:‘r’在此作用域中尚未声明
29 | if(R>mid)update(o*2+1,mid+1,r,L,R,v);
| ^
/tmp/compiler_uggymdt7/src:29:35: 错误:‘L’在此作用域中尚未声明
29 | if(R>mid)update(o*2+1,mid+1,r,L,R,v);
| ^
/tmp/compiler_uggymdt7/src:29:39: 错误:‘v’在此作用域中尚未声明
29 | if(R>mid)update(o*2+1,mid+1,r,L,R,v);
| ^
/tmp/compiler_uggymdt7/src:30:5: 错误:‘mx’在此作用域中尚未声明
30 | mx[o]=max(mx[o*2],mx[o*2+1]);
| ^~
/tmp/compiler_uggymdt7/src: 在函数‘int main()’中:
/tmp/compiler_uggymdt7/src:33:19: 错误:‘t’ was not declared in this scope; did you mean ‘tm’?
33 | scanf("%lld",&t);
| ^
| tm
/tmp/compiler_uggymdt7/src:35:9: 错误:‘ans’ was not declared in this scope; did you mean ‘abs’?
35 | ans=0;
| ^~~
| abs
/tmp/compiler_uggymdt7/src:36:16: 错误:‘laz’在此作用域中尚未声明
36 | memset(laz,0,sizeof laz);
| ^~~
/tmp/compiler_uggymdt7/src:37:16: 错误:‘mx’在此作用域中尚未声明
37 | memset(mx,0,sizeof mx);
| ^~
/tmp/compiler_uggymdt7/src:38:31: 错误:‘n’ was not declared in this scope; did you mean ‘yn’?
38 | scanf("%lld%lld%lld",&n,&w,&h);
| ^
| yn
/tmp/compiler_uggymdt7/src:38:34: 错误:‘w’在此作用域中尚未声明
38 | scanf("%lld%lld%lld",&n,&w,&h);
| ^
/tmp/compiler_uggymdt7/src:38:37: 错误:‘h’在此作用域中尚未声明
38 | scanf("%lld%lld%lld",&n,&w,&h);
| ^
/tmp/compiler_uggymdt7/src:39:17: 错误:expected ‘;’ before ‘i’
39 | for(int i=1;i<=n;i++){
| ^
/tmp/compiler_uggymdt7/src:39:17: 错误:‘i’在此作用域中尚未声明
/tmp/compiler_uggymdt7/src:39:25: 错误:expected ‘)’ before ‘;’ token
39 | for(int i=1;i<=n;i++){
| ~ ^
| )
/tmp/compiler_uggymdt7/src:39:9: 警告:this ‘for’ clause does not guard... [-Wmisleading-indentation]
39 | for(int i=1;i<=n;i++){
| ^~~
/tmp/compiler_uggymdt7/src:39:26: 附注:...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
39 | for(int i=1;i<=n;i++){
| ^
/tmp/compiler_uggymdt7/src:2:18: 警告:unused variable ‘longa’ [-Wunused-variable]
2 | #define int long longa
| ^~~~~
/tmp/compiler_uggymdt7/src:39:13: 附注:in expansion of macro ‘int’
39 | for(int i=1;i<=n;i++){
| ^~~
/tmp/compiler_uggymdt7/src:39:26: 错误:‘i’在此作用域中尚未声明
39 | for(int i=1;i<=n;i++){
| ^
/tmp/compiler_uggymdt7/src:47:14: 错误:‘a’在此作用域中尚未声明
47 | sort(a+1,a+n+1);
| ^
/tmp/compiler_uggymdt7/src:48:14: 错误:‘tree’ was not declared in this scope; did you mean ‘free’?
48 | sort(tree+1,tree+n+1,cmp);
| ^~~~
| free
/tmp/compiler_uggymdt7/src:49:9: 错误:‘cnt’ was not declared in this scope; did you mean ‘int’?
49 | cnt=unique(a+1,a+n+1)-a-1;
| ^~~
| int
/tmp/compiler_uggymdt7/src:50:17: 错误:expected ‘;’ before ‘i’
50 | for(int i=1;i<=n;i++){
| ^
/tmp/compiler_uggymdt7/src:50:25: 错误:expected ‘)’ before ‘;’ token
50 | for(int i=1;i<=n;i++){
| ~ ^
| )
/tmp/compiler_uggymdt7/src:50:9: 警告:this ‘for’ clause does not guard... [-Wmisleading-indentation]
50 | for(int i=1;i<=n;i++){
| ^~~
/tmp/compiler_uggymdt7/src:50:26: 附注:...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
50 | for(int i=1;i<=n;i++){
| ^
/tmp/compiler_uggymdt7/src:2:18: 警告:unused variable ‘longa’ [-Wunused-variable]
2 | #define int long longa
| ^~~~~
/tmp/compiler_uggymdt7/src:50:13: 附注:in expansion of macro ‘int’
50 | for(int i=1;i<=n;i++){
| ^~~
```
by Chinshyo @ 2023-08-28 20:29:44
@[qxhAwA](/user/312820) az,不小心复制过来的时候手抽了,把 a 删了就行
by Jerry_heng @ 2023-08-28 20:37:24