状压 dp.参考there #include <algorithm> #include <iostream> #include <cstring> #include <cstdio> using namespace std; typedef long long ll; int T, h, w, m, n, dp[1055][1055], qx[55], qy[55], dx, dy, blc, sss[505], bel[505]; int maxn[505…
Description There is a robot, its task is to bury treasures in order on a N × M grids map, and each treasure can be represented by its weight, which is an integer. The robot begins to bury the treasures from the top-left grid. Because it is stupid, i…
#include <iostream> #include<string> #include<algorithm> using namespace std; ; int a[maxn][maxn]; bool vis[maxn][maxn]={false};//是否访问数组 int main () { int m,n;//m行n列的矩阵 int i,j; ;//计算输出元素个数 cin>>m>>n; i=;j=;//初始化起点坐标 while(cn…