
(^-^) --------搜索 --------(^-^)
SY_Pistachio
低调的前行,越努力越幸运!
展开
-
搜索 A - 棋盘问题
在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。 Input 输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空...原创 2018-04-11 20:02:05 · 244 阅读 · 0 评论 -
搜索--广搜深搜结合--H - 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 ≤ i ≤ 2) from the tap;DROP(i) empty the pot i ...原创 2018-05-22 21:30:19 · 317 阅读 · 0 评论 -
搜索--I - Fire Game (两个节点)
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 board is consisting of grass or just empty and then they start...原创 2018-05-23 21:33:58 · 375 阅读 · 0 评论 -
搜索---广搜N - Find a way
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...原创 2018-05-29 20:41:33 · 337 阅读 · 0 评论 -
A*算法
1.A*算法,A*(A-Star)算法是一种静态路网中求解最短路径最有效的直接搜索方法,也是解决许多搜索问题的有效算法。算法中的距离估算值与实际值越接近,最终搜索速度越快。 2. f*(n)=g*(n) +h*(n)从初始节点 S0 出发,经过节点 n到达目标节点的 最小步数 (真实值)。 g*(n): 从S0 出发,到达 n的最少步数(真实值) ...原创 2018-08-17 14:17:30 · 450 阅读 · 0 评论 -
Catch That Cow(广度搜索 poj 3278)
Catch That Cow(点击转到) Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 119275 Accepted: 37221 Description Farmer John has been informed of th...原创 2018-08-18 09:46:03 · 161 阅读 · 0 评论 -
迷宫问题(广搜 POJ 3984)
迷宫问题Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 33792 Accepted: 19239 Description定义一个二维数组: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, ...原创 2018-08-18 11:13:23 · 231 阅读 · 0 评论 -
拯救行动(迷宫问题变形 百练 4980 ) 北京大学ACM/ICPC竞赛训练暑期课
拯救行动查看 提交 统计 提问总时间限制: 1000ms 内存限制: 65536kB描述公主被恶人抓走,被关押在牢房的某个地方。牢房用N*M (N, M <= 200)的矩阵来表示。矩阵中的每项可以代表道路(@)、墙壁(#)、和守卫(x)。 英勇的骑士(r)决定孤身一人去拯救公主(a)。我们假设拯救成功的表示是“骑士到达了公主所在的位置”。由于在通往公主...原创 2018-08-18 16:24:50 · 891 阅读 · 0 评论 -
鸣人和佐助 (迷宫问题变形二 百练 6044 ) 北京大学ACM/ICPC竞赛训练暑期课
鸣人和佐助查看 提交 统计 提问总时间限制: 1000ms 内存限制: 65536kB描述佐助被大蛇丸诱骗走了,鸣人在多少时间内能追上他呢?已知一张地图(以二维矩阵的形式表示)以及佐助和鸣人的位置。地图上的每个位置都可以走到,只不过有些位置上有大蛇丸的手下,需要先打败大蛇丸的手下才能到这些位置。鸣人有一定数量的查克拉,每一个单位的查克拉可以打败一个大蛇丸...原创 2018-08-18 20:46:57 · 694 阅读 · 1 评论 -
搜索--深搜--L - Oil Deposits
The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid that divides th...原创 2018-05-26 14:22:04 · 278 阅读 · 0 评论 -
搜索--广度搜索--J - Fire! (双bfs())
题目: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. Help Joe escape the maze. Given Joe’s location in the...原创 2018-05-26 13:32:23 · 217 阅读 · 0 评论 -
搜索--广搜 E - 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...原创 2018-05-15 21:11:33 · 241 阅读 · 0 评论 -
搜索 B - Red and Black
There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to one of four adjacent tile...原创 2018-04-11 20:59:09 · 189 阅读 · 1 评论 -
搜索 C - Prime Ring Problem
A ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of numbers in two adjacent circles should be a prime. Note: the number ...原创 2018-04-12 19:30:56 · 191 阅读 · 0 评论 -
搜索---广度搜索---F - 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-digit room numbers on their offices. — It is a matter of sec...原创 2018-05-18 16:36:45 · 191 阅读 · 0 评论 -
搜索---G - Shuffle'm Up
A common pastime for poker players at a poker table is to shuffle stacks of chips. Shuffling chips is performed by starting with two stacks of poker chips, S1 and S2, each stack containing C chips. Ea...原创 2018-05-19 10:06:31 · 254 阅读 · 0 评论 -
搜索--广度--K - 迷宫问题
定义一个二维数组: 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表示可以走的路,只能横着走或竖着走,不能斜着走,要求编程序找出从左上角到右下角的最短路线。Input一个5 × 5的二维数组,表示...原创 2018-05-19 15:44:20 · 178 阅读 · 0 评论 -
搜索--B - 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 filled with rock. It takes one minute to move one uni...原创 2018-05-14 20:56:55 · 265 阅读 · 0 评论 -
搜索---广搜---C - 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,000) on a number line and the cow is at a point K (...原创 2018-05-15 19:20:05 · 171 阅读 · 0 评论 -
搜索--广度搜索--M - 非常可乐
大家一定觉的运动以后喝可乐是一件很惬意的事情,但是seeyou却不这么认为。因为每次当seeyou买了可乐以后,阿牛就要求和seeyou一起分享这一瓶可乐,而且一定要喝的和seeyou一样多。但seeyou的手中只有两个杯子,它们的容量分别是N 毫升和M 毫升 可乐的体积为S (S<101)毫升 (正好装满一瓶) ,它们三个之间可以相互倒可乐 (都是没有刻度的,且 S==N+M,101...原创 2018-05-21 21:36:32 · 682 阅读 · 0 评论 -
“浪潮杯”第九届山东省ACM大学生程序设计竞赛重现赛 H Dominoes (BFS)
链接:https://www.nowcoder.com/acm/contest/123/H来源:牛客网 题目描述Orz likes to play dominoes. Now giving an n∗m chessboard and k dominoes whose size are 1∗2, Orz finds that there is exactly one grid empty...原创 2018-10-08 21:30:56 · 416 阅读 · 0 评论