Submission #993645
Source Code Expand
n, m = map(int, raw_input().split()) g = [[] for i in xrange(m)] L = [None]*n for i in xrange(n): ipt = map(int, raw_input().split()) k = ipt[0] L[i] = ipt[1:] for e in L[i]: g[e-1].append(i) parent = range(n) def root(x): if x == parent[x]: return x parent[x] = root(parent[x]) return parent[x] def unite(x, y): px = root(x) py = root(y) if px < py: parent[py] = px elif px > py: parent[px] = py return min(px, py) for e in g: for i in xrange(len(e)-1): unite(e[i], e[i+1]) print "YES"*(sum(parent) == 0) or "NO"
Submission Info
Submission Time | |
---|---|
Task | C - Interpretation |
User | yaketake08 |
Language | Python (2.7.6) |
Score | 0 |
Code Size | 633 Byte |
Status | WA |
Exec Time | 559 ms |
Memory | 30312 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 |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01-01.txt | AC | 16 ms | 2696 KB |
01-02.txt | AC | 18 ms | 2696 KB |
01-03.txt | AC | 21 ms | 2820 KB |
01-04.txt | WA | 21 ms | 2696 KB |
01-05.txt | AC | 20 ms | 2696 KB |
01-06.txt | WA | 19 ms | 2820 KB |
01-07.txt | WA | 19 ms | 2696 KB |
01-08.txt | AC | 19 ms | 2820 KB |
01-09.txt | WA | 20 ms | 2696 KB |
01-10.txt | AC | 21 ms | 2820 KB |
02-01.txt | AC | 200 ms | 17384 KB |
02-02.txt | AC | 511 ms | 21508 KB |
02-03.txt | AC | 212 ms | 13288 KB |
02-04.txt | WA | 403 ms | 24296 KB |
02-05.txt | WA | 475 ms | 20356 KB |
02-06.txt | AC | 414 ms | 24296 KB |
02-07.txt | WA | 489 ms | 22020 KB |
02-08.txt | AC | 494 ms | 19972 KB |
02-09.txt | AC | 559 ms | 30312 KB |
02-10.txt | AC | 320 ms | 20392 KB |
02-11.txt | AC | 317 ms | 20280 KB |
02-12.txt | WA | 313 ms | 19940 KB |
02-13.txt | AC | 321 ms | 19964 KB |
sample-01.txt | AC | 16 ms | 2696 KB |
sample-02.txt | AC | 16 ms | 2696 KB |