This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
ll f(ll n){
if(n%2) return ((n-1)/2)*((n-1)/2);
else return n/2*(n/2-1);
}
int main(){
string s;
cin>>s;
ll n=s.size();
double ans=0;
for(ll i=3;i<=n;i++){
ans+=(double)f(i)/(double)i;
}
cout<<setprecision(20)<<ans<<endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |