|
0
I tried to analyse your code : |
|
0
yes yes using pref and suff more easier just the idea didn't came |
|
0
Hello guys i know it's been a while for this div but i have an idea on D that got me ACC so we can make it using seg tree because b1+b3+b2-(r-l) to be maximized we can see it like this : (b1+l)+b2+(b3-r) and for every element from 2 to n-1 we can get max element which is (bj+j) and j from 1 to i-1 and max (bc-c) where c from i+1 to n so result will be max(bi+max(bj+j)+max(bc-c)) and we can query using the seg tree to see the two element we are looking for because both B1 and B3 needs to be the left and right itself |
|
0
it's been a while but for problem C we can use monotonic stack good luck everyone !!! |
|
0
there's the check part n%i |
|
На
Pyqe →
Codeforces Round #831 (Div. 1 + Div. 2, based on COMPFEST 14 Final) Editorial, 3 года назад
0
yes we can just make it in O(n+log(n) for the sort ) == O(n) . |