HDU 2821 Pusher】的更多相关文章

原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=2821 首先,题目描述给的链接游戏很好玩,建议先玩几关,后面越玩越难,我索性把这道题A了,也就相当于通关了. 其实这道题算是比较水点搜索题,直接DFS + 回溯,但是题目描述不是很清楚使得很难下手,后来枚举题意才知道在边缘位置不会出现嵌套盒子,而且所有输入都肯定有解决的方案,所有的输入数据都是标准的. #include <stdio.h> #include <string.h> #inc…
Problem Description PusherBoy is an online game http://www.hacker.org/push . There is an R * C grid, and there are piles of blocks on some positions. The goal is to clear the blocks by pushing into them. You should choose an empty area as the initial…
Pusher Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/65536 K (Java/Others)Total Submission(s): 754    Accepted Submission(s): 264Special Judge Problem Description PusherBoy is an online game http://www.hacker.org/push . There is an R…
把这个写出来是不是就意味着把   http://www.hacker.org/push  这个游戏打爆了? ~啊哈哈哈 其实只要找到一个就可以退出了  所以效率也不算很低的  可以直接DFS呀呀呀呀 #include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <cmath> #include <vector> using…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2821 思路:一开始的时候没注意到,必须从map[i][j]==0的位置开始,然后就是dfs了,回溯的时候稍微注意一下就可以了. #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<string> using namespace std;…
#include<iostream> #include<cstdio> #include<cstring> using namespace std; int r,c,s,flag; int dir}}; char mapp] = {"DURL"}; bool check(int x,int y) { if || y >= c) return false; return true; } void dfs(int x,int y,int num)…
Fling Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 354    Accepted Submission(s): 143 Problem Description Fling is a kind of puzzle games available on phone.This game is played on a board wit…
King's Game 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5643 Description In order to remember history, King plans to play losephus problem in the parade gap.He calls n(1≤n≤5000) soldiers, counterclockwise in a circle, in label 1,2,3...n. The firs…
http://acm.hdu.edu.cn/showproblem.php?pid=2818 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5935    Accepted Submission(s): 1838 Problem Description John are playing with blocks. There are N…
Saving HDU Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 7194    Accepted Submission(s): 3345 Problem Description 话说上回讲到海东集团面临内外交困,公司的元老也只剩下XHD夫妇二人了.显然,作为多年拼搏的商人,XHD不会坐以待毙的.  一天,当他正在苦思冥想解困良策的…