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

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)  編輯 收藏 引用


只有注冊用戶登錄后才能發表評論。
網站導航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


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

導航

統計

常用鏈接

留言簿

文章檔案(85)

搜索

最新評論

  • 1.?re: poj1426
  • 我嚓,,輝哥,,居然搜到你的題解了
  • --season
  • 2.?re: poj3083
  • @王私江
    (8+i)&3 相當于是 取余3的意思 因為 3 的 二進制是 000011 和(8+i)
  • --游客
  • 3.?re: poj3414[未登錄]
  • @王私江
    0ms
  • --jh818012
  • 4.?re: poj3414
  • 200+行,跑了多少ms呢?我的130+行哦,你菜啦,哈哈。
  • --王私江
  • 5.?re: poj1426
  • 評論內容較長,點擊標題查看
  • --王私江
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
            一区二区三区高清视频在线观看| 欧美特黄一级大片| 精品粉嫩aⅴ一区二区三区四区| 亚洲精品国产欧美| 国产精品一区二区三区四区五区| 一本色道久久88精品综合| 亚洲男女自偷自拍| 国产欧美日韩一区二区三区在线 | 亚洲在线成人| 久久精品国产91精品亚洲| 亚洲第一在线视频| 亚洲激情啪啪| 亚洲女女做受ⅹxx高潮| 亚洲香蕉视频| 国产精品久久久久久户外露出| 在线亚洲精品福利网址导航| 亚洲欧美日韩第一区| 国产精品综合av一区二区国产馆| 亚洲欧美日韩天堂一区二区| 久久久999精品免费| 伊人成综合网伊人222| 麻豆久久久9性大片| 亚洲欧洲视频在线| 亚洲自啪免费| 国产欧美日韩亚洲一区二区三区| 欧美在线观看一二区| 麻豆精品精华液| 91久久中文| 欧美色综合天天久久综合精品| 亚洲影视在线| 欧美91大片| 亚洲一区二区免费| 国产婷婷色一区二区三区在线| 久久精品亚洲热| 亚洲欧洲一级| 久久成人免费日本黄色| 在线免费观看欧美| 欧美日韩免费在线视频| 欧美亚洲三区| 亚洲丰满在线| 亚洲自拍偷拍网址| 亚洲高清久久网| 国产精品xxx在线观看www| 久久xxxx精品视频| 亚洲精品免费网站| 久久久免费精品视频| 亚洲精品孕妇| 国产一区再线| 欧美日韩精品一区二区天天拍小说 | 欧美大片免费看| 亚洲一区二区三区乱码aⅴ蜜桃女| 国产日韩在线看| 欧美精品在线免费| 久久精品二区三区| 99热精品在线观看| 麻豆成人91精品二区三区| 一区二区久久| 尤物yw午夜国产精品视频| 欧美三区在线| 欧美成人午夜激情视频| 欧美一二三视频| 亚洲另类视频| 欧美在线综合| 老鸭窝毛片一区二区三区| 一个色综合导航| 精久久久久久| 国产精品日日摸夜夜添夜夜av| 久久免费精品日本久久中文字幕| 亚洲一二三区在线| 亚洲精品乱码视频| 欧美成人精品福利| 久久精品国产精品| 亚洲欧美国产高清va在线播| 亚洲精品在线电影| 一色屋精品视频在线看| 国产伦精品免费视频| 欧美日韩在线观看视频| 欧美激情1区2区3区| 毛片av中文字幕一区二区| 欧美一区二区免费视频| 亚洲欧美日韩视频一区| 亚洲天天影视| 一区二区三区日韩欧美| 亚洲精品色婷婷福利天堂| 欧美激情一区二区三区四区| 老司机67194精品线观看| 久久se精品一区二区| 午夜精品久久| 午夜精品亚洲一区二区三区嫩草| 亚洲午夜av在线| 一区二区三区国产| 亚洲久久成人| 亚洲精品色图| 日韩午夜免费视频| 日韩视频免费观看| 亚洲精品免费电影| 最新国产拍偷乱拍精品| 亚洲国产成人高清精品| 在线观看免费视频综合| 亚洲成人原创| 亚洲电影视频在线| 亚洲高清视频在线| 亚洲欧洲精品一区二区三区不卡| 亚洲电影免费观看高清完整版在线 | 一本色道久久综合亚洲二区三区| 亚洲国产精品国自产拍av秋霞| 美女精品自拍一二三四| 男女激情视频一区| 欧美电影免费观看高清完整版| 欧美成人免费在线视频| 亚洲激情视频在线播放| 夜夜嗨av色一区二区不卡| 一区二区三区蜜桃网| 午夜精品福利在线观看| 久久精品国产v日韩v亚洲| 久久婷婷国产综合精品青草| 久久综合导航| 欧美精品啪啪| 国产精品久久久久久久app | 欧美jizzhd精品欧美巨大免费| 久久综合狠狠综合久久综青草 | 欧美成人免费播放| 欧美黄免费看| 欧美日韩视频在线| 国产精品美女久久久久久久| 国产日本亚洲高清| 亚洲二区精品| 中国女人久久久| 亚洲欧美日韩国产成人精品影院| 欧美一区二区三区四区视频| 久久综合网色—综合色88| 欧美激情一区二区三区全黄| 亚洲美洲欧洲综合国产一区| 亚洲在线观看免费视频| 久久精品人人| 欧美日韩一卡| 国产欧美亚洲视频| 欧美成人按摩| 亚洲电影免费观看高清完整版| 亚洲乱码久久| 久久精品电影| 欧美激情国产精品| 国产日韩精品视频一区| 亚洲国产乱码最新视频| 亚洲视频一区二区在线观看 | 久久精品成人| 欧美高清视频免费观看| 一本大道久久a久久精二百| 欧美影院成人| 欧美日韩亚洲激情| 亚洲第一综合天堂另类专| 亚洲欧美一区二区在线观看| 麻豆91精品| 亚洲欧美欧美一区二区三区| 另类国产ts人妖高潮视频| 国产精品午夜av在线| 亚洲三级影院| 久久综合狠狠综合久久综青草| 日韩视频免费观看高清在线视频 | 亚洲综合999| 猛干欧美女孩| 红桃视频欧美| 亚洲欧美久久久| 亚洲人成免费| 久久爱www| 国产精一区二区三区| 一本大道av伊人久久综合| 免费欧美电影| 亚洲欧美精品一区| 欧美性一区二区| 99综合精品| 欧美国产视频一区二区| 欧美尤物巨大精品爽| 国产精品国产三级国产aⅴ浪潮| 亚洲日本精品国产第一区| 久久免费视频这里只有精品| 亚洲婷婷免费| 欧美婷婷久久| 一区二区欧美在线观看| 亚洲成人在线网站| 久久久久久久久久久成人| 国产婷婷一区二区| 欧美在线观看视频一区二区| 在线一区二区三区四区| 欧美日韩亚洲三区| 亚洲图片欧美午夜| 日韩一区二区精品| 欧美日韩免费观看一区三区| 日韩午夜激情| 日韩一级黄色av| 欧美巨乳在线| 一本久道久久综合婷婷鲸鱼| 亚洲黄色成人网| 欧美国产在线观看| 99国产精品一区| 亚洲精品久久久久久久久久久久久| 欧美成人精品激情在线观看| 亚洲欧洲一区| 亚洲精品日韩在线| 欧美日韩亚洲一区二区|