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;
typedef long double ld;
#define all(x) x.begin(), x.end()
#define pb push_back
#define fi first
#define se second
const int maxn5 = 3e5 + 10;
const ll inf = 1e18;
int main(){
ios_base::sync_with_stdio(false); cin.tie(0);
string s; cin >> s;
ll n = s.size();
ll len1 = n / 2;
ll len2 = len1 + n % 2;
cout << setprecision(10) << fixed << ld(len1 * (len1 - 1) + len2 * (len2 - 1)) / 4 << 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... |