![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
kuangbin专题
tomjobs
别慌,慌也没用
展开
-
C - 哈密顿绕行世界问题 HDU - 2181(DFS)
一个规则的实心十二面体,它的 20个顶点标出世界著名的20个城市,你从一个城市出发经过每个城市刚好一次后回到出发的城市。 Input 前20行的第i行有3个数,表示与第i个城市相邻的3个城市.第20行以后每行有1个数m,m<=20,m>=1.m=0退出. Output 输出从第m个城市出发经过每个城市1次又回到m的所有路线,如有多条路线,按字典序输出,每行1条路线.每行首先输出是第几条...原创 2019-03-27 01:15:23 · 284 阅读 · 0 评论 -
A - 棋盘问题 POJ - 1321(DFS,八皇后)
在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。 Input 输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵内描述棋盘,以及摆放棋子的数目。 n <= 8 , k <= n 当为...原创 2019-03-27 08:11:19 · 271 阅读 · 0 评论 -
L - Oil Deposits HDU - 1241(flood fill,dfs,基础搜索)
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...原创 2019-03-27 08:15:45 · 182 阅读 · 0 评论 -
K - 迷宫问题 POJ - 3984(BFS,记录路径)
定义一个二维数组: 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的二维数组,表示一个迷...原创 2019-03-28 23:04:04 · 217 阅读 · 3 评论 -
C - Catch That Cow POJ - 3278(一维BFS)
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 (0 ≤ K ≤ 100,0...原创 2019-03-28 23:25:36 · 325 阅读 · 0 评论 -
E - Find The Multiple POJ - 1426(DFS)
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...原创 2019-03-28 23:28:02 · 178 阅读 · 0 评论 -
N - Find a way HDU - 2612(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 cou...原创 2019-03-29 00:02:52 · 178 阅读 · 0 评论