結果

問題 No.2780 The Bottle Imp
ユーザー 2000 Ekiben2000 Ekiben
提出日時 2024-06-08 00:13:30
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 535 bytes
コンパイル時間 185 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 38,352 KB
最終ジャッジ日時 2024-06-08 10:40:23
合計ジャッジ時間 10,270 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,752 KB
testcase_01 AC 30 ms
10,624 KB
testcase_02 AC 29 ms
10,752 KB
testcase_03 AC 30 ms
10,752 KB
testcase_04 AC 30 ms
10,752 KB
testcase_05 AC 30 ms
10,624 KB
testcase_06 AC 32 ms
10,752 KB
testcase_07 AC 238 ms
19,320 KB
testcase_08 AC 282 ms
24,820 KB
testcase_09 AC 276 ms
24,824 KB
testcase_10 AC 280 ms
24,684 KB
testcase_11 AC 236 ms
19,444 KB
testcase_12 AC 406 ms
24,300 KB
testcase_13 AC 414 ms
24,444 KB
testcase_14 AC 146 ms
16,768 KB
testcase_15 AC 145 ms
16,892 KB
testcase_16 AC 144 ms
17,016 KB
testcase_17 AC 145 ms
16,768 KB
testcase_18 AC 146 ms
16,896 KB
testcase_19 AC 150 ms
16,896 KB
testcase_20 AC 148 ms
17,016 KB
testcase_21 AC 146 ms
16,880 KB
testcase_22 AC 126 ms
14,932 KB
testcase_23 AC 147 ms
16,272 KB
testcase_24 AC 238 ms
20,988 KB
testcase_25 AC 357 ms
25,588 KB
testcase_26 AC 173 ms
17,896 KB
testcase_27 AC 227 ms
21,608 KB
testcase_28 AC 236 ms
21,620 KB
testcase_29 WA -
testcase_30 AC 186 ms
18,280 KB
testcase_31 AC 476 ms
36,708 KB
testcase_32 AC 83 ms
12,288 KB
testcase_33 AC 506 ms
38,332 KB
testcase_34 AC 501 ms
38,352 KB
testcase_35 AC 75 ms
13,312 KB
testcase_36 WA -
testcase_37 WA -
testcase_38 AC 78 ms
13,056 KB
testcase_39 AC 361 ms
27,824 KB
testcase_40 AC 354 ms
27,952 KB
testcase_41 WA -
testcase_42 AC 30 ms
10,880 KB
testcase_43 AC 30 ms
10,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections
N, = map(int, input().split())
graph = collections.defaultdict(list)
for i in range(1, N + 1):
    Mi, *neigb = map(int, input().split())
    for neighbor in neigb:
        graph[i].append(neighbor)
visited = set()
queue = collections.deque([1])
while queue:
    node = queue.popleft()
    if node not in visited:
        visited.add(node)
        for neighbor in graph[node]:
            if neighbor not in visited:
                queue.append(neighbor)
if len(visited) == N:
    print("Yes")
else:
    print("No")
0