#include <iostream.h>
void main()
{
int n,k,time,i,j,max,ii,temp;
int t[100],p[100],s[100],a[2][101];
cin>>n>>k>>time;
for(i=0;i<n;i++)
cin>>t[i];
for(i=0;i<n;i++)
cin>>p[i];
for(i=0;i<n;i++)
cin>>s[i];
for(j=0;j<=k;j++)
{
a[0][j]=0;
}
for(i=0;i<n-1;i++)
for(j=i+1;j<n;j++)
if (t[i]>t[j])
{
temp=t[i];
t[i]=t[j];
t[j]=temp;
temp=s[i];
s[i]=s[j];
s[j]=temp;
temp=p[i];
p[i]=p[j];
p[j]=temp;
}
ii=1;temp=0;
while (t[temp]==0)
temp++;
for(i=1;i<=time&&temp<n;i++)
{
for(j=0;j<=k;j++)
{
a[ii][j]=0;
if (j>0&&a[1-ii][j-1]>a[ii][j]) a[ii][j]=a[1-ii][j-1];
if (a[1-ii][j]>a[ii][j]) a[ii][j]=a[1-ii][j];
if (j<k&&a[1-ii][j+1]>a[ii][j]) a[ii][j]=a[1-ii][j+1];
}
while (temp<n&&t[temp]==i)
{
if(s[temp]<=i)
a[ii][s[temp]]+=p[temp];
temp++;
}
ii=1-ii;
}
max=0;
for(i=0;i<=k;i++)
if(max<a[1-ii][i]) max=a[1-ii][i];
cout<<max<<endl;
}
分享到:
相关推荐
Chapter One Fighting For Economic Development 1 Chapter Two Suharto, Inc. 22 Chapter Three The Smuggling Gap 53 ...Learning to Fight Economic Gangsters 186 Epilogue Doing Better This Time 207
Grand Gangsters 3D 大BOSS Unity侠盗之城竞速射击项目源码C# 支持Unity版本2019.4.40f1及以上 欢迎来到侠盗之城!一切开始的地方。今天就在《大BOSS》的圣安德烈亚斯断层中开启一次危险的全新城市之旅! 《大黑帮》...
BN-Gangsters
British Gangsters Pack - Museum v1.0
* - listen for publications from gangsters on subAddress * - proxy http connections requests to httpAddress : httpPort */var alley = require ( 'gang' ) . alley ( { subAddress : 'tcp://127.0.0.1:8990'...
此外,“If the money was not paid promptly, the gangsters would quickly put a man out of business”展示了条件句的使用,以及动词短语“put out of business”的含义——使某人破产。 文章还涉及到时间和年龄...
6. **团队介绍(YOUR GANGSTERS)**:展示团队成员的照片和个人简介,可以增加观众对你的信任度。每个团队成员的描述应简明扼要,突出他们的专业技能和成就。 7. **服务展示(WE OFFER THE BEST SERVICES)**:用...
例如:“The gangsters were involved in illegal activities such as drug trafficking.”(这些歹徒参与了贩毒等非法活动。) ##### 38. **hard** (艰苦) - **解析:** 艰难困苦的。例如:“Life in the ...