正文
增加 5 行删除 5 行
30 行未改动31323334353637383946 行未改动86878889909192939495963 行未改动1001011021031041051061071084 行未改动11311411511611711830 行未改动for(int j = 1; j <= n; ++ j){std::cin >> vis[i][j];}}for(int i = 1; i <= m; ++ i){for(int j = 1; j <= n; ++ j){int l = std::max(1,j - x),r = std::min(n,j + x);cost[i][j] = 0;46 行未改动}std::cout << ans << '\n';/*一个显然的 O(n ^ 4) 的暴力就是f[i][j][k] i 时刻站在 j 的后面,当前是否能消耗 k 的体力转移就是枚举当前 i 在什么位置,枚举 i - 1 在什么位置f[i][j][k] = \cap_{p = 1} ^ n f[i - 1][p][k - cost[i][j] - |j - p|]*/}int main(){std::ios::sync_with_stdio(false);3 行未改动while(c -- ){solve();}return 0;}/*43 1 0 10 1 04 行未改动0 1 08 2 1 21 1 1 0 0 0 0 10 0 1 1 1 0 0 1*/```30 行未改动31323334353637383946 行未改动86878889909192939495963 行未改动1001011021031041051061071084 行未改动11311411511611711830 行未改动for(int j = 1; j <= n; ++ j){std::cin >> vis[i][j];}}for(int i = 1; i <= m; ++ i){for(int j = 1; j <= n; ++ j){int l = std::max(1,j - x),r = std::min(n,j + x);cost[i][j] = 0;46 行未改动}std::cout << ans << '\n';/*一个显然的 O(n ^ 4) 的暴力就是f[i][j][k] i 时刻站在 j 的后面,当前是否能消耗 k 的体力转移就是枚举当前 i 在什么位置,枚举 i - 1 在什么位置f[i][j][k] = \cap_{p = 1} ^ n f[i - 1][p][k - cost[i][j] - |j - p|]*/}int main(){std::ios::sync_with_stdio(false);3 行未改动while(c -- ){solve();}return 0;}/*43 1 0 10 1 04 行未改动0 1 08 2 1 21 1 1 0 0 0 0 10 0 1 1 1 0 0 1*/```