die码
麻烦各位了
#include<bits/stdc++.h>
#define int long long
using namespace std;
struct tag
{
int data=INT_MAX;
vector<int> num;
};
const int N=100;
int est[N][N];
int flo_num,vas_num;
tag dp[N][N];
signed main()
{
cin>>flo_num>>vas_num;
for(int times1=1;times1<=flo_num;times1++)
for(int times2=1;times2<=vas_num;times2++)
cin>>est[times1][times2];
for(int times=0;times<=vas_num;times++)
dp[0][times].data=0;
for(int times1=1;times1<=flo_num;times1++)
for(int times2=times1;times2<=vas_num-(flo_num-times1);times2++)
{
dp[times1][times2]=dp[times1][times2-1];
if(dp[times1-1][times2-1].data+est[times1][times2]>dp[times1][times2].data)
{
dp[times1][times2].data=dp[times1-1][times2-1].data+est[times1][times2];
dp[times1][times2].num=dp[times1-1][times2-1].num;
dp[times1][times2].num.push_back(times2);
}
}
cout<<dp[flo_num][vas_num].data<<endl;
for(int times=0;times<flo_num;times++)
{
cout<<dp[flo_num][vas_num].num[times]<<" ";
}
}