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

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>
            免费视频久久| 亚洲国产日韩欧美在线动漫| 日韩一级大片在线| 欧美日本精品| 亚洲综合国产激情另类一区| 亚洲精品久久久久久久久久久| 欧美bbbxxxxx| 日韩视频免费大全中文字幕| 欧美视频一区二区三区…| 正在播放亚洲一区| 一本色道久久综合狠狠躁篇怎么玩| 欧美日本乱大交xxxxx| 在线中文字幕一区| 亚洲欧美成人精品| 韩国三级在线一区| 亚洲精品国产精品乱码不99 | 亚洲国产欧美日韩精品| 欧美国产日韩a欧美在线观看| 亚洲麻豆视频| 亚洲在线免费| 精品福利av| 亚洲九九精品| 国产亚洲福利社区一区| 欧美精品18+| 久久精品99国产精品| 久久综合导航| 亚洲欧美日韩一区在线| 久久九九精品| 亚洲午夜伦理| 久久婷婷av| 午夜在线精品偷拍| 另类av导航| 欧美一区二区三区婷婷月色 | 欧美 日韩 国产精品免费观看| 亚洲天堂网在线观看| 久久精品日产第一区二区| 亚洲黄色成人久久久| 午夜精品久久久久久久99樱桃 | 99视频精品全国免费| 欧美一级专区| 亚洲一区二区免费视频| 六十路精品视频| 久久精品国产亚洲高清剧情介绍| 欧美成人四级电影| 久久全球大尺度高清视频| 欧美日韩国产精品成人| 欧美~级网站不卡| 国产精品丝袜91| 亚洲美女黄网| 亚洲国产欧美一区| 久久久午夜电影| 欧美综合国产| 国产精品视频网址| 亚洲美女啪啪| 日韩视频欧美视频| 你懂的视频欧美| 久热爱精品视频线路一| 国产私拍一区| 亚洲欧美在线网| 欧美一区2区三区4区公司二百 | 久久精品毛片| 久久福利资源站| 国产精品一区二区久久久| 99re66热这里只有精品4| 亚洲六月丁香色婷婷综合久久| 久久免费国产| 免费观看久久久4p| 黄色精品一区| 久久久午夜电影| 久久亚洲春色中文字幕久久久| 国产精品视频成人| 西西人体一区二区| 久久精视频免费在线久久完整在线看| 国产精品日本精品| 午夜亚洲精品| 久久天堂成人| 一区二区在线看| 欧美大胆人体视频| 亚洲精品日韩精品| 亚洲一区日本| 国产精品资源| 久久久亚洲人| 亚洲国产一区在线| 亚洲私人影院| 国产精品爽黄69| 久久精品男女| 亚洲国产高清一区| 亚洲午夜电影在线观看| 国产精品视频免费观看www| 欧美一区二区三区久久精品茉莉花| 久久黄色网页| 亚洲黄色av一区| 欧美午夜电影网| 午夜视频在线观看一区二区三区| 久久伊人精品天天| 亚洲靠逼com| 国产精品免费一区二区三区观看| 久久狠狠久久综合桃花| 欧美黄色免费| 亚洲综合首页| 韩日视频一区| 欧美视频一区二区三区在线观看| 午夜一区不卡| 亚洲理论在线| 久久在线免费观看| 亚洲网站在线观看| 精品999在线播放| 国产精品久久999| 浪潮色综合久久天堂| 一本不卡影院| 欧美夫妇交换俱乐部在线观看| 一区二区三区日韩精品| 国产综合视频| 国产精品久久一区主播| 美女网站在线免费欧美精品| 亚洲一区二区三区四区五区午夜| 欧美电影美腿模特1979在线看| 亚洲一区二区三区精品视频| 尤物精品国产第一福利三区 | 欧美色另类天堂2015| 欧美在线网站| 亚洲午夜在线观看| 亚洲精品系列| 欧美刺激性大交免费视频| 久久国产精品一区二区三区四区 | 亚洲精品中文字幕在线| 国产一区二区三区黄视频| 欧美视频在线一区| 欧美激情在线观看| 久久久午夜精品| 欧美一区二区视频免费观看| 在线视频一区观看| 亚洲精品久久嫩草网站秘色| 你懂的国产精品| 久久日韩精品| 午夜日韩在线观看| 亚洲自拍另类| 国产精品99久久99久久久二8 | 夜夜嗨av一区二区三区网页| 在线不卡免费欧美| 狠狠综合久久av一区二区老牛| 国产精品日韩精品欧美精品| 欧美日韩综合| 欧美日韩亚洲视频| 欧美日韩一区二区三区在线| 欧美高清在线视频观看不卡| 欧美电影免费观看大全| 欧美波霸影院| 欧美国产第一页| 欧美日韩岛国| 国产精品porn| 国产女人18毛片水18精品| 国产精品午夜电影| 国产欧美日韩一区| 国产一区二区日韩| 在线观看精品一区| 最近看过的日韩成人| 亚洲精品在线看| 亚洲一区精品电影| 香港久久久电影| 久久精品中文字幕免费mv| 久久综合九色综合久99| 欧美大片第1页| 亚洲国内精品| 亚洲色图综合久久| 欧美一区二区三区免费观看视频| 性欧美xxxx大乳国产app| 久久久久久伊人| 欧美国产精品久久| 国产精品区二区三区日本| 国产香蕉97碰碰久久人人| 在线高清一区| 一区二区日韩免费看| 亚洲欧美日韩精品综合在线观看 | 亚洲六月丁香色婷婷综合久久| 在线亚洲国产精品网站| 欧美一区二区在线免费观看| 久久久久久久999精品视频| 欧美激情亚洲自拍| 亚洲午夜久久久| 老司机久久99久久精品播放免费 | 欧美在线亚洲| 欧美本精品男人aⅴ天堂| 国产精品久久久久久影视| 国产主播精品| 亚洲午夜在线| 欧美成人亚洲成人| 亚洲视频999| 欧美成人精品福利| 国产一区二区三区在线播放免费观看| 亚洲欧洲精品一区二区| 久久不射中文字幕| 亚洲精华国产欧美| 久久不见久久见免费视频1| 欧美日韩国产大片| 亚洲国产经典视频| 久久精品人人| 亚洲综合首页| 欧美视频中文字幕| 亚洲精品无人区|