摘要:
斜率dp#include#include#include#include#define maxn 10005#define maxm 5005using namespace std;int dp[maxn][maxm];int q[maxn*10];int num[maxn];bool check(int j,int tail,int i){ int yk=dp[q[tail-1]][j-1]+num[q[tail-1]+1]*num[q[tail-1]+1]; int yj=dp[q[tail]][j-1]+num[q[tail]+1]*num[q[tail]+1]; in... 阅读全文