結果

問題 No.977 アリス仕掛けの摩天楼
ユーザー KodaiKodai
提出日時 2020-04-14 23:51:20
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 407 bytes
コンパイル時間 254 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 21,376 KB
最終ジャッジ日時 2024-04-09 18:23:30
合計ジャッジ時間 5,309 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,752 KB
testcase_01 AC 30 ms
10,752 KB
testcase_02 AC 31 ms
10,752 KB
testcase_03 AC 29 ms
10,752 KB
testcase_04 AC 29 ms
10,752 KB
testcase_05 AC 30 ms
10,752 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 30 ms
10,752 KB
testcase_09 AC 30 ms
10,752 KB
testcase_10 AC 32 ms
10,752 KB
testcase_11 AC 29 ms
10,752 KB
testcase_12 AC 30 ms
10,880 KB
testcase_13 WA -
testcase_14 AC 68 ms
11,392 KB
testcase_15 AC 68 ms
11,392 KB
testcase_16 WA -
testcase_17 AC 68 ms
11,392 KB
testcase_18 WA -
testcase_19 AC 156 ms
13,200 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 462 ms
21,136 KB
testcase_24 AC 436 ms
21,136 KB
testcase_25 AC 461 ms
21,188 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter
N = int(input())
temp_dict = {}
for i in range(N):
    temp_dict[i] = 0

for i in range(N-1):
    a, b = list(map(int, input().split()))
    temp_dict[a] += 1
    temp_dict[b] += 1

count = Counter(temp_dict.values())
if 0 not in count:
    print("Bob")
elif count[0] == 1:
    if 1 not in count:
        print("Bob")
    else:
        print("Alice")
else:
    print("Alice")
0