随笔分类 - 搜索
POJ1376 --Robot+译文(BFS+地图转化+细心)
摘要:The Robot Moving Institute is using a robot in their local store to transport different items. Of course the robot should spend only t...
阅读全文
HDU-1043 POJ -1077 Eight(A*算法)
摘要:The 15-puzzle has been around for over 100 years; even if you don't know it by that name, you've seen it. It is constructed with 15 sl...
阅读全文
POJ2342 Anniversary party
摘要:链接:http://poj.org/problem?id=2342Anniversary partyTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 10326 Accepted: 5913Descri...
阅读全文
2016年第七届蓝桥杯C/C++程序设计本科B组省赛 剪邮票(dfs填空)
摘要:如【图1.jpg】, 有12张连在一起的12生肖的邮票。现在你要从中剪下5张来,要求必须是连着的。(仅仅连接一个角不算相连)比如,【图2.jpg】,【图3.jpg】中,粉红色所示部分就是合格的剪取。请你计算,一共有多少种不同的剪取方法。请填写表示方案数目的整数。注意:...
阅读全文
POJ 1724 ROADS (dfs+剪枝+邻接表)
摘要:N cities named with numbers 1 ... N are connected with one-way roads. Each road has two parameters associated with it : the road lengt...
阅读全文
hdu-1258 Sum It Up(dfs+去重)
摘要:Problem DescriptionGiven a specified total t and a list of n integers, find all distinct sums using numbers from the list that add up ...
阅读全文
51Nod - 1649 齐头并进(BFS,坑~~~)
摘要:在一个叫奥斯汀的城市,有n个小镇(从1到n编号),这些小镇通过m条双向火车铁轨相连。当然某些小镇之间也有公路相连。为了保证每两个小镇之间的人可以方便的相互访问,市长就在那些没有铁轨直接相连的小镇之间建造了公路。在两个直接通过公路或者铁路相连的小镇之间移动,要花费一个小...
阅读全文
HihoCoder - 1632 Secret Poems
摘要:The Yongzheng Emperor (13 December 1678 – 8 October 1735), was the fifth emperor of the Qing dynasty of China. He was a very hard-work...
阅读全文
UVA-136 Ugly Numbers (map容器+优先队列)
摘要:题目链接:https://cn.vjudge.net/problem/UVA-136题意:如果一个数的因子只由2,3,5,组成,则这个数被称为丑数。按照惯例,1也被称为丑数。求第1500个丑数并·输出。这道题没有数据输入。思路:题意很简单,但一不小心就会超时。。。。。...
阅读全文
UVA - 307 Sticks (dfs+剪枝)
摘要:George took sticks of the same length and cut them randomly until all parts became at most 50 unitslong. Now he wants to return sticks...
阅读全文
CodeForces - 540C Ice Cave 队列bfs
摘要:You play a computer game. Your character stands on some level of a multilevel ice cave. In order to move on forward, you need to desce...
阅读全文
hdu-1978 How many ways
摘要:Problem Description这是一个简单的生存游戏,你控制一个机器人从一个棋盘的起始点(1,1)走到棋盘的终点(n,m)。游戏的规则描述如下:1.机器人一开始在棋盘的起始点并有起始点所标有的能量。2.机器人只能向右或者向下走,并且每走一步消耗一单位能量。3....
阅读全文
HDU - 1078 FatMouse and Cheese(记忆化搜索)
摘要:FatMouse has stored some cheese in a city. The city can be considered as a square grid of dimension n: each grid location is labelled ...
阅读全文
POJ - 1088 滑雪(在这里dp和记忆化搜索有区别吗)
摘要:Michael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael想知道载一个区域中最长底滑坡。区域由一个二维数组给出。数组的每个数字代表点的高度。下面是一个例子 ...
阅读全文
HDU - 2822 Dogs (优先队列+bfs)
摘要:Prairie dog comes again! Someday one little prairie dog Tim wants to visit one of his friends on the farmland, but he is as lazy as hi...
阅读全文
POJ - 3021 e-Coins (BFS)
摘要:At the Department for Bills and Coins, an extension of today's monetary system has newly been proposed, in order to make it fit the ne...
阅读全文
POJ 3669 Meteor Shower
摘要:Bessie hears that an extraordinary meteor shower is coming; reports say that these meteors will crash into earth and destroy anything ...
阅读全文
CodeForce 825B Five-In-a-Row
摘要:Alice and Bob play 5-in-a-row game. They have a playing field of size 10 × 10. In turns they put either crosses or noughts, one at a t...
阅读全文
POJ - 1426 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 digit...
阅读全文
LightOJ - 1141 Number Transformation
摘要:In this problem, you are given an integer number s. You can transform any integer number A to another integer numberB by adding x to A...
阅读全文