/ Vijos /

记录详情

Compile Error

foo.cc:4:17: error: expected primary-expression before ';' token
    4 | const int N=2e6+;
      |                 ^
foo.cc:5:18: error: size of array 'hd' is not an integral constant-expression
    5 | int n,cnt,tim,hd[N],v[N],nxt[N],w[N],c[N],du[N],vis[N],q[N];
      |                  ^
foo.cc:5:23: error: size of array 'v' is not an integral constant-expression
    5 | int n,cnt,tim,hd[N],v[N],nxt[N],w[N],c[N],du[N],vis[N],q[N];
      |                       ^
foo.cc:5:30: error: size of array 'nxt' is not an integral constant-expression
    5 | int n,cnt,tim,hd[N],v[N],nxt[N],w[N],c[N],du[N],vis[N],q[N];
      |                              ^
foo.cc:5:35: error: size of array 'w' is not an integral constant-expression
    5 | int n,cnt,tim,hd[N],v[N],nxt[N],w[N],c[N],du[N],vis[N],q[N];
      |                                   ^
foo.cc:5:40: error: size of array 'c' is not an integral constant-expression
    5 | int n,cnt,tim,hd[N],v[N],nxt[N],w[N],c[N],du[N],vis[N],q[N];
      |                                        ^
foo.cc:5:46: error: size of array 'du' is not an integral constant-expression
    5 | int n,cnt,tim,hd[N],v[N],nxt[N],w[N],c[N],du[N],vis[N],q[N];
      |                                              ^
foo.cc:5:53: error: size of array 'vis' is not an integral constant-expression
    5 | int n,cnt,tim,hd[N],v[N],nxt[N],w[N],c[N],du[N],vis[N],q[N];
      |                                                     ^
foo.cc:5:58: error: size of array 'q' is not an integral constant-expression
    5 | int n,cnt,tim,hd[N],v[N],nxt[N],w[N],c[N],du[N],vis[N],q[N];
      |                                                          ^
foo.cc:6:10: error: size of array 'd' is not an integral constant-expression
    6 | ll ans,d[N],f[N],a[N],b[N];
      |          ^
foo.cc:6:15: error: size of array 'f' is not an integral constant-expression
    6 | ll ans,d[N],f[N],a[N],b[N];
      |               ^
foo.cc:6:20: error: size of array 'a' is not an integral constant-expression
    6 | ll ans,d[N],f[N],a[N],b[N];
      |                    ^
foo.cc:6:25: error: size of array 'b' is not an integral constant-expression
    6 | ll ans,d[N],f[N],a[N],b[N];
      |                         ^
foo.cc: In function 'void topsort()':
foo.cc:15:12: error: expected primary-expression before ',' token
   15 |     int qs=,qe=;
      |            ^
foo.cc:16:15: error: expected primary-expression before ';' token
   16 |     for(int i=;i<=n;i++)if(du[i]==)q[qe++]=i;
      |               ^
foo.cc:16:35: error: expected primary-expression before ')' token
   16 |     for(int i=;i<=n;i++)if(du[i]==)q[qe++]=i;
      |                                   ^
foo.cc:16:38: error: 'qe' was not declared in this scope; did you mean 'qs'?
   16 |     for(int i=;i<=n;i++)if(du[i]==)q[qe++]=i;
      |                                      ^~
      |                                      qs
foo.cc:17:14: error: 'qe' was not declared in this scope; did you mean 'qs'?
   17 |     while(qs<qe)
      |              ^~
      |              qs
foo.cc:21:21: error: expected primary-expression before ')' token
   21 |         if(du[v[i]]>)
      |                     ^
foo.cc:26:26: error: expected primary-expression before ')' token
   26 |             if(du[v[i]]==)q[qe++]=v[i];
      |                          ^
foo.cc: In function 'void dp(int, int)':
foo.cc:32:11: error: expected primary-expression before ',' token
   32 |     int m=,y=x,i;
      |           ^
foo.cc:34:18: error: 'y' was not declared in this scope
   34 |         a[++m]=f[y];
      |                  ^
foo.cc:35:15: error: expected primary-expression before ';' token
   35 |         du[y]=;
      |               ^
foo.cc:36:13: error: 'i' was not declared in this scope
   36 |         for(i=hd[y];i;i=nxt[i])
      |             ^
foo.cc:37:21: error: expected primary-expression before ')' token
   37 |         if(du[v[i]]>){b[m+]=b[m]+w[i];y=v[i];break;}
      |                     ^
foo.cc:37:27: error: expected primary-expression before ']' token
   37 |         if(du[v[i]]>){b[m+]=b[m]+w[i];y=v[i];break;}
      |                           ^
foo.cc:38:12: error: 'i' was not declared in this scope
   38 |     }while(i);
      |            ^
foo.cc:39:11: error: expected primary-expression before ')' token
   39 |     if(m==)
      |           ^
foo.cc:41:17: error: expected primary-expression before ';' token
   41 |         int len=;
      |                 ^
foo.cc:42:22: error: 'y' was not declared in this scope
   42 |         for(int i=hd[y];i;i=nxt[i])if(v[i]==x)len=max(len,w[i]);
      |                      ^
foo.cc:43:32: error: 'y' was not declared in this scope
   43 |         d[tp]=max(d[tp],f[x]+f[y]+len);
      |                                ^
foo.cc:46:18: error: 'y' was not declared in this scope
   46 |     for(int i=hd[y];i;i=nxt[i])if(v[i]==x){b[m+]=b[m]+w[i];break;}
      |                  ^
foo.cc:46:48: error: expected primary-expression before ']' token
   46 |     for(int i=hd[y];i;i=nxt[i])if(v[i]==x){b[m+]=b[m]+w[i];break;}
      |                                                ^
foo.cc:47:15: error: expected primary-expression before ';' token
   47 |     for(int i=;i<=m;i++)a[m+i]=a[i],b[m+i]=b[m+]+b[i];
      |               ^
foo.cc:47:48: error: expected primary-expression before ']' token
   47 |     for(int i=;i<=m;i++)a[m+i]=a[i],b[m+i]=b[m+]+b[i];
      |                                                ^
foo.cc:48:11: error: expected primary-expression before ',' token
   48 |     int l=,r=;
      |           ^
foo.cc:49:7: error: 'r' was not declared in this scope
   49 |     l=r=q[]=;
      |       ^
foo.cc:49:11: error: expected primary-expression before ']' token
   49 |     l=r=q[]=;
      |           ^
foo.cc:49:13: error: expected primary-expression before ';' token
   49 |     l=r=q[]=;
      |             ^
foo.cc:50:15: error: expected primary-expression before ';' token
   50 |     for(int i=;i<*m;i++)
      |               ^
foo.cc:50:19: error: invalid type argument of unary '*' (have 'int')
   50 |     for(int i=;i<*m;i++)
      |                   ^
foo.cc: In function 'int main()':
foo.cc:61:15: error: expected primary-expression before ',' token
   61 |     for(int i=,x,y;i<=n;i++)scanf("%d%d",&x,&y),add(i,x,y),add(x,i,y),du[x]++,du[i]++;
      |               ^
foo.cc:61:43: error: 'x' was not declared in this scope
   61 |     for(int i=,x,y;i<=n;i++)scanf("%d%d",&x,&y),add(i,x,y),add(x,i,y),du[x]++,du[i]++;
      |                                           ^
foo.cc:61:46: error: 'y' was not declared in this scope
   61 |     for(int i=,x,y;i<=n;i++)scanf("%d%d",&x,&y),add(i,x,y),add(x,i,y),du[x]++,du[i]++;
      |                                              ^
foo.cc:62:15: error: expected primary-expression before ';' token
   62 |     for(int i=;i<=n;i++)if(!c[i])dfs(i,++tim);
      |               ^
foo.cc:64:15: error: expected primary-expression before ';' token
   64 |     for(int i=;i<=n;i++)
      |               ^
foo.cc:65:16: error: expected identifier before '!' token
   65 |     if(du[i]>&&!vis[c[i]])vis[c[i]]=,dp(i,c[i]),ans+=d[c[i]];
      |                ^
foo.cc:65:16: error: expected ')' before '!' token
   65 |     if(du[i]>&&!vis[c[i]])vis[c[i]]=,dp(i,c[i]),ans+=d[c[i]];
      |       ~        ^
      |                )
foo.cc:65:37: error: expected primary-expression before ',' token
   65 |     if(du[i]>&&!vis[c[i]])vis[c[i]]=,dp(i,c[i]),ans+=d[c[i]];
      |                                     ^
foo.cc:60:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   60 |     scanf("%d",&n);
      |     ~~~~~^~~~~~~~~
正在同步测试数据,请稍后
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1791 骑士的旅行
语言
C++
递交时间
2022-04-12 17:07:18
评测时间
2022-04-12 17:07:18
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes