zcmu
qq_36054450
这个作者很懒,什么都没留下…
展开
-
ZCMU1551
一列一列考虑 dp[i][j][3], 后面3个表示从什么方向进入这个点 假设现在的点为(i,j) 从左边进入的话要考虑点(i,j-1)的情况,取该点左,上,下的最大值 dp[i][j][left]=max(dp[i][j-1][left],dp[i][j-1][up],dp[i][j-1][down])+a[i][j]; 从上面进入的话要考虑点(i-1,j)的情况转载 2016-10-13 17:34:27 · 202 阅读 · 0 评论 -
状态压缩
dp[i][j] i表示用二进制表示有几个点如:5=101 表示0,2点存在1点不存在 题目中j表示存在点的时候奖励为多少。 if(i&(1 集点i包括点j i=(i|(1 把点j加入到集点i中去 i=(i-(1 把点j从集点i中删去 //zcmu1552#include #include #include #include #include #include #incl转载 2016-10-18 15:39:03 · 175 阅读 · 0 评论 -
ZCMU 1708 树状数组优化dp
1708: 上升子序列 Time Limit: 1 Sec Memory Limit: 128 MB Description 有一个长度为n的数组,要你求出最长上升子序列???然而事实并没有那么难。infact,有一个长度为n的数组a,求出长度为m的上升子序列的个数。 Input 多组测试数据 第一行输入一个n,m(m 第二行输入数组a。1 Output转载 2016-12-14 15:49:34 · 311 阅读 · 0 评论 -
poj2550
Description Harvard linguistics professor George Kingsley Zipf (1902-1950) observed that the frequency of the kth most common word in a text is roughly proportional to 1/k. He justified his observa转载 2017-02-07 16:03:45 · 290 阅读 · 0 评论 -
ZCMU 1902: Rhombinoes ( 二分图匹配)
1902: Rhombinoes Description Rhombinoes In the game of Rhombinoes, you have a board made up entirely of equilateral trianges (see the image), some of which are "live" and some are "dead". You原创 2017-03-29 16:08:01 · 895 阅读 · 0 评论