結果

問題 No.977 アリス仕掛けの摩天楼
ユーザー convexineq
提出日時 2020-01-31 21:34:31
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 451 bytes
コンパイル時間 95 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 11,520 KB
最終ジャッジ日時 2024-09-17 07:19:49
合計ジャッジ時間 2,433 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 15 WA * 11
権限があれば一括ダウンロードができます

ソースコード

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