結果

問題 No.977 アリス仕掛けの摩天楼
ユーザー sho_00sho_00
提出日時 2020-04-07 17:19:16
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 365 bytes
コンパイル時間 309 ms
コンパイル使用メモリ 87,220 KB
実行使用メモリ 90,652 KB
最終ジャッジ日時 2023-09-22 01:33:38
合計ジャッジ時間 6,596 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
71,712 KB
testcase_01 AC 93 ms
71,736 KB
testcase_02 AC 90 ms
71,820 KB
testcase_03 AC 91 ms
71,620 KB
testcase_04 AC 92 ms
71,728 KB
testcase_05 AC 92 ms
71,628 KB
testcase_06 AC 97 ms
71,692 KB
testcase_07 AC 95 ms
71,492 KB
testcase_08 AC 97 ms
71,828 KB
testcase_09 AC 96 ms
71,916 KB
testcase_10 WA -
testcase_11 AC 94 ms
71,732 KB
testcase_12 AC 95 ms
71,708 KB
testcase_13 AC 174 ms
79,624 KB
testcase_14 AC 140 ms
78,444 KB
testcase_15 AC 145 ms
79,340 KB
testcase_16 AC 145 ms
79,588 KB
testcase_17 AC 139 ms
78,364 KB
testcase_18 AC 172 ms
81,136 KB
testcase_19 WA -
testcase_20 AC 188 ms
84,192 KB
testcase_21 AC 210 ms
86,136 KB
testcase_22 AC 252 ms
89,644 KB
testcase_23 AC 302 ms
90,468 KB
testcase_24 AC 289 ms
90,424 KB
testcase_25 AC 309 ms
90,652 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque
n=int(input())
e=[[] for _ in range(n)]
for i in range(n-1):
  a,b=map(int,input().split())
  a-=1
  b-=1
  e[a].append(b)
  e[b].append(a)
seen=[0]*n
seen[0]=1
stack=deque([0])
while stack:
  u=stack.pop()
  for v in e[u]:
    if seen[v]!=1:
      seen[v]=1
      stack.append(v)
if sum(seen)==n:
  print('Bob')
else:
  print('Alice')
0