#include <bits/stdc++.h>
#define FAST_IO ios_base::sync_with_stdio(false); cin.tie(nullptr)
#define FOR(i, begin, end) for(int i=(begin); i<(end); i++)
#define sz(x) int((x).size())
#define pb push_back
#define s second
#define f first
using namespace std;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef tuple<int, int, int> tiii;
typedef long double ld;
const int INF=1e9;
const int N=1e5+10;
int n;
string s;
int main()
{
FAST_IO;
cin >> s; n=sz(s);
ld ans=0;
FOR(i, 2, (n+1)/2+1)
{
ld val=(i-1)/ld(i);
ans+=val;
}
FOR(i, 2, n/2+1)
{
ld val=(i-1)/ld(i);
ans+=val;
}
cout << fixed << setprecision(4) << ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
1st numbers differ - expected: '100800.5000000000', found: '885.6271000000', error = '0.9912140604' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
1st numbers differ - expected: '1.0000000000', found: '2.3333000000', error = '1.3333000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
1st numbers differ - expected: '1.0000000000', found: '2.3333000000', error = '1.3333000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
1st numbers differ - expected: '100800.5000000000', found: '885.6271000000', error = '0.9912140604' |
2 |
Halted |
0 ms |
0 KB |
- |