/ Vijos /

记录详情

Compile Error

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:08:02
评测时间
2022-04-12 17:08:02
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes