結果
| 問題 | No.977 アリス仕掛けの摩天楼 |
| コンテスト | |
| ユーザー |
tktk_snsn
|
| 提出日時 | 2020-06-06 13:35:06 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 456 bytes |
| 記録 | |
| コンパイル時間 | 394 ms |
| コンパイル使用メモリ | 20,828 KB |
| 実行使用メモリ | 15,964 KB |
| 最終ジャッジ日時 | 2026-05-29 12:36:21 |
| 合計ジャッジ時間 | 5,191 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 18 WA * 8 |
ソースコード
from collections import Counter
import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 7)
N = int(input())
edge = [0] * N
for _ in range(N-1):
a, b = map(int, input().split())
edge[a] += 1
edge[b] += 1
c = Counter(edge)
if c[0] == 0: # 木
print("Bob")
elif c[0] == 1:
if c[2] == N - 1: # 輪っかと1つの島だと連接にできる
print("Bob")
else:
print("Alice")
else:
print("Alice")
tktk_snsn