/ Vijos /

记录详情

Compile Error

/in/foo.cc: In function 'void build(int, int, int)':
/in/foo.cc:24:19: warning: suggest parentheses around '+' inside '<<' [-Wparentheses]
  build(m+1,r,rt<<1+1);
                  ~^~
/in/foo.cc:15:48: warning: suggest parentheses around '+' inside '<<' [-Wparentheses]
 #define up(rt) sum[rt]=sum[rt << 1]+sum[rt << 1+1]
                                               ~^~
/in/foo.cc:25:2: note: in expansion of macro 'up'
  up(rt);
  ^~
/in/foo.cc: In function 'void pushdown1(int, int, int)':
/in/foo.cc:29:5: error: 'flag' was not declared in this scope
  if(flag[rt]){
     ^~~~
/in/foo.cc:31:15: warning: suggest parentheses around '+' inside '<<' [-Wparentheses]
   flag[rt << 1+1]+=flag[rt];
              ~^~
/in/foo.cc:32:26: error: 'ln' was not declared in this scope
   sum[rt << 1]+=flag[rt]*ln;
                          ^~
/in/foo.cc:34:14: warning: suggest parentheses around '+' inside '<<' [-Wparentheses]
   sum[rt << 1+1]+=flag[rt]*rn;
             ~^~
/in/foo.cc:34:28: error: 'rn' was not declared in this scope
   sum[rt << 1+1]+=flag[rt]*rn;
                            ^~
/in/foo.cc:35:14: warning: suggest parentheses around '+' inside '<<' [-Wparentheses]
   sum[rt << 1+1]%=mod;
             ~^~
/in/foo.cc: In function 'void add1(int, int, int, int, int, int)':
/in/foo.cc:42:43: error: 'flag' was not declared in this scope
   sum[rt]+=(c*(r-l+1) % mod);sum[rt]%=mod;flag[rt]+=c;flag[rt]%=mod;return;
                                           ^~~~
/in/foo.cc:47:34: warning: suggest parentheses around '+' inside '<<' [-Wparentheses]
  if(y>m) add1(x,y,c,m+1,r,rt << 1+1);
                                 ~^~
/in/foo.cc:15:48: warning: suggest parentheses around '+' inside '<<' [-Wparentheses]
 #define up(rt) sum[rt]=sum[rt << 1]+sum[rt << 1+1]
                                               ~^~
/in/foo.cc:48:2: note: in expansion of macro 'up'
  up(rt);
  ^~
/in/foo.cc: In function 'void pushdown2(int, int, int)':
/in/foo.cc:52:5: error: 'flag' was not declared in this scope
  if(flag[rt]){
     ^~~~
/in/foo.cc:54:15: warning: suggest parentheses around '+' inside '<<' [-Wparentheses]
   flag[rt << 1+1]*=flag[rt];
              ~^~
/in/foo.cc:57:14: warning: suggest parentheses around '+' inside '<<' [-Wparentheses]
   sum[rt << 1+1]*=flag[rt];
             ~^~
/in/foo.cc:58:14: warning: suggest parentheses around '+' inside '<<' [-Wparentheses]
   sum[rt << 1+1]%=mod;
             ~^~
/in/foo.cc: In function 'void add2(int, int, int, int, int, int)':
/in/foo.cc:65:35: error: 'flag' was not declared in this scope
   sum[rt]*=(c % mod);sum[rt]%=mod;flag[rt]*=c;flag[rt]%=mod;return;
                                   ^~~~
/in/foo.cc:70:34: warning: suggest parentheses around '+' inside '<<' [-Wparentheses]
  if(y>m) add2(x,y,c,m+1,r,rt << 1+1);
                                 ~^~
/in/foo.cc:15:48: warning: suggest parentheses around '+' inside '<<' [-Wparentheses]
 #define up(rt) sum[rt]=sum[rt << 1]+sum[rt << 1+1]
                                               ~^~
/in/foo.cc:71:2: note: in expansion of macro 'up'
  up(rt);
  ^~
/in/foo.cc: At global scope:
/in/foo.cc:74:22: error: 'l' has not been declared
 ll query(int x,int y,l,int r,int rt){
                      ^
/in/foo.cc: In function 'long long int query(int, int, int, int, int)':
/in/foo.cc:75:8: error: 'l' was not declared in this scope
  if(x<=l&&y>=r) return sum[rt];
        ^
/in/foo.cc:76:9: error: 'l' was not declared in this scope
  int m=(l+r) >> 1;
         ^
/in/foo.cc:82:39: warning: suggest parentheses around '+' inside '<<' [-Wparentheses]
  if(y>m) ans+=query(x,y,m+1,rt,rt << 1+1);
                                      ~^~
/in/foo.cc: In function 'int main()':
/in/foo.cc:13:25: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
 #define rep(i,l,r,step) for(int i=l;i<=r;i+=step)
                         ^
/in/foo.cc:89:2: note: in expansion of macro 'rep'
  rep(i,1,n,1) scanf("%d",&a[i]);build(1,n,1);
  ^~~
/in/foo.cc:89:33: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'for'
  rep(i,1,n,1) scanf("%d",&a[i]);build(1,n,1);
                                 ^~~~~
/in/foo.cc:96:36: error: expected ')' before '}' token
   if(st==2){scanf("%d%d%d",&l,&r,&c};add1(l,r,c,1,n,1);continue;}
                                    ^
/in/foo.cc:97:6: error: 'st' was not declared in this scope
   if(st==3){scanf("%d%d",&l,&r);printf("%lld\n",query(l,r,1,n,1));continue;}
      ^~
/in/foo.cc:97:27: error: 'l' was not declared in this scope
   if(st==3){scanf("%d%d",&l,&r);printf("%lld\n",query(l,r,1,n,1));continue;}
                           ^
/in/foo.cc:97:30: error: 'r' was not declared in this scope
   if(st==3){scanf("%d%d",&l,&r);printf("%lld\n",query(l,r,1,n,1));continue;}
                              ^
/in/foo.cc:97:67: error: continue statement not within a loop
   if(st==3){scanf("%d%d",&l,&r);printf("%lld\n",query(l,r,1,n,1));continue;}
                                                                   ^~~~~~~~
/in/foo.cc: At global scope:
/in/foo.cc:99:1: error: expected declaration before '}' token
 }
 ^

信息

递交者
类型
自测
题目
P1000 A+B Problem
语言
C++
递交时间
2017-06-12 19:02:30
评测时间
2017-06-12 19:02:30
评测机
分数
0
总耗时
328ms
峰值内存
41.992 MiB