結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 27 ms
10,132 KB
testcase_02 AC 26 ms
10,132 KB
testcase_03 AC 27 ms
10,132 KB
testcase_04 AC 27 ms
10,132 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 27 ms
10,132 KB
testcase_09 AC 27 ms
10,132 KB
testcase_10 AC 27 ms
10,132 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 38 ms
10,224 KB
testcase_15 AC 39 ms
10,224 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 63 ms
10,232 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 149 ms
10,760 KB
testcase_24 WA -
testcase_25 AC 150 ms
10,760 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
# Your code here!
import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline
read = sys.stdin.read


n = int(input())
res = [0]*n
for _ in range(n-2):
    a,b = [int(i) for i in readline().split()]
    res[a] += 1
    res[b] += 1

c = res.count(0)    
d = res.count(1)

if c >= 2:
    print("Alice")
elif c == 0:
    print("Bob")
else:
    if d == 0: 
        print("Alice")
    else:
        print("Bob")
        









0