上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 30 下一页
摘要: 分析:http://blog.csdn.net/chenzhenyu123456/article/details/51308460 #include <cstdio> #include <cstring> #include <queue> #include <set> #include <map> 阅读全文
posted @ 2016-05-04 14:03 shuguangzw 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 思路:正好是二分图,自己敌人,符合条件的随从二人组建边,最大匹配为n是符合要求 #include <cstdio> #include <cstring> #include <queue> #include <set> #include <map> #include <stack> #include 阅读全文
posted @ 2016-05-03 23:05 shuguangzw 阅读(159) 评论(0) 推荐(0) 编辑
摘要: #include <cstdio> #include <cstring> #include <queue> #include <set> #include <stack> #include <cstdlib> #include <algorithm> #include <time.h> #inclu 阅读全文
posted @ 2016-05-03 18:06 shuguangzw 阅读(253) 评论(0) 推荐(0) 编辑
摘要: 关键在建图 题解:http://www.cnblogs.com/crackpotisback/p/4856159.html 学习:http://www.cnblogs.com/jackiesteed/articles/2043934.html 阅读全文
posted @ 2016-05-02 15:31 shuguangzw 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 这个题一上来 没有思路,后来想没有思路就二分吧 那么我们来二分 首先,大于当前的mid值的关系,不能出现在一个集合里 (即关系形成的图是一个二分图,判定二分图可以二染色) 如果不能形成二分图,那么说明有些关系要在一个集合里,那就向上二分 否则向下二分 #include<cstdio> #includ 阅读全文
posted @ 2016-05-01 20:58 shuguangzw 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 水题 #include<cstdio> #include<cstring> #include<queue> #include<set> #include<cstdlib> #include<algorithm> #include<vector> #include<cmath> using names 阅读全文
posted @ 2016-05-01 17:40 shuguangzw 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 分析:对于给出的n个询问,每次求有多少个数对(x,y),满足a≤x≤b,c≤y≤d,且gcd(x,y) = k,gcd(x,y)函数为x和y的最大公约数。 然后对于求这样单个的gcd(x,y)=k的,我们通常采用莫比乌斯反演 但是,时间复杂度是O(n*(n/k))的,当复杂度很坏的时候,当k=1时, 阅读全文
posted @ 2016-04-27 21:42 shuguangzw 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 分析:http://www.cnblogs.com/huhuuu/archive/2011/11/25/2263803.html 注:从这个题收获了两点 1,第一象限(x,y)到(0,0)的线段上整点的个数是gcd(x,y) 2,新学了一发求gcd(x,y)=k有多少对的姿势,已知0<x<=n,0< 阅读全文
posted @ 2016-04-27 20:40 shuguangzw 阅读(243) 评论(0) 推荐(1) 编辑
摘要: 分析:筛素数,然后枚举,莫比乌斯反演,然后关键就是分块加速(分块加速在上一篇文章) #include<cstdio> #include<cstring> #include<queue> #include<cstdlib> #include<algorithm> #include<vector> #i 阅读全文
posted @ 2016-04-27 19:18 shuguangzw 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 分析: http://blog.csdn.net/acdreamers/article/details/12871643 分析参见这一篇 http://wenku.baidu.com/view/fbe263d384254b35eefd34eb.html 分块看这一篇 #include<cstdio> 阅读全文
posted @ 2016-04-27 18:42 shuguangzw 阅读(150) 评论(0) 推荐(0) 编辑
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 30 下一页