#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 time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
found '100800.5000000000', expected '100800.5000000000', error '0.0000000000' |
2 |
Correct |
0 ms |
212 KB |
found '0.0000000000', expected '0.0000000000', error '-0.0000000000' |
3 |
Correct |
1 ms |
212 KB |
found '0.0000000000', expected '0.0000000000', error '-0.0000000000' |
4 |
Correct |
1 ms |
212 KB |
found '1.0000000000', expected '1.0000000000', error '0.0000000000' |
5 |
Correct |
1 ms |
212 KB |
found '124002.0000000000', expected '124002.0000000000', error '0.0000000000' |
6 |
Incorrect |
1 ms |
528 KB |
1st numbers differ - expected: '772893586.0000000000', found: '-300848238.0000000000', error = '1.3892492362' |
7 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
1st numbers differ - expected: '1.0000000000', found: '3.0000000000', error = '2.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
1st numbers differ - expected: '1.0000000000', found: '3.0000000000', error = '2.0000000000' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
found '100800.5000000000', expected '100800.5000000000', error '0.0000000000' |
2 |
Correct |
0 ms |
212 KB |
found '0.0000000000', expected '0.0000000000', error '-0.0000000000' |
3 |
Correct |
1 ms |
212 KB |
found '0.0000000000', expected '0.0000000000', error '-0.0000000000' |
4 |
Correct |
1 ms |
212 KB |
found '1.0000000000', expected '1.0000000000', error '0.0000000000' |
5 |
Correct |
1 ms |
212 KB |
found '124002.0000000000', expected '124002.0000000000', error '0.0000000000' |
6 |
Incorrect |
1 ms |
528 KB |
1st numbers differ - expected: '772893586.0000000000', found: '-300848238.0000000000', error = '1.3892492362' |
7 |
Halted |
0 ms |
0 KB |
- |