結果
| 問題 |
No.977 アリス仕掛けの摩天楼
|
| ユーザー |
|
| 提出日時 | 2020-03-10 17:29:48 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 573 bytes |
| コンパイル時間 | 256 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 19,516 KB |
| 最終ジャッジ日時 | 2024-11-15 23:27:06 |
| 合計ジャッジ時間 | 7,778 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 8 WA * 1 RE * 17 |
ソースコード
def dfs(goto, u, v, now=0):
for i in range(n-1):
if u[i] == now and not goto[v[i]]:
goto[v[i]] = True
return dfs(goto, u, v, v[i])
elif v[i] == now and not goto[u[i]]:
goto[u[i]] = True
return dffs(goto, u, v, u[i])
return goto
n = int(input())
goto = [False for i in range(n)]
goto[0] = True
u, v = [], []
for i in range(n - 1):
te, mp = map(int, input().split())
u.append(te), v.append(mp)
goto = dfs(goto, u, v)
print('Bob' if len(list(filter(lambda x: not x, goto))) == 0 else 'Alice')