| Task: | Arvonta |
| Sender: | Mahtimursu |
| Submission time: | 2025-09-07 20:13:46 +0300 |
| Language: | Python3 (PyPy3) |
| Status: | READY |
| Result: | 37 |
| group | verdict | score |
|---|---|---|
| #1 | ACCEPTED | 37 |
| #2 | TIME LIMIT EXCEEDED | 0 |
| test | verdict | time | group | |
|---|---|---|---|---|
| #1 | ACCEPTED | 0.04 s | 1, 2 | details |
| #2 | TIME LIMIT EXCEEDED | -- | 2 | details |
Code
from math import factorial
def prob(k, n, p):
nck = factorial(n) / (factorial(k) * factorial(n-k))
return nck * p**k * (1-p)**(n-k)
t = int(input())
for _ in range(t):
n = int(input())
# x voittoa: x * 1/n * (n-x) * (n-1)/n
ans = 0
for x in range(1, n+1):
ans += prob(x, n, 1/n)
print(ans)Test details
Test 1
Group: 1, 2
Verdict: ACCEPTED
| input |
|---|
| 10 1 2 3 4 ... |
| correct output |
|---|
| 1.0 0.75 0.7037037037 0.68359375 0.67232 ... |
| user output |
|---|
| 1.0 0.75 0.7037037037037037 0.68359375 0.6723200000000001 ... Truncated |
Test 2
Group: 2
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 1000 1 2 3 4 ... |
| correct output |
|---|
| 1.0 0.75 0.7037037037 0.68359375 0.67232 ... |
| user output |
|---|
| (empty) |
