搜索
milkmmilkme
这个作者很懒,什么都没留下…
展开
-
POJ 3279 Fliptile
题目大意:给定一个M*N个棋子组成的矩形,每个棋子只有0或者1两种状态,每个棋子皆可被翻转,但同时会翻转其相邻的四个棋子,要求输出一个M*N的矩形,在矩形的每个点上1代表翻转改点0代表不翻转,使得翻转后原棋盘所有棋子状态为0,求翻转总次数最低的矩形,无解输出IMPOSSIBLE 解题思路:先枚举第一行中2^N中可能,从第二行开始每一行棋子状况用以保证上一行棋子状况为0,遍历完最后一行后判原创 2017-11-29 23:50:25 · 129 阅读 · 0 评论 -
POJ 2251 Dungeon Master
Description You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled with rock. It takes one minute to move one un原创 2017-11-26 22:09:00 · 131 阅读 · 0 评论 -
L - Oil Deposits
遍历整张图,若judge=1则输出s的值,若不为1则对第一个没被遍历过的为@的点进行搜索。 值得注意的是样例最后一个5 5后面多跟了一个空格。。。还以为自己错了改了好久 #include #include #include using namespace std; int m,n,a[120][120]; int dx[8]={-1,0,1,-1,1,-1,0,1}; int dy[8]原创 2017-12-25 16:16:19 · 144 阅读 · 0 评论 -
M - Find a way
记下两人坐标同时BFS即可,注意有的KCF可能到不了的情况 #include #include #include #include using namespace std; int m,n,vis[210][210],t[210][210],t1[210][210]; char a[210][210]; struct point { int x; int y; }原创 2017-12-25 17:06:36 · 561 阅读 · 0 评论