QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#812356 | #4196. Monty's Hall | rlc202204 | AC ✓ | 1ms | 3948kb | C++14 | 420b | 2024-12-13 14:39:10 | 2024-12-13 14:39:11 |
Judging History
answer
#include <iostream>
#include <cstdio>
#include <map>
#include <string>
#include <vector>
#include <cstring>
#include <algorithm>
using namespace std;
int main() {
int d, s, e;
cin >> d >> s >> e;
double p1 = 1.0 / d;
double p2 = (1.0 - 1.0 * s / d) / (d - e - s);
if (d - e - s >= s) {//???
printf("%.8lf\n", p2 * s);
}
else {
printf("%.8lf\n", 1.0 - 1.0 * s / d + (s - (d - e - s)) * p1);
}
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3832kb
input:
3 1 1
output:
0.66666667
result:
ok found '0.6666667', expected '0.6666670', error '0.0000003'
Test #2:
score: 0
Accepted
time: 1ms
memory: 3932kb
input:
8 4 2
output:
0.75000000
result:
ok found '0.7500000', expected '0.7500000', error '0.0000000'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3888kb
input:
15 4 2
output:
0.32592593
result:
ok found '0.3259259', expected '0.3259259', error '0.0000000'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3832kb
input:
1000000 1 1
output:
0.00000100
result:
ok found '0.0000010', expected '0.0000010', error '0.0000000'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3888kb
input:
1000000 999998 1
output:
0.99999900
result:
ok found '0.9999990', expected '0.9999990', error '0.0000000'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3948kb
input:
1000000 1 999998
output:
0.99999900
result:
ok found '0.9999990', expected '0.9999990', error '0.0000000'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3884kb
input:
78 39 18
output:
0.73076923
result:
ok found '0.7307692', expected '0.7307692', error '0.0000000'
Test #8:
score: 0
Accepted
time: 0ms
memory: 3892kb
input:
95 67 2
output:
0.72631579
result:
ok found '0.7263158', expected '0.7263158', error '0.0000000'
Test #9:
score: 0
Accepted
time: 0ms
memory: 3836kb
input:
132 37 42
output:
0.50242996
result:
ok found '0.5024300', expected '0.5024300', error '0.0000000'
Test #10:
score: 0
Accepted
time: 0ms
memory: 3784kb
input:
358 286 67
output:
0.98603352
result:
ok found '0.9860335', expected '0.9860335', error '0.0000000'
Test #11:
score: 0
Accepted
time: 0ms
memory: 3932kb
input:
507 268 214
output:
0.95069034
result:
ok found '0.9506903', expected '0.9506903', error '0.0000000'
Test #12:
score: 0
Accepted
time: 0ms
memory: 3888kb
input:
307521 21170 77603
output:
0.09443271
result:
ok found '0.0944327', expected '0.0944327', error '0.0000000'
Test #13:
score: 0
Accepted
time: 0ms
memory: 3756kb
input:
801885 303025 80078
output:
0.45014978
result:
ok found '0.4501498', expected '0.4501498', error '0.0000000'
Test #14:
score: 0
Accepted
time: 0ms
memory: 3892kb
input:
841840 457853 312238
output:
0.91477122
result:
ok found '0.9147712', expected '0.9147712', error '0.0000000'
Test #15:
score: 0
Accepted
time: 0ms
memory: 3824kb
input:
141716 97110 2985
output:
0.70630698
result:
ok found '0.7063070', expected '0.7063070', error '0.0000000'
Test #16:
score: 0
Accepted
time: 0ms
memory: 3892kb
input:
107479 105123 477
output:
0.98251752
result:
ok found '0.9825175', expected '0.9825175', error '0.0000000'