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

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秋霞| 欧美大片18| 欧美精品一区在线| 亚洲欧美日韩国产成人精品影院| 亚洲视频大全| 国产综合色精品一区二区三区| 久久蜜桃香蕉精品一区二区三区| 美女视频网站黄色亚洲| 一本色道久久综合亚洲二区三区| 夜夜嗨av一区二区三区网页 | 久久久久久九九九九| 午夜宅男久久久| 在线日韩欧美| 亚洲精品在线三区| 国产日产欧美一区| 欧美国产日韩亚洲一区| 欧美日韩一区二区三区视频| 欧美一级淫片播放口| 国产一区二区三区四区| 免费观看日韩av| 欧美日韩亚洲一区三区| 久久久久成人精品免费播放动漫| 久久网站免费| 午夜精品福利在线| 久热国产精品| 小黄鸭视频精品导航| 免费亚洲一区二区| 午夜精品久久久久久久99水蜜桃 | 欧美国产日韩一区| 国产精品igao视频网网址不卡日韩| 久久久精品欧美丰满| 欧美精品色综合| 久久一区二区三区av| 欧美日韩亚洲视频| 欧美国产日韩免费| 国产亚洲欧美aaaa| 一本色道88久久加勒比精品| 雨宫琴音一区二区在线| 亚洲一区久久| 亚洲特级片在线| 欧美不卡视频一区发布| 久久久精品999| 国产精品久久一区二区三区| 亚洲成人资源网| 国内揄拍国内精品久久| 亚洲午夜激情网站| avtt综合网| 欧美国产精品日韩| 欧美激情自拍| 亚洲国产精品第一区二区三区 | 久久综合伊人77777尤物| 欧美日韩一区二| 欧美激情精品久久久久久大尺度 | 欧美精品久久久久久久久老牛影院| 欧美中文字幕视频在线观看| 欧美日韩成人在线播放| 亚洲第一精品福利| 在线观看日韩av先锋影音电影院| 亚洲自啪免费| 小辣椒精品导航| 国产精品久久综合| 亚洲性视频h| 欧美一区二区三区视频| 国产精品网站在线| 亚洲一区国产| 久久精品亚洲| 激情懂色av一区av二区av| 午夜日韩在线| 久久久久久久综合狠狠综合| 国产视频一区免费看| 欧美在线免费| 欧美高清视频在线播放| 亚洲黄色成人网| 欧美精品免费播放| 亚洲精品自在久久| 亚洲免费在线精品一区| 国产精品一区久久久久| 性色一区二区| 久久综合久久久久88| 在线播放日韩专区| 美女精品网站| 亚洲美女中文字幕| 午夜性色一区二区三区免费视频 | 久久久久国产精品人| 欧美.www| 一区二区久久久久久| 国产精品久久久久久久久免费| 亚洲午夜视频在线| 久久久人人人| 亚洲精品中文字幕在线| 国产精品久久久久天堂| 欧美一区二区观看视频| 欧美mv日韩mv国产网站app| 亚洲美女啪啪| 国产亚洲精品自拍| 免费国产一区二区| 亚洲色无码播放| 免费在线日韩av| 亚洲一区二区综合| 精品69视频一区二区三区| 欧美久久久久久久久久| 性xx色xx综合久久久xx| 亚洲电影自拍| 久久久精品国产一区二区三区| 亚洲国产天堂久久国产91| 国产精品高精视频免费| 久久综合色8888| 一区二区三区免费看| 欧美69视频| 欧美在线免费| 亚洲最黄网站| 在线观看不卡av| 国产精品视频九色porn| 欧美激情一区二区三区在线视频观看| 亚洲淫片在线视频| 亚洲日本欧美天堂| 欧美国产精品久久| 久久国产精品亚洲77777| 亚洲精品在线观看免费| 激情综合亚洲| 国产欧美三级| 国产精品成人一区二区艾草| 麻豆精品在线观看| 午夜精品视频在线| 国产精品99久久久久久久vr| 亚洲国产精品va在线看黑人| 久久另类ts人妖一区二区| 亚洲欧美资源在线| 亚洲网址在线| 日韩视频精品在线| 亚洲丶国产丶欧美一区二区三区 | 欧美jizz19hd性欧美| 久久狠狠婷婷| 亚洲欧美卡通另类91av| 亚洲深夜av| 亚洲午夜未删减在线观看| 99在线精品免费视频九九视| 亚洲激情欧美| 91久久精品一区| 亚洲欧洲一级| 日韩午夜在线观看视频| 亚洲精选中文字幕| 亚洲精品乱码久久久久久久久 | 欧美一区二区三区视频| 午夜精品剧场| 久久精品国产清自在天天线| 欧美一区二区成人| 久久精品免费电影| 久久夜色精品国产欧美乱| 久久男人资源视频| 欧美大片91| 91久久夜色精品国产九色| 亚洲国产色一区| 日韩写真在线| 中文在线不卡| 午夜精品免费在线| 久久久www成人免费无遮挡大片| 久久综合电影| 欧美日本在线观看| 国产精品高清一区二区三区| 国产免费观看久久黄| 国产亚洲一区二区三区在线观看| 好看的亚洲午夜视频在线| 亚洲国产专区| 亚洲一区国产精品| 久久久久久久久岛国免费| 免费亚洲电影在线| 亚洲七七久久综合桃花剧情介绍| 99视频精品全部免费在线| 亚洲欧美一区在线| 久久夜色精品国产噜噜av| 欧美日韩国产黄| 国产一区二区你懂的| 亚洲国产日韩一区| 香蕉成人久久| 欧美凹凸一区二区三区视频| 亚洲精品一区二区三区99| 亚洲综合不卡| 免费在线观看成人av| 国产精品久久久久久久久久三级| 欲色影视综合吧| 午夜精品久久久久久| 毛片一区二区| 亚洲视频网在线直播| 久久婷婷av| 国产视频在线观看一区二区三区| 亚洲国产欧美在线人成| 性久久久久久| 亚洲激情在线视频| 久久99在线观看| 国产精品成人免费精品自在线观看| 激情综合网址| 欧美在线国产|