10 2016 档案
摘要: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...
阅读全文
摘要: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...
阅读全文
摘要: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...
阅读全文
摘要:1 //寻找M S的数量 2017微软秋季校园招聘在线编程笔试 hihocoder 1402 MS Recognition 2 //看了讨论区写了一发 3 //套一下思路: 4 //有一个很简单的做法,一遍bfs找到一个端点,再一遍bfs找到另一个端点,然后把两个端点的中点和整个图形的重心比对一下,区分度非常大。具体来说就是比对一下端点中点到重心的距离,以及两个端点的距离的一半,...
阅读全文
摘要: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;...
阅读全文
摘要:1 // 洛谷1801 2 // 一个升序堆,一个降序堆 3 // 降序堆维护序列的前i个最小值 4 // 插如元素的时候,如果x小于降序堆最大值,则替换,并将最大值插入升序堆;否则,直接插入升序堆 5 // 每次输出升序堆的最小值即可 6 7 8 #include 9 using namespace std; 10 #define LL long long 11 ty...
阅读全文
摘要: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...
阅读全文