怎么做到在devc++和洛谷测试上输出不一样的(相同代码)

P1002 [NOIP2002 普及组] 过河卒

https://www.luogu.com.cn/ide 这是洛谷在线 IDE,你可以上去测测
by splendore @ 2023-10-03 14:33:18


@[splendore](/user/573096) 不一样啊,真的不一样) 他真就和devc++里面输出的不一样它里面输出819 devc++里面输出1617
by hpealxel @ 2023-10-03 22:27:34


@[splendore](/user/573096) 我也不知道怎么把1+0算成-1的 全部打完后 1 1 1 1 0 0 0 1 2 0 1 1 1 0 1 3 3 0 1 0 0 1 4 7 7 8 8 8 1 5 12 19 27 35 43 1 6 18 37 64 99 142 1 7 25 62 126 225 367 1 8 33 95 221 446 813 1 9 42 137 358 804 1617 是devc++的 1 -1 -1 -1 0 0 0 1 0 0 -1 -1 -1 0 1 1 1 0 -1 0 0 1 2 3 3 2 2 2 1 3 6 9 11 13 15 1 4 10 19 30 43 58 1 5 15 34 64 107 165 1 6 21 55 119 226 391 1 7 28 83 202 428 819 事洛谷的 悲
by hpealxel @ 2023-10-03 22:30:23


数组越界了吧,你的 `[x+bx[i]][y+by[i]]` 都没判断就直接用了。 本地可能不会报错,但交上去必定出锅。
by splendore @ 2023-10-04 08:22:53


|