結果

問題 No.977 アリス仕掛けの摩天楼
コンテスト
ユーザー convexineq
提出日時 2020-01-31 21:33:00
言語 Python3
(3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
WA  
実行時間 -
コード長 451 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 910 ms
コンパイル使用メモリ 21,284 KB
実行使用メモリ 16,504 KB
最終ジャッジ日時 2026-08-29 09:29:44
合計ジャッジ時間 5,489 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 12 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

# 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-2):
    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