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

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>
            国产精品高潮久久| 国产午夜精品久久久久久免费视| 激情懂色av一区av二区av| 欧美一二三视频| 性色一区二区三区| 精品二区视频| 亚洲免费av片| 国产九色精品成人porny| 久久精品人人做人人综合| 久久久久久一区二区三区| 亚洲精品国产精品国自产观看| 亚洲精品日韩精品| 国产精品视频不卡| 免费久久99精品国产自| 欧美日韩国产bt| 欧美在线地址| 欧美黄色aa电影| 欧美在线观看网址综合| 久久欧美中文字幕| 亚洲永久免费精品| 久久久久一区二区三区| 中文av一区特黄| 久久青草久久| 香蕉久久夜色精品国产使用方法| 久久久www成人免费精品| 一本久久a久久免费精品不卡| 亚洲综合色自拍一区| 亚洲激情小视频| 午夜精品免费视频| av成人免费| 久久在线免费视频| 亚洲主播在线播放| 男女av一区三区二区色多| 亚洲欧美综合一区| 欧美a级在线| 久久久久国内| 国产精品国产三级国产普通话99 | 欧美一二三区在线观看| 欧美福利视频在线| 久久综合给合久久狠狠色 | 欧美日韩精品三区| 免费成人黄色| 国产主播在线一区| 亚洲欧美日韩精品在线| 欧美在线视频一区二区| 国产一区二区三区日韩欧美| 亚洲一区二区在线视频| 国产精品卡一卡二卡三| 亚洲素人一区二区| 久久夜色精品国产欧美乱| 一区二区免费在线观看| 久久精品视频免费播放| 亚洲一本视频| 欧美成年人网站| 久久超碰97中文字幕| 欧美精品久久久久久久免费观看| 亚洲一区二区三区高清不卡| 欧美大秀在线观看| 亚洲国产精品免费| 国内精品亚洲| 久久久999| 久久精品免费播放| 韩国一区二区三区在线观看| 性久久久久久久久| 久久视频一区| 激情成人综合| 久久综合国产精品| 免费在线亚洲欧美| 亚洲国产一区二区在线| 久久综合伊人77777蜜臀| 模特精品在线| 日韩视频一区二区| 欧美日本亚洲视频| 99精品热视频只有精品10| 亚洲一区在线免费| 国产精品麻豆成人av电影艾秋| 亚洲伊人网站| 老司机成人网| 亚洲经典在线| 欧美亚洲成人免费| 午夜精品久久久久久久蜜桃app | 亚洲一区欧美一区| 国产精品多人| 久久久99久久精品女同性| 欧美成人有码| 亚洲视频专区在线| 国产亚洲网站| 欧美极品一区| 午夜国产欧美理论在线播放 | 一本色道久久88综合亚洲精品ⅰ | 欧美sm极限捆绑bd| 亚洲精品老司机| 欧美一级理论片| 在线观看视频免费一区二区三区| 欧美成人一区二区三区| 亚洲精品你懂的| 亚洲永久精品大片| 国产综合在线看| 欧美精选一区| 性亚洲最疯狂xxxx高清| 亚洲国产成人精品久久久国产成人一区 | 亚欧美中日韩视频| 亚洲三级观看| 久久成人综合网| 99视频在线精品国自产拍免费观看 | 欧美黄色aa电影| 亚洲欧美国产日韩中文字幕| 免费精品99久久国产综合精品| 日韩一级在线| 国内一区二区三区| 欧美日韩一区三区四区| 久久免费精品日本久久中文字幕| 亚洲精品在线免费观看视频| 久久免费午夜影院| 亚洲天堂av综合网| 91久久中文| 国外视频精品毛片| 国产精品护士白丝一区av| 免费永久网站黄欧美| 亚洲自拍都市欧美小说| 亚洲三级视频| 欧美国产欧美亚洲国产日韩mv天天看完整 | 久久久水蜜桃av免费网站| 9久草视频在线视频精品| 欧美成人精品在线播放| 欧美一区在线看| 亚洲无吗在线| 99在线热播精品免费99热| 亚洲国产日韩在线| 在线观看视频一区二区欧美日韩| 国产精品视频999| 欧美视频在线免费| 欧美激情视频一区二区三区免费| 久久精品视频99| 久久精彩视频| 欧美在线视频a| 亚洲欧美成aⅴ人在线观看| 一本久道久久综合婷婷鲸鱼| 亚洲欧洲精品一区| 最新中文字幕亚洲| 亚洲精品影视| 这里只有精品丝袜| 亚洲视频免费| 亚洲免费中文| 性欧美超级视频| 久久久久久9999| 美女诱惑一区| 欧美大片在线观看| 欧美日韩中文字幕在线视频| 欧美日韩久久| 国产精品久久久久影院亚瑟 | 欧美日韩国产a| 欧美日韩在线高清| 国产精品美女xx| 国产亚洲激情在线| 在线观看91精品国产入口| 在线成人欧美| 亚洲美女黄网| 亚洲女同同性videoxma| 午夜电影亚洲| 久久综合一区| 亚洲精选大片| 欧美亚洲免费高清在线观看| 久久午夜精品一区二区| 欧美激情中文字幕乱码免费| 国产精品九九久久久久久久| 国产日韩在线一区| 亚洲国产日韩欧美在线动漫| 亚洲午夜性刺激影院| 欧美有码在线观看视频| 免费久久精品视频| 日韩视频一区二区在线观看 | 欧美精品网站| 韩国av一区二区三区| 一本色道久久综合亚洲精品婷婷 | 久久九九国产精品| 亚洲大片精品永久免费| 亚洲一二三区精品| 美国十次了思思久久精品导航| 欧美日韩在线免费观看| 韩日欧美一区| 亚洲免费在线电影| 欧美gay视频激情| 一区二区三欧美| 久久久女女女女999久久| 国产精品大全| 亚洲伦理一区| 久久视频一区| 亚洲男人天堂2024| 免费视频久久| 激情一区二区三区| 性高湖久久久久久久久| 亚洲国产小视频在线观看| 欧美一区午夜精品| 欧美日韩综合另类| 亚洲国产日韩一级| 久久人人97超碰国产公开结果 | 亚洲影院色无极综合| 欧美精品1区2区| 激情小说另类小说亚洲欧美 |