随笔分类 -  5-1-搜索-BFS

摘要:The only difference between the easy and the hard versions is constraints. A subsequence is a string that can be derived from another string by deleti 阅读全文
posted @ 2019-06-28 12:14 yzm10 阅读(752) 评论(0) 推荐(0)
摘要:九宫重排 时间限制:1.0s 内存限制:256.0MB 时间限制:1.0s 内存限制:256.0MB 问题描述 如下面第一个图的九宫格中,放着 1~8 的数字卡片,还有一个格子空着。与空格子相邻的格子中的卡片可以移动到空格中。经过若干次移动,可以形成第二个图所示的局面。 我们把第一个图的局面记为:1 阅读全文
posted @ 2019-04-04 23:54 yzm10 阅读(339) 评论(0) 推荐(0)
摘要:这题用dfs搜不出来,需要使用bfs并记录路径,设置好方向顺序跑就ok 正解类似:POJ-3984 迷宫问题 然而毕竟是暴力杯,我们的原则是代码能省就省(懒癌晚期 于是乎网上便出现了形形色色的题解,笔者综合了各路大神神乎其技的思想,总结出了一种完善的Excel解法。 (这里需要感谢知乎某匿名用户和考 阅读全文
posted @ 2019-03-25 17:41 yzm10 阅读(7085) 评论(4) 推荐(3)
摘要:L2-006 树的遍历 (25 分) 给定一棵二叉树的后序遍历和中序遍历,请你输出其层序遍历的序列。这里假设键值都是互不相等的正整数。 输入格式: 输入第一行给出一个正整数N(≤30),是二叉树中结点的个数。第二行给出其后序遍历序列。第三行给出其中序遍历序列。数字间以空格分隔。 输出格式: 在一行中 阅读全文
posted @ 2019-03-08 23:57 yzm10 阅读(265) 评论(0) 推荐(0)
摘要:题目1 : Saving Tang Monk II 题目1 : Saving Tang Monk II 时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 《Journey to the West》(also 《Monkey》) is one of the Four Grea 阅读全文
posted @ 2018-09-22 19:05 yzm10 阅读(626) 评论(0) 推荐(0)
摘要:来自xjy的签到题 来自xjy的签到题 来自xjy的签到题 Description 爱丽丝冒险来到了红皇后一个n*n大小的花园,每个格子由'.'或'#'表示,'.'表示爱丽丝可以到达这个格子,‘#’表示爱丽丝不能到达这个格子,爱丽丝每1分钟可以移动到非'#'的相邻格子(与当前所在格子具有公共边)。花 阅读全文
posted @ 2018-08-31 21:37 yzm10 阅读(217) 评论(0) 推荐(0)
摘要:Maze This story happened on the background of Star Trek. Spock, the deputy captain of Starship Enterprise, fell into Klingon’s trick and was held as p 阅读全文
posted @ 2018-07-16 21:39 yzm10 阅读(267) 评论(0) 推荐(0)
摘要:炸老师与他的女朋友们 Description qdu最帅的炸老师今天又要抽空去找他的女朋友们了,但是考虑到他的好gay友ycb仍是个单身狗,炸老师作为基友不希望打击他。所以他在找女朋友们的路途中必须要避开ycb老师,可他又不知道ycb的具体位置,只知道一些可能的位置,所以他必须要避开所有这些位置,同 阅读全文
posted @ 2018-04-24 17:25 yzm10 阅读(400) 评论(0) 推荐(0)
摘要:Find a way Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 16184 Accepted Submission(s): 5194 Pro 阅读全文
posted @ 2017-07-28 21:27 yzm10 阅读(1284) 评论(0) 推荐(0)
摘要:非常可乐 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 16071 Accepted Submission(s): 6488 Problem D 阅读全文
posted @ 2017-07-28 20:57 yzm10 阅读(319) 评论(0) 推荐(0)
摘要:Description Fat brother and Maze are playing a kind of special (hentai) game on an N*M board (N rows, M columns). At the beginning, each grid of this 阅读全文
posted @ 2017-07-27 13:36 yzm10 阅读(187) 评论(0) 推荐(1)
摘要:Pots 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 ≤  阅读全文
posted @ 2017-07-26 23:32 yzm10 阅读(630) 评论(0) 推荐(1)
摘要:Prime Path 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 阅读全文
posted @ 2017-07-26 20:19 yzm10 阅读(211) 评论(0) 推荐(0)
摘要:Dungeon Master 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 fi 阅读全文
posted @ 2017-07-26 16:15 yzm10 阅读(343) 评论(0) 推荐(0)
摘要:Fire! Joe works in a maze. Unfortunately, portions of the maze have caught on fire, and the owner of the maze neglected to create a fire escape plan. 阅读全文
posted @ 2017-07-26 15:59 yzm10 阅读(262) 评论(0) 推荐(0)
摘要:生化危机 发布时间: 2015年10月10日 18:05 时间限制: 1000ms 内存限制: 256M 描述 X博士想造福人类, 研发一种可以再生肢体的药物, 可是很不幸......研究失败了, 他在蜥蜴身上实验的时候, 蜥蜴发生了变异, 更糟糕的是, 蜥蜴逃出了生化实验室. 恐怖的事情发生了, 阅读全文
posted @ 2017-07-25 20:09 yzm10 阅读(355) 评论(0) 推荐(1)
摘要:迷宫问题 定义一个二维数组: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, }; 它表示一个迷宫,其中的1表示墙壁,0表示可以走的路,只能横着走或竖着走,不能 阅读全文
posted @ 2017-07-24 20:52 yzm10 阅读(1073) 评论(0) 推荐(1)
摘要: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 阅读全文
posted @ 2017-07-24 20:44 yzm10 阅读(402) 评论(1) 推荐(0)
摘要:Catch That Cow Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100 阅读全文
posted @ 2017-07-24 20:24 yzm10 阅读(119) 评论(0) 推荐(0)
摘要:Battle City Many of us had played the game "Battle city" in our childhood, and some people (like me) even often play it on computer now. What we are d 阅读全文
posted @ 2017-07-22 22:49 yzm10 阅读(285) 评论(0) 推荐(0)