#include<bits/stdc++.h>
using namespace std;
typedef long double ld;
const int G=20;
const int N=1e5+5;
int n,g;
ld dp[N];
int main(){
cin.tie(nullptr)->sync_with_stdio(false);
string s;
cin >> s;
n=s.size();
for(int i=1;i<=n;i++){
dp[i]=dp[i-1];
dp[i]+=1.l*(1ll*(i/2)*(i/2-1))/i;
if(i&1)dp[i]+=1.l*(i/2)/i;
}
cout << dp[n] << "\n";
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
340 KB |
1st numbers differ - expected: '100800.5000000000', found: '100689.0000000000', error = '0.0011061453' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
1st numbers differ - expected: '1.0000000000', found: '2.6333300000', error = '1.6333300000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
1st numbers differ - expected: '1.0000000000', found: '2.6333300000', error = '1.6333300000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
340 KB |
1st numbers differ - expected: '100800.5000000000', found: '100689.0000000000', error = '0.0011061453' |
2 |
Halted |
0 ms |
0 KB |
- |