Submission #481461


Source Code Expand

# -*- coding: utf-8 -*-

N, K = map(int, raw_input().split())
# get a string
largerK = N - K;
lessK = K - 1;
a = 6 * largerK * lessK + 3 * largerK + 3 * lessK + 1;
base = N * N * N;
result = a * 1.0 / base;
# output
print result

Submission Info

Submission Time
Task D - 乱数生成
User cilam
Language Python (2.7.3)
Score 100
Code Size 238 Byte
Status AC
Exec Time 58 ms
Memory 3392 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 58 ms 3388 KiB
example_1.txt AC 58 ms 3376 KiB
example_2.txt AC 57 ms 3388 KiB
handmade_0.txt AC 56 ms 3256 KiB
handmade_1.txt AC 56 ms 3372 KiB
handmade_2.txt AC 57 ms 3380 KiB
handmade_3.txt AC 56 ms 3380 KiB
handmade_4.txt AC 57 ms 3384 KiB
handmade_5.txt AC 56 ms 3376 KiB
random_0.txt AC 57 ms 3388 KiB
random_1.txt AC 56 ms 3384 KiB
random_2.txt AC 56 ms 3388 KiB
random_3.txt AC 57 ms 3376 KiB
random_4.txt AC 56 ms 3384 KiB
smallrand_0.txt AC 56 ms 3380 KiB
smallrand_1.txt AC 58 ms 3392 KiB
smallrand_2.txt AC 58 ms 3380 KiB
smallrand_3.txt AC 55 ms 3392 KiB
smallrand_4.txt AC 57 ms 3388 KiB