搜索
JalexDooo
努力中...
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
UVa 1629 Cake Slicing (切蛋糕)
有一个n行m列的网格蛋糕上有一些樱桃,要求延网格线切割,并且每块蛋糕上有一个樱桃,问最小的切割长度。#include #include #include #include #include using namespace std;typedef long long LL;const int INF = 0x3f3f3f3f;int dp[21][21][21][21];int原创 2016-07-14 17:17:05 · 588 阅读 · 0 评论 -
HDU 3368 Reversi (简单dfs)
题意:跟小时候在电视机上玩过的黑白棋一模一样,于是题也没读便开始做。给你一副棋盘,让你走一步黑棋,尽可能多的吃掉白棋,求吃掉的个数。思路:一开始想从D开始递归,后来一想不对啊,比如,走的那一步黑棋,可以从多个方向上吃掉白棋,那么从D开始递归会麻烦太多。所以:从*开始dfs,直到遇上D或者*便停止退出递归,把握好递归方向即可。#include #include #include #原创 2016-07-26 20:03:41 · 659 阅读 · 0 评论 -
UVa 1637 Double Patience (搜索)
题意:36张牌分成9堆,每堆4张牌。每次可以拿走某两堆顶部的牌,但需要点数相同。如果有多种拿法则等概率的随机拿。例如,9堆顶部的牌分别为KS,KH,KD,9H, 8S,8D,7C,7D,6H,则有5种拿法(KS,KH),(KS,KD),(KH,KD),(8S,8D),(7C,7D),每种拿法的概率均为1/5.如果最后拿完所有的牌则游戏成功。按顺序给出每堆牌的4张牌,求成功的概率。思路:用9元组原创 2016-07-07 13:58:09 · 647 阅读 · 0 评论 -
POJ 3172 (dfs写0-1背包)
#include #include #include #include #include #include using namespace std;typedef long long LL;const int maxn = 1007;int n, c, a[maxn], ans;LL sum[maxn];void dfs(int cnt, int w) { //cnt下标,原创 2016-07-28 20:08:08 · 747 阅读 · 0 评论 -
HDU 3690 bfs+哈希
You must have heard of the Knight's Tour problem. In that problem, a knight is placed on an empty chess board and you are to determine whether it can visit each square on the board exactly once.原创 2016-08-04 19:17:46 · 709 阅读 · 0 评论
分享