Submission #522859


Source Code Expand

S = raw_input()
list = S.split(" ")
list = map(int, list)

parameter = list[0] ** 3

n_lower = list[1]
n_higher = list[0]-list[1] + 1

combination = n_lower * n_higher
# input: n r
# r r r
combination = 1
# r r x
combination += 3 * (n_lower-1) + 3 * (n_higher-1)
# r x x
combination += ((n_lower * n_higher) - 1 - (n_lower-1 + n_higher-1)) * 6

print float(combination)/float(parameter)

Submission Info

Submission Time
Task D - 乱数生成
User tasuwo_
Language Python (2.7.3)
Score 100
Code Size 404 Byte
Status AC
Exec Time 69 ms
Memory 3740 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 69 ms 3672 KiB
example_1.txt AC 63 ms 3740 KiB
example_2.txt AC 66 ms 3656 KiB
handmade_0.txt AC 63 ms 3672 KiB
handmade_1.txt AC 63 ms 3664 KiB
handmade_2.txt AC 65 ms 3652 KiB
handmade_3.txt AC 65 ms 3652 KiB
handmade_4.txt AC 64 ms 3616 KiB
handmade_5.txt AC 66 ms 3676 KiB
random_0.txt AC 63 ms 3672 KiB
random_1.txt AC 63 ms 3668 KiB
random_2.txt AC 64 ms 3660 KiB
random_3.txt AC 64 ms 3680 KiB
random_4.txt AC 63 ms 3672 KiB
smallrand_0.txt AC 64 ms 3672 KiB
smallrand_1.txt AC 63 ms 3664 KiB
smallrand_2.txt AC 62 ms 3680 KiB
smallrand_3.txt AC 63 ms 3668 KiB
smallrand_4.txt AC 65 ms 3616 KiB