我是sb!
WA了两发哈哈哈哈哈哈
记录第i个位置的期望连击长度l[i]和期望得分f[i]
直接搞
都不好说什么了
sigh
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<=b;i++)
int n;
char st[300001];
long double l[300001] , f[300001];
int main() {
scanf("%d" , &n);
scanf("%s" , st + 1);
rep(i , 1 , n) {
if (st[i] == 'o')
l[i] = l[i - 1] + 1 , f[i] = f[i - 1] + (l[i] * 2 - 1);
else if (st[i] == 'x')
l[i] = 0 , f[i] = f[i - 1];
else if (st[i] == '?')
l[i] = (l[i - 1] + 1) / 2 , f[i] = f[i - 1] + (l[i - 1] + 0.5);
}
printf("%.4Lf\n" , f[n]);
return 0;
}