读题坑了队友,害怕.jpg
好好做还是能a的,详见队友的博客了,大佬讲了一下,还是不难的,但是~~~
#include#include #include #include #include #include #include #include #define INF 0x3f3f3f3fusing namespace std;#define ll long longconst int maxn=110;double dp[maxn][maxn];struct Node{ double a,l,p; double c,d;}nod[maxn];bool cmp(Node A,Node B){ return (A.c-1)*B.d j) dp[i][j]=dp[i-1][j]; dp[i][j]=max(dp[i][j],dp[i-1][j-1]*nod[i].c+nod[i].d); } } printf("%.2lf\n",dp[n][k]); } return 0;}