上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 16 下一页
摘要: 选取不同列不同行的N个数。。。明摆着叫你二分匹配二分答案,然后枚举边的范围并跑匈牙利,以此判断答案范围。#include #include #include #include #include #include #include #define rep(i, l, r) for(int i=l; i... 阅读全文
posted @ 2015-03-17 21:05 NanoApe 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 先用染色法判断是否存在奇数环,也就是方案是否可行。然后二分匹配。#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) 编辑
摘要: 据网上说这是到差分约束四星题。。。可我觉得难吗?比推DP方程容易。。。两种约束方式,当然实现到程序就变成六种了。。。#include #include #include #include #include #include #include #include #define rep(i, l, r)... 阅读全文
posted @ 2015-03-15 00:10 NanoApe 阅读(214) 评论(0) 推荐(0) 编辑
摘要: 很容易发现约束条件:L#include #include #include #include #include #include #include #define rep(i, l, r) for(int i=l; i=r; i--)#define N 456#define MAX 1'9') { ... 阅读全文
posted @ 2015-03-15 00:07 NanoApe 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 四种约束条件。。照做就行了。。最长路建图。#include #include #include #include #include #include #include #include #define rep(i, l, r) for(int i=l; i=r; i--)#define N 1000... 阅读全文
posted @ 2015-03-15 00:02 NanoApe 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 差分约束。很容易看出两种约束方式,然后建图。而且题目要求排序不能乱,于是加上第三种约束。求最长就跑一遍最短路啊就行了。#include #include #include #include #include #include #include #include #define rep(i, l, r... 阅读全文
posted @ 2015-03-14 23:57 NanoApe 阅读(185) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 16 下一页
AmazingCounters.com