Submission #2712484
Source Code Expand
n,m = (int(i) for i in input().split()) a = [[i,2**i] for i in range(n)] b = [0 for i in range(n)] dp = [1]+[0 for i in range(2**n-1)] for _ in range(m): x,y = (int(i) for i in input().split()) b[x-1]+=a[y-1][1] for i in range(2**n): for j,j2 in a: if i&b[j]==0 and i&j2==0: dp[i | j2]+=dp[i] print(dp[-1])
Submission Info
Submission Time | |
---|---|
Task | D - 徒競走 |
User | Clamperl |
Language | Python (3.4.3) |
Score | 100 |
Code Size | 321 Byte |
Status | AC |
Exec Time | 412 ms |
Memory | 5524 KB |
Judge Result
Set Name | Sample | Subtask1 | All | ||||||
---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 30 / 30 | 70 / 70 | ||||||
Status |
|
|
|
Set Name | Test Cases |
---|---|
Sample | 0_00.txt, 0_01.txt, 0_02.txt |
Subtask1 | 0_00.txt, 0_01.txt, 1_00.txt, 1_01.txt, 1_02.txt, 1_03.txt, 1_04.txt, 1_05.txt, 1_06.txt, 1_07.txt, 1_08.txt, 1_09.txt, 1_10.txt, 1_11.txt, 1_12.txt |
All | 0_00.txt, 0_01.txt, 0_02.txt, 1_00.txt, 1_01.txt, 1_02.txt, 1_03.txt, 1_04.txt, 1_05.txt, 1_06.txt, 1_07.txt, 1_08.txt, 1_09.txt, 1_10.txt, 1_11.txt, 1_12.txt, 2_00.txt, 2_01.txt, 2_02.txt, 2_03.txt, 2_04.txt, 2_05.txt, 2_06.txt, 2_07.txt, 2_08.txt, 2_09.txt, 2_10.txt, 2_11.txt, 2_12.txt, 2_13.txt, 2_14.txt, 2_15.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
0_00.txt | AC | 17 ms | 3064 KB |
0_01.txt | AC | 17 ms | 3064 KB |
0_02.txt | AC | 412 ms | 5524 KB |
1_00.txt | AC | 17 ms | 3064 KB |
1_01.txt | AC | 18 ms | 3064 KB |
1_02.txt | AC | 18 ms | 3064 KB |
1_03.txt | AC | 18 ms | 3064 KB |
1_04.txt | AC | 18 ms | 3064 KB |
1_05.txt | AC | 17 ms | 3064 KB |
1_06.txt | AC | 17 ms | 3064 KB |
1_07.txt | AC | 17 ms | 3064 KB |
1_08.txt | AC | 17 ms | 3064 KB |
1_09.txt | AC | 18 ms | 3064 KB |
1_10.txt | AC | 17 ms | 3060 KB |
1_11.txt | AC | 18 ms | 3064 KB |
1_12.txt | AC | 17 ms | 3064 KB |
2_00.txt | AC | 387 ms | 5524 KB |
2_01.txt | AC | 212 ms | 4120 KB |
2_02.txt | AC | 223 ms | 4120 KB |
2_03.txt | AC | 251 ms | 4116 KB |
2_04.txt | AC | 129 ms | 3608 KB |
2_05.txt | AC | 123 ms | 3608 KB |
2_06.txt | AC | 118 ms | 3632 KB |
2_07.txt | AC | 112 ms | 3608 KB |
2_08.txt | AC | 325 ms | 5140 KB |
2_09.txt | AC | 243 ms | 4120 KB |
2_10.txt | AC | 251 ms | 4372 KB |
2_11.txt | AC | 221 ms | 4120 KB |
2_12.txt | AC | 377 ms | 5420 KB |
2_13.txt | AC | 332 ms | 5268 KB |
2_14.txt | AC | 333 ms | 5268 KB |
2_15.txt | AC | 355 ms | 5396 KB |