estie プログラミングコンテスト2025 (AtCoder Regular Contest 210)
D
Independent Set Game
AtCoder
⌀ 3525
原题
← CE →
翻译中…

Problem Statement

翻译中…

You are given a simple undirected graph $G$ with $N$ vertices and $M$ edges, where vertices are numbered $1$ to $N$. The $i$-th edge connects vertices $u_i$ and $v_i$.

翻译中…

Initially, no vertices of $G$ are colored. Alice and Bob will play a game using $G$. Alice and Bob perform the following actions in order for $t=1,\ldots,N$:

翻译中…
  • If $t$ is odd, Alice chooses one vertex that is not yet colored and colors that vertex black.
  • If $t$ is even, Bob chooses one vertex that is not yet colored and colors that vertex white.
翻译中…

After all $N$ actions are completed, if the set of all vertices colored black is an independent set of $G$, Alice is the winner; otherwise, Bob is the winner. Output the name of the winner when both players play optimally.

翻译中…

You are given $T$ test cases; solve each of them.

翻译中…

What is an independent set A set $S$ consisting of vertices of a simple undirected graph $G$ is an independent set of $G$ if there does not exist a pair of vertices $u$ and $v$ connected by an edge such that $u\in S$ and $v\in S$.

翻译中…

Constraints

翻译中…
  • $1\leq T\leq 2\times 10^5$
  • $2\leq N\leq 2\times 10^5$
  • $0\leq M\leq 2\times 10^5$
  • $1\leq u_i < v_i \leq N$
  • The given graph is a simple undirected graph.
  • The sum of $N$ over all test cases is at most $2\times 10^5$.
  • The sum of $M$ over all test cases is at most $2\times 10^5$.
翻译中…

Input

翻译中…

The input is given from Standard Input in the following format:

翻译中…

T
\mathrm{case}_1
\mathrm{case}_2
\vdots
\mathrm{case}_T

翻译中…

Each case is given in the following format:

翻译中…

N M
u_1 v_1
\vdots
u_M v_M

翻译中…

Output

翻译中…

Output $T$ lines. The $i$-th line should contain the name of the winner (Alice or Bob) for the $i$-th test case when both players play optimally.

翻译中…

样例

Input #1
3
3 2
1 2
1 3
4 2
1 2
1 3
4 6
1 2
1 3
1 4
2 3
2 4
3 4
Output #1
Bob
Alice
Bob
The graph given in each test case is illustrated below: ![image](https://img.atcoder.jp/arc210/d904a1191b2a90eea4c58343a1def228.png)
题目信息
题号
arc210_d
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。