結果

問題 No.977 アリス仕掛けの摩天楼
ユーザー GrayCoderGrayCoder
提出日時 2020-01-31 23:24:08
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 456 bytes
コンパイル時間 98 ms
コンパイル使用メモリ 11,852 KB
実行使用メモリ 24,032 KB
最終ジャッジ日時 2023-10-17 12:38:47
合計ジャッジ時間 2,973 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 29 ms
9,996 KB
testcase_04 AC 29 ms
9,996 KB
testcase_05 AC 29 ms
9,996 KB
testcase_06 AC 29 ms
9,996 KB
testcase_07 AC 29 ms
10,000 KB
testcase_08 AC 29 ms
10,000 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 29 ms
10,000 KB
testcase_12 AC 29 ms
10,000 KB
testcase_13 AC 44 ms
11,428 KB
testcase_14 AC 43 ms
11,428 KB
testcase_15 AC 43 ms
11,428 KB
testcase_16 AC 43 ms
11,428 KB
testcase_17 AC 43 ms
11,364 KB
testcase_18 AC 71 ms
14,080 KB
testcase_19 WA -
testcase_20 AC 97 ms
16,872 KB
testcase_21 AC 133 ms
20,564 KB
testcase_22 AC 168 ms
23,464 KB
testcase_23 WA -
testcase_24 AC 170 ms
24,028 KB
testcase_25 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import stdin


def main():
    input = lambda: stdin.readline()[:-1]
    N = int(input())
    UV = [tuple(map(int, input().split())) for _ in [0] * (N - 1)]

    num = [0] * N
    for u, v in UV:
        num[u] += 1
        num[v] += 1

    for n in num:
        if n not in (1, 2):
            print('Alice')
            return
    for n in num:
        if n not in (0, 2):
            print('Alice')
            return
    print('Bob')


main()
0