上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 83 下一页
摘要: 题目链接 "luoguP4360 [CEOI2004]锯木厂选址" 题解 dis:后缀和 sum:前缀和 补集转化,减去少走的,得到转移方程 dp[i] = min(tot sumj disj (sumi sumj) disi 不需要斜率优化吧?反正也是个SB式子 代码 c++ include us 阅读全文
posted @ 2018-07-11 08:00 zzzzx 阅读(122) 评论(0) 推荐(0) 编辑
摘要: #题目链接 CodeForces - 997C Sky Full of Stars #题解 有空补一下套题题解Qwq,然而我只是pilpuQwq 设$f(i,j)$表示至少有i行j列一种颜色的方案数 可以发现,当ij有相交时颜色只能为一种 那么对于$i=0 || j=0$时$f(i,j) = C_n 阅读全文
posted @ 2018-07-09 09:10 zzzzx 阅读(217) 评论(0) 推荐(0) 编辑
摘要: 题目链接 "bzoj4196: [Noi2015]软件包管理器" 题解 看来我还没忘Qwq 一个std随便打,12 min 1A,刺激,好吧,其实很慢 题解 c++ include using namespace std; inline int read() { int x = 0,f = 1; c 阅读全文
posted @ 2018-07-09 08:18 zzzzx 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 题目链接 "bzoj4034: [HAOI2015]树上操作" 题解 树剖线段树 代码 c++ include using namespace std; inline int read() { int x = 0,f = 1; char c = getchar(); while(c '9'){if( 阅读全文
posted @ 2018-07-09 08:16 zzzzx 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 题目链接 "bzoj1220: [HNOI2002]跳蚤" 题解 根据裴蜀定理,不定方程的解为未知数的gcd,所以选取的n个数的gcd为1 那么n 1个数保证没有公约数为m的约数,枚举质因数容斥 质因数的个数上届是log的啊,我真傻,还想了半天QAq 那啥,bzoj高精,你们去做吧Qwq 代码 c+ 阅读全文
posted @ 2018-07-08 08:38 zzzzx 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 题目链接 "bzoj1017: [JSOI2008]魔兽地图DotR" 题解 设dp[i][j][k]表示以i为根的子树中,有j个i节点用于和成上层,花费为k的最大收益 枚举合成l个i节点,然后用剩余的钱在子树中制造一些别的power g[i][j]表示对于当前子树的前i棵子树花费j能得到的最大收益 阅读全文
posted @ 2018-07-08 08:28 zzzzx 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 题目链接 "bzoj1816: [Cqoi2010]扑克牌" 题解 还是挺妙的 一套牌只能用一张Joker,那么贪心是不对的 若能够组成k套牌,那么joker一定有种方法在k套牌中出现 include include inline int read() { int x = 0,f = 1; char 阅读全文
posted @ 2018-07-07 11:22 zzzzx 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 题目链接 "bzoj3566: [SHOI2014]概率充电器" 题解 考虑一个点不连通的概率 计算概率的式子 $P(A)$表示$A$发生的概率 $P(A+B)$表示$A,B$至少发生一个的概率 $P(A+B)=P(A)+P(B) P(AB)$ $P(A)=(P(A+B) P(B))/(1 P(B) 阅读全文
posted @ 2018-07-07 11:11 zzzzx 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 题目链接 "luoguP3871 [TJOI2010]中位数" 题解 平衡树 代码 c++ include include include include define LL long long inline int read() { int x = 0,f = 1;char c = getchar 阅读全文
posted @ 2018-07-05 21:34 zzzzx 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 题目链接 "luogu P2439 [SDOI2005]阶梯教室设备利用" 题解 dp 代码 c++ include include include include define LL long long inline int read() { int x = 0,f = 1;char c = ge 阅读全文
posted @ 2018-07-05 20:01 zzzzx 阅读(150) 评论(0) 推荐(0) 编辑
上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 83 下一页