Submission #11197100
Source Code Expand
import sys input = sys.stdin.readline n, m = map(int, input().split()) g = [[] for _ in range(n)] d = {} for i in range(n): kl = list(map(int, input().split())) L = kl[1:] L = [l-1 for l in L] for l in L: if l not in d: d[l] = i else: g[d[l]].append(i) from collections import deque s = deque() s.append(0) visit = [-1]*n visit[0] = 0 while s: x = s.pop() for nx in g[x]: if visit[nx] == -1: visit[nx] = 0 s.append(nx) if min(visit) != -1: print('YES') else: print('NO')
Submission Info
Submission Time | |
---|---|
Task | C - Interpretation |
User | brthyyjp |
Language | PyPy3 (2.4.0) |
Score | 0 |
Code Size | 606 Byte |
Status | WA |
Exec Time | 333 ms |
Memory | 56432 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 | AC | 166 ms | 38512 KB |
01-02.txt | WA | 169 ms | 38640 KB |
01-03.txt | AC | 175 ms | 38896 KB |
01-04.txt | WA | 177 ms | 38768 KB |
01-05.txt | AC | 177 ms | 38896 KB |
01-06.txt | WA | 171 ms | 38768 KB |
01-07.txt | WA | 173 ms | 38896 KB |
01-08.txt | AC | 171 ms | 38768 KB |
01-09.txt | WA | 174 ms | 38896 KB |
01-10.txt | AC | 177 ms | 38896 KB |
02-01.txt | WA | 246 ms | 47964 KB |
02-02.txt | AC | 308 ms | 50464 KB |
02-03.txt | AC | 255 ms | 48860 KB |
02-04.txt | WA | 298 ms | 51564 KB |
02-05.txt | WA | 320 ms | 50924 KB |
02-06.txt | AC | 311 ms | 52332 KB |
02-07.txt | WA | 333 ms | 50556 KB |
02-08.txt | AC | 290 ms | 53296 KB |
02-09.txt | AC | 304 ms | 54832 KB |
02-10.txt | AC | 286 ms | 56432 KB |
02-11.txt | AC | 270 ms | 56176 KB |
02-12.txt | WA | 267 ms | 52444 KB |
02-13.txt | AC | 270 ms | 51804 KB |
sample-01.txt | AC | 162 ms | 38256 KB |
sample-02.txt | AC | 161 ms | 38256 KB |