
ACM_搜索
DATELOST
I'm curious.
展开
-
POJ-3074 Dancing Links精确覆盖
题目行(所有情况)81个格子 * 9个数字=9^3列(限制条件)1.每个格子放一个数-812.行限制-9行 * 9个数字3.列限制-9列 * 9个数字4.小宫格限制-9个小宫格 * 9个数字把限制条件插入,dancing…剪枝:先选择数字多的列#include<stdio.h>#include<string.h>using namespace std...原创 2020-03-21 21:57:48 · 218 阅读 · 0 评论 -
POJ-2449 A* bfs
Description“Good man never makes girls wait or breaks an appointment!” said the mandarin duck father. Softly touching his little ducks’ head, he told them a story.“Prince Remmarguts lives in his kin...原创 2019-08-27 23:58:16 · 138 阅读 · 0 评论 -
POJ-1915 双向bfs
DescriptionBackgroundMr Somurolov, fabulous chess-gamer indeed, asserts that no one else but him can move knights from one position to another so fast. Can you beat him?The ProblemYour task is to ...原创 2019-08-26 12:40:44 · 271 阅读 · 0 评论 -
POJ-3322 bfs
DescriptionLittle Tom loves playing games. One day he downloads a little computer game called ‘Bloxorz’ which makes him excited. It’s a game about rolling a box to a specific position on a special pl...原创 2019-08-22 19:47:53 · 260 阅读 · 0 评论 -
POJ-2248 迭代加深搜索
DescriptionAn addition chain for n is an integer sequence with the following four properties:a0 = 1am = na0 < a1 < a2 < … < am-1 < amFor each k (1<=k<=m) there exist two (not...原创 2019-08-15 17:48:03 · 147 阅读 · 0 评论 -
ACwing-171. 送礼物 双向搜索
达达帮翰翰给女生送礼物,翰翰一共准备了N个礼物,其中第i个礼物的重量是G[i]。达达的力气很大,他一次可以搬动重量之和不超过W的任意多个物品。达达希望一次搬掉尽量重的一些物品,请你告诉达达在他的力气范围内一次性能搬动的最大重量是多少。输入格式第一行两个整数,分别代表W和N。以后N行,每行一个正整数表示G[i]。输出格式仅一个整数,表示达达在他的力气范围内一次性能搬动的最大重量。数据...原创 2019-08-20 20:07:06 · 203 阅读 · 0 评论 -
POJ-3279 状压 搜索
DescriptionFarmer 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...原创 2019-03-17 23:56:45 · 291 阅读 · 0 评论 -
HDU-1043 逆向bfs 打表
Problem DescriptionThe 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 sliding tiles, each with a number from 1 to 15 o...原创 2019-03-11 23:03:24 · 252 阅读 · 0 评论 -
HDU-1238 Substrings stl的运用
这里写自定义目录标题欢迎使用Markdown编辑器新的改变功能快捷键合理的创建标题,有助于目录的生成如何改变文本的样式插入链接与图片如何插入一段漂亮的代码片生成一个适合你的列表创建一个表格设定内容居中、居左、居右SmartyPants创建一个自定义列表如何创建一个注脚注释也是必不可少的KaTeX数学公式新的甘特图功能,丰富你的文章UML 图表FLowchart流程图导出与导入导出导入欢迎使用Ma...原创 2019-01-22 22:19:41 · 188 阅读 · 0 评论 -
HDU-1258 DFS hash去重
Problem DescriptionGiven a specified total t and a list of n integers, find all distinct sums using numbers from the list that add up to t. For example, if t=4, n=6, and the list is [4,3,2,2,1,1], th...原创 2019-02-10 19:20:10 · 160 阅读 · 0 评论 -
HDU-1045 DFS
题目Sample Input4. X . .. . . .X X. .. . . .2XX. X3. X .X.X. X .3. . ..XX.XX4. . . .. . . .. . . .. . . .0Sample Output51524代码:#include<bits/stdc++.h>using namespac...原创 2019-02-10 14:49:56 · 280 阅读 · 0 评论 -
HDU-2717 BFS
Problem Description: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 p...原创 2019-02-08 09:05:53 · 199 阅读 · 0 评论 -
HDU-1426 DFS PE
Problem Description:填数独Presentation Error = =Input本题包含多组测试,每组之间由一个空行隔开。每组测试会给你一个 9*9 的矩阵,同一行相邻的两个元素用一个空格分开。其中1-9代表该位置的已经填好的数,问号(?)表示需要你填的数。Output对于每组测试,请输出它的解,同一行相邻的两个数用一个空格分开。两组解之间要一个空行。对于每组测试...原创 2019-02-03 23:19:49 · 184 阅读 · 0 评论