这次是德龙出的题,好好体会与真神之间态度、思维的差距。
//map[i][j][x]表示此状态最小改变方格数。仔细体会这种预处理方块摆放情况的dp,别老想着傻不愣登地暴力,限制条件很多时想dp。
#include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;
const int maxn = 1010;
int n, m;
int map[maxn][maxn][2], haoyu[maxn][maxn];//0右1下
bool check(int x, int y){
if(x > 0 && x <= n && y > 0 && y <= m && haoyu[x][y])
return true;
return false