Submission #169829


Source Code Expand

Copy
import itertools
n = int(raw_input())
a = []
b = [] 
c = []
ans = 0
ans = float(ans)
for i in range(n):
    tmp = int(raw_input())
    a.append(tmp)
    b.append(0)

c = list(itertools.permutations(a))

tmp = 1.0
for j in range(1, n + 1):
    tmp = tmp * j

tmp1 = int(tmp)
for i in range(tmp1):
    for l in range(n):
        for j in range((l + 1), n):
            if c[i][l] % c[i][j] == 0:
                b[j] += 1
    for k in range(n):
        if b[k] % 2 == 0:
            ans += 1
    for m in range(n):
        b[m] = 0

tmp = 1.0
for j in range(1, n + 1):
    tmp = tmp * j

tmp = tmp * n
print ans * n / tmp

Submission Info

Submission Time
Task C - コイン
User kametaso
Language Python (2.7.3)
Score 0
Code Size 656 Byte
Status WA
Exec Time 2129 ms
Memory 727600 KB

Judge Result

Set Name Sample Subtask1 Subtask2
Score / Max Score 0 / 0 0 / 99 0 / 1
Status
AC × 2
WA × 1
AC × 10
WA × 10
AC × 10
WA × 10
TLE × 20
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
Subtask1 subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask1_14.txt, subtask1_15.txt, subtask1_16.txt, subtask1_17.txt, subtask1_18.txt, subtask1_19.txt, subtask1_20.txt
Subtask2 subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask1_14.txt, subtask1_15.txt, subtask1_16.txt, subtask1_17.txt, subtask1_18.txt, subtask1_19.txt, subtask1_20.txt, subtask2_01.txt, subtask2_02.txt, subtask2_03.txt, subtask2_04.txt, subtask2_05.txt, subtask2_06.txt, subtask2_07.txt, subtask2_08.txt, subtask2_09.txt, subtask2_10.txt, subtask2_11.txt, subtask2_12.txt, subtask2_13.txt, subtask2_14.txt, subtask2_15.txt, subtask2_16.txt, subtask2_17.txt, subtask2_18.txt, subtask2_19.txt, subtask2_20.txt
Case Name Status Exec Time Memory
sample_01.txt AC 58 ms 3380 KB
sample_02.txt AC 47 ms 3380 KB
sample_03.txt WA 47 ms 3380 KB
subtask1_01.txt AC 46 ms 3384 KB
subtask1_02.txt WA 55 ms 3380 KB
subtask1_03.txt AC 47 ms 3376 KB
subtask1_04.txt WA 804 ms 9880 KB
subtask1_05.txt WA 822 ms 9828 KB
subtask1_06.txt AC 134 ms 4020 KB
subtask1_07.txt AC 786 ms 9820 KB
subtask1_08.txt WA 58 ms 3376 KB
subtask1_09.txt AC 51 ms 3356 KB
subtask1_10.txt WA 837 ms 9824 KB
subtask1_11.txt AC 54 ms 3372 KB
subtask1_12.txt AC 852 ms 9820 KB
subtask1_13.txt WA 47 ms 3460 KB
subtask1_14.txt AC 135 ms 4004 KB
subtask1_15.txt WA 861 ms 9820 KB
subtask1_16.txt AC 791 ms 9820 KB
subtask1_17.txt AC 864 ms 9828 KB
subtask1_18.txt WA 871 ms 9820 KB
subtask1_19.txt WA 864 ms 9828 KB
subtask1_20.txt WA 836 ms 9828 KB
subtask2_01.txt TLE 2113 ms 655716 KB
subtask2_02.txt TLE 2129 ms 678240 KB
subtask2_03.txt TLE 2118 ms 727600 KB
subtask2_04.txt TLE 2114 ms 700712 KB
subtask2_05.txt TLE 2103 ms 718256 KB
subtask2_06.txt TLE 2114 ms 716324 KB
subtask2_07.txt TLE 2106 ms 700712 KB
subtask2_08.txt TLE 2114 ms 713512 KB
subtask2_09.txt TLE 2111 ms 708652 KB
subtask2_10.txt TLE 2113 ms 715188 KB
subtask2_11.txt TLE 2110 ms 707500 KB
subtask2_12.txt TLE 2110 ms 702124 KB
subtask2_13.txt TLE 2111 ms 708016 KB
subtask2_14.txt TLE 2108 ms 708648 KB
subtask2_15.txt TLE 2123 ms 709292 KB
subtask2_16.txt TLE 2117 ms 715304 KB
subtask2_17.txt TLE 2110 ms 713512 KB
subtask2_18.txt TLE 2108 ms 706424 KB
subtask2_19.txt TLE 2121 ms 715184 KB
subtask2_20.txt TLE 2107 ms 708912 KB