
查找
一只会旅行的猫
这个作者很懒,什么都没留下…
展开
-
hdu 1969 Pie
http://acm.hdu.edu.cn/showproblem.php?pid=1969 题意:“我”要将我拥有的n个不同大小的pie分给f+1(自己),求每人能得到的最大pie的面积,注意只能由一块饼分得,不能拼接 分析:二分查找,判断每次的面积变化是否能满足人数需求 #include #include #include using namespace std; const doub原创 2013-08-20 21:48:55 · 490 阅读 · 0 评论 -
hdu 2141 Can you find it ?
#include #include #include using namespace std; const int NM=505; __int64 a[NM],b[NM],c[NM],num[NM*NM]; int main() { __int64 L,N,M,i,j,flag,t,n,ans,mid,low,high,T; ans=1; whi原创 2013-08-20 19:55:40 · 526 阅读 · 0 评论 -
hdu 4004 The Frog's Games
http://acm.hdu.edu.cn/showproblem.php?pid=4004 分析:二分查找+贪心(哎) #include #include #include using namespace std; const int NM=500005; int a[NM],n,m; bool Stone(int mid) { int k,t,i,j; i=1;j=k=原创 2013-08-22 20:17:52 · 549 阅读 · 0 评论 -
hdu 2298 Toxophily
http://acm.hdu.edu.cn/showproblem.php?pid=2298 分析:斜抛运动:http://baike.baidu.com/link?url=JYIT2a6cWniYW7UfTHTYFOxf_B-D2noUxnLIRTRTrydpixDeq8s_mGvdH7N1hfre 斜抛运动轨迹方程式:y=xtanθ-gx^2/2(v0cosθ)^2,其中x:某时刻该点水平原创 2013-08-22 22:54:43 · 614 阅读 · 0 评论 -
poj 2456 Aggressive cows
http://poj.org/problem?id=2456 题意:在n个位置放置c只牛,使得每只牛之间的间距最大,求满足条件的最小间距? #include #include #include #include using namespace std; const int NM=100005; int a[NM],n,c; //判断在整个长槽内,间距>=x,是否可以放下原创 2014-02-19 18:12:22 · 527 阅读 · 0 评论 -
三分查找
求函数的最值,1)函数是否单调?(可直接用二分) 如:hdu 2199 http://acm.hdu.edu.cn/showproblem.php?pid=2199 这是一个单调递增函数,判断取值范围, if(Y(100.0)y) printf("No solution!\n"); 然后,寻找可替换的二分区间 low=0.0,high=100.0; while(high-原创 2013-06-03 22:39:39 · 689 阅读 · 0 评论