Submission #6799178
Source Code Expand
n,m=map(int,input().split()) p_list=[list(map(lambda x:int(x)-1,input().split()))[1:] for _ in [0]*n] p_check=[False for _ in [0]*n] l_check=[False for _ in [0]*m] l_list=[[] for _ in [0]*m] for k,i in enumerate(p_list): for j in i: l_list[j].append(k) for i,j in enumerate(l_list): if j!=[]: q=[i] break l_check[q[0]]=True while q: qq=q.pop() p=l_list[qq] for pp in p: if p_check[pp]==False: p_check[pp]=True for l in p_list[pp]: if l_check[l]==False: l_check[l]=True q.append(l) print(["NO","YES"][all(p_check)])
Submission Info
Submission Time | |
---|---|
Task | C - Interpretation |
User | tmg_dayo |
Language | Python (3.4.3) |
Score | 400 |
Code Size | 681 Byte |
Status | AC |
Exec Time | 492 ms |
Memory | 30340 KB |
Judge Result
Set Name | sample | dataset1 | dataset2 | ||||||
---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | 200 / 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 | AC | 17 ms | 3064 KB |
01-02.txt | AC | 19 ms | 3064 KB |
01-03.txt | AC | 22 ms | 3316 KB |
01-04.txt | AC | 22 ms | 3188 KB |
01-05.txt | AC | 21 ms | 3064 KB |
01-06.txt | AC | 22 ms | 3188 KB |
01-07.txt | AC | 20 ms | 3064 KB |
01-08.txt | AC | 21 ms | 3188 KB |
01-09.txt | AC | 20 ms | 3188 KB |
01-10.txt | AC | 22 ms | 3316 KB |
02-01.txt | AC | 172 ms | 18760 KB |
02-02.txt | AC | 463 ms | 20712 KB |
02-03.txt | AC | 161 ms | 14480 KB |
02-04.txt | AC | 371 ms | 24432 KB |
02-05.txt | AC | 431 ms | 20064 KB |
02-06.txt | AC | 365 ms | 24320 KB |
02-07.txt | AC | 471 ms | 21416 KB |
02-08.txt | AC | 427 ms | 18916 KB |
02-09.txt | AC | 492 ms | 30340 KB |
02-10.txt | AC | 295 ms | 21104 KB |
02-11.txt | AC | 299 ms | 21132 KB |
02-12.txt | AC | 308 ms | 20312 KB |
02-13.txt | AC | 320 ms | 20692 KB |
sample-01.txt | AC | 18 ms | 3064 KB |
sample-02.txt | AC | 18 ms | 3064 KB |