摘要: 先用染色法判断是否存在奇数环,也就是方案是否可行。然后二分匹配。#include #include #include #include #include #include #include #define rep(i, l, r) for(int i=l; i=r; i--)#define N 23... 阅读全文
posted @ 2015-03-16 20:37 NanoApe 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 行列二分匹配。位于重要点的判断,删边后再判断最大匹配是否变小。#include #include #include #include #include #include #include #define rep(i, l, r) for(int i=l; i=r; i--)#define N 123... 阅读全文
posted @ 2015-03-16 20:35 NanoApe 阅读(187) 评论(0) 推荐(0) 编辑
摘要: Prufer编码的应用。懒的写质因数分解,直接高精度。注意当n=1的特殊情况的处理。#include #include #include #include #include #include #include #define rep(i, l, r) for(int i=l; i=r; i--)#d... 阅读全文
posted @ 2015-03-16 20:31 NanoApe 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 还是Prufer编码的应用。这次我们不再限制各个点的度数,那么在Prufer编码中每个位置都用N中选择,Prufer编码的种类就有n^(n-2)可能,再加上每棵树有(n-1)!的交友顺序,相乘就是答案了。其实前者的n^(n-2)也叫做Cayley定理。#include #define rep(i, ... 阅读全文
posted @ 2015-03-16 20:20 NanoApe 阅读(138) 评论(0) 推荐(0) 编辑
摘要: Prufer编码练习题,这个编码是跟树的生成计数有关系的。推荐这篇博文:http://www.cnblogs.com/zhj5chengfeng/archive/2013/08/23/3278557.html介绍地挺全面+生动形象会了Prufer之后这道题还要用上组合数学来高精度计算。#includ... 阅读全文
posted @ 2015-03-16 20:16 NanoApe 阅读(148) 评论(0) 推荐(0) 编辑
AmazingCounters.com