Submission #1201418
Source Code Expand
[N, M] = map(int, raw_input().split(' ')) arr = [[False] * N for i in range(N)] language = [] for i in range(N): language.append(set(raw_input().split(' ')[1:])) modified = True while modified: is_modified = False for i in range(N): for j in range(N-i): if i == i + j: continue elif arr[i][i+j] == True: continue else: # First check language if len(language[i].intersection(language[i+j])) > 0: arr[i][i + j] = True arr[i+j][i] = True is_modified = True # Then check neighbour else: for a in range(N): if arr[i][a] == True and arr[i+j][a] == True: arr[i][i + j] = True arr[i+j][i] = True is_modified = True break modified = is_modified for i in range(N): for j in range(N-i): if arr[i][i+j] != True: print "No" exit() print "Yes"
Submission Info
Submission Time | |
---|---|
Task | C - Interpretation |
User | kingloo |
Language | Python (2.7.6) |
Score | 0 |
Code Size | 1177 Byte |
Status | WA |
Exec Time | 2229 ms |
Memory | 1942404 KB |
Judge Result
Set Name | sample | dataset1 | dataset2 | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 200 | 0 / 200 | ||||||||||
Status |
|
|
|
Set Name | Test Cases |
---|---|
sample | sample-01.txt, sample-02.txt |
dataset1 | sample-01.txt, sample-02.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt |
dataset2 | sample-01.txt, sample-02.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 02-01.txt, 02-02.txt, 02-03.txt, 02-04.txt, 02-05.txt, 02-06.txt, 02-07.txt, 02-08.txt, 02-09.txt, 02-10.txt, 02-11.txt, 02-12.txt, 02-13.txt, sample-01.txt, sample-02.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01-01.txt | WA | 10 ms | 2696 KB |
01-02.txt | WA | 19 ms | 2696 KB |
01-03.txt | TLE | 2104 ms | 10884 KB |
01-04.txt | TLE | 2104 ms | 10756 KB |
01-05.txt | TLE | 2104 ms | 9348 KB |
01-06.txt | TLE | 2104 ms | 5252 KB |
01-07.txt | TLE | 2104 ms | 4740 KB |
01-08.txt | TLE | 2104 ms | 5252 KB |
01-09.txt | TLE | 2104 ms | 5636 KB |
01-10.txt | WA | 534 ms | 10884 KB |
02-01.txt | TLE | 2116 ms | 210052 KB |
02-02.txt | TLE | 2223 ms | 1883012 KB |
02-03.txt | TLE | 2157 ms | 797788 KB |
02-04.txt | TLE | 2197 ms | 1483012 KB |
02-05.txt | TLE | 2202 ms | 1556484 KB |
02-06.txt | TLE | 2197 ms | 1479940 KB |
02-07.txt | TLE | 2213 ms | 1744516 KB |
02-08.txt | TLE | 2229 ms | 1942404 KB |
02-09.txt | TLE | 2225 ms | 1942404 KB |
02-10.txt | TLE | 2199 ms | 1522308 KB |
02-11.txt | TLE | 2201 ms | 1522308 KB |
02-12.txt | TLE | 2199 ms | 1522308 KB |
02-13.txt | TLE | 2200 ms | 1522308 KB |
sample-01.txt | WA | 15 ms | 2948 KB |
sample-02.txt | WA | 11 ms | 2696 KB |