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;
typedef long long ll;
#define sz(x) (int)(x).size()
double expectOneGroup(int N)
{
ll k1 = ceil(N / (double)2), k2 = floor(N / (double)2);
return (k1 * (k1 - 1) + k2 * (k2 - 1)) / (double)4;
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
string P;
cin >> P;
ll N = sz(P);
double res = expectOneGroup(N);
printf("%f\n", res);
return 0;
}
# | 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... |