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

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>
            亚洲免费观看高清完整版在线观看熊| 美女日韩在线中文字幕| 美女尤物久久精品| 国产婷婷色一区二区三区| 一区二区三区日韩精品视频| 久久亚洲综合色一区二区三区| 一区二区三区四区五区视频| 欧美国产三区| 国产精品制服诱惑| 午夜精品久久久久久久蜜桃app| 亚洲日本一区二区| 欧美日本在线一区| 日韩一区二区久久| 亚洲第一页在线| 欧美不卡视频一区发布| 亚洲国产精品久久久久婷婷884 | 日韩午夜三级在线| 欧美日韩精品免费看| 亚洲午夜国产成人av电影男同| 亚洲人成7777| 欧美日本不卡视频| 亚洲小说欧美另类社区| 一本色道**综合亚洲精品蜜桃冫| 欧美日韩另类在线| 小黄鸭精品aⅴ导航网站入口| 亚洲一区影音先锋| 黄色小说综合网站| 欧美不卡视频一区| 男人插女人欧美| 一区二区三区国产在线观看| 亚洲午夜精品17c| 国产日韩一区| 亚洲第一精品久久忘忧草社区| 欧美激情成人在线视频| 亚洲欧美影院| 久久久久9999亚洲精品| 亚洲人成在线影院| 在线亚洲一区二区| 激情五月婷婷综合| 欧美h视频在线| 欧美日韩综合视频网址| 欧美一级久久| 看欧美日韩国产| 亚洲视频精品| 午夜伦理片一区| 亚洲精品国产精品久久清纯直播| 亚洲毛片在线| 韩国欧美一区| 一区二区欧美亚洲| 娇妻被交换粗又大又硬视频欧美| 亚洲黄色视屏| 国产三区精品| 亚洲毛片网站| 在线成人亚洲| 亚洲综合另类| 亚洲电影成人| 亚洲欧美日韩专区| 日韩视频在线免费| 久久精品视频在线播放| 亚洲一区二区三区激情| 久久性天堂网| 欧美在线啊v| 欧美日韩一区二区免费视频| 裸体女人亚洲精品一区| 国产精品久久久久久久久久ktv| 美国三级日本三级久久99| 国产精品久久久久毛片软件| 欧美高清视频在线| 国内伊人久久久久久网站视频| 亚洲免费观看视频| 亚洲日本激情| 六月丁香综合| 麻豆av一区二区三区久久| 国产美女在线精品免费观看| 亚洲精品视频免费| 亚洲美女免费视频| 欧美.www| 免费人成精品欧美精品| 激情六月婷婷综合| 欧美伊人久久大香线蕉综合69| 香蕉久久一区二区不卡无毒影院| 免费av成人在线| 欧美高清你懂得| 1769国内精品视频在线播放| 久久精品中文| 亚洲少妇诱惑| 欧美午夜电影在线| 日韩视频亚洲视频| 亚洲伊人伊色伊影伊综合网| 国产日韩欧美精品| 久久久99久久精品女同性| 欧美成人精精品一区二区频| 亚洲精品免费观看| 国产精品一二三四区| 久久国产精品久久久| 免费h精品视频在线播放| 有码中文亚洲精品| 老牛嫩草一区二区三区日本| 免费中文日韩| 亚洲精品午夜精品| 欧美久久综合| 亚洲视屏一区| 久久精品最新地址| 在线看国产一区| 免费久久99精品国产自在现线| 亚洲第一在线综合网站| 亚洲午夜女主播在线直播| 国产精品激情偷乱一区二区∴| 欧美freesex交免费视频| 亚洲人午夜精品| 欧美日韩亚洲一区二| 亚洲欧美文学| 欧美顶级大胆免费视频| 国内外成人免费激情在线视频网站| 久久久久久久久久久久久女国产乱 | 亚洲高清电影| 欧美日韩激情小视频| 亚洲一区二区三区久久| 久久九九国产| 亚洲美女毛片| 国产精品影片在线观看| 欧美激情第三页| 欧美亚洲视频在线观看| 亚洲最新在线| 亚洲国产欧美日韩另类综合| 久久www成人_看片免费不卡| 99在线热播精品免费| 亚洲激情欧美| 国内精品伊人久久久久av影院| 国产精品久久久久久久午夜片| 欧美极品色图| 欧美 日韩 国产一区二区在线视频| 欧美一区激情| 亚洲欧美日本国产有色| 在线中文字幕一区| 一区二区三区|亚洲午夜| 亚洲第一在线综合网站| 免费在线看一区| 美女国内精品自产拍在线播放| 欧美一区二区成人| 亚洲欧美制服另类日韩| 亚洲欧美激情四射在线日| 亚洲视频精选在线| 亚洲视频国产视频| 亚洲影视综合| 午夜精品福利电影| 欧美制服丝袜第一页| 欧美在线地址| 久久国内精品视频| 久久女同互慰一区二区三区| 久久免费黄色| 免播放器亚洲一区| 亚洲国产高清在线观看视频| 亚洲第一在线综合在线| 亚洲全黄一级网站| 一区二区冒白浆视频| 亚洲影音一区| 久久av一区二区| 老司机精品视频网站| 欧美激情无毛| 国产精品欧美一区二区三区奶水| 国产精品亚洲一区二区三区在线| 国产精品视频一区二区三区| 国产在线视频欧美一区二区三区| 伊人成年综合电影网| 亚洲精品日韩一| 亚洲伊人观看| 鲁大师影院一区二区三区| 欧美激情四色| 亚洲视频欧美视频| 久久精品盗摄| 欧美日韩成人在线视频| 国产精品亚洲综合久久| 伊人色综合久久天天| 一区二区精品| 久久久久久9| 亚洲国内高清视频| 亚洲欧美日韩天堂一区二区| 久久蜜桃精品| 欧美午夜不卡影院在线观看完整版免费| 国产精品久久一区二区三区| 亚洲第一级黄色片| 亚洲男人影院| 欧美电影资源| 午夜精品久久久久久久男人的天堂| 久久国产欧美精品| 欧美视频在线免费| 在线免费观看视频一区| 亚洲欧美成人一区二区在线电影 | 国产欧美一区二区三区在线看蜜臀| 红桃视频国产一区| 亚洲先锋成人| 蘑菇福利视频一区播放| 一区二区冒白浆视频| 久久免费视频网| 国产精品网曝门| 一区二区三区四区五区在线| 六月丁香综合| 欧美一级黄色录像| 国产精品99免费看 |