結果

問題 No.977 アリス仕掛けの摩天楼
ユーザー tktk_snsn
提出日時 2020-06-06 13:35:06
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 456 bytes
コンパイル時間 177 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 11,392 KB
最終ジャッジ日時 2024-12-23 12:21:50
合計ジャッジ時間 3,106 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 18 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter
import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 7)

N = int(input())
edge = [0] * N
for _ in range(N-1):
    a, b = map(int, input().split())
    edge[a] += 1
    edge[b] += 1

c = Counter(edge)
if c[0] == 0:  # 木
    print("Bob")
elif c[0] == 1:
    if c[2] == N - 1:  # 輪っかと1つの島だと連接にできる
        print("Bob")
    else:
        print("Alice")
else:
    print("Alice")
0