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

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>
            一区精品在线播放| 99精品国产在热久久| 欧美va亚洲va国产综合| 久久综合伊人77777| 在线视频日韩精品| 久久精品视频在线| 亚洲永久在线| 美日韩在线观看| 亚洲免费在线观看| 欧美**人妖| 久久精品国产久精国产爱| 欧美精品一区二区视频| 久久精品99无色码中文字幕| 激情偷拍久久| 欧美另类专区| 欧美一区二区黄色| 亚洲一区久久久| 国产亚洲一级高清| 一区二区毛片| 夜夜嗨av一区二区三区| 欧美jizz19性欧美| 亚洲一区视频在线观看视频| 夜夜嗨网站十八久久| 国产精品一区二区三区成人| 99国产精品久久久久老师| 亚洲国产成人精品久久| 久久不见久久见免费视频1| 欧美伊人久久久久久午夜久久久久| 欧美高清在线视频| 亚洲国产成人在线播放| 亚洲欧美在线播放| 亚洲综合色激情五月| 黄色成人av网| 久久中文字幕一区| 亚洲视频中文字幕| 欧美一激情一区二区三区| 国产精品亚洲美女av网站| 一区二区三区欧美视频| 欧美www视频| 久久av最新网址| 国产一区二区久久| 欧美色欧美亚洲另类二区| 亚洲美女毛片| 在线观看福利一区| 欧美 日韩 国产一区二区在线视频 | 99视频在线观看一区三区| 六月天综合网| 亚洲福利视频网| 国产欧美精品va在线观看| 欧美一区二区三区免费在线看| 亚洲精品国产欧美| 亚洲免费一级电影| 亚洲每日在线| 国产精品免费一区二区三区在线观看| 亚洲午夜精品一区二区三区他趣 | 久久精品亚洲乱码伦伦中文| 中文亚洲免费| 久久久精品午夜少妇| 亚洲国产另类久久精品| 欧美日韩福利在线观看| 亚洲一区在线视频| 一本色道久久综合狠狠躁篇怎么玩 | 亚洲永久字幕| 在线亚洲成人| 在线亚洲高清视频| 亚洲网站在线播放| 中文亚洲免费| 亚洲专区一区| 亚洲国产精品久久| 久久成人国产| 久久精品中文字幕一区| 亚洲欧美国产精品桃花| 亚洲欧美国产精品专区久久| 亚洲欧美日韩国产综合| 午夜免费久久久久| 日韩午夜电影av| 99视频精品全国免费| 日韩视频在线观看一区二区| 99re成人精品视频| 亚洲图片欧美日产| 亚洲激情不卡| 99精品国产一区二区青青牛奶| 日韩写真在线| 亚洲欧美精品在线| 久久国产精品网站| 老司机67194精品线观看| 免费在线亚洲欧美| 亚洲国产影院| 一区二区高清在线| 午夜精品区一区二区三| 日韩午夜在线播放| a4yy欧美一区二区三区| 亚洲一区二区三区精品视频 | 国产精品久久久久秋霞鲁丝| 国产麻豆午夜三级精品| 精品动漫一区| 亚洲免费av电影| 性欧美1819性猛交| 免费不卡中文字幕视频| 久久国产一二区| 欧美成人综合一区| 久久久综合网| 久久99在线观看| 欧美成人国产一区二区| 亚洲精选大片| 久久av一区二区| 欧美亚洲综合在线| 欧美承认网站| 久久资源在线| 欧美日韩一区二区在线观看| 欧美久久视频| 国产日韩精品电影| 亚洲精品一级| 99综合电影在线视频| 欧美亚洲日本国产| 欧美成va人片在线观看| 亚洲图片欧洲图片日韩av| 久久久99精品免费观看不卡| 欧美日韩国产高清| 国产日韩欧美夫妻视频在线观看| 国产精品久久久久国产a级| 国产精品福利久久久| 在线电影国产精品| 亚洲欧美日韩一区二区三区在线| 老司机午夜精品视频| 一本色道久久99精品综合| 麻豆91精品| 国产免费成人在线视频| 亚洲每日在线| 欧美成人精品一区二区| 亚洲欧美另类国产| 欧美日韩精品久久| 在线看片成人| 日韩视频一区二区| 久久综合给合久久狠狠狠97色69| 免费看的黄色欧美网站| 亚洲欧美国产三级| 欧美三级日本三级少妇99| 亚洲国产欧美精品| 久久一二三四| 欧美一级片久久久久久久| 国产精品久久99| 夜夜嗨av一区二区三区网站四季av | 亚洲国产精品嫩草影院| 久久天堂av综合合色| 欧美精品少妇一区二区三区| 欧美日韩免费观看中文| 亚洲国产欧美一区二区三区丁香婷| 欧美中文在线免费| 亚洲一卡久久| 国产精品久久久久9999| 亚洲尤物视频在线| 99精品视频一区| 欧美片在线播放| 99爱精品视频| 亚洲精品国产视频| 欧美韩日精品| 99国产精品久久久久久久成人热 | 欧美一级欧美一级在线播放| 9国产精品视频| 欧美视频你懂的| 亚洲综合第一| 亚洲影院色在线观看免费| 国产精品久久午夜| 欧美一二区视频| 亚洲女人天堂成人av在线| 国产精品无码永久免费888| 亚洲欧美不卡| 午夜精品在线看| 国内精品久久久久影院 日本资源| 亚洲美女精品久久| 亚洲美女精品久久| 欧美午夜久久久| 亚洲区欧美区| 久久亚洲私人国产精品va| 久久国产精彩视频| 亚洲成色www8888| 亚洲高清免费在线| 欧美日韩成人一区二区| 亚洲天堂av在线免费观看| 亚洲一区二区三区精品在线 | 亚洲国产精品成人| 欧美日本在线播放| 亚洲欧美日韩区| 久久er精品视频| 亚洲精品1区| 国产精品99久久久久久久久| 国产日韩欧美三区| 欧美凹凸一区二区三区视频| 欧美精品自拍| 欧美一区二区三区精品| 久久激情视频久久| 亚洲毛片在线观看| 亚洲欧美日韩一区二区三区在线| 国产亚洲精品久久久久动| 欧美高清在线| 国产精品性做久久久久久| 美女视频黄免费的久久| 欧美日韩一区二| 久久免费视频在线|