码迷,mamicode.com
首页 > 其他好文 > 详细

未完成

时间:2017-09-23 00:10:00      阅读:132      评论:0      收藏:0      [点我收藏+]

标签:str   logs   amp   div   完成   g++   bsp   pop   class   

#include <cstdio>
#include <cmath>
#include <queue>
#define N 100005 

using namespace std;
int n,m,q,u,v,t;
struct node
{
    int l,flag;
    friend bool operator<(node a,node b)
    {
        return a.l+(a.left-a.flag)*q<b.l+(b.left-b.flag)*q;
    }
    node ()
    {
        l=0,flag=0,left=m;
    }
};
priority_queue<node>Q;
int Main()
{
    scanf("%d%d%d%d%d%d",&n,&m,&q,&u,&v,&t);
    double p=u*1.0/v;
    for(int i=1;i<=n;++i)
    {
        node a;
        scanf("%d",&a.l);
        Q.push(a);
    }
    for(int i=1;i<=m;++i)
    {
        node now=Q.top();
        Q.pop();
        int l1=floor(p*(now.l+(i-now.flag-1)*q)),l2=now.l+(i-now.flag-1)*q-l1;
        node tmp1,tmp2;
        tmp1.l=l1,tmp1.flag++,tmp1.left=m-i;
        tmp2.l=l2,tmp2.flag++,tmp2.left=m-i;
        Q.push(tmp1);
        Q.push(tmp2);
        if(i%t==0) printf("%d ",now.l+(i-now.flag-1)*q);
    }
    printf("\n");
    for(int i=1;i<=Q.size();++i)
    {
        node tmp=Q.top();
        Q.pop();
        if(i%t==0) printf("%d ",tmp.l+(m-tmp.flag-1)*q);
    }
    return 0;
}
int sb=Main();
int main(int argc,char *argv[]){;}

 

未完成

标签:str   logs   amp   div   完成   g++   bsp   pop   class   

原文地址:http://www.cnblogs.com/ruojisun/p/7577343.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!