摘要:
简单DP,状态转移方程如下:res[i][j]=min(res[i][j],res[k][j-1]+fact(k+1,i)) (1<=j<i && j<=m, 1<=i<=n, 1<=k<i);fact(i,j)表示从i到j的系数。#include<iostream>#include<cstdio>#include<cstring>using namespace std;#define MAX 1234567890int res[501][501],fact[501][501],horse[501]; 阅读全文