#P1365. WJMZBMR打osu! / Easy
WJMZBMR打osu! / Easy
Description
One day WJMZBMR was playing osu, but he is too weak; some parts rely entirely on luck :(.
Let’s simplify the rules of the game.
There are clicks to make. A success is o, a miss is x. The score is computed by combos: a combo of length is worth points. A combo is a maximal consecutive block of o.
For example, for ooxxxxooooxxx, the score is .
Some positions are fixed (either o or x), and some positions are random with chance for each, denoted by ?.
For example, oo?xx is a possible input. What is the expected score of this osu game?
For oo?xx, if ? is o, then it becomes oooxx (); if it is x, then it becomes ooxxx (). The expected value is .
Input Format
The first line contains an integer (), the number of clicks.
The next line contains a string, where each character is one of o, x, ?.
Output Format
Output a single floating-point number: the answer.
Round to decimal places.
If you are worried about precision, it is recommended to use long double or extended.
4
????
4.1250
Hint
Translated by ChatGPT 5
京公网安备 11011102002149号