青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

poj1064

Cable master
Time Limit: 1000MS Memory Limit: 10000K
Total Submissions: 15127 Accepted: 3200

Description

Inhabitants of the Wonderland have decided to hold a regional programming contest. The Judging Committee has volunteered and has promised to organize the most honest contest ever. It was decided to connect computers for the contestants using a "star" topology - i.e. connect them all to a single central hub. To organize a truly honest contest, the Head of the Judging Committee has decreed to place all contestants evenly around the hub on an equal distance from it.
To buy network cables, the Judging Committee has contacted a local network solutions provider with a request to sell for them a specified number of cables with equal lengths. The Judging Committee wants the cables to be as long as possible to sit contestants as far from each other as possible.
The Cable Master of the company was assigned to the task. He knows the length of each cable in the stock up to a centimeter,and he can cut them with a centimeter precision being told the length of the pieces he must cut. However, this time, the length is not known and the Cable Master is completely puzzled.
You are to help the Cable Master, by writing a program that will determine the maximal possible length of a cable piece that can be cut from the cables in the stock, to get the specified number of pieces.

Input

The first line of the input file contains two integer numb ers N and K, separated by a space. N (1 = N = 10000) is the number of cables in the stock, and K (1 = K = 10000) is the number of requested pieces. The first line is followed by N lines with one number per line, that specify the length of each cable in the stock in meters. All cables are at least 1 meter and at most 100 kilometers in length. All lengths in the input file are written with a centimeter precision, with exactly two digits after a decimal point.

Output

Write to the output file the maximal length (in meters) of the pieces that Cable Master may cut from the cables in the stock to get the requested number of pieces. The number must be written with a centimeter precision, with exactly two digits after a decimal point.
If it is not possible to cut the requested number of pieces each one being at least one centimeter long, then the output file must contain the single number "0.00" (without quotes).

Sample Input

4 11
            8.02
            7.43
            4.57
            5.39

Sample Output

2.00

Source

坑爹的水題,

精度,精度!


code

#include <cstdio>
#include 
<cstdlib>
#include 
<cstring>
#include 
<cmath>
#include 
<ctime>
#include 
<cassert>
#include 
<iostream>
#include 
<sstream>
#include 
<fstream>
#include 
<map>
#include 
<set>
#include 
<vector>
#include 
<queue>
#include 
<algorithm>
#include 
<iomanip>
#define maxn 10005
using namespace std;
int n,k;
double a[maxn];
int b[maxn];
double mlen;
double max(double a,double b)
{
    
return a>b?a:b;
}
int getnum(__int64 x)
{
    
int tot;
    
if(x==0return 100000;
    tot
=0;
    
for(int i=1; i<=n; i++) tot+=b[i]/x;
    
return tot;
}
int main()
{
    scanf(
"%d%d",&n,&k);
    __int64 sum;
    mlen
=-1;
    
for(int i=1; i<=n; i++)
    {
        scanf(
"%lf",&a[i]);
        mlen
=max(mlen,a[i]);
        b[i]
=(a[i]+0.005)*100;
        sum
+=b[i];
    }
    
if(sum<k)
    {
        printf(
"0.00\n");
        
return 0;
    }
    __int64 left,right,mid;
    left
=0;
    right
=(int)((mlen+0.005)*100);
    
while(right-left>0)
    {
       
// printf("%d %d\n",left,right);
        mid=(left+right)/2+1;
        
if(getnum(mid)>=k)
            left
=mid;
        
else right=mid-1;
    }
    
//printf("%d\n",mid);
    printf("%.2lf\n",double(right)/100.0);
    
return 0;
}

posted on 2012-08-02 16:54 jh818012 閱讀(1575) 評論(0)  編輯 收藏 引用


只有注冊用戶登錄后才能發(fā)表評論。
網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


<2025年11月>
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456

導(dǎo)航

統(tǒng)計

常用鏈接

留言簿

文章檔案(85)

搜索

最新評論

  • 1.?re: poj1426
  • 我嚓,,輝哥,,居然搜到你的題解了
  • --season
  • 2.?re: poj3083
  • @王私江
    (8+i)&3 相當(dāng)于是 取余3的意思 因為 3 的 二進制是 000011 和(8+i)
  • --游客
  • 3.?re: poj3414[未登錄]
  • @王私江
    0ms
  • --jh818012
  • 4.?re: poj3414
  • 200+行,跑了多少ms呢?我的130+行哦,你菜啦,哈哈。
  • --王私江
  • 5.?re: poj1426
  • 評論內(nèi)容較長,點擊標題查看
  • --王私江
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            亚洲欧美精品一区| 久久综合九九| 欧美一级久久| 一区二区三区视频观看| 黄色影院成人| 1024国产精品| 亚洲精选久久| 亚洲一区二区黄色| 亚洲一级高清| 久久夜色精品国产亚洲aⅴ| 久久精品视频在线| 久久久中精品2020中文| 久久精品中文字幕一区| 久久亚洲欧洲| 亚洲日本欧美在线| 欧美福利专区| 日韩亚洲综合在线| 久久gogo国模裸体人体| 欧美成人精品影院| 国产精品国产三级国产普通话三级| 国产欧美日韩综合一区在线观看 | 久久精品30| 欧美电影资源| 国产日韩亚洲欧美| 亚洲国产精品999| 亚洲调教视频在线观看| 久久成人18免费网站| 亚洲国产日韩欧美在线动漫| 亚洲字幕一区二区| 麻豆成人综合网| 国产精品爽爽ⅴa在线观看| 亚洲国内精品| 久久精品国产视频| 久久久精品久久久久| 亚洲第一伊人| 欧美在线亚洲在线| 国产精品扒开腿爽爽爽视频 | 欧美日韩免费在线| 黄色成人小视频| 亚洲午夜黄色| 亚洲激情视频在线| 久久精品日产第一区二区三区 | 久久精品72免费观看| 国产精品都在这里| 夜夜嗨av色一区二区不卡| 欧美在线日韩在线| 欧美成人一区二区在线| 欧美专区在线| 国产一区二区你懂的| 亚洲欧美日韩国产成人| 亚洲黄色尤物视频| 欧美91福利在线观看| 激情六月婷婷久久| 久久美女艺术照精彩视频福利播放| 亚洲视频在线一区| 国产精品高精视频免费| 99精品热6080yy久久| 亚洲黄色一区| 欧美日韩成人激情| 一本久久青青| 亚洲国产精品成人综合| 免费在线观看成人av| 在线观看亚洲a| 美女日韩在线中文字幕| 久久久久久久久久久久久9999 | 亚洲三级视频| 亚洲国产成人久久综合| 欧美激情视频一区二区三区免费| 亚洲欧洲日本国产| 亚洲日本在线观看| 欧美日韩四区| 午夜精品久久久久久久久久久久| 亚洲一区二区三区在线观看视频 | 亚洲激情网站免费观看| 欧美激情在线观看| 欧美裸体一区二区三区| 夜夜嗨av一区二区三区中文字幕 | 男人的天堂成人在线| 亚洲国产日韩在线| 亚洲精品久久久久久久久久久| 欧美日韩国产精品| 香蕉久久夜色精品| 久久久成人精品| 亚洲精品欧美日韩专区| 夜夜爽www精品| 国产午夜精品美女视频明星a级 | 亚洲女女女同性video| 黄色欧美成人| 亚洲精品网址在线观看| 国产欧亚日韩视频| 欧美成人免费在线观看| 欧美视频在线一区| 免费不卡在线视频| 国产精品video| 理论片一区二区在线| 欧美日韩国产探花| 久久视频在线视频| 欧美日韩亚洲在线| 蜜桃av综合| 国产精品欧美久久| 亚洲国产精品va在线看黑人| 国产精一区二区三区| 亚洲国产精品欧美一二99| 国产欧美日韩一区二区三区在线观看| 欧美成人影音| 国产亚洲欧美日韩日本| 日韩视频在线一区| 伊人狠狠色丁香综合尤物| 99国产精品私拍| 亚洲激情校园春色| 久久黄色小说| 欧美中文字幕在线| 欧美午夜不卡影院在线观看完整版免费| 久久久久中文| 国产九九视频一区二区三区| 亚洲精品视频在线观看免费| 伊人久久大香线蕉综合热线 | 亚洲精品资源| 久久国产精品72免费观看| 亚洲欧美日韩综合| 欧美日本二区| 欧美激情欧美激情在线五月| 国产视频在线观看一区| 一区二区三区国产在线观看| 亚洲精品老司机| 久久视频免费观看| 久久久精品久久久久| 国产精品自拍网站| 亚洲综合色丁香婷婷六月图片| 在线亚洲自拍| 欧美精品日韩www.p站| 亚洲第一在线| 亚洲精品视频在线播放| 欧美暴力喷水在线| 亚洲电影免费观看高清完整版在线观看 | 狠狠色丁香婷婷综合影院| 亚洲视频图片小说| 亚洲天堂男人| 欧美日韩另类在线| av成人福利| 亚洲欧美日韩国产成人| 国产精品视屏| 欧美一区二区啪啪| 久久琪琪电影院| 伊人成人网在线看| 免费欧美在线视频| 亚洲激情成人在线| 亚洲精品美女在线观看播放| 欧美黄色日本| 中文无字幕一区二区三区| 亚洲自拍偷拍一区| 国产精品日日摸夜夜摸av| 亚洲一品av免费观看| 欧美一区2区三区4区公司二百| 国产欧美日本一区二区三区| 欧美在线一二三区| 欧美激情综合| 亚洲综合成人婷婷小说| 国产欧美一区二区在线观看| 久久夜色精品国产噜噜av| 亚洲区在线播放| 午夜日本精品| 亚洲国产精品视频| 欧美亚一区二区| 亚洲欧美日韩国产综合在线| 久久在线免费观看| 一本色道久久综合亚洲二区三区| 国产精品裸体一区二区三区| 久久成人18免费网站| 亚洲成色www久久网站| 亚洲淫性视频| 精品成人一区| 欧美日韩亚洲91| 欧美一级理论片| 91久久久久久久久久久久久| 亚洲欧美在线另类| 一区免费视频| 欧美日韩在线电影| 久久乐国产精品| 亚洲三级毛片| 老**午夜毛片一区二区三区| 91久久国产综合久久| 国产精品一区二区久久精品 | 欧美激情一区三区| 欧美一区在线视频| 日韩视频免费观看| 久久免费视频在线观看| 亚洲桃花岛网站| 在线播放不卡| 国产精品亚洲网站| 欧美激情综合五月色丁香小说 | 欧美性色aⅴ视频一区日韩精品| 99国产精品久久久久久久久久| 久久精品一区二区三区四区 | 老司机成人网| 一区二区三区四区蜜桃| 久久综合色88| 欧美一区二区三区免费看| 亚洲日韩视频| 国产视频一区在线|