二分
SSShigH
站在巨人的肩膀上看世界
展开
-
Need for Speed
对于这道题,当时wa了很多次,当我在while循环里面取mid的时候,就wa,当把mid先放在外面取的时候就过了#include <iostream> #include <cstdio> #include <algorithm> using namespace std; int n; int d[1005],s[1005]; double t; bool c(d...原创 2018-03-23 21:02:54 · 171 阅读 · 0 评论 -
hdu 2141 Can you find it?
对于这道题,当时在程序挑战竞赛这本书上看到过类似的他的优化就是分治加二分,这道题也一样, 先把a,b两个数加起来进行优化#include <iostream> #include <cstdio> #include <algorithm> using namespace std; int L,M,N,k=1,s; int a[505],b[505],c[505],...原创 2018-03-23 21:17:49 · 75 阅读 · 0 评论 -
Aggressive cows poj2456
对于这道题的看法 二分答案 加上一点贪心二分搜索的是两头牛之间的最大能够达到的距离#include <iostream> #include <cstdio> #include <algorithm> using namespace std; int L,M,N,k=1,s; int a[505],b[505],c[505],kk[250005]; int ma...原创 2018-03-23 21:22:56 · 129 阅读 · 0 评论