結果
問題 | No.977 アリス仕掛けの摩天楼 |
ユーザー | flygon |
提出日時 | 2023-03-28 12:43:16 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 469 bytes |
コンパイル時間 | 182 ms |
コンパイル使用メモリ | 81,756 KB |
実行使用メモリ | 88,116 KB |
最終ジャッジ日時 | 2023-10-20 07:44:06 |
合計ジャッジ時間 | 4,536 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 40 ms
53,480 KB |
testcase_01 | AC | 40 ms
53,480 KB |
testcase_02 | AC | 40 ms
53,480 KB |
testcase_03 | AC | 40 ms
55,528 KB |
testcase_04 | AC | 41 ms
55,528 KB |
testcase_05 | AC | 41 ms
55,528 KB |
testcase_06 | AC | 40 ms
55,528 KB |
testcase_07 | AC | 40 ms
55,528 KB |
testcase_08 | AC | 43 ms
55,528 KB |
testcase_09 | AC | 42 ms
55,528 KB |
testcase_10 | WA | - |
testcase_11 | AC | 42 ms
55,528 KB |
testcase_12 | AC | 42 ms
55,528 KB |
testcase_13 | AC | 96 ms
77,096 KB |
testcase_14 | AC | 84 ms
76,800 KB |
testcase_15 | AC | 101 ms
77,036 KB |
testcase_16 | AC | 98 ms
77,100 KB |
testcase_17 | AC | 96 ms
77,192 KB |
testcase_18 | AC | 122 ms
80,056 KB |
testcase_19 | WA | - |
testcase_20 | AC | 140 ms
81,648 KB |
testcase_21 | AC | 165 ms
84,744 KB |
testcase_22 | AC | 205 ms
87,684 KB |
testcase_23 | AC | 254 ms
88,084 KB |
testcase_24 | AC | 241 ms
88,032 KB |
testcase_25 | AC | 249 ms
88,116 KB |
ソースコード
n= int(input()) graph = [[] for i in range(n+1)] for i in range(n-1): a,b = map(int,input().split()) graph[a].append(b) graph[b].append(a) from collections import deque que = deque([0]) depth = [-1]*(n+1) depth[0] = 0 while que: crr = que.popleft() for nxt in graph[crr]: if depth[nxt] == -1: depth[nxt] = depth[crr]+1 que.append(nxt) flg = 1 for i in range(n): flg &= (depth[i] != -1) if flg: print("Bob") else: print("Alice")