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

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>
            欧美极品影院| 亚洲精品乱码久久久久久| 国产人成精品一区二区三| 欧美理论视频| 欧美日韩一卡| 国产精品区一区| 国产日韩在线看片| 韩国v欧美v日本v亚洲v | 欧美精品日韩三级| 欧美日韩视频在线一区二区| 国产精品v欧美精品v日韩| 国产欧美日韩中文字幕在线| 亚洲高清123| 亚洲一区美女视频在线观看免费| 亚洲欧美清纯在线制服| 久久精品国产久精国产思思| 亚洲国产午夜| 亚洲男人av电影| 欧美国产亚洲另类动漫| 国产精品女人毛片| 亚洲国产小视频| 欧美一区二区在线免费观看| 欧美成人激情视频| 国产精品99久久久久久久久久久久| 翔田千里一区二区| 欧美日韩黄色大片| 亚洲国产精品久久久久久女王| 亚洲午夜影视影院在线观看| 久久亚洲精品视频| 亚洲一区高清| 欧美女激情福利| 在线观看欧美视频| 久久久7777| 亚洲视频专区在线| 欧美精品二区| 黄色成人在线网址| 欧美一区二区三区另类| 亚洲人在线视频| 久久婷婷成人综合色| 国产精品美女在线| 一区二区三区 在线观看视| 媚黑女一区二区| 国产日韩欧美不卡| 欧美日韩一级黄| 亚洲日本va午夜在线影院| 久久爱91午夜羞羞| 亚洲小视频在线| 欧美日韩中文另类| 一区二区三区毛片| 91久久精品美女高潮| 蜜臀av在线播放一区二区三区| 国产一区91| 欧美与欧洲交xxxx免费观看| 一本一本久久a久久精品综合妖精| 蜜臀久久99精品久久久画质超高清| 国产人成精品一区二区三| 欧美一区二区日韩一区二区| 亚洲一区二区视频在线| 欧美午夜大胆人体| 亚洲欧美在线免费| 亚洲图色在线| 国产伦精品一区二区三区在线观看| 亚洲伊人第一页| 亚洲一区二区三区在线播放| 国产精品美女久久久久久免费| 亚洲欧美激情视频| 亚洲男人天堂2024| 国产亚洲一区二区三区在线播放| 欧美一区二区女人| 久久久久久电影| 最新中文字幕一区二区三区| 亚洲激情网址| 欧美日韩一区在线视频| 亚洲欧美日韩精品久久| 亚洲欧美日韩视频二区| 国产综合久久| 亚洲电影免费在线观看| 欧美日本亚洲韩国国产| 亚洲主播在线观看| 久久精品国产成人| 亚洲精品一区二区三区四区高清| 亚洲人成网在线播放| 国产精品区二区三区日本| 久久亚洲综合色| 欧美巨乳在线| 久久国产欧美精品| 美女网站久久| 午夜免费日韩视频| 久久在线免费观看| 亚洲在线不卡| 久久久夜色精品亚洲| 中国av一区| 久久久久久亚洲精品不卡4k岛国| 9久草视频在线视频精品| 亚洲综合精品一区二区| 亚洲国产婷婷香蕉久久久久久99| 亚洲午夜激情网站| 亚洲欧洲在线播放| 午夜一区二区三区在线观看| 亚洲欧洲日产国产网站| 亚洲一区综合| 亚洲精品欧美精品| 久久成人免费| 亚洲男人第一网站| 亚洲日本久久| 亚洲尤物精选| 亚洲国产精品黑人久久久 | 麻豆成人91精品二区三区| 欧美国产日韩二区| 久久久久久久999精品视频| 欧美日韩国产二区| 美女免费视频一区| 国产精品一区二区三区乱码| 亚洲人成绝费网站色www| 黄色成人在线网站| 性8sex亚洲区入口| 欧美一区二区| 欧美午夜宅男影院| 日韩一区二区免费看| 亚洲精品日本| 免费成人av资源网| 欧美激情国产日韩精品一区18| 国产一区二区三区久久| 亚洲一区二区三区在线视频| 国产精品99久久久久久久女警| 美玉足脚交一区二区三区图片| 久久久之久亚州精品露出| 国产乱肥老妇国产一区二| 一本大道久久a久久综合婷婷| 亚洲人成啪啪网站| 久久亚洲精选| 欧美77777| 亚洲国产欧美另类丝袜| 久久久久九九九| 欧美大片国产精品| 亚洲日本一区二区| 欧美国产日韩一二三区| 亚洲人成网站在线观看播放| 亚洲欧洲一区二区在线观看| 美女尤物久久精品| 亚洲日韩欧美视频| 亚洲免费在线看| 国产欧美精品一区二区色综合 | 欧美成人精品高清在线播放| 极品日韩久久| 美女久久网站| 亚洲理伦电影| 亚洲欧美综合国产精品一区| 国产精品影音先锋| 久久久国产一区二区| 免费成人网www| 99热在线精品观看| 国产精品久久国产三级国电话系列 | 亚洲电影免费| 亚洲免费一级电影| 国产综合第一页| 欧美va天堂va视频va在线| 亚洲精品国产精品久久清纯直播 | 欧美大片一区二区| 一区二区三区视频在线播放| 国产精品大片免费观看| 久久狠狠亚洲综合| 亚洲特级毛片| 久久爱另类一区二区小说| 黄色小说综合网站| 欧美高清一区二区| 亚洲五月六月| 欧美国产一区二区在线观看| 亚洲视频一区在线| 在线不卡亚洲| 国产精品二区在线观看| 久久精品国产欧美激情| 亚洲精品一区在线| 久久综合狠狠综合久久综青草| 在线一区亚洲| 在线免费观看成人网| 欧美日韩一区二区在线观看| 久久国产精品久久国产精品 | 久久色中文字幕| 夜夜爽av福利精品导航| 国产亚洲福利社区一区| 欧美精品18+| 久久久久在线观看| 亚洲嫩草精品久久| 99视频精品在线| 亚洲大胆视频| 久久婷婷麻豆| 久久激情视频免费观看| 中文在线不卡| 夜夜爽av福利精品导航 | 久色婷婷小香蕉久久| 午夜精品国产更新| 一本色道久久综合精品竹菊 | 欧美好骚综合网| 欧美在线三区| 亚洲一区二区三区免费观看 | 一区二区三区在线观看国产| 亚洲日本中文字幕免费在线不卡| 激情六月综合| 欧美成人伊人久久综合网|