摘要: 查询回文子串个数: #include<bits/stdc++.h> using namespace std; typedef long long LL; typedef pair<double,int> pii; const int N = 3e5+5; const int M = 1e6+5; c 阅读全文
posted @ 2020-10-05 13:53 levill 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 非常好的一个题,第一眼看到就觉得是贪心或者DP。 首先,一开始的思路是枚举第k天,然后把第k天最大的放入,但是保证每天放入剩下的树中对于这一天最大的,不一定是最优方案,所以不能枚举了。 正解:dp,dp[i][j]表示到第i棵树,天数为j的最大代价。 转移很简单,但是这里直接去dp,还不太对,因为有 阅读全文
posted @ 2020-10-05 09:23 levill 阅读(143) 评论(0) 推荐(0) 编辑