結果

問題 No.977 アリス仕掛けの摩天楼
ユーザー NagisaNagisa
提出日時 2020-01-31 21:45:01
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 572 bytes
コンパイル時間 141 ms
コンパイル使用メモリ 11,920 KB
実行使用メモリ 11,060 KB
最終ジャッジ日時 2023-10-17 09:07:05
合計ジャッジ時間 2,731 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,116 KB
testcase_01 AC 30 ms
10,116 KB
testcase_02 AC 31 ms
10,116 KB
testcase_03 AC 29 ms
10,116 KB
testcase_04 AC 29 ms
10,116 KB
testcase_05 AC 29 ms
10,116 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 30 ms
10,116 KB
testcase_09 WA -
testcase_10 AC 30 ms
10,116 KB
testcase_11 AC 30 ms
10,116 KB
testcase_12 AC 30 ms
10,116 KB
testcase_13 AC 41 ms
10,216 KB
testcase_14 AC 42 ms
10,216 KB
testcase_15 AC 42 ms
10,216 KB
testcase_16 AC 41 ms
10,216 KB
testcase_17 AC 42 ms
10,216 KB
testcase_18 AC 66 ms
10,456 KB
testcase_19 AC 66 ms
10,456 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 152 ms
11,004 KB
testcase_25 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys, math

def input():
    return sys.stdin.readline()[:-1]

def main():
    N = int(input())
    G = [0 for k in range(N)]
    for k in range(N-1):
        u, v = map(int,input().split())
        G[u-1] += 1
        G[v-1] += 1
    t = 0
    o = 0
    z = 0
    for e in G:
        if e == 2:
            t += 1
        elif e == 1:
            o += 1
        elif e == 0:
            z += 1
    if t == N-2 and o == 2:
        print("Bob")
    elif t == N-1 and z == 1:
        print("Bob")
    else:
        print("Alice")
if __name__ == '__main__':
    main()
0