摘要: D分4种情况讨论1 不需要加边 , 就是说原本就有一个奇数环,我们只要跑一次二分图就好了2 加一条边 , 也就是说存在大于等于3个点的联通块 我们对于这个联通块也跑一遍二分图, 可以知道图中所有的 同颜色染色中的点任意相连,都是一个奇数环,那么对于每个联通分量都有相应的数可以计算3 加两条边,也就是... 阅读全文
posted @ 2015-09-15 22:31 来自大山深处的菜鸟 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 这题计算 一张图上 能走的 点对有多少个 对于每个限制边权 , 对每条边排序,对每个查询排序然后边做克鲁斯卡尔算法的时候变计算就好了#include #include #include #include #include #include using namespace std;const int ... 阅读全文
posted @ 2015-09-15 21:38 来自大山深处的菜鸟 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 题意初始给了 1 2 两个数第二步 因为第2个数是2 所以 在序列后面放上2个2 包括他自己之前有的 序列变成 1 2 2第三步 因为第3个数是2 所以 在序列后面放上2个3 就变成了 1 2 2 3 3第4步 第4个数为3 所以 在序列后面放上3个4 变成 1 2 2 3 3 4 4 4以此... 阅读全文
posted @ 2015-09-15 21:04 来自大山深处的菜鸟 阅读(139) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include using namespace std;const int maxn=20005;int MaxRepresstation(char * S, int len ) { int i = 0, j = 1... 阅读全文
posted @ 2015-09-15 17:00 来自大山深处的菜鸟 阅读(168) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include using namespace std;const int maxn=2000005;int MinRepresstation(char * S, int len ) { int i = 0, j =... 阅读全文
posted @ 2015-09-15 16:07 来自大山深处的菜鸟 阅读(180) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include using namespace std;const int maxn=10005;struct elem{ char str[105]; int len; bool operator = le... 阅读全文
posted @ 2015-09-15 15:35 来自大山深处的菜鸟 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 题意 一个人打比赛 ,rating 有p的概率 为加50分 有1-p的概率为 x-100分 最大值为 1000 最小值为0有两个号 每次拿较小的号来提交 , 计算最后到达 1000分得期望场数是多少,对每个状态建立一个方程然后用高斯消元解决#include #include #include #in... 阅读全文
posted @ 2015-09-15 10:51 来自大山深处的菜鸟 阅读(186) 评论(0) 推荐(0) 编辑