摘要: http://www.cnblogs.com/hoojo/archive/2012/02/14/2350782.html ----------rational rose 的配置和破解 阅读全文
posted @ 2014-12-09 16:23 persistent codeants 阅读(319) 评论(0) 推荐(0) 编辑
摘要: 一周总结数论POJ3058题意:就是给定一个分数,要求把它化成二进制形式,求最小的循环节和循环节开始的位置。首先约分化成最简分数形式p/q,然后化成二进制就是每次乘2大于1时,本位为1,该数取余,那么总会存在。则(p*2^i)%q=(p*2^j)%q,这里假设i<j,则可化为(p*2^(j-... 阅读全文
posted @ 2014-08-25 14:56 persistent codeants 阅读(417) 评论(0) 推荐(0) 编辑
摘要: 一周总结树状dp:在一棵树上进行状态转移,一般在树上遍历的时候,有返回到父节点的有不需要返回的,有无根树的遍历(即任意一点都可作为一个根),但状态方程的转移还是从父结点到儿子节点的递归转移。Hdu1296题意:求任意一个点作为根,求该树的半径两次dfs第一次求出以该点为根的最大距离和次大距... 阅读全文
posted @ 2014-08-17 09:06 persistent codeants 阅读(544) 评论(0) 推荐(0) 编辑
摘要: 一周总结状态压缩:状态压缩无论是有关于图的遍历的还是图形和物体的放置的,都可归结于一类问题,那就是排列问题即先算谁的问题。如:hdu4295题意说将4个子串放入一个主串中,使得覆盖的字符数最大和最小。此题先预处理每个子串可在主串中放的位置pos[i][j]以kmp字符串匹配算法... 阅读全文
posted @ 2014-08-10 09:09 persistent codeants 阅读(409) 评论(0) 推荐(0) 编辑
摘要: 一周总结状态压缩:状态压缩无论是有关于图的遍历的还是图形和物体的放置的,都可归结于一类问题,那就是排列问题即先算谁的问题。如:hdu4295题意说将4个子串放入一个主串中,使得覆盖的字符数最大和最小。此题先预处理每个子串可在主串中放的位置pos[i][j]以kmp字符串匹配算法... 阅读全文
posted @ 2014-08-10 09:04 persistent codeants 阅读(441) 评论(0) 推荐(0) 编辑
摘要: 一周总结费用流:BZOJ1927有n个点保证每个点都走一次,且走完n个点的最小花费。分点,保证每个点只走一次。BZOJ2324有n个点k个人保证在走完前i-1个点时,才能走第i个点,求遍历n个点的最小花费。此题建边时要用floyd求出前... 阅读全文
posted @ 2014-08-02 14:37 persistent codeants 阅读(432) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionGiven two positive integersnandk, you are asked to generate a new integer, saym, by changing some (maybe none) digits ofn, such that the following properties holds:mcontains no leading zeros and has the same length asn(We considerzeroitself a one-digit integer without leading zero 阅读全文
posted @ 2014-01-30 11:35 persistent codeants 阅读(525) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionAcellular automatonis a collection of cells on a grid of specified shape that evolves through a number of discrete time steps according to a set of rules that describe the new state of a cell based on the states of neighboring cells. Theorder of the cellular automatonis the number 阅读全文
posted @ 2014-01-29 15:13 persistent codeants 阅读(884) 评论(0) 推荐(0) 编辑
摘要: 题意:把奶牛分成3组,只要有两组大于1/2量,用深搜剪枝 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 const int maxn=220; 7 struct node 8 { 9 int key,id;10 bool operator xx.key;13 }14 }data[maxn];15 16 bool cmp(const node &p,const node &q)17 {18 return p.keyn*500&&sum[n+n]-ans>n*500). 阅读全文
posted @ 2014-01-27 12:22 persistent codeants 阅读(520) 评论(0) 推荐(0) 编辑
摘要: 把题意写一下: 给你一个n*n的矩阵,每个格子都有一个非负整数,从左上角走到右下角,收集走过的数字,累加,但是只能向右或者向下走,走过之后数字就变为0,让你求从左上角到右下角,走k次之后,所得的最大值是多少。典型的最小费用最大流入门题,只需在建图时,把源点到1的cap设成k,对走完一次变成0的处理时,只需拆点,拆成两条边,一条容量为1,权值为点权,另一条是跳板,容量为inf,费用为0,即可******************************************************************************************************** 阅读全文
posted @ 2014-01-27 11:48 persistent codeants 阅读(455) 评论(0) 推荐(0) 编辑