結果

問題 No.977 アリス仕掛けの摩天楼
ユーザー convexineqconvexineq
提出日時 2020-01-31 21:34:31
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 451 bytes
コンパイル時間 99 ms
コンパイル使用メモリ 11,924 KB
実行使用メモリ 10,756 KB
最終ジャッジ日時 2023-10-17 08:52:02
合計ジャッジ時間 2,737 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,128 KB
testcase_01 AC 29 ms
10,128 KB
testcase_02 AC 30 ms
10,128 KB
testcase_03 AC 31 ms
10,128 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 30 ms
10,128 KB
testcase_07 AC 29 ms
10,128 KB
testcase_08 AC 30 ms
10,128 KB
testcase_09 AC 30 ms
10,128 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 42 ms
10,220 KB
testcase_15 AC 42 ms
10,220 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 89 ms
10,492 KB
testcase_21 AC 124 ms
10,492 KB
testcase_22 AC 152 ms
10,756 KB
testcase_23 AC 159 ms
10,756 KB
testcase_24 WA -
testcase_25 AC 157 ms
10,756 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
# Your code here!
import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline
read = sys.stdin.read


n = int(input())
res = [0]*n
for _ in range(n-1):
    a,b = [int(i) for i in readline().split()]
    res[a] += 1
    res[b] += 1

c = res.count(0)    
d = res.count(1)

if c >= 2:
    print("Alice")
elif c == 0:
    print("Bob")
else:
    if d == 0: 
        print("Alice")
    else:
        print("Bob")
        









0