最长连续子序列和问题,我用了dp,状态转移方程是f[i] = max(f[i-1]+a[i],a[i]);但因为我实在是太弱了,没想到怎么找出两个边界,我只能又遍历了两次,等于最大值的i就是右边界,然后我从i往左找,再找左边界qaq
By signing up a 追梦算法网 universal account, you can submit code and join discussions in all online judging services provided by us.
Using your 追梦算法网 universal account