上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 83 下一页
摘要: 题目链接: "luogu P1623 [CEOI2007]树的匹配Treasury" 题解: 设dp[u][0]表示在以u为根的子树中,u不匹配能得到的最大匹配数,dp[u][1]表示在以u为根的子树中,匹配u等得到的最大匹配数 显然dp[u][1]一定是 =dp[u][0]的,那么 $dp[u][ 阅读全文
posted @ 2018-02-26 09:00 zzzzx 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 题目链接 "bzoj 1879: [Sdoi2009]Bill的挑战" 题解 n include include include define mod 1000003 using std::max; using std::min; inline int read() { int x=0,f=1; c 阅读全文
posted @ 2018-02-26 08:13 zzzzx 阅读(226) 评论(0) 推荐(0) 编辑
摘要: 题目链接: "bzoj 1067: [SCOI2007]降雨量" 题解: 很简单的一道题,但代码里有许多细节需要注意,切容易出错,调了三个小时OTZ 做一个st表维护区间最大值就 在获得年份在序列中的pos时二分 也可以维护平衡树查询pos 或者用直接用线段维护最大值同时维护区间中有多少年份 其次分 阅读全文
posted @ 2018-02-21 20:15 zzzzx 阅读(197) 评论(0) 推荐(0) 编辑
摘要: 题目链接: "bzoj 1005: [HNOI2008]明明的烦恼" 题解: 首先要了解prufer序列 对于每个prufer序列都对应唯一的一棵树,对于该规定了度数的点也就规定了该店在prufer序列中出现的次数,那么就是求prufer序列的方案数也就是可重复序列的全排列。 首先只考虑规定度数得点 阅读全文
posted @ 2018-02-21 14:04 zzzzx 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 三角形向右对齐后 你想打掉一个砖块,那么你必须打掉右上方的三角形,前缀和维护 若是第i列若是k个,那么它右边的那一列至少选了k 1个 f[i][j][k] 表示从后向前选到第 i 列第j个一共打了k次的分数 c++ // luogu judger enable o2 include include 阅读全文
posted @ 2018-02-20 14:40 zzzzx 阅读(112) 评论(0) 推荐(0) 编辑
摘要: ```c++ /* dp[i][j][k]表示 已经选i个,本次选到了第j个,小红满意度k时,小明最大收益* */ #include #include using std::max; using std::min; const int maxn=107; inline int read() { int x=0,f=1; char c=getchar(); while(c'9... 阅读全文
posted @ 2018-02-20 14:14 zzzzx 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 题解真的是越写越懒 // luogu judger enable o2 include include using std::sort; const int maxn = 200006; int n,m,sum[maxn'9'){if(c==' ')f= 1;c=getchar();} while( 阅读全文
posted @ 2018-02-20 14:12 zzzzx 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 题目链接 "BZOJ 2301 HAOI2011 Problem b" 题解 $$\sum_{i=1}^n\sum_{j=1}^m[gcd(i,j)==k]$$ $$=\sum_{i=1}^{⌊ \dfrac{n}{k}⌋}\sum_{j=1}^{⌊\dfrac{m}{k}⌋}[gcd(i,j)== 阅读全文
posted @ 2018-02-11 15:24 zzzzx 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 题目链接 "bzoj 1066: [SCOI2007]蜥蜴" 题解 对于每块石头拆点限流为高度 限制跳跃次数 对于能跳出去的石头的连接汇点容量为INF 源点连接青蛙容量为1 对于互相能到达的点建立容量为INF的边 求出最大流为做多逃出数 答案为青蛙数 最大流 代码 c++ include inclu 阅读全文
posted @ 2018-02-10 21:33 zzzzx 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 题目链接 "bzoj 1305: [CQOI2009]dance跳舞" 题解 男,女生拆点A1A2,B1B2,拆成两点间分别连容量为K的边,限制与不喜欢的人跳舞的数量 A1连接源点容量为x,B1连接汇点容量为x,x即为歌曲数目数 对与相互喜欢的男女直在A1,B1间接连容量为1的边 对于相互不喜欢A2 阅读全文
posted @ 2018-02-10 21:25 zzzzx 阅读(145) 评论(0) 推荐(0) 编辑
上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 83 下一页