Bloxorz I (poj 3322 水bfs)】的更多相关文章

Language: Default Bloxorz I Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 5443   Accepted: 1811 Description Little Tom loves playing games. One day he downloads a little computer game called 'Bloxorz' which makes him excited. It's a ga…
Little Tom loves playing games. One day he downloads a little computer game called 'Bloxorz' which makes him excited. It's a game about rolling a box to a specific position on a special plane. Precisely, the plane, which is composed of several unit c…
[题目链接] http://poj.org/problem?id=3322 [算法] 广度优先搜索 [代码] #include <algorithm> #include <bitset> #include <cctype> #include <cerrno> #include <clocale> #include <cmath> #include <complex> #include <cstdio> #inc…
题目: http://poj.org/problem?id=2251 #include <stdio.h> #include <string.h> #include <queue> using namespace std; ][][]; ][][]; ][] = {{,,}, {,,}, {,,}, {,,-}, {,-,}, {-,,}}; struct Point { int x, y, z, step; }; struct Point start; queue&l…
首先呢 这个题目的名字好啊 ORZ啊 如果看不懂题意的话 请戳这里 玩儿几盘就懂了[微笑] http://www.albinoblacksheep.com/games/bloxorz 就是这个神奇的木块可以各种滚 但是有墙的地方是不能去的 有的地方只能躺着走 立着会掉下去.(姑且把这种底面叫"软底面"吧) (很坑的) 思路: 搜索(BFS) 一开始是想传5个参数(其实没必要 ...) ① flag flag表示在第几种状态② x1 ③ y1 ④ x2 ⑤ y2(坐标们) 1. flag…
bfs 标准广搜题,主要是把每一步可能的坐标都先预处理出来,会好写很多 每个状态对应三个限制条件,x坐标.y坐标.lie=0表示直立在(x,y),lie=1表示横着躺,左半边在(x,y),lie=2表示竖着躺,上半边在(x,y) #include <bits/stdc++.h> #define INF 0x3f3f3f3f using namespace std; typedef long long ll; inline int lowbit(int x){ return x & (-…
#include<cstring> #include<algorithm> #include<iostream> #include<cstdio> #include<queue> #define de system("pause"); using namespace std; int r,c; ][]; ]; ; ][][]; bool check(int way,int x,int y) { ||x>r||y<|…
---恢复内容开始--- http://poj.org/problem?id=3322 题意:http://jandan.net/2008/01/24/bloxorz.html就是这个鬼游戏 我也是郁闷了,昨天就看到一道连连看的题目,今天就是这个游戏.都懵逼了. 思路:这个游戏的难度主要是在于它是第一个长方体,而不是一个正方体,不过是正方体也就不存在这个游戏了,所以我们要想办法来标记它. 我首先定义了这个长方体有三种状态. 对于第一种状态来说,它是的底面是一个正方形,四边都是一个长方形. 第二种…
Pots(POJ - 3414) 题目链接 算法 BFS 1.这道题问的是给你两个体积分别为A和B的容器,你对它们有三种操作,一种是装满其中一个瓶子,另一种是把其中一个瓶子的水都倒掉,还有一种就是把其中一个瓶子的水导入另一个瓶子中(可能会有剩余).最后让你输出在能够得出体积为C的水的情况下操作的最小次数并且把过程输出.如果无法得出体积为C的水,则输出"impossible". 2.这个题主要涉及两个点,一个是求出最小次数,还有一个就是把路径输出.对于这种有目标值的求最小次数问题,我们可…
http://poj.org/problem?id=3026 题意:任意两个字母可以连线,求把所有字母串联起来和最小. 很明显这就是一个最小生成树,不过这个题有毒.他的输入有问题.在输入m和N后面,可能有一大串的空格.就因为这个,我RE都有点懵了,要不是discuss里面有人说输入有问题,我都没注意到这个,原本只用了一个getchar吃掉最后的换行符.没想到之后还有空格.有点小坑. 思路:这个题目如果他给你一个图,那就是最裸的prim了.不过这个题的难点也就是在他给的图你不能用Prim,你只能通…