Submission #701887

#TimeUsernameProblemLanguageResultExecution timeMemory
701887JohannBoarding Passes (BOI22_passes)C++14
0 / 100
1 ms528 KiB
#include "bits/stdc++.h"
using namespace std;

typedef long long ll;
#define sz(x) (int)(x).size()

double expectOneGroup(int N)
{
    int 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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...