题意 题目链接 Sol 很显然的dp,设\(f[i][j]\)表示第\(i\)个位置,高度为\(j\)的最小步数 向上转移的时候是完全背包 向下转移判断一下就可以 #include<bits/stdc++.h> #define Fin(x) {freopen(x, "r", stdin);} #define chmin(a, b) (a = (a < b ? a : b)) //#define int long long using namespace std; co…
题目:https://www.luogu.org/problemnew/show/P1941 此题主要注意许多细节,详见代码. 代码如下: #include<iostream> #include<cstdio> #include<cstring> using namespace std; int n,m,k,up[10005],down[10005],p[10005],l[10005],h[10005],f[10005][1005],wall[10005]; int I…