結果

問題 No.977 アリス仕掛けの摩天楼
ユーザー GrayCoderGrayCoder
提出日時 2020-02-01 04:02:04
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 442 bytes
コンパイル時間 838 ms
コンパイル使用メモリ 11,748 KB
実行使用メモリ 23,984 KB
最終ジャッジ日時 2023-10-18 23:29:17
合計ジャッジ時間 3,166 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
9,944 KB
testcase_01 AC 28 ms
9,944 KB
testcase_02 AC 28 ms
9,944 KB
testcase_03 AC 28 ms
9,944 KB
testcase_04 AC 28 ms
9,944 KB
testcase_05 AC 29 ms
9,944 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 28 ms
9,948 KB
testcase_09 AC 29 ms
9,948 KB
testcase_10 AC 29 ms
9,948 KB
testcase_11 AC 29 ms
9,948 KB
testcase_12 AC 29 ms
9,948 KB
testcase_13 WA -
testcase_14 AC 43 ms
11,380 KB
testcase_15 AC 43 ms
11,380 KB
testcase_16 WA -
testcase_17 AC 43 ms
11,316 KB
testcase_18 WA -
testcase_19 AC 70 ms
14,036 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 174 ms
23,980 KB
testcase_24 AC 175 ms
23,980 KB
testcase_25 AC 169 ms
23,984 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import stdin


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

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

    zero = cnt.count(0)
    if not zero:
        print('Bob')
    elif zero == 1 and cnt.count(2) == N - 1:
        print('Bob')
    else:
        print('Alice')


main()
0