随笔分类 - 二分
摘要: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 // Codeforces Round #365 (Div. 2) 2 // C - Chris and Road 二分找切点 3 // 题意:给你一个凸边行,凸边行有个初始的速度往左走,人有最大速度,可以停下来,竖直走。 4 // 问走到终点的最短时间 5 // 思路: 6 // 1.贪心来做 7 // 2.我觉的二分更直观 8 // 可以抽象成:一条射线与凸边行相交,判断...
阅读全文
摘要:http://codeforces.com/contest/702 题意:n个村庄,m个机站,问机站最短半径覆盖完所有村庄 思路:直接二分答案 二分太弱,调了半天。。。。。
阅读全文
摘要:A 脑筋急转弯 1 // #pragma comment(linker, "/STACK:1024000000,1024000000") 2 #include <iostream> 3 #include <cstdio> 4 #include <cstring> 5 #include <sstrea
阅读全文
摘要:二分答案 下等:a-x 中等:b-x 上等:c 1 // #pragma comment(linker, "/STACK:1024000000,1024000000") 2 #include <iostream> 3 #include <cstdio> 4 #include <cstring> 5
阅读全文