会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
kewowlo
博客园
首页
新随笔
联系
管理
订阅
上一页
1
···
7
8
9
10
11
12
13
14
15
···
21
下一页
2014年9月5日
字典树模板/ac自动机模板
摘要: #define maxnode 60101#define sigma_size 26struct trie{ int ch[maxnode][sigma_size]; int val[maxnode]; int sz; void init() { cler...
阅读全文
posted @ 2014-09-05 16:01 kewowlo
阅读(154)
评论(0)
推荐(0)
2014年9月3日
【DP】UVA 10651 Pebble Solitaire 记忆化搜索
摘要: #include #include #include #include #include #include #include using namespace std;#include #include #include #include #include #include #define cler(...
阅读全文
posted @ 2014-09-03 16:16 kewowlo
阅读(134)
评论(0)
推荐(0)
2014年9月2日
【DP】UVA 10131 Is Bigger Smarter? LIS
摘要: 排序后dp写代码的速度还不够快。。。#include #include #include #include #include #include #include using namespace std;#include #include #include #include #include #inc...
阅读全文
posted @ 2014-09-02 15:47 kewowlo
阅读(187)
评论(0)
推荐(0)
【DP】HDU 1712 ACboy needs your help 背包
摘要: 将一门课学习几天当成一个物品一门课中的m天 只能选择其中的一天所以对于第i门课来说 用dp数组储存当前这门课的最大值 用out储存这门课选择了一天后的最大值#include #include #include #include #include #include #include usi...
阅读全文
posted @ 2014-09-02 15:00 kewowlo
阅读(145)
评论(0)
推荐(0)
【DP】 POJ 1191 棋盘分割 记忆化搜索
摘要: 思路:黑书递归割x边或y边 取上或取下四个选择#include #include #include #include #include #include #include using namespace std;#include #include #include #include #include...
阅读全文
posted @ 2014-09-02 14:04 kewowlo
阅读(158)
评论(0)
推荐(0)
【DP】HDU 2577 How to Type
摘要: 题意:求最少按键盘多少次注意当大写开关开着时按shift打出来的是小写dp[i][j] i==0表示没开大写 i==1 表示开大写;#include #include #include #include #include #include #include using namespace std;#...
阅读全文
posted @ 2014-09-02 10:04 kewowlo
阅读(135)
评论(0)
推荐(0)
【DP】UVA 116 Unidirectional TSP
摘要: 要求输出的路径的字典序最小,所以要从后往前转移状态,每次都取最小的行序号#include #include #include #include #include #include #include using namespace std;#include #include #include #inc...
阅读全文
posted @ 2014-09-02 09:16 kewowlo
阅读(116)
评论(0)
推荐(0)
2014年9月1日
【DP】UVA 10003 Cutting Sticks 类似矩阵链乘
摘要: 记忆化搜索#include #include #include #include #include #include #include using namespace std;#include #include #include #include #include #include #define ...
阅读全文
posted @ 2014-09-01 22:09 kewowlo
阅读(156)
评论(0)
推荐(0)
【DP】UVA 103 Stacking Boxes 输出路径
摘要: 类似于叠箱子对于箱子a : (a1,a2,a3),b : (b1,b2,b3)存在一个顺序ai#include #include #include #include #include #include using namespace std;#include #include #include #i...
阅读全文
posted @ 2014-09-01 19:29 kewowlo
阅读(184)
评论(0)
推荐(0)
【DP】HDU 1143 Tri Tiling
摘要: 需要放满格子,所以N为奇数时ans应该为0;当前格子放的状态用表示0-7的二进制来表示初始化第一列时先令036为1第i列可有前一列的状态转化而来i-1列 当前第i列 7->0 6-> 1 5-> 2 4,7 -> 3 3 -> 4 2 -> 5 1,7 -> 6 3,6...
阅读全文
posted @ 2014-09-01 15:40 kewowlo
阅读(145)
评论(0)
推荐(0)
上一页
1
···
7
8
9
10
11
12
13
14
15
···
21
下一页
公告