
算法竞赛-搜索
文章平均质量分 72
算法竞赛-搜索
Jamence
AI从业者,负责过多模态大模型、超大规模分类、聚类、检索等任务;发表过10+ CCF A/B等论文
展开
-
POJ 3278 Catch That Cow
Catch That Cow Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 80477 Accepted: 25346 Description Farmer John has been informed of the location of a fugitiv原创 2016-12-06 08:47:40 · 257 阅读 · 0 评论 -
hdu1016 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原创 2017-12-07 11:57:23 · 357 阅读 · 0 评论 -
hdu1627 Krypton Factor(注意后缀+dfs)
You have been employed by the organisers of a Super Krypton Factor Contest in which contestants have very high mental and physical abilities. In one section of the contest the contestants are tested o原创 2017-12-07 11:55:59 · 638 阅读 · 0 评论 -
hdu2553(八皇后问题+打表)
在N*N的方格棋盘放置了N个皇后,使得它们不相互攻击(即任意2个皇后不允许处在同一排,同一列,也不允许处在与棋盘边框成45角的斜线上。 你的任务是,对于给定的N,求出有多少种合法的放置方法。 Input共有若干行,每行一个正整数N≤10,表示棋盘和皇后的数量;如果N=0,表示结束。 Output共有若干行,每行一个正整数,表示对应输入行的皇后的不同放置数量。 Sample原创 2017-12-07 11:51:25 · 786 阅读 · 0 评论 -
hdu1010(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-12-07 11:49:31 · 329 阅读 · 0 评论 -
hdu1495非常可乐(bfs)
大家一定觉的运动以后喝可乐是一件很惬意的事情,但是seeyou却不这么认为。因为每次当seeyou买了可乐以后,阿牛就要求和seeyou一起分享这一瓶可乐,而且一定要喝的和seeyou一样多。但seeyou的手中只有两个杯子,它们的容量分别是N 毫升和M 毫升 可乐的体积为S (S Input三个整数 : S 可乐的体积 , N 和 M是两个杯子的容量,以"0 0 0"结束。 Output原创 2017-11-04 10:15:08 · 1413 阅读 · 0 评论 -
poj3984 迷宫问题
定义一个二维数组: 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原创 2017-11-04 10:12:15 · 273 阅读 · 0 评论 -
poj3414 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-11-04 10:07:47 · 283 阅读 · 0 评论 -
poj3126 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 s原创 2017-11-04 09:52:21 · 453 阅读 · 0 评论 -
poj1426 Find The Multiple(bfs)
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-11-04 09:46:43 · 237 阅读 · 0 评论 -
poj3279 Fliptile(翻转棋盘)
Farmer John knows that an intellectually satisfied cow is a happy cow who will give more milk. He has arranged a brainy activity for cows in which they manipulate an M× N grid (1 ≤ M ≤ 15; 1 ≤ N ≤ 15)原创 2017-11-04 09:38:53 · 480 阅读 · 0 评论 -
poj3278 抓牛(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原创 2017-11-04 09:31:08 · 589 阅读 · 0 评论 -
poj2251 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-11-04 09:21:42 · 269 阅读 · 0 评论 -
poj1321 dfs(八皇后变形)
在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。 Input 输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵内描述棋盘,以及摆放棋子的数目。 n 当为-1 -1时表示输入结束原创 2017-11-04 09:08:19 · 346 阅读 · 0 评论 -
第七届蓝桥杯省赛剪邮票
剪邮票 如【图1.jpg】, 有12张连在一起的12生肖的邮票。 现在你要从中剪下5张来,要求必须是连着的。 (仅仅连接一个角不算相连) 比如,【图2.jpg】,【图3.jpg】中,粉红色所示部分就是合格的剪取。 请你计算,一共有多少种不同的剪取方法。 请填写表示方案数目的整数。 注意:你提交的应该是一个整数,不要填写任何多余的内容或说明性文字。 我们不一定使用dfs,可以使用...原创 2018-03-26 21:41:50 · 394 阅读 · 0 评论