Submission #600806

#TimeUsernameProblemLanguageResultExecution timeMemory
600806alextodoranBoarding Passes (BOI22_passes)C++17
0 / 100
0 ms212 KiB
/**
 ____ ____ ____ ____ ____
||a |||t |||o |||d |||o ||
||__|||__|||__|||__|||__||
|/__\|/__\|/__\|/__\|/__\|

**/

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int main () {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cout << fixed << setprecision(4);

    string S;
    cin >> S;
    int N = (int) S.size();
    int L = N / 2;
    int R = N - L;
    ll answer = (ll) L * (L - 1) / 2 + (ll) R * (R - 1) / 2;
    if (answer % 2 == 0) {
        cout << answer / 2 << ".0\n";
    } else {
        cout << answer / 2 << ".5\n";
    }

    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...