This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
//consider scc graph
//u -> v
//if u bad then v must be bad
//so every ingoing edge into v must be good and sum of sub(tree?graph?) must be >= minimal parent
//i dont even need scc,only scc is if all values are equal okay yes
#include <bits/stdc++.h>
using namespace std;
#define sz(a) (int)(a.size())
#define all(a) a.begin(),a.end()
#define pb push_back
#define owo ios_base::sync_with_stdio(0);cin.tie(0);
typedef long long int ll;
typedef long double ld;
int main()
{
string s;
cin>>s;
int n = sz(s);
ld ans = 0;
ll a = (n+1)/2;
ll b = n/2;
ans = a*(a-1)/2 + b*(b-1)/2;
ans/=2;
cout<<fixed<<setprecision(10)<<ans<<'\n';
}
# | 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... |