1ac3wa1re 状态转移方程感觉没问题
#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int n,h,tot=1,htot,maxn,w[100][100],f[100],d[100],t[100];
int main()
{
scanf("%d%d",&n,&h);
h=h*60/5;
for(int i=1;i<=n;i++)
scanf("%d",&f[i]);
for(int i=1;i<=n;i++)
scanf("%d",&d[i]);
for(int i=1;i<=n-1;i++)
scanf("%d",&t[i]);
for(int i=1;i<=n;i++)
{
for(int k=htot+1;k<=h;k++)
{
w[i][k]=max(w[i-1][k-t[i-1]-1]+f[i],w[i][k-1]+f[i]-tot*d[i]);
if(w[i][k]==w[i][k-1])
break;
cout<<w[i][k]<<" ";
maxn=max(maxn,w[i][k]);
if(w[i][k]==w[i][k-1]+f[i]-tot*d[i])
tot++;
else
tot=1;
}
tot=0;
htot+=t[i];
cout<<endl;
}
cout<<maxn;
return 0;
}