/ Vijos /

记录详情

Accepted

foo.cc: In function 'int Tree::lca(int, int)':
foo.cc:23:9: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   23 |         for(int d=dep[u]-dep[v],i=0;d;d>>=1,i++)if(d&1)u=fa[u][i];if(u==v)return u;
      |         ^~~
foo.cc:23:67: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   23 |         for(int d=dep[u]-dep[v],i=0;d;d>>=1,i++)if(d&1)u=fa[u][i];if(u==v)return u;
      |                                                                   ^~
foo.cc:24:9: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   24 |         for(int i=17;i>=0;i--)if(fa[u][i]!=fa[v][i])u=fa[u][i],v=fa[v][i];return fa[u][0];
      |         ^~~
foo.cc:24:75: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   24 |         for(int i=17;i>=0;i--)if(fa[u][i]!=fa[v][i])u=fa[u][i],v=fa[v][i];return fa[u][0];
      |                                                                           ^~~~~~
foo.cc: In function 'void Tree::clear()':
foo.cc:29:9: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   29 |         for(int i=1;i<=k;i++)for(int j=0;j<18;j++)fa[i][j]=0;df=0;
      |         ^~~
foo.cc:29:62: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   29 |         for(int i=1;i<=k;i++)for(int j=0;j<18;j++)fa[i][j]=0;df=0;
      |                                                              ^~
foo.cc: In function 'void Grph::ins(int, int, int, int)':
foo.cc:41:3: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   41 |   if(u==1)add(s,ctt+1,0),add(s,ctt+3,0);for(int i=1;i<=4;i++)tp[ctt+i]=d;//拆成4条边
      |   ^~
foo.cc:41:41: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   41 |   if(u==1)add(s,ctt+1,0),add(s,ctt+3,0);for(int i=1;i<=4;i++)tp[ctt+i]=d;//拆成4条边
      |                                         ^~~
foo.cc: In function 'void Grph::solve()':
foo.cc:69:3: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   69 |   for(int i=1;i<=ctt;i++)d[i]=(1LL<<40);d[s]=0;
      |   ^~~
foo.cc:69:41: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   69 |   for(int i=1;i<=ctt;i++)d[i]=(1LL<<40);d[s]=0;
      |                                         ^
foo.cc:79:4: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   79 |    for(int j=0;j<(int)eib[i].size();j++)ret=min(ret,d[eib[i][j]]);printf("%lld\n",ret);
      |    ^~~
foo.cc:79:67: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   79 |    for(int j=0;j<(int)eib[i].size();j++)ret=min(ret,d[eib[i][j]]);printf("%lld\n",ret);
      |                                                                   ^~~~~~
foo.cc: In function 'void Grph::clear()':
foo.cc:89:3: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   89 |   for(int i=1;i<=ctt+1;i++)book[i]=false;ct=0;ctt=0;
      |   ^~~
foo.cc:89:42: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   89 |   for(int i=1;i<=ctt+1;i++)book[i]=false;ct=0;ctt=0;
      |                                          ^~
foo.cc: In function 'int main()':
foo.cc:100:17: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  100 | int main(){scanf("%d",&T);for(int z=1;z<=T;z++)solve(),clear();return 0;}//拜拜程序~
      |            ~~~~~^~~~~~~~~
foo.cc: In function 'void solve()':
foo.cc:94:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   94 |     scanf("%d%d%d",&n,&m,&k);Grph::s=4*m+1;
      |     ~~~~~^~~~~~~~~~~~~~~~~~~
foo.cc:95:39: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   95 |     for(int i=1,u,v,w,d;i<=m;i++)scanf("%d%d%d%d",&u,&v,&w,&d),Grph::ins(u,v,w,d);
      |                                  ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
foo.cc:96:36: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   96 |     for(int i=1,u,v,w;i<k;i++)scanf("%d%d%d",&u,&v,&w),Tree::add(u,v,w);
      |                               ~~~~~^~~~~~~~~~~~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务
# 状态 耗时 内存占用
#1 Accepted 225ms 13.375 MiB
#2 Accepted 214ms 14.0 MiB
#3 Accepted 282ms 14.234 MiB
#4 Accepted 289ms 14.238 MiB
#5 Accepted 239ms 14.375 MiB
#6 Accepted 421ms 27.105 MiB
#7 Accepted 418ms 27.246 MiB
#8 Accepted 545ms 27.492 MiB
#9 Accepted 405ms 27.992 MiB
#10 Accepted 407ms 28.613 MiB
#11 Accepted 401ms 29.113 MiB
#12 Accepted 507ms 29.867 MiB
#13 Accepted 590ms 30.73 MiB
#14 Accepted 502ms 31.117 MiB
#15 Accepted 536ms 29.992 MiB
#16 Accepted 506ms 30.48 MiB
#17 Accepted 499ms 31.621 MiB
#18 Accepted 590ms 31.82 MiB
#19 Accepted 484ms 32.785 MiB
#20 Accepted 471ms 33.605 MiB

信息

递交者
类型
递交
题目
P2022 天才黑客
语言
C++
递交时间
2022-02-12 21:24:27
评测时间
2022-02-12 21:24:27
评测机
分数
100
总耗时
8540ms
峰值内存
33.605 MiB