POJ 3122(二分答案)
来源:互联网 发布:数据机房装修要求 编辑:程序博客网 时间:2024/05/09 02:48
二分答案……
Program pie;const lef=0.00001;var t,n,f,i,j:longint; r:array[1..10000] of longint; s:array[1..10000] of double; maxs:double;procedure sort(l,r:double);var m:real; i,j,tot:longint;begin m:=(l+r)/2; tot:=0; for i:=1 to n do inc(tot,trunc(s[i]/m)); if tot>=f then begin if r-l<lef then writeln(r:4:4) else sort(m,r); end else sort(l,m);end;begin read(t); while (t>0) do begin read(n,f); inc(f); for i:=1 to n do begin read(r[i]); s[i]:=sqr(r[i])*pi; end; maxs:=s[1]; for i:=2 to n do if maxs<s[i] then maxs:=s[i]; sort(0,maxs); dec(t); end;end.
- POJ 3122(二分答案)
- POJ 3122 Pie(二分答案)
- poj 3122 Pie 二分答案
- POJ 3122 Pie【二分答案】
- POJ 3122 Pie 二分答案
- POJ-3273(二分答案)
- [POJ 3122] Pie 二分答案+贪心
- poj 3258 River Hopscotch(二分答案)
- POJ 1064 Cable master (二分答案)
- [POJ 2976] Dropping tests (二分答案)
- poj 3258二分答案
- poj 3104 二分答案
- POJ 3273 二分答案
- [POJ 3579] Median (二分答案+二分查找)
- poj 3658 二分枚举答案。
- POJ 3104 Drying-二分答案
- POJ 1759 Garland 二分答案
- poj 3104 Drying 二分答案
- Ubuntu下FastDFS环境的安装搭建
- 蝴蝶兰与鳞托菊
- Android的图像处理类Bitmap
- 我回来了
- 使用Flash Cookie技术在客户端永久保存HTTP Cookie
- POJ 3122(二分答案)
- 三极管开关电路电容减速器
- josephus约瑟夫环问题变种 核心:求模运算 移动
- 第十五章 面向对象编程
- 有关羽毛球的英文术语
- Wifi小车方案——路由器篇
- 一个是阆苑仙葩,一个是美玉无瑕
- linux解决xhost: unable to open display
- WPF自定义控件快速构成窗体布局