結果

問題 No.977 アリス仕掛けの摩天楼
ユーザー Kodai
提出日時 2020-04-14 23:51:20
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 407 bytes
コンパイル時間 309 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 21,212 KB
最終ジャッジ日時 2024-10-01 18:26:10
合計ジャッジ時間 5,460 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 18 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter
N = int(input())
temp_dict = {}
for i in range(N):
    temp_dict[i] = 0

for i in range(N-1):
    a, b = list(map(int, input().split()))
    temp_dict[a] += 1
    temp_dict[b] += 1

count = Counter(temp_dict.values())
if 0 not in count:
    print("Bob")
elif count[0] == 1:
    if 1 not in count:
        print("Bob")
    else:
        print("Alice")
else:
    print("Alice")
0