
搜索
Konago
这个作者很懒,什么都没留下…
展开
-
hdu1078 FatMouse and Cheese
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1078题意:老鼠每次最多只能走k步,停下的这个位置的数字比上一个停留的位置大,并获取其价值,每次只能水平或垂直走,问最大能得到的价值简单DFS + 记忆化搜索#include#include#include#include#include#include#define原创 2017-09-05 16:46:58 · 244 阅读 · 0 评论 -
hdu1195 Open the Lock
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1195bfs水一水 #include<cstdio>#include<cstring>#include<iostream>#include<algorithm>#include<queue>#include<map...原创 2018-01-25 14:12:03 · 217 阅读 · 0 评论 -
hdu2102 A计划
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2102题意:中文题就不翻译了,在T时刻前找到也行。(在变量设置的时候T和cnt一开始都是T......然后wa了好几次才发现。太蠢了)简单的bfs #include<iostream>#include<cstdio>#include<cstring...原创 2018-01-25 00:17:11 · 211 阅读 · 0 评论 -
hdu3309 Roll The Cube
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3309题意:和基础bfs不一样的就是多了一个,于是就增加相应的属性就好了简单的搜索题,需要注意的细节多 #include<iostream>#include<cstdio>#include<cstring>#include<algo...原创 2018-01-23 16:42:30 · 235 阅读 · 0 评论 -
hdu 3681 Prison Break
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3681题意:n*m矩阵有加起来不超过十五个的G和Y,你需要走过所有的Y,移动一次需要一电量,问最少需要多大的电池。思路:如果没有G,就是一个很简单的最短路了,有了G就很复杂,我们二分讨论V,用状压dp做辅助,dp[S][k] = max(dp[S+{j}][j] - dis[j][k]) ...原创 2017-10-31 01:46:25 · 348 阅读 · 0 评论 -
poj 1465 Multiple
题目链接:http://poj.org/problem?id=1465题意:用给定的m个数字构造一个数是n最小的倍数思路:bfs搜索,用队列未果,然后用数组模拟的 #include<iostream>#include<cstdio>#include<cstring>#include<string>#include<...原创 2017-09-27 19:26:19 · 286 阅读 · 0 评论 -
hdu1973 Prime Path
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1973题意:从一个素数变到另一个素数,一次只能动一位,一次的费用是1,求最小费用。思路:bfs,但是注意第一位不能为0,否则第二个样例的答案是5 #include<iostream>#include<cstdio>#include<cstring>...原创 2017-09-26 01:04:57 · 254 阅读 · 0 评论 -
hdu 1728 逃离迷宫
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1728题意:除了第一次任意方向走不算拐弯,问在最多拐k次的情况下能不能从(x1,y1)到(x2,y2)思路:一次四个方向都走到头,并记录去过地方,将其入队,然后在出队的时候,如果四个方向有没去过的地方,往那边走就是拐弯,所以在入队的时候拐弯数就+1(神tm最后一行输入,先输入的列,找了半天o...原创 2017-09-23 01:54:11 · 188 阅读 · 0 评论 -
POJ 3635(HDU 1676)Full Tank?
题目:http://poj.org/problem?id=3635用优先级队列+dijkstra//#include<bits/stdc++.h>//#define DEBUG#include<cstdio>#include<iostream>#include<cstring>#include<string>#inc...原创 2018-08-07 18:35:59 · 249 阅读 · 0 评论 -
hdu 1226 超级密码
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1226题意:给出n,c,m,密码必须是n这个十进制数的整数倍,c代表这个密码是C进制数,m代表这个密码只有m种字符构成,而且密码不能长于500(做了半天没做出来!最后看题解A掉http://blog.youkuaiyun.com/libin56842/article/details/9750901。...转载 2017-09-19 00:20:05 · 439 阅读 · 0 评论 -
hdu1254 推箱子
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1254题意:中文题就不说了,就是注意箱子是可以回到之前去过的位置的,下面这个是来自discuss的数据。 #include<cstdio>#include<cstring>#include<iostream>#include<algori...原创 2018-01-26 10:51:11 · 241 阅读 · 0 评论 -
2017 ICPC Naning Rake It In
题目链接alpha-beta剪枝#include<cstdio>#include<iostream>#include<cstring>#include<string>#include<queue>#include<map>#include<vector>#include<set原创 2018-07-29 01:04:42 · 354 阅读 · 0 评论 -
hdu1142 A Walk Through the Forest
题目链接:题意:问从office到home有多少路可以走,下一步到家的最小距离必须比现在到家的最短距离小才能到下一步。思路:先处理出各个点到home的最短距离,再用dfs+记忆化搜索#include#include#include#include#include#include#define maxn 1005#define inf 100000using namespa原创 2017-09-06 15:00:22 · 225 阅读 · 0 评论 -
hdu 1208 Pascal's Travels
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1208题意:从(0, 0)出发,到(n - 1, n - 1),当你在(r, c)的位置时,只能向右或者向下走Map(r,c)步,问有多少种走法。DFS水题,注意一点细节就好#include#include#include#include#define maxn 40usin原创 2017-09-08 00:06:00 · 251 阅读 · 0 评论 -
poj1190 生日蛋糕
题目链接:http://poj.org/problem?id=1190题意:m层,要求Ri > Ri+1且Hi > Hi+1,并且总体积等于n,求最小的表面积(最下一层的下底面除外)思路:因为s = 侧面积 + 最大圆面积。可以从考虑从底层到高层或者从高层到底层搜索。暴力搜索就别想了。。各种剪枝之后勉强过Accepted760K47MS原创 2017-09-12 16:57:56 · 281 阅读 · 0 评论 -
poj 2688 Cleaning Robot
题目链接:http://poj.org/problem?id=2688题意:一个机器人从'o'出发,要到达所有的'*',问最少的步数。思路:1:状压dp可以做:2:求出每两个目标点的最短距离,然后dfs搜索最小答案。 #include<iostream>#include<cstdio>#include<cstring>#includ...原创 2017-09-30 11:19:31 · 314 阅读 · 0 评论 -
poj 2308 Dearboy’s Puzzle
题目链接:http://acm.pku.edu.cn/JudgeOnline/problem?id=2308题意:就不说了。。思路:dfs搜索消除路径,消除路径用bfs求。 #include<iostream>#include<cstdio>#include<cstring>#include<algorithm>#inclu...原创 2017-10-03 01:09:41 · 304 阅读 · 0 评论 -
hdu 5971Wrestling Match
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5971题意:题不好懂大致就是给你方向不确定的边,和一些确定的点的属性, 问这个图可不可以是二分图#include#include#include#include#include#include#include#define maxn 1005using namespace原创 2017-11-05 23:53:42 · 189 阅读 · 0 评论 -
hdu 2614 Beat
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2614DFS入门题#include#include#include#include#include#includeusing namespace std;const int maxn = 20;int n, Ans;int Map[maxn][maxn];int ans[原创 2018-01-22 13:09:43 · 263 阅读 · 0 评论 -
hdu2437 Jerboas
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2437题意:求从起点开始到某个P点路径长度是k的倍数的最短路#include#include#include#include#include#includeusing namespace std;const int maxn = 1005;int n, m, s, k, an原创 2018-01-24 15:54:00 · 290 阅读 · 0 评论 -
ACM-ICPC 2018 南京赛区网络预赛 E AC Challenge
题目链接:https://nanti.jisuanke.com/t/30994题意:有n道题,做第i道题首先得做Si道题(p1,p2,...,psi),做一道题需要一分钟,在t时刻完成第i道题可以获得t×ai+bi分数求最大值思路:首先看数据就暗示了状压,1 << i表示第i道题,于是可以连一条 到i的有向边,然后记忆化搜索就好#include<b...原创 2018-09-05 20:24:59 · 331 阅读 · 0 评论