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

oyjpArt ACM/ICPC算法程序設計空間

// I am new in programming, welcome to my blog
I am oyjpart(alpc12, 四城)
posts - 224, comments - 694, trackbacks - 0, articles - 6

終于發現自己G題Accelarator的錯誤了 找了好久好久 就這個錯誤 讓我在整個后半段的比賽中幾乎廢掉了 太不應該了!
吸取教訓!在場上出現自己無法找出錯誤的情況 應該要讓隊友重寫

#include <stdio.h>
#include <string.h>
#include <math.h>

const int N = 100010;
int d[N];
__int64 d2[N];
int na, av, np;

bool check(int x) {
 int i;
 for(i = 0; i < np; i++) d2[i] = d[i];
 for(i = 0; i < np; i++) d2[i] -= x;
 int cnt = 0;
 __int64 rest = na*x; 左邊寫了__int64 右邊卻忘記轉成__int64了
 for(i = 0; i<np; i++) {
  if(d2[i] > 0) {
   if(av <= 0) return false;
   __int64 need = (d2[i]-1)/av + 1;
   if(need > rest || need > x) return false;
   rest -= need;
  }
 }
 return 1;
}

int main() {
 int ntc, i;
 scanf("%d", &ntc);
 while(ntc--) {
  scanf("%d", &np);
  int _max = -1;
  for(i = 0; i<np; i++) {
   scanf("%d", d + i);
   if(d[i] > _max) _max = d[i];
  }
  scanf("%d %d", &na, &av);
  av--;
  int lo = 0, hi = _max;
  while(lo < hi) {
   int mid = lo + (hi-lo)/2;
   if(check(mid)) hi = mid;
   else lo = mid+1;
  }
  if(check(lo)) printf("%d\n", lo);
 }
 return 0;
}

  
Accelerator
Time Limit:4000MS  Memory Limit:65536K
Total Submit:811 Accepted:142

Description


Shiming (alpc02) is a boy likes to play PopKart very much. He is a good rider in this game. And one day he thought that he became a team leader of a team of N Kart riders.

Today, after the game begins, the riders of his team are now at different places at the racetrack, for that some of the riders got some short cut.

However, we know actually how long has each rider left to run along, and they will ride actually one meter per one time unit (maybe 10ms).

Luckily, Shiming now gets M accelerators, the accelerator can help one rider to ride k meters per one time unit. And all the accelerators are as the same. But one rider can't use more than one accelerator at one time unit.

Shiming is the team leader, and he wants all the team members to finish in the minimal time not just the fastest one to finish the race. He will distribute all the accelerators to the riders.

Note: Here some rules are not as the same as the game we played. At a time unit, Shiming distributes the accelerators to riders for one rider one accelerator, and at the next time unit, all the accelerator can be reused, and Shiming can re-distributes all the accelerators to riders also for one rider one accelerator and the distribution is no relationship with the last time unit.

So you will program to help Shiming to get the actually minimal time the team will use to finish the race.


Input


The input file has T (1<T<20) test cases, and the first line of the file will show the T.

Each of test cases, will be the N (1<= N <= 100000) rider, and N numbers Ai (1<= Ai <= 10^8) show how long will the rider have to finish the race. And the M and the K (1<= K*M <=10^8) for the accelerators.


Output
For each of test cases print a single integer on a single line, the minimal possible number of time units required to finish the race all team.

Sample Input


2
3
2 3 9
1 5
3
2 3 6
1 5


Sample Output


3
2

Feedback

# re: 終于發現自己G題Accelarator的錯誤了  回復  更多評論   

2007-05-10 22:29 by
bless,我也是錯在這個上。

# re: 終于發現自己G題Accelarator的錯誤了  回復  更多評論   

2007-05-11 12:25 by oyjpart
這么巧啊 同bless
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
            一区二区三区.www| 国产一级一区二区| 亚洲欧洲日韩综合二区| 久久夜色精品国产欧美乱| 久久动漫亚洲| 在线成人www免费观看视频| 久久九九免费| 久久久青草青青国产亚洲免观| 国产日韩精品在线观看| 美女图片一区二区| 欧美欧美在线| 欧美在线网站| 欧美成人国产| 亚洲一区二区综合| 午夜视频精品| 99re热这里只有精品视频| 亚洲午夜久久久| 狠狠干综合网| 亚洲精品少妇30p| 国产在线精品成人一区二区三区| 亚洲女性喷水在线观看一区| 一区二区电影免费观看| 伊人久久av导航| 亚洲欧洲精品一区二区三区| 欧美色123| 久久久久久夜精品精品免费| 欧美激情第二页| 久久成人免费| 欧美三级电影大全| 久久午夜色播影院免费高清| 欧美日韩一区二区三区| 久久资源在线| 欧美日韩中国免费专区在线看| 狂野欧美激情性xxxx| 99精品国产在热久久下载| 亚洲欧美一区二区原创| 日韩视频在线观看免费| 欧美亚洲免费在线| 一区二区三区欧美亚洲| 久久精品国产亚洲一区二区| 亚洲午夜高清视频| 男人插女人欧美| 精品不卡一区| 亚洲欧美乱综合| 亚洲蜜桃精久久久久久久| 久久久国际精品| 亚洲小视频在线| 久久婷婷丁香| 久久野战av| 国产亚洲人成a一在线v站| 一区二区三区福利| 一本色道久久综合狠狠躁的推荐| 久久亚洲精品一区二区| 亚洲成色www8888| 欧美中文字幕在线播放| 欧美在线视频观看免费网站| 国产精品v欧美精品v日韩精品| 欧美激情一区二区在线| 精品1区2区3区4区| 在线视频欧美精品| 亚洲一区网站| 欧美人成在线| 亚洲国产精品传媒在线观看| 精品9999| 久久综合久久综合久久综合| 噜噜噜91成人网| 国内在线观看一区二区三区| 欧美国产另类| 亚洲欧洲日产国码二区| 欧美黄色日本| 亚洲精品一区二区三区樱花| 99www免费人成精品| 亚洲影音先锋| 久久久噜噜噜久久中文字免| 狠狠久久亚洲欧美| 美女精品视频一区| 亚洲国产精品成人va在线观看| 亚洲另类春色国产| 亚洲欧美国产高清| 欧美日韩小视频| 亚洲免费电影在线观看| 亚洲永久免费av| 国产美女一区| 欧美在线播放一区二区| 久久精品国产亚洲一区二区三区| 黑人巨大精品欧美一区二区| 久久夜色撩人精品| 欧美电影免费观看网站| 一区二区三区四区五区精品视频| 欧美网站在线观看| 久久精品99国产精品日本| 亚洲国产精品第一区二区三区| 一区二区欧美国产| 国产日韩精品视频一区二区三区| 久久久亚洲人| 在线一区免费观看| 久久深夜福利| 1024日韩| 国产麻豆成人精品| 欧美韩日一区| 久久se精品一区二区| 欧美激情亚洲精品| 午夜精品久久久久久久男人的天堂| 国内外成人免费激情在线视频| 欧美激情五月| 久久国产88| 国产精品99久久久久久久久久久久| 久久久噜噜噜久久中文字幕色伊伊| 日韩视频在线免费| 狠狠色香婷婷久久亚洲精品| 欧美三日本三级少妇三99| 另类春色校园亚洲| 久久本道综合色狠狠五月| 99精品欧美| 欧美国产日韩视频| 久久精品国产精品亚洲综合| 一区二区免费在线播放| 亚洲品质自拍| 欧美午夜精品久久久久久超碰| 亚洲你懂的在线视频| 欧美大片免费观看| 欧美亚洲免费| 一本色道婷婷久久欧美| 亚洲第一毛片| 国产性天天综合网| 国产精品乱子久久久久| 欧美另类极品videosbest最新版本| 欧美专区第一页| 亚洲主播在线观看| 亚洲视频在线一区| 亚洲免费视频网站| 樱桃视频在线观看一区| 国产日韩精品视频一区二区三区| 日韩一区二区精品| 亚洲人成在线观看| 亚洲高清免费视频| 一区二区精品| 久久手机精品视频| 亚洲精品美女91| 香蕉av777xxx色综合一区| 美女日韩在线中文字幕| 国产精品二区二区三区| 激情综合网址| 亚洲一区二区欧美| 男人的天堂亚洲| 亚洲丝袜av一区| 久久看片网站| 国产精品视频在线观看| 91久久久一线二线三线品牌| 午夜在线成人av| 亚洲国产高清在线| 欧美一级黄色录像| 欧美精品精品一区| 精品1区2区3区4区| 性久久久久久久久| 亚洲激情视频| 久久er精品视频| 欧美激情一区二区在线| 国内精品久久久久影院优| 亚洲天堂免费观看| 欧美韩日视频| 欧美中在线观看| 国产欧美日韩在线| 亚洲一区视频在线| 日韩午夜剧场| 欧美激情1区2区| 在线观看一区二区精品视频| 欧美一级视频| 中文亚洲欧美| 欧美日韩一区二区欧美激情| 亚洲欧洲在线视频| 欧美不卡高清| 久久久之久亚州精品露出| 国产精品亚洲网站| 亚洲一区免费看| 亚洲经典在线| 欧美成人综合在线| 亚洲国产精品久久久久秋霞蜜臀 | 欧美激情视频一区二区三区不卡| 国产色视频一区| 午夜一区二区三视频在线观看| 亚洲国产欧美精品| 欧美成人午夜激情视频| 在线观看欧美黄色| 久久久欧美一区二区| 亚洲欧美影院| 国产欧美日韩一区| 久久精品日韩欧美| 午夜精品区一区二区三| 国产精品毛片在线看| 亚洲欧美日韩一区二区三区在线观看| 亚洲毛片视频| 欧美天堂亚洲电影院在线播放| 99这里有精品| 一区二区三区久久精品| 国产精品久久久久久福利一牛影视| 亚洲午夜三级在线| 亚洲一区二区三区成人在线视频精品 | 午夜精品剧场| 狠狠88综合久久久久综合网|