07 2016 档案

摘要:总结一下。 设S表示一个01状态集,那么它的所有非空子集x可以通过以下代码枚举。 比如S=1011,则x分别为:1011, 1010, 1001, 1000, 0011, 0010, 0001。忽略S中第二位的0其实就是111, 110, 101, 100, 011, 010, 001。 阅读全文
posted @ 2016-07-27 19:19 Commence 阅读(506) 评论(0) 推荐(0) 编辑
摘要:原贴地址http://www.cnblogs.com/bigrabbit/archive/2012/09/20/2695543.html 有些信息在存储时,并不需要占用一个完整的字节, 而只需占几个或一个二进制位。例如在存放一个开关量时,只有0和1 两种状态, 用一位二进位即可。为了节省存储空间,并 阅读全文
posted @ 2016-07-22 21:52 Commence 阅读(341) 评论(0) 推荐(0) 编辑
摘要:struct bign { int len, s[numlen]; bign() { memset(s, 0, sizeof(s)); len = 1; } bign(int num) { *this = num; } bign(const char *num) { *this = num; } bign opera... 阅读全文
posted @ 2016-07-20 12:37 Commence 阅读(175) 评论(0) 推荐(0) 编辑
摘要:#include #include #include #include #include const long Size1 = 39L; const long Size2 = 100 * Size1; const long Size3 = 100 * Size2; bool f3(int x) {return x % 3 == 0 ;} bool f13(int x) {return x % 1... 阅读全文
posted @ 2016-07-20 10:26 Commence 阅读(195) 评论(0) 推荐(0) 编辑
摘要:#include #include #include #include #include #include #include #include int main() { using namespace std; cout.setf(ios_base::left,ios_base::adjustfield); cout.setf(ios_base::showpos); ... 阅读全文
posted @ 2016-07-18 00:03 Commence 阅读(275) 评论(0) 推荐(0) 编辑
摘要:set的一个用法 。 difference找差集 union合并set intersection找到交集 阅读全文
posted @ 2016-07-17 19:44 Commence 阅读(150) 评论(0) 推荐(0) 编辑
摘要:题意: 给你一颗n(n<=10^5)个节点树根为1的树,然后进行dfs,求每个点,在dfs中被访问时间的期望。 我们求的就是starting_time[v]的期望pv。 题解: 我们来求一下节点2的期望。 1、我们知道我们要先通过2节点的父亲1才能到2。但2节点什么时候访问是不固定的。 我们假设ri 阅读全文
posted @ 2016-07-17 00:03 Commence 阅读(217) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示