Comments
0

It's brilliant! Thank you bicsi, this is a really neat solution.

I have another solution to this problem that may work

Use f[i][j]=X to represent the X extra segments are needed to cover from i to i + 2^j Use g[i][j]=Y to represent when adding f[i][j] extra segments after segment i, the actual terminating node is Y.

DP to calculate f, g, then loop every starting node and lookup f, g to calculate the answer in logK. Go through this process and reverse all segments to do it again, to cover the case that first extra segment is not starting from i_right

0

I think the prerequisite of sliding window is: if you move head or tail, middle solution doesn't change. Which might not be true in this problem

0

How are you going to handle the case that one extra X covers multiple intervals? Also, when the head of sliding window changes, all the extra X in the middle might change.

0

Auto comment: topic has been updated by Mopriestt (previous revision, new revision, compare).

0

Auto comment: topic has been updated by Mopriestt (previous revision, new revision, compare).

On tunyashCodeforces Round #213, 13 years ago
+2

Oh,I smelt some special tricks..

On SteamTurbineCodeforces Round #180, 13 years ago
+4

Surprised to see Chinese character^_^

(with sniper precision)!

On MinakoKojimaCodeforces Round #172, 13 years ago
0

Div1..not Div2

On MinakoKojimaCodeforces Round #172, 13 years ago
+1

For div1 B...I tested the case#3 on my PC and the answer is correct,but the result is different on CF..

On MopriesttY..?, 14 years ago
+22

Ok I got it,sorry for annoying.I thought it only a private space...