Submission #118677


Source Code Expand

Copy
from random import sample

N, M, K = map(int, input().split())

T = [tuple(map(int, input().split())) for _ in range(M)]

hoge = 50000
count = 0
for _ in range(hoge):
    l = list(range(N))

    for _ in range(K):
        a, b = sample(l, 2)
        l[a], l[b] = l[b], l[a]

    count += any(((l[i], l[i - 1])
                  if l[i] < l[i - 1]
                  else (l[i - 1], l[i]))
                 in T
                 for i in range(N))

print(1. - count / hoge)

Submission Info

Submission Time
Task D - シャッフル席替え
User misolmiso
Language Python (3.2.3)
Score 0
Code Size 496 Byte
Status WA
Exec Time 10039 ms
Memory 8612 KB

Judge Result

Set Name all
Score / Max Score 0 / 100
Status
AC × 29
WA × 4
TLE × 38
Set Name Test Cases
all 00_mini_01.txt, 00_mini_02.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_rnd_11_01.txt, 01_rnd_11_02.txt, 01_rnd_11_03.txt, 01_rnd_11_04.txt, 01_rnd_11_05.txt, 01_rnd_11_06.txt, 01_rnd_11_07.txt, 01_rnd_11_08.txt, 01_rnd_11_09.txt, 01_rnd_11_10.txt, 01_rnd_11_11.txt, 01_rnd_11_12.txt, 01_rnd_11_13.txt, 01_rnd_11_14.txt, 01_rnd_11_15.txt, 01_rnd_11_16.txt, 01_rnd_11_17.txt, 01_rnd_11_18.txt, 01_rnd_11_19.txt, 01_rnd_11_20.txt, 01_rnd_11_21.txt, 01_rnd_11_22.txt, 01_rnd_7_01.txt, 01_rnd_7_02.txt, 01_rnd_7_03.txt, 01_rnd_7_04.txt, 01_rnd_7_05.txt, 01_rnd_7_06.txt, 01_rnd_7_07.txt, 01_rnd_7_08.txt, 01_rnd_7_09.txt, 01_rnd_7_10.txt, 01_rnd_7_11.txt, 01_rnd_7_12.txt, 01_rnd_7_13.txt, 01_rnd_7_14.txt, 01_rnd_7_15.txt, 01_rnd_7_16.txt, 01_rnd_7_17.txt, 01_rnd_7_18.txt, 01_rnd_7_19.txt, 01_rnd_7_20.txt, 01_rnd_7_21.txt, 01_rnd_7_22.txt, 01_rnd_8_01.txt, 01_rnd_8_02.txt, 01_rnd_8_03.txt, 01_rnd_8_04.txt, 01_rnd_8_05.txt, 01_rnd_8_06.txt, 01_rnd_8_07.txt, 01_rnd_8_08.txt, 01_rnd_8_09.txt, 01_rnd_8_10.txt, 01_rnd_8_11.txt, 01_rnd_8_12.txt, 01_rnd_8_13.txt, 01_rnd_8_14.txt, 01_rnd_8_15.txt, 01_rnd_8_16.txt, 01_rnd_8_17.txt, 01_rnd_8_18.txt, 01_rnd_8_19.txt, 01_rnd_8_20.txt, 01_rnd_8_21.txt, 01_rnd_8_22.txt
Case Name Status Exec Time Memory
00_mini_01.txt TLE 10029 ms 8600 KB
00_mini_02.txt TLE 10030 ms 8596 KB
00_sample_01.txt AC 951 ms 8468 KB
00_sample_02.txt TLE 10031 ms 8596 KB
00_sample_03.txt WA 1572 ms 8388 KB
01_rnd_11_01.txt TLE 10032 ms 8600 KB
01_rnd_11_02.txt TLE 10030 ms 8484 KB
01_rnd_11_03.txt TLE 10029 ms 8596 KB
01_rnd_11_04.txt TLE 10030 ms 8600 KB
01_rnd_11_05.txt TLE 10030 ms 8492 KB
01_rnd_11_06.txt TLE 10030 ms 8484 KB
01_rnd_11_07.txt TLE 10030 ms 8484 KB
01_rnd_11_08.txt TLE 10030 ms 8484 KB
01_rnd_11_09.txt TLE 10030 ms 8488 KB
01_rnd_11_10.txt TLE 10032 ms 8484 KB
01_rnd_11_11.txt TLE 10031 ms 8484 KB
01_rnd_11_12.txt AC 9434 ms 8488 KB
01_rnd_11_13.txt AC 1041 ms 8516 KB
01_rnd_11_14.txt AC 1935 ms 8484 KB
01_rnd_11_15.txt TLE 10030 ms 8600 KB
01_rnd_11_16.txt AC 6379 ms 8484 KB
01_rnd_11_17.txt WA 3790 ms 8468 KB
01_rnd_11_18.txt AC 7428 ms 8468 KB
01_rnd_11_19.txt AC 9956 ms 8472 KB
01_rnd_11_20.txt AC 9837 ms 8596 KB
01_rnd_11_21.txt AC 6307 ms 8476 KB
01_rnd_11_22.txt AC 3766 ms 8484 KB
01_rnd_7_01.txt TLE 10031 ms 8524 KB
01_rnd_7_02.txt TLE 10030 ms 8524 KB
01_rnd_7_03.txt TLE 10030 ms 8488 KB
01_rnd_7_04.txt TLE 10031 ms 8488 KB
01_rnd_7_05.txt TLE 10034 ms 8512 KB
01_rnd_7_06.txt TLE 10031 ms 8484 KB
01_rnd_7_07.txt TLE 10031 ms 8536 KB
01_rnd_7_08.txt TLE 10030 ms 8484 KB
01_rnd_7_09.txt TLE 10030 ms 8612 KB
01_rnd_7_10.txt TLE 10030 ms 8488 KB
01_rnd_7_11.txt TLE 10030 ms 8592 KB
01_rnd_7_12.txt AC 6065 ms 8472 KB
01_rnd_7_13.txt TLE 10030 ms 8524 KB
01_rnd_7_14.txt AC 6649 ms 8404 KB
01_rnd_7_15.txt AC 5514 ms 8384 KB
01_rnd_7_16.txt AC 9612 ms 8488 KB
01_rnd_7_17.txt AC 4072 ms 8484 KB
01_rnd_7_18.txt AC 6077 ms 8484 KB
01_rnd_7_19.txt AC 2495 ms 8472 KB
01_rnd_7_20.txt AC 3506 ms 8476 KB
01_rnd_7_21.txt AC 6010 ms 8484 KB
01_rnd_7_22.txt AC 1980 ms 8484 KB
01_rnd_8_01.txt TLE 10030 ms 8480 KB
01_rnd_8_02.txt TLE 10031 ms 8476 KB
01_rnd_8_03.txt TLE 10030 ms 8600 KB
01_rnd_8_04.txt TLE 10039 ms 8488 KB
01_rnd_8_05.txt TLE 10036 ms 8600 KB
01_rnd_8_06.txt TLE 10031 ms 8480 KB
01_rnd_8_07.txt TLE 10030 ms 8596 KB
01_rnd_8_08.txt TLE 10031 ms 8484 KB
01_rnd_8_09.txt TLE 10030 ms 8520 KB
01_rnd_8_10.txt TLE 10029 ms 8484 KB
01_rnd_8_11.txt TLE 10031 ms 8596 KB
01_rnd_8_12.txt AC 7283 ms 8404 KB
01_rnd_8_13.txt AC 997 ms 8388 KB
01_rnd_8_14.txt AC 7246 ms 8472 KB
01_rnd_8_15.txt AC 5151 ms 8472 KB
01_rnd_8_16.txt WA 4198 ms 8484 KB
01_rnd_8_17.txt WA 9968 ms 8480 KB
01_rnd_8_18.txt AC 2089 ms 8524 KB
01_rnd_8_19.txt AC 5238 ms 8472 KB
01_rnd_8_20.txt AC 7164 ms 8480 KB
01_rnd_8_21.txt AC 2069 ms 8468 KB
01_rnd_8_22.txt AC 9731 ms 8464 KB