给定一个长度为n的排列p1,p2,...,pn,你需要将其划分成m个连续的段,并最大化每个连续段中最大值的和。同时,计算出达到最大和的分段方案数。最后,答案对109+7取模。
4 2
4 1 3 2
7
2
4 4
3 2 1 4
10
1
By signing up a acjudge universal account, you can submit code and join discussions in all online judging services provided by us.