acm-二分搜索
星空永恒&&卡利达
这个作者很懒,什么都没留下…
展开
-
hdu 1969 pie
#include#include#includeusing namespace std;int main(){ double v[11000],pi; int n,f,ri; int i; int t; pi=4.0*atan(1.0); scanf("%d",&t); while(t--) { scanf("%d%d",&n,&f); for(i=0;i<=n原创 2016-02-11 09:20:23 · 286 阅读 · 0 评论 -
hdu 2178 猜数字
#include#include#includeint main(){ long long n,sum; int t; scanf("%d",&t); while(t--) { scanf("%lld",&n); sum=pow(2,n)-1; printf("%lld\n",sum); } return 0;}原创 2016-02-11 09:21:27 · 336 阅读 · 0 评论 -
hdu 1551 Cable master
#include#includeusing namespace std;int n,k;double len[10010];/*int judge(double s){ int cnt=0; for(int i=1;i<=n;i++) { cnt+=(int)(len[i]/s); } if(cnt>=k) return 1; else return 0;}原创 2016-02-05 20:54:27 · 300 阅读 · 0 评论 -
light oj 1297 Largest Box
#include#include#include#includeusing namespace std;double l,w;double g(double x){ return 12*x*x-4*(l+w)*x+l*w;}int main(){ int t; double left,right,mid; int k=1; scanf("%d",&t); whi原创 2016-02-16 19:19:19 · 275 阅读 · 0 评论 -
hdu 2199 Can you solve this equation?
#include#include#includedouble r,m,l;double Y;int t;double f( double x ){ return 8*pow(x, 4.0) + 7*pow(x, 3.0) + 2*pow(x, 2.0) + 3*x + 6;}int main(){ scanf("%d",&t); while(t--) {原创 2016-02-04 17:58:52 · 290 阅读 · 0 评论 -
hdu 2899 Strange fuction
#include//记得求导 #include#include#include int t; double y; double r,m,l; double ans;double f1(double x){ return 42*pow(x,6.0)+48*pow(x,5.0)+21*pow(x,2.0)+10*x-y;}double f2(double x){ retu原创 2016-02-04 18:24:50 · 265 阅读 · 0 评论 -
poj 2549 Sumsets (枚举+二分)
SumsetsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 10026 Accepted: 2743DescriptionGiven S, a set of integers, find the largest d such that a + b + c转载 2016-03-31 21:06:44 · 461 阅读 · 0 评论