Here is Problem Link i read its editorial but unable to understand it would anyone like to make me understand this problem ?

Codeforces celebrates 10 years! We are pleased to announce the crowdfunding-campaign. Congratulate us by the link https://codeforces.com/10years.
×

Before contest

Codeforces Round #623 (Div. 1, based on VK Cup 2019-2020 - Elimination Round, Engine)

23:36:44

Register now »

Codeforces Round #623 (Div. 1, based on VK Cup 2019-2020 - Elimination Round, Engine)

23:36:44

Register now »

*has extra registration

Before contest

Codeforces Round #623 (Div. 2, based on VK Cup 2019-2020 - Elimination Round, Engine)

23:36:43

Register now »

Codeforces Round #623 (Div. 2, based on VK Cup 2019-2020 - Elimination Round, Engine)

23:36:43

Register now »

*has extra registration

# | User | Rating |
---|---|---|

1 | MiFaFaOvO | 3681 |

2 | tourist | 3404 |

3 | TLE | 3356 |

4 | apiadu | 3351 |

5 | mnbvmar | 3281 |

6 | LHiC | 3276 |

7 | Um_nik | 3268 |

8 | 300iq | 3267 |

9 | yosupo | 3249 |

10 | ainta | 3226 |

# | User | Contrib. |
---|---|---|

1 | Errichto | 190 |

2 | antontrygubO_o | 186 |

3 | tourist | 182 |

4 | Radewoosh | 168 |

5 | vovuh | 167 |

6 | pikmike | 166 |

7 | ko_osaga | 161 |

8 | Um_nik | 160 |

9 | Petr | 154 |

10 | McDic | 152 |

Here is Problem Link i read its editorial but unable to understand it would anyone like to make me understand this problem ?

↑

↓

Codeforces (c) Copyright 2010-2020 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Feb/22/2020 19:28:17 (f2).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|

Did you mean "understand its editorial"?

I haven't understood the editorial, but I have another idea for you, and it may be shorter! :)

When you are at the i-th click, let L be the length of the previous consecutive "O"s block. If the i-th click is bad, your score increases 0, otherwise it increases (L+1)^2-L^2=2L+1.

We will canculate the expected score each click "gives". The answer to the problem is the sum of all expected score. For the i-th click, let X be the expected length of the previous consecutive "O"s block (after i-1 clicks). The expected score this click gives is p*(2*X+1), where p is the probability that the click will be correct. Then, the expected length X after this click changes to p*(X+1).

See my submission 7665345 for more information.

I hope you will understand it. Thanks for your attention :D