PersonalCorpus 版 (精华区)

40240 2002-10-09 21:02:17 Accepted
1200 C++ 00:00.98 424K Big Guava

int main()
{
#ifndef ONLINE_JUDGE
    freopen("c:\\0acm\\zju\\i1200","r",stdin);
    freopen("c:\\0acm\\zju\\o1200","w",stdout);
#endif

    int i,j,k;
    int t[10000],n,tot,s,w,c,m;

    while (scanf("%d%d%d%d%d\n",&s,&w,&c,&k,&m)==5) {
        tot=0; n=0;
        if (k>10000) k=10000;
        for (i=0;i<k;i++) t[i]=s+i*m+m;
        while (tot<10000) {
            j=0; for (i=1;i<k;i++) if (t[i]<t[j]) j=i;
            if (t[j]>n) n=t[j];
            t[j]=n+s+s+w;
            n+=w;
            tot+=c;
        }
        printf("%d\n",n+s);
    }
}
[百宝箱] [返回首页] [上级目录] [根目录] [返回顶部] [刷新] [返回]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:3.087毫秒