poj 1064
来源:互联网 发布:java游戏破解版下载 编辑:程序博客网 时间:2024/06/05 20:40
二分题,不解释#include<iostream>#include<cstdlib>#include<cstdio>#include<cmath>using namespace std; int n,m;double a[10005];int solve(double x){int i,j;int sum=0;for(i=0;i<n;i++){sum+=int(a[i]/x);}return sum;}int main(){cin>>n>>m;int i,j;for(i=0;i<n;i++){cin>>a[i];}double l=0;double r = 100000;double mid;int ans;for(i=0;i<1000;i++){mid=(l+r)/2;ans=solve(mid);if(ans>=m){l=mid;}else{r=mid;}}printf("%.2f\n",floor(l*100)/100);}
0 0
- poj 1064
- POJ 1064
- POJ 1064
- poj-1064
- poj 1064
- poj---1064
- poj 1064
- POJ 1064
- POJ 1064
- POJ 1064
- 【POJ】1064
- poj 1064
- poj 1064 Cable master
- poj 1064 Cable master
- poj 1064 Cable master
- POJ 1064 Cable master
- 二分法 poj 1064
- poj 1064 Cable master
- IOS合并lib(.a)库的终极可用方法(可用于解决duplicate symbol静态库冲突)
- TextView显示更多和收起
- 设计模式---模板模式 实例
- 使用ReactiveCocoa初探MVVM
- Android双击返回键Activity的方法
- poj 1064
- 类Bitmap和Drawable
- model redirect
- ACE_Message_Queue编码注意问题点
- 剪贴板操作
- Android让按钮或控件圆角让被景圆圈
- 利用共享内存来恢复玩家数据
- 【转载】IOS 入门开发之创建第一个应用程序(一)
- 无限的路