上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 26 下一页
摘要: day 1 A 给G,w(e)1M(diff),|V|100K,|E|1M,求 MST MST上任意两点间距离的期望 显然MST唯一 E(dis(u,v))可以通过计算每条边的贡献加出来 B n个并行游戏,每个游戏都在一个1x20的棋盘上有20个不可区分的棋子,两人轮流,每人可以选择一个棋子往右跳到 阅读全文
posted @ 2016-07-21 19:31 zball 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 明确一下,我们要求这个: $${n \choose m} \bmod t$$ defs 假设$n,m,t \le 2^w$,$w$是字长,即认为+ ×÷全是basic operation($O(1)$). $${n \choose m} = \frac{n^{\underline{m}}}{m!} 阅读全文
posted @ 2016-07-15 23:07 zball 阅读(337) 评论(0) 推荐(0) 编辑
摘要: 狗带×1 阅读全文
posted @ 2016-06-16 13:49 zball 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 0613 A. 复制代码的时候忘了后续的对称的修改. 统计答案时出现了一些不可理喻的低级失误. B. 在0 indexed的程序中访问第一个元素使用了Arr[1]. Matrix tree为mat[deg] mat[adj]而使用了mat[adj] mat[deg]. C. Left blank. 阅读全文
posted @ 2016-06-13 22:28 zball 阅读(147) 评论(0) 推荐(0) 编辑
摘要: /// the original blog is http://www.cnblogs.com/tmzbot/p/5579020.html , automatic crawling without link to original blog is unallowed. 判定 + 寻找一组解 (感觉这 阅读全文
posted @ 2016-06-12 22:30 zball 阅读(762) 评论(0) 推荐(0) 编辑
摘要: 替罪羊树只插入远远慢于std::set... 我比较了sgt的4种实现.. Set.zball cpp /// public domain include using namespace std; set p; int main(){ for(int i=1;i include include in 阅读全文
posted @ 2016-06-11 22:52 zball 阅读(284) 评论(0) 推荐(0) 编辑
摘要: cnbb 我被数组清零卡了一天.. 子树改色询问子树颜色数.. 先考虑颜色为x的节点对祖先答案的贡献,那么我们考虑把所有这些节点都搞出来,按dfs序排序,然后考虑每个节点a掌管的祖先是它和按dfs序的下一个同色节点b的LCA以下的节点,然后每个有颜色x儿子的树都被覆盖了,而且最多覆盖一次. 在删除节 阅读全文
posted @ 2016-06-11 13:57 zball 阅读(545) 评论(0) 推荐(0) 编辑
摘要: ```cpp I p(I q){r p(c((q>9?q-p(q/10):q)+'0')),q*10; } ``` 阅读全文
posted @ 2016-05-27 22:18 zball 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 主要利用了宏和stderr... 1. 输出到stderr 2. 若debug则插入一段代码 example. cpp include "cstdio" include "vector" include "cstring" include "cstdlib" include "algorithm" 阅读全文
posted @ 2016-05-24 22:07 zball 阅读(656) 评论(0) 推荐(0) 编辑
摘要: http://share.weiyun.com/bcc6b7e2156f81447a1b431aba19d475 阅读全文
posted @ 2016-05-24 16:18 zball 阅读(153) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 26 下一页