摘要: http://www.ifrog.cc/acm/problem/1097?contest=1013&no=1 阅读全文
posted @ 2017-03-05 09:32 yyblues 阅读(283) 评论(0) 推荐(0) 编辑
摘要: 1 //SPOJ - UOFTCG 树的最小路径覆盖 2 3 #include 4 #include 5 using namespace std; 6 #define ll long long 7 const int mod = 1e9+7; 8 const int maxn=510; 9 const int N = 1e5+10; 10 int cnt; 11 int ... 阅读全文
posted @ 2017-02-25 14:41 yyblues 阅读(426) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 using namespace std; 3 #define LL long long 4 typedef pair pii; 5 const int inf = 0x3f3f3f3f; 6 const int N =1e6+10; 7 const int MOD = 1e9+7; 8 #define clc(a,b) memset(a,b,sizeo... 阅读全文
posted @ 2016-11-02 23:33 yyblues 阅读(275) 评论(0) 推荐(0) 编辑
摘要: 1 //codeforces 559C|51nod1486 Gerald and Giant Chess(组合数学+逆元) 2 3 #include 4 using namespace std; 5 #define LL long long 6 typedef pair pii; 7 const int inf = 0x3f3f3f3f; 8 const int N =2e5... 阅读全文
posted @ 2016-10-24 12:02 yyblues 阅读(259) 评论(0) 推荐(0) 编辑
摘要: 1 //UVALive7461 - Separating Pebbles 判断两个凸包相交 2 3 #include 4 using namespace std; 5 #define LL long long 6 typedef pair pii; 7 const int inf = 0x3f3f3f3f; 8 const int N =1e5+10; 9... 阅读全文
posted @ 2016-10-22 14:32 yyblues 阅读(895) 评论(0) 推荐(0) 编辑
摘要: 1 // CF 732F Tourist Reform 2 // 思路:两遍tarjan 3 // 找强联通分量 4 #include 5 using namespace std; 6 #define LL long long 7 typedef pair pii; 8 const int inf = 0x3f3f3f3f; 9 const int N =41e5+10; 1... 阅读全文
posted @ 2016-10-20 20:02 yyblues 阅读(338) 评论(0) 推荐(0) 编辑
摘要: 1 //寻找M S的数量 2017微软秋季校园招聘在线编程笔试 hihocoder 1402 MS Recognition 2 //看了讨论区写了一发 3 //套一下思路: 4 //有一个很简单的做法,一遍bfs找到一个端点,再一遍bfs找到另一个端点,然后把两个端点的中点和整个图形的重心比对一下,区分度非常大。具体来说就是比对一下端点中点到重心的距离,以及两个端点的距离的一半,... 阅读全文
posted @ 2016-10-11 22:50 yyblues 阅读(1362) 评论(0) 推荐(0) 编辑
摘要: 1 //二分判定 覆盖问题 BZOJ 1052 2 // 首先确定一个最小矩阵包围所有点,则最优正方形的一个角一定与矩形一个角重合。 3 // 然后枚举每个角,再解决子问题 4 5 #include 6 using namespace std; 7 #define LL long long 8 typedef pair pii; 9 const int inf = 1e9;... 阅读全文
posted @ 2016-10-04 23:26 yyblues 阅读(395) 评论(0) 推荐(0) 编辑
摘要: 1 // 洛谷1801 2 // 一个升序堆,一个降序堆 3 // 降序堆维护序列的前i个最小值 4 // 插如元素的时候,如果x小于降序堆最大值,则替换,并将最大值插入升序堆;否则,直接插入升序堆 5 // 每次输出升序堆的最小值即可 6 7 8 #include 9 using namespace std; 10 #define LL long long 11 ty... 阅读全文
posted @ 2016-10-03 22:55 yyblues 阅读(1950) 评论(0) 推荐(0) 编辑
摘要: 1 //fwt优化+树形DP HDU 5909 2 //见官方题解 3 // BestCoder Round #88 http://bestcoder.hdu.edu.cn/ 4 5 #include 6 // #include 7 // #include 8 // #include 9 // #include 10 // #include 11 // #incl... 阅读全文
posted @ 2016-10-03 16:43 yyblues 阅读(277) 评论(0) 推荐(0) 编辑