这个题简直有毒
按照q=0的情况来写
一开始sort超时
后来手动排序
结果
忽略了*u的地方有可能超int
一直卡在50
后面初始化成128[负数最小值]
真的是打死我也想不到(ಥ _ ಥ)
初始化的原因是在有一队取完之后指向位置的数值为0
其他为负数
比较时会出错
哪里有卖蚯蚓吃的
请务必告诉我⁾(ノಠ益ಠ)ノ彡┻━┻
#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<queue>
#include<cstring>
#include<string>
#include<stdio.h>
using namespace std;
long long x,a;
int n,m,q,u,v,t,i,h=1,h1=1,h2=1,p[9999999],r[9999999],l[9999999],k,f[9999999];
int main()
{
freopen("earthworm.in","r",stdin);
freopen("earthworm.ans","w",stdout);
scanf("%d%d%d%d%d%d",&n,&m,&q,&u,&v,&t);
memset(p,128,sizeof(p));
memset(l,128,sizeof(l));
memset(r,128,sizeof(r));
for(i=1;i<=n;i++)
scanf("%d",&p[i]);
sort(p+1,p+n+1,greater<int>());
for(i=1;i<=m;i++)
{
x=max(p[h],max(r[h1],l[h2]));
if(x==p[h]) h++;
else if(x==r[h1]) h1++;
else h2++;
a=(x+=(i-1)*q)*u/v;
r[i]=a-i*q;
l[i]=x-a-i*q;
if(i%t==0) printf("%lld ",x);
}
printf("\n");
for(i=1;i<=n+m;i++)
{
x=max(p[h],max(r[h1],l[h2]));
if(x==p[h]) h++;
else if(x==r[h1]) h1++;
else h2++;
if(i%t==0) printf("%lld ",x+m*q);
}
return 0;
}