Submission #480327


Source Code Expand

def main():
    N, K = map(int, raw_input().split())
    cnt = 0.0
    for i in xrange(1, N + 1):
        for j in xrange(1, N + 1):
            for k in xrange(1, N + 1):
                a = [i, j, k]
                a.sort()
                if a[1] == K:
                    cnt += 1
    print cnt / N**3


if __name__ == '__main__':
    main()

Submission Info

Submission Time
Task D - 乱数生成
User issy
Language Python (2.7.3)
Score 0
Code Size 362 Byte
Status TLE
Exec Time 2045 ms
Memory 3420 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 100
Status
AC × 2
TLE × 1
AC × 6
TLE × 16
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 55 ms 3252 KiB
example_1.txt AC 54 ms 3256 KiB
example_2.txt TLE 2035 ms 3368 KiB
handmade_0.txt AC 57 ms 3252 KiB
handmade_1.txt TLE 2034 ms 3420 KiB
handmade_2.txt TLE 2034 ms 3372 KiB
handmade_3.txt TLE 2034 ms 3372 KiB
handmade_4.txt TLE 2033 ms 3380 KiB
handmade_5.txt TLE 2035 ms 3376 KiB
random_0.txt TLE 2034 ms 3372 KiB
random_1.txt TLE 2045 ms 3420 KiB
random_2.txt TLE 2034 ms 3372 KiB
random_3.txt TLE 2035 ms 3368 KiB
random_4.txt TLE 2034 ms 3372 KiB
smallrand_0.txt TLE 2035 ms 3372 KiB
smallrand_1.txt TLE 2034 ms 3420 KiB
smallrand_2.txt TLE 2033 ms 3348 KiB
smallrand_3.txt TLE 2034 ms 3380 KiB
smallrand_4.txt AC 273 ms 3260 KiB