为什么可以用BUG来AC

P4568 [JLOI2011] 飞行路线

Q1:我把以下代码的 x 的初始值赋为 0 就过了,大概是 s=t 的缘故(4个点的s=t是吧) ```cpp for(int x=1;x<=k;x++){ ans=min(ans,dis[t+n*x]); } cout << ans; ``` Q2:是因为不一定要用玩全部免费乘机次数, 加上那两行代码后就能使得跑最短路时一搜到 t+nx 时,就会连续更新其他的 dis[t+nx], 最后所有的 dis[t+nx] 都是答案
by Anli_li_father @ 2023-09-29 22:30:44


@[WYD525](/user/745048)
by Anli_li_father @ 2023-09-29 22:31:16


@[Anli_li_father](/user/805653) 感谢大佬帮助 已经AC哩
by WYD525 @ 2023-09-30 08:00:22


|