結果

問題 No.977 アリス仕掛けの摩天楼
ユーザー universatouniversato
提出日時 2020-01-31 22:45:10
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 429 bytes
コンパイル時間 156 ms
コンパイル使用メモリ 11,928 KB
実行使用メモリ 28,780 KB
最終ジャッジ日時 2023-10-17 11:19:42
合計ジャッジ時間 4,511 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 29 ms
10,188 KB
testcase_04 AC 29 ms
10,188 KB
testcase_05 AC 29 ms
10,188 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 29 ms
10,196 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 29 ms
10,196 KB
testcase_12 AC 29 ms
10,196 KB
testcase_13 AC 61 ms
11,660 KB
testcase_14 AC 61 ms
11,660 KB
testcase_15 AC 61 ms
11,660 KB
testcase_16 AC 61 ms
11,660 KB
testcase_17 AC 62 ms
11,660 KB
testcase_18 AC 127 ms
15,152 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 382 ms
26,684 KB
testcase_25 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())

g = [[] for _ in range(n)]

for i in range(n-1):
    u, v = map(int, input().split())
    g[u].append(v)
    g[v].append(u)


zero = one = 0
for i in range(n):
    
    l = len(g[i])
    if l > 2:
        print("Alice")
        exit(0)
    
    if l == 1:
        one += 1
    if l == 0:
        # print(i)
        zero += 1

print(g,zero,one)
if one == 2 or zero == 1:
    print("Bob")
else:
    print("Alice")
0