CODE FESTIVAL 2016 Final

Submission #11197100

Source codeソースコード

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

Task問題 C - Interpretation
User nameユーザ名 brthyyjp
Created time投稿日時
Language言語 PyPy3 (2.4.0)
Status状態 WA
Score得点 0
Source lengthソースコード長 606 Byte
File nameファイル名
Exec time実行時間 ms
Memory usageメモリ使用量 -

Test case

Set

Set name Score得点 / Max score Cases
sample - sample-01.txt,sample-02.txt
dataset1 0 / 200 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 0 / 200 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

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
01-01.txt AC 166 ms 38512 KB
01-02.txt WA
01-03.txt AC 175 ms 38896 KB
01-04.txt WA
01-05.txt AC 177 ms 38896 KB
01-06.txt WA
01-07.txt WA
01-08.txt AC 171 ms 38768 KB
01-09.txt WA
01-10.txt AC 177 ms 38896 KB
02-01.txt WA
02-02.txt AC 308 ms 50464 KB
02-03.txt AC 255 ms 48860 KB
02-04.txt WA
02-05.txt WA
02-06.txt AC 311 ms 52332 KB
02-07.txt WA
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
02-13.txt AC 270 ms 51804 KB
sample-01.txt AC 162 ms 38256 KB
sample-02.txt AC 161 ms 38256 KB