Comments

My submission [](https://atcoder.jp/contests/abc330/submissions/47945295) my code even change from WA to AC after switch to clang C++,literally don't know what's going on.

It require ~762MB memory space for the long long DP[10^5][10^3] array which doesn't fit in the question's limitation. To reduce the space complexity,you need to use the technique called rolling array.The idea is like reusing two layer of array alternatively for the DP transition. My accepted code for reference:https://cses.fi/paste/27ef5df72fd9b9261f7b04/

Can anyone tells what's wrong with my solution with problem D,I think that the idea is similar to the editorial,I fail even I change the direction of iterating. My submission's link:https://atcoder.jp/contests/abc201/submissions/22620773

Thank you very much

I want to ask about the case 4 of testcase2 in question A .There is given that n=5 x=10000 array 10000 5000 5000 10000 0 The answer should be 4 which the subarray is 10000 5000 10000 0. But why the official answer of the case is 3. Am I misunderstand the question statement?