結果

問題 No.977 アリス仕掛けの摩天楼
ユーザー mokraimokrai
提出日時 2020-01-31 22:52:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 367 bytes
コンパイル時間 131 ms
コンパイル使用メモリ 11,932 KB
実行使用メモリ 10,760 KB
最終ジャッジ日時 2023-10-17 11:36:24
合計ジャッジ時間 4,080 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,104 KB
testcase_01 AC 29 ms
10,104 KB
testcase_02 AC 29 ms
10,104 KB
testcase_03 AC 30 ms
10,104 KB
testcase_04 AC 29 ms
10,104 KB
testcase_05 AC 30 ms
10,104 KB
testcase_06 RE -
testcase_07 RE -
testcase_08 AC 30 ms
10,108 KB
testcase_09 AC 30 ms
10,108 KB
testcase_10 RE -
testcase_11 AC 30 ms
10,108 KB
testcase_12 AC 31 ms
10,108 KB
testcase_13 WA -
testcase_14 AC 61 ms
10,204 KB
testcase_15 AC 62 ms
10,204 KB
testcase_16 WA -
testcase_17 AC 61 ms
10,204 KB
testcase_18 WA -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 AC 342 ms
10,740 KB
testcase_24 AC 346 ms
10,740 KB
testcase_25 AC 339 ms
10,740 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

B = [0] * N

for i in range(N-1):
    u, v = list(map(int, input().split()))
    B[u] += 1
    B[v] += 1

no_b = 0
for i, bi in enumerate(B):
    if bi == 0:
        no_b += 1

if no_b == 0:
    print("Bob")
else:
    for i in B:
        if i not in [0, 2]:
            ans = False

    if ans:
        print('Bob')
    else:
        print("Alice")
0