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

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>
            在线看成人片| 亚洲国产欧美一区二区三区丁香婷| 老司机aⅴ在线精品导航| 国产精品婷婷| 在线精品视频在线观看高清| 久久久高清一区二区三区| 亚洲一区二区三区午夜| 国产嫩草影院久久久久| 久久精品视频在线免费观看| 久久国产精品网站| 欲色影视综合吧| 亚洲第一视频| 欧美精品激情blacked18| 中文久久乱码一区二区| 亚洲伊人一本大道中文字幕| 免费欧美在线视频| 艳妇臀荡乳欲伦亚洲一区| 中日韩美女免费视频网站在线观看| 久久aⅴ国产紧身牛仔裤| 免费国产一区二区| 亚洲桃花岛网站| 亚洲欧美日韩综合国产aⅴ| 国内精品久久久久久久影视麻豆| 日韩一级片网址| 亚洲一区二区三区在线观看视频| 欧美成人午夜免费视在线看片| 国产欧美一区二区白浆黑人| 在线视频欧美精品| 午夜精品一区二区三区四区| 欧美视频在线观看 亚洲欧| 久久精品国产久精国产一老狼 | 国产视频一区二区三区在线观看| 亚洲国产精品悠悠久久琪琪| 亚洲精品中文字幕在线观看| 国产亚洲欧美一级| 亚洲高清不卡| 国产日本欧美一区二区三区在线 | 国产精品老牛| 欧美jjzz| 国产精品资源在线观看| 亚洲国产91| 免费观看亚洲视频大全| 中日韩高清电影网| 在线精品视频一区二区三四| 久久中文欧美| 国产精品国产成人国产三级| 欧美激情亚洲| 好吊日精品视频| 亚洲视频第一页| 一本色道久久99精品综合| 亚洲人成久久| 影音欧美亚洲| 欧美亚洲网站| 香蕉成人伊视频在线观看| 亚洲欧美一区二区三区在线| 亚洲最新在线| 欧美成熟视频| 亚洲福利视频免费观看| 狠狠综合久久av一区二区老牛| 久久亚洲一区二区| 国产精品亚洲视频| 亚洲性视频网址| 中文一区二区在线观看| 欧美精品一区二区三| 亚洲国产精品精华液2区45| 影音先锋成人资源站| 欧美中文日韩| 久久伊伊香蕉| 韩国美女久久| 久久久精彩视频| 久久米奇亚洲| 伊人久久大香线蕉av超碰演员| 欧美激情在线免费观看| 亚洲丶国产丶欧美一区二区三区| 亚洲第一网站| 欧美性感一类影片在线播放 | 极品少妇一区二区三区| 午夜亚洲福利| 亚洲国产一区二区三区在线播| 99视频+国产日韩欧美| 99在线精品观看| 欧美三级在线| 亚洲永久精品国产| 久久久久久久精| 欧美日韩激情小视频| 欧美在线观看天堂一区二区三区| 久久婷婷影院| 小处雏高清一区二区三区| 国产精品狼人久久影院观看方式| 欧美14一18处毛片| 亚洲精品一品区二品区三品区| 亚洲曰本av电影| 久久精品导航| 亚洲国产美女精品久久久久∴| 亚洲一区二区伦理| 久久久久久久久久看片| 亚洲高清二区| 欧美吻胸吃奶大尺度电影| 免费美女久久99| 99精品视频免费| 国产精品视频一二三| 久久xxxx| 日韩午夜黄色| 久久婷婷久久| 亚洲一区成人| 在线看片第一页欧美| 欧美日韩精品一区二区三区| 欧美一级一区| 亚洲日本激情| 久久久久免费视频| 亚洲深夜av| 在线观看成人小视频| 美日韩精品视频| 一区二区三区高清视频在线观看| 免费在线日韩av| 噜噜噜在线观看免费视频日韩 | 欧美在线播放一区| 91久久精品国产91久久性色| 在线日韩日本国产亚洲| 欧美亚州在线观看| 欧美1区2区视频| 先锋影音网一区二区| 久久九九久精品国产免费直播| 国产农村妇女精品| 欧美另类专区| 欧美v国产在线一区二区三区| 欧美风情在线| 久久久久久久久久看片| 亚洲综合成人在线| 亚洲免费观看高清完整版在线观看熊 | 午夜精品久久久久99热蜜桃导演| 国产精品成av人在线视午夜片| 99热这里只有成人精品国产| 免费在线观看日韩欧美| 亚洲精品一区二区三区婷婷月 | 日韩午夜三级在线| 欧美不卡在线视频| 久久久.com| 久久精品国产精品亚洲综合| 午夜精品www| 亚洲男女毛片无遮挡| 亚洲婷婷在线| 国产欧美日韩在线播放| 国产精品久久久免费| 欧美日韩国产一区| 欧美精品一区二区三| 亚洲一区二区在线免费观看| 一区二区三区四区五区视频| 久久精品国产亚洲一区二区三区| 伊人久久综合97精品| 狠狠爱综合网| 一区免费在线| 亚洲国产精品国自产拍av秋霞| 欧美三区美女| 国产精品免费久久久久久| 国产精品日产欧美久久久久| 国产精品一二| 国产资源精品在线观看| 精品成人一区二区三区| 亚洲国产精品小视频| 亚洲免费观看| 亚洲欧美日韩成人高清在线一区| 亚洲国产经典视频| 日韩亚洲欧美高清| 宅男在线国产精品| 亚洲欧美日本另类| 久久精品一区二区三区四区| 鲁大师影院一区二区三区| 欧美激情一区二区在线 | 欧美区国产区| 国产精品久久久久久久午夜| 国产欧美一区二区精品仙草咪 | 日韩亚洲欧美高清| 亚洲午夜在线观看视频在线| 欧美一级片一区| 欧美大胆成人| 国产精品伦一区| 一区精品在线| 一区二区久久久久| 亚洲人成网站精品片在线观看| 国产色爱av资源综合区| 欧美新色视频| 一区免费观看视频| 一区二区精品国产| 久久激情五月丁香伊人| 欧美高清视频www夜色资源网| 久久婷婷久久| 亚洲美女免费精品视频在线观看| 欧美激情中文不卡| 中文精品视频一区二区在线观看| 日韩午夜精品| 亚洲国产日日夜夜| 亚洲欧美日韩电影| 欧美第十八页| 狠狠色丁香久久综合频道| 亚洲美女在线国产| 久久综合给合久久狠狠色 | 欧美视频网站| 影音先锋亚洲精品| 国产精品99久久久久久www|