Submission #6134870
Source Code Expand
import sys sys.setrecursionlimit(10**7) n,m=map(int,input().split()) g=[[] for _ in range((n+m))] for i in range(n): a=[int(i)-1 for i in input().split()][1:] for l in a: g[i].append(n+l) g[n+l].append(i) par=[i for i in range(n+m)] def root(x): if x==par[x]: return x else: par[x]=root(par[x]) return par[x] def connect(x,y): rx=root(x) ry=root(y) if rx!=ry: par[rx]=ry return for i in range(n+m): for nb in g[i]: connect(i,nb) p=par[0] ans='YES' for i in range(n): if par[i]!=p: ans='NO' print(ans,par)
Submission Info
Submission Time | |
---|---|
Task | C - Interpretation |
User | keroru |
Language | Python (3.4.3) |
Score | 0 |
Code Size | 658 Byte |
Status | WA |
Exec Time | 659 ms |
Memory | 61368 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 | 17 ms | 3064 KB |
01-02.txt | WA | 22 ms | 3188 KB |
01-03.txt | WA | 24 ms | 3316 KB |
01-04.txt | WA | 23 ms | 3188 KB |
01-05.txt | WA | 23 ms | 3188 KB |
01-06.txt | WA | 23 ms | 3188 KB |
01-07.txt | WA | 23 ms | 3188 KB |
01-08.txt | WA | 23 ms | 3316 KB |
01-09.txt | WA | 23 ms | 3188 KB |
01-10.txt | WA | 24 ms | 3316 KB |
02-01.txt | WA | 465 ms | 24332 KB |
02-02.txt | WA | 647 ms | 25668 KB |
02-03.txt | WA | 422 ms | 17892 KB |
02-04.txt | WA | 612 ms | 32180 KB |
02-05.txt | WA | 643 ms | 23808 KB |
02-06.txt | WA | 567 ms | 32172 KB |
02-07.txt | WA | 659 ms | 25652 KB |
02-08.txt | WA | 554 ms | 25960 KB |
02-09.txt | WA | 608 ms | 38988 KB |
02-10.txt | WA | 503 ms | 61368 KB |
02-11.txt | WA | 491 ms | 60896 KB |
02-12.txt | WA | 512 ms | 27892 KB |
02-13.txt | WA | 479 ms | 27784 KB |
sample-01.txt | WA | 18 ms | 3192 KB |
sample-02.txt | WA | 17 ms | 3064 KB |