摘要:
题目链接 "bzoj1012: [JSOI2008]最大数maxnumber" 题解 维护一颗长m序列的线段树 瞎打就OK了 听说可以单调栈? luogu数据真是有毒 代码 c++ include include const int maxn = 200007; inline int read() 阅读全文
摘要:
题目链接 "bzoj1055: [HAOI2008]玩具取名" 题解 f[l][r][k]表示l r能否合成字母k 由枚举自己可能的分解转移得到 记忆化搜索好写些 代码 c++ include include include inline int read() { int x = 0,f = 1; 阅读全文
摘要:
题目链接 "1996: [Hnoi2010]chorus 合唱队" 题解 区间dp 设dp[i][j][0/1] 表示可以构成i到j 0表示上次匹配在左,1表示在右 转移显然 代码 c++ include include define mod 19650827 const int maxn = 10 阅读全文
摘要:
题目链接 "bzoj1016: [JSOI2008]最小生成树计数" 题解 每种权值的边的数量是确定的,每种权值的边的作用是确定的 求一遍最小生成树,对于相同权值的边分组 然后对于每一种权值的边搜索,得出每组权值的边选择方案 乘法原理统计答案 代码 c++ include include inlin 阅读全文