上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 83 下一页
摘要: 题目链接 "bzoj1294: [SCOI2009]围豆豆Bean" 题解 对豆豆进行装压 令dp[i][j][k]表示从i,j出发,把状态为k豆豆的围起来的最小话费 spfa转移 在进行状态的转移的时候,我们需要得到下一个位置的豆豆状态 利用 "射线法" 判断是否在多边形内部,从该豆豆点向右引出一 阅读全文
posted @ 2018-04-28 19:26 zzzzx 阅读(238) 评论(0) 推荐(0) 编辑
摘要: 题目链接 "bzoj3886:[Usaco2015 Jan]Moovie Mooving" 题解 看数据范围 每场电影只能看一次 我们可以对电影进行装压 令dp[i]表示看过状态为i的电影,最多能不间断看多少 然后在电影开始时间中二分转移就好了 ps:以下代码有一个点(样例)在linux下过不去,w 阅读全文
posted @ 2018-04-28 19:17 zzzzx 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 搜索+dp c++ // luogu judger enable o2 include include include const int maxn = 607; int n,m; int map[maxn][maxn]; int fs[5] = {1,0, 1,0,1}; bool vis[max 阅读全文
posted @ 2018-04-28 10:44 zzzzx 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 二项式定理 ~~组合数取膜~~ 费马小定理 c++ include using namespace std; define mod 10007 define int long long int pow(int a,int b) { int ret = 1; for(;b;b = 1 , a = a 阅读全文
posted @ 2018-04-28 10:43 zzzzx 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 题目链接 "bzoj2298: [HAOI2011]problem a" 题解 补集转化答案就是n 最多人说真话 考虑每个人的话构成一段相等成绩区间 令同分数人的个数为区间权值,那么问题就是求最大权不相交区间 代码 c++ / / include include include include in 阅读全文
posted @ 2018-04-27 21:29 zzzzx 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 题目链接 "luogu P1273 有线电视网" 题解 树形背包 dp[i][j]表示在以i为根的子树中,满足j个客户的需求所能获得的最大收益 代码 阅读全文
posted @ 2018-04-17 21:04 zzzzx 阅读(131) 评论(1) 推荐(0) 编辑
摘要: 题目链接 "luogu P2134 百日旅行" 题解 dp方程好想吧 优化有些玄学惹 不会证.... 不过我会三分和贪心 ~~\滑稽~~ 但还是写dp吧 代码 阅读全文
posted @ 2018-04-17 21:02 zzzzx 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 题目链接 "bzoj1079[SCOI2008]着色方案" 题解 状态设计好神呐 dp[a][b][c][d][e][last] 表示剩余1个的有a中,2个的有b中三个的有c中.... last表示上次转移的种类 然后记忆化搜索一下 乘法原理转移 代码 c++ include include inl 阅读全文
posted @ 2018-04-17 20:48 zzzzx 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 题目链接 "bzoj4543 [POI2014]Hotel" 题解 ~~这不是裸地点分嘛~~ ,我真傻,真的 n^2 这不是是sb题,~滑稽 ~ 枚举点转换为无根树,暴力子树中点的深度 计数转移 令a b c d为已知四颗子树,则新来一颗深度为k的点数为e的子树 推下式子 $new_ans=e (a 阅读全文
posted @ 2018-04-17 20:41 zzzzx 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 题目链接 "luogu P1026 统计单词个数" 题解 贪心的预处理母本串从i到j的最大单词数 然后dp[i][j] 表示从前i个切了k次最优解 转移显然 代码 c++ include include include const int maxn = 507; char a[maxn]; char 阅读全文
posted @ 2018-04-10 21:55 zzzzx 阅读(167) 评论(1) 推荐(0) 编辑
上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 83 下一页