結果

問題 No.977 アリス仕掛けの摩天楼
ユーザー mokraimokrai
提出日時 2020-01-31 23:00:49
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 404 bytes
コンパイル時間 102 ms
コンパイル使用メモリ 11,740 KB
実行使用メモリ 10,628 KB
最終ジャッジ日時 2023-10-17 11:52:49
合計ジャッジ時間 3,916 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
9,996 KB
testcase_01 AC 29 ms
9,996 KB
testcase_02 AC 28 ms
9,996 KB
testcase_03 AC 29 ms
9,996 KB
testcase_04 AC 28 ms
9,996 KB
testcase_05 AC 29 ms
9,996 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 29 ms
10,000 KB
testcase_09 AC 29 ms
10,000 KB
testcase_10 AC 30 ms
10,000 KB
testcase_11 AC 30 ms
10,000 KB
testcase_12 AC 29 ms
10,000 KB
testcase_13 WA -
testcase_14 AC 59 ms
10,100 KB
testcase_15 AC 59 ms
10,100 KB
testcase_16 WA -
testcase_17 AC 59 ms
10,100 KB
testcase_18 WA -
testcase_19 AC 121 ms
10,100 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 332 ms
10,628 KB
testcase_24 AC 340 ms
10,628 KB
testcase_25 AC 336 ms
10,628 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 bi in B:
    if bi == 0:
        no_b += 1

# print(B)

if no_b == 0:
    print("Bob")
elif no_b == 1:
    ans = True
    for i in B:
        if i == 1:
            ans = False
    if ans:
        print('Bob')
    else:
        print("Alice")
else:
    print("Alice")
0