結果

問題 No.977 アリス仕掛けの摩天楼
ユーザー tktk_snsntktk_snsn
提出日時 2020-06-06 13:35:06
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 456 bytes
コンパイル時間 150 ms
コンパイル使用メモリ 10,700 KB
実行使用メモリ 9,396 KB
最終ジャッジ日時 2023-08-25 00:41:11
合計ジャッジ時間 2,627 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,484 KB
testcase_01 AC 18 ms
8,632 KB
testcase_02 AC 18 ms
8,536 KB
testcase_03 AC 18 ms
8,548 KB
testcase_04 AC 19 ms
8,652 KB
testcase_05 AC 18 ms
8,556 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 17 ms
8,504 KB
testcase_09 AC 18 ms
8,656 KB
testcase_10 AC 18 ms
8,648 KB
testcase_11 AC 18 ms
8,548 KB
testcase_12 AC 17 ms
8,656 KB
testcase_13 WA -
testcase_14 AC 29 ms
8,708 KB
testcase_15 AC 28 ms
8,548 KB
testcase_16 WA -
testcase_17 AC 28 ms
8,596 KB
testcase_18 WA -
testcase_19 AC 52 ms
8,592 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 128 ms
9,236 KB
testcase_24 AC 127 ms
9,396 KB
testcase_25 AC 129 ms
9,284 KB
権限があれば一括ダウンロードができます

ソースコード

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