搜索
日月火山
这个作者很懒,什么都没留下…
展开
-
生化危机 (深搜 建图)
生化危机发布时间: 2015年10月10日 18:05 时间限制: 1000ms 内存限制: 256M描述X博士想造福人类, 研发一种可以再生肢体的药物, 可是很不幸......研究失败了, 他在蜥蜴身上实验的时候, 蜥蜴发生了变异, 更糟糕的是, 蜥蜴逃出了生化实验室.恐怖的事情发生了, 疫情以X博士所在的城市为中心向四周扩散开, 最终, 整个地球上的城市原创 2017-06-23 12:34:41 · 528 阅读 · 0 评论 -
The Tag Game(bfs)
Alice got tired of playing the tag game by the usual rules so she offered Bob a little modification to it. Now the game should be played on an undirected rooted tree of n vertices. Vertex 1 is the r原创 2017-07-27 21:06:41 · 363 阅读 · 1 评论 -
Find a way(bfs)
Pass a year learning in Hangzhou, yifenfei arrival hometown Ningbo at finally. Leave Ningbo one year, yifenfei have many people to meet. Especially a good friend Merceki. Yifenfei’s home is at the c原创 2017-07-28 21:02:47 · 268 阅读 · 0 评论 -
滑雪(dp 记忆化搜索)
Michael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael想知道载一个区域中最长底滑坡。区域由一个二维数组给出。数组的每个数字代表点的高度。下面是一个例子 1 2 3 4 516 17 18 19 615 24 25 20 714 23 22 21 813 12原创 2017-08-15 20:42:39 · 395 阅读 · 0 评论 -
翻纸牌游戏 HDU - 2209 (bfs+数位标记)
有一种纸牌游戏,很有意思,给你N张纸牌,一字排开,纸牌有正反两面,开始的纸牌可能是一种乱的状态(有些朝正,有些朝反),现在你需要整理这些纸牌。但是麻烦的是,每当你翻一张纸牌(由正翻到反,或者有反翻到正)时,他左右两张纸牌(最左边和最右边的纸牌,只会影响附近一张)也必须跟着翻动,现在给你一个乱的状态,问你能否把他们整理好,使得每张纸牌都正面朝上,如果可以,最少需要多少次操作。Input有多个原创 2017-09-14 15:54:33 · 391 阅读 · 0 评论 -
藏宝图(广搜+排列)
蒜头君得到一张藏宝图。藏宝图是一个 10×1010 \times 1010×10 的方格地图,图上一共有 101010 个宝藏。有些方格地形太凶险,不能进入。整个图只有一个地方可以出入,即是入口也是出口。蒜头君是一个贪心的人,他规划要获得所有宝藏以后才从出口离开。藏宝图上从一个方格到相邻的上下左右的方格需要 111 天的时间,蒜头君从入口出发,找到所有宝藏以后,回到出口,最少需要多少天。// 思路...原创 2018-03-31 20:43:14 · 350 阅读 · 0 评论 -
Game (2018山东省第九届ACM省赛)
g:题意:给你n堆石子,两个人nim博弈,问你事先最多移走d堆石子,问能使后手必胜的移动方法有几种。t <=5n<=1000d<=1000ai<=1000 (每堆石子数目)思路:nim的思想一出,立马想到异或为0,因此,问题转化为,最多移走d堆石子,使得剩余的石子异或为有几种方案。我的解决方法是记忆化搜索。dp[i][j][k] 记录状态。从前往后搜索,每一堆石子要或者不要...原创 2018-05-07 15:26:08 · 461 阅读 · 0 评论 -
Fresh Air(逆向思维+bfs)
链接:https://www.nowcoder.com/acm/contest/106/L来源:牛客网It’s universally acknowledged that there’re innumerable trees in the campus of HUST. And you know that, trees have the special ability to ...原创 2018-04-29 20:20:41 · 351 阅读 · 0 评论 -
第九届蓝桥杯b组 搭积木
搭积木Description小明对搭积木非常感兴趣。他的积木都是同样大小的正立方体。在搭积木时,小明选取 m 块积木作为地基,将他们在桌子上一字排开,中间不留空隙,并称其为第0层。随后,小明可以在上面摆放第1层,第2层,……,最多摆放至第n层。摆放积木必须遵循三条规则:规则1:每块积木必须紧挨着放置在某一块积木的正上方,与其下一层的积木对齐;规则2:同一层中的积木必须连续摆放,中间不能留有空隙;规...原创 2018-05-28 21:08:46 · 1108 阅读 · 0 评论 -
poj 2251 Dungeon Master(多起点bfs)
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 unit north, south原创 2017-07-27 20:46:51 · 318 阅读 · 1 评论 -
FOJ--1046--Tempter of the Bone(dfs+奇偶剪枝)
The doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, and the doggie could feel the ground sinking. He realized that the bone原创 2017-07-27 20:25:42 · 628 阅读 · 0 评论 -
poj 3414 Pots(BFS)(简单题)
You are given two pots, having the volume of A and B liters respectively. The following operations can be performed:FILL(i) fill the pot i (1 ≤ i ≤ 2) from the tap;DROP(i) empty the po原创 2017-07-27 19:33:38 · 233 阅读 · 0 评论 -
Find The Multiple(数学+搜索)
Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You may assume that n is not greater than 200 and there原创 2017-07-29 13:57:38 · 459 阅读 · 2 评论 -
War Chess (bfs + 优先队列)
War chess is hh's favorite game: In this game, there is an N * M battle map, and every player has his own Moving Val (MV). In each round, every player can move in four directions as long as he has e原创 2017-07-20 20:54:35 · 404 阅读 · 0 评论 -
HDU 2102 A计划DFS
可怜的公主在一次次被魔王掳走一次次被骑士们救回来之后,而今,不幸的她再一次面临生命的考验。魔王已经发出消息说将在T时刻吃掉公主,因为他听信谣言说吃公主的肉也能长生不老。年迈的国王正是心急如焚,告招天下勇士来拯救公主。不过公主早已习以为常,她深信智勇的骑士LJ肯定能将她救出。 现据密探所报,公主被关在一个两层的迷宫里,迷宫的入口是S(0,0,0),公主的位置用P表示,时空传输机用#表示,墙用*表原创 2017-07-29 18:19:21 · 291 阅读 · 0 评论 -
POJ - 1190 生日蛋糕(dfs+剪枝)
7月17日是Mr.W的生日,ACM-THU为此要制作一个体积为Nπ的M层生日蛋糕,每层都是一个圆柱体。 设从下往上数第i(1 Ri+1且Hi > Hi+1。 由于要在蛋糕上抹奶油,为尽可能节约经费,我们希望蛋糕外表面(最下一层的下底面除外)的面积Q最小。 令Q = Sπ 请编程对给出的N和M,找出蛋糕的制作方案(适当的Ri和Hi的值),使S最小。 (除Q外,以上所有数据皆为正原创 2017-07-29 21:37:30 · 325 阅读 · 0 评论 -
HDU 2553 N皇后问题(dfs)
在N*N的方格棋盘放置了N个皇后,使得它们不相互攻击(即任意2个皇后不允许处在同一排,同一列,也不允许处在与棋盘边框成45角的斜线上。 你的任务是,对于给定的N,求出有多少种合法的放置方法。 Input共有若干行,每行一个正整数N≤10,表示棋盘和皇后的数量;如果N=0,表示结束。Output共有若干行,每行一个正整数,表示对应输入行的皇后的不同放置数量。Sample原创 2017-07-30 10:50:45 · 287 阅读 · 0 评论 -
Maze (广搜)
Pavel loves grid mazes. A grid maze is an n × m rectangle maze where each cell is either empty, or is a wall. You can go from one cell to another only if both cells are empty and have a common side.原创 2017-07-25 15:28:10 · 371 阅读 · 0 评论 -
【poj】3126 Prime Path(bfs)
The ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digit room numbers on their offices. — It is a matter of s原创 2017-07-26 13:44:58 · 289 阅读 · 0 评论 -
POJ 2676 Sudoku(经典DFS)
SudokuTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 11575 Accepted: 5748 Special JudgeDescriptionSudoku is a very simple task. A原创 2017-07-27 19:07:04 · 352 阅读 · 0 评论 -
最优装载问题
题目描述:现有n个集装箱要装进两艘载重分别为c1,c2的船,其中第i个集装箱重w[i],并且题目保证 i=1nwi≤c1+c2 , 问是否存在一个合理的装载方案,使得这n个集装箱都装进两艘船,若有请找出一种方案。 题目分析:方法1:对于每个集装箱,都有3种状态:装到船1,装到船2,或者不装。按照这个思想我们可以枚举所有的n位3进制数,0,1,2分别代表三种状态,每个数判断是否可以...原创 2018-11-30 15:15:44 · 666 阅读 · 0 评论