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

oyjpArt ACM/ICPC算法程序設(shè)計(jì)空間

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

終于發(fā)現(xiàn)自己G題Accelarator的錯(cuò)誤了 找了好久好久 就這個(gè)錯(cuò)誤 讓我在整個(gè)后半段的比賽中幾乎廢掉了 太不應(yīng)該了!
吸取教訓(xùn)!在場(chǎng)上出現(xiàn)自己無(wú)法找出錯(cuò)誤的情況 應(yīng)該要讓隊(duì)友重寫

#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 右邊卻忘記轉(zhuǎn)成__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: 終于發(fā)現(xiàn)自己G題Accelarator的錯(cuò)誤了  回復(fù)  更多評(píng)論   

2007-05-10 22:29 by
bless,我也是錯(cuò)在這個(gè)上。

# re: 終于發(fā)現(xiàn)自己G題Accelarator的錯(cuò)誤了  回復(fù)  更多評(píng)論   

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>
            欧美日韩第一区日日骚| 久久伊人免费视频| 欧美片在线观看| 久久精品日产第一区二区三区 | 欧美伊人久久久久久午夜久久久久 | 亚洲日本激情| 亚洲欧美日本在线| 国产欧美日本| 99精品热视频| 亚洲人成网站在线观看播放| 亚洲国产精品va在线看黑人| 欧美日韩亚洲一区二区三区| 亚洲在线视频免费观看| 亚洲一区尤物| 亚洲一区欧美二区| 欧美日韩在线播| 久久精品视频在线| 国产精一区二区三区| 亚洲夜间福利| 午夜在线电影亚洲一区| 久久精品免费观看| 亚洲精品国产精品国产自| 久久免费的精品国产v∧| 久久精品动漫| 欧美紧缚bdsm在线视频| 亚洲专区一二三| 久久精品一区二区三区不卡牛牛| 亚洲欧美日韩国产| 久久久久久久波多野高潮日日 | 亚洲一区三区视频在线观看| 亚洲综合导航| 亚洲国产精品久久| 一区二区三区免费网站| 亚洲深夜福利在线| 久久久999精品| 久久人人爽人人| 欧美日韩精品免费观看视频| 日韩视频一区二区三区| 亚洲午夜女主播在线直播| 欧美日韩亚洲高清一区二区| 开心色5月久久精品| 韩国精品主播一区二区在线观看| 亚洲精品国产精品乱码不99按摩| 夜夜精品视频一区二区| 久久精彩免费视频| 亚洲午夜女主播在线直播| 国产精品家庭影院| 欧美永久精品| 亚洲视频免费在线| 美女网站在线免费欧美精品| 欧美黑人国产人伦爽爽爽| 亚洲肉体裸体xxxx137| 香蕉久久国产| 亚洲欧美国产77777| 国产欧美一区二区三区久久人妖| 久久久av水蜜桃| 欧美一级视频一区二区| 欧美日韩国产色综合一二三四| 久久久亚洲午夜电影| 亚洲国产乱码最新视频| 欧美日韩一区二区视频在线观看 | 国产精品毛片va一区二区三区| 欧美激情国产精品| 亚洲一区二区不卡免费| 狠狠色噜噜狠狠狠狠色吗综合| 欧美国产综合一区二区| 亚洲成色www8888| 亚洲一区中文| 欧美日韩在线一区二区| 午夜精品婷婷| 亚洲精选一区| 噜噜噜在线观看免费视频日韩| 一本久久a久久精品亚洲| 国产日韩精品在线| 欧美剧在线免费观看网站| 午夜久久久久久| 亚洲麻豆视频| 亚洲一区尤物| 亚洲国产另类精品专区| 国产日产亚洲精品| 欧美日韩一区成人| 老司机免费视频一区二区三区| 欧美va天堂| 欧美一区日韩一区| 99热这里只有精品8| 一色屋精品视频在线看| 国产欧美亚洲一区| 欧美在线三区| 亚洲色图制服丝袜| 亚洲日本乱码在线观看| 老司机午夜精品视频| 亚洲国产欧洲综合997久久| 久久在线免费观看| 性刺激综合网| 亚洲自拍另类| 制服诱惑一区二区| 午夜视频在线观看一区二区三区| 国产精品入口麻豆原神| 欧美日韩精品久久| 亚洲欧美在线另类| 亚洲深夜福利视频| 亚洲美女视频在线观看| 性欧美xxxx大乳国产app| 亚洲视频香蕉人妖| 国产亚洲福利| 国产精品日韩精品欧美精品| 久久精品观看| 久久www免费人成看片高清| 欧美成人亚洲| 蜜桃av综合| 亚洲一区二区在线看| 国产在线拍偷自揄拍精品| 久久天堂成人| 一本在线高清不卡dvd| 久久成人这里只有精品| 91久久综合| 亚洲靠逼com| 日韩午夜免费| 一区二区免费在线视频| 亚洲一二三区精品| 狠狠色狠狠色综合日日91app| 欧美日韩高清在线观看| 欧美日韩国内自拍| 国产精品国产三级国产专区53| 国产精品久久久久久久久久直播 | 免费在线亚洲欧美| 欧美电影免费观看| 欧美日韩a区| 国产精品亚洲欧美| 欧美成人午夜影院| 欧美日韩福利视频| 欧美色网在线| 国产日产高清欧美一区二区三区| 欧美电影免费观看| 国产精品国产三级国产aⅴ入口| 国产精品久久久久免费a∨| 国产精品自在欧美一区| 欧美日韩亚洲三区| 久热成人在线视频| 欧美中文在线视频| 免费日本视频一区| 久久日韩粉嫩一区二区三区| 亚洲亚洲精品三区日韩精品在线视频| 亚洲免费中文| 欧美高清不卡在线| 国产精品外国| 亚洲高清自拍| 亚洲自拍偷拍网址| 免费亚洲电影| 亚洲视频网在线直播| 亚洲精品五月天| 先锋亚洲精品| 欧美成人免费大片| 国产精品视频最多的网站| 伊人久久成人| 在线成人小视频| 亚洲视频电影在线| 麻豆国产精品一区二区三区| 欧美激情网友自拍| 亚洲高清资源| 亚洲欧美日韩精品久久| 亚洲影音先锋| 蘑菇福利视频一区播放| 国产农村妇女毛片精品久久麻豆| 国产精品拍天天在线| 亚洲福利av| 久久精品免费| 久久全国免费视频| 亚洲视频网站在线观看| 欧美电影免费观看| 在线观看91久久久久久| 午夜视频久久久| 久久er99精品| 久久精视频免费在线久久完整在线看| 亚洲精选在线| 你懂的视频一区二区| 欧美激情视频免费观看| 欧美日韩另类综合| 91久久久久| 老司机亚洲精品| 欧美激情中文不卡| 久久国产日韩| 国产香蕉久久精品综合网| 红桃视频一区| 亚洲激情综合| 玖玖在线精品| 亚洲美女网站| 欧美人与禽性xxxxx杂性| 国产精品美女久久久免费| 中文在线一区| 日韩视频免费观看高清完整版| 亚洲视频视频在线| 久久精品视频在线观看| 欧美激情一区二区久久久| 亚洲国产精品一区二区三区| 亚洲视频电影图片偷拍一区| 欧美永久精品| 欧美激情亚洲| 免费观看久久久4p| 国产精品一区二区三区观看 |