Submission #489862


Source Code Expand

n, k = [int(n) for n in raw_input().split()]

p0 = 1.0/n * (n-k*1.0)/n * (k-1.0)/n * 6
p1 = 1.0/n * (n-k*1.0)/n * 1.0/n * 3
p2 = 1.0/n * 1.0/n * (k-1.0)/n * 3
p3 = (1.0/n) ** 3

print p0+p1+p2+p3

Submission Info

Submission Time
Task D - 乱数生成
User lackdog
Language Python (2.7.3)
Score 100
Code Size 204 Byte
Status AC
Exec Time 59 ms
Memory 3504 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 3
AC × 22
Set Name Test Cases
Sample example_0.txt, example_1.txt, example_2.txt
All example_0.txt, example_1.txt, example_2.txt, handmade_0.txt, handmade_1.txt, handmade_2.txt, handmade_3.txt, handmade_4.txt, handmade_5.txt, random_0.txt, random_1.txt, random_2.txt, random_3.txt, random_4.txt, smallrand_0.txt, smallrand_1.txt, smallrand_2.txt, smallrand_3.txt, smallrand_4.txt, example_0.txt, example_1.txt, example_2.txt
Case Name Status Exec Time Memory
example_0.txt AC 59 ms 3488 KiB
example_1.txt AC 57 ms 3504 KiB
example_2.txt AC 57 ms 3500 KiB
handmade_0.txt AC 57 ms 3264 KiB
handmade_1.txt AC 57 ms 3504 KiB
handmade_2.txt AC 57 ms 3496 KiB
handmade_3.txt AC 57 ms 3496 KiB
handmade_4.txt AC 58 ms 3504 KiB
handmade_5.txt AC 57 ms 3488 KiB
random_0.txt AC 57 ms 3504 KiB
random_1.txt AC 57 ms 3500 KiB
random_2.txt AC 55 ms 3264 KiB
random_3.txt AC 57 ms 3504 KiB
random_4.txt AC 58 ms 3504 KiB
smallrand_0.txt AC 57 ms 3500 KiB
smallrand_1.txt AC 54 ms 3252 KiB
smallrand_2.txt AC 55 ms 3496 KiB
smallrand_3.txt AC 56 ms 3496 KiB
smallrand_4.txt AC 56 ms 3504 KiB