ユニークビジョンプログラミングコンテスト2025 春(AtCoder Beginner Contest 398)
G
Not Only Tree Game
AtCoder
⌀ 3352
原题
翻译中…

Problem Statement

翻译中…

You are given a simple undirected graph with $N$ vertices and $M$ edges, with vertices labeled $1$ to $N$ and edges labeled $1$ to $M$. The $i$-th edge connects vertices $U_i$ and $V_i$. Initially, $G$ does not contain an odd cycle.

翻译中…

Takahashi and Aoki will play a game using this graph $G$. With Aoki going first, they take turns performing the following operation:

翻译中…
  • Choose a pair of integers $(i,j)$ with $1 \leq i < j \leq N$ that satisfies both of the following conditions, then add an edge connecting vertices $i$ and $j$ to $G$.
  • $G$ does not already have an edge connecting vertices $i$ and $j$.
    • Adding an edge connecting vertices $i$ and $j$ does not create an odd cycle.
翻译中…

A player who cannot perform this operation loses, and the other player wins.

翻译中…

Determine who wins when both players play optimally.

翻译中…

What is an odd cycle? A sequence of vertices $(v_0,v_1,\ldots,v_k)$ of $G$ is called an odd cycle if and only if all of the following conditions are satisfied: $k$ is odd. $v_0=v_k$. For every $1\leq i \leq k$, there is an edge connecting $v_{i-1}$ and $v_{i}$.

翻译中…

Constraints

翻译中…
  • $1 \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 does not contain an odd cycle.
  • The given graph does not contain multi-edges.
  • All input values are integers.
翻译中…

Input

翻译中…

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

翻译中…

N M
U_1 V_1
U_2 V_2
\vdots
U_M V_M

翻译中…

Output

翻译中…

If Aoki (the first player) wins, print Aoki; otherwise, if Takahashi (the second player) wins, print Takahashi.

翻译中…

样例

Input #1
4 3
1 2
2 3
3 4
Output #1
Aoki
If Aoki (the first player) adds the edge $(1,4)$, Takahashi (the second player) cannot move. Thus, Aoki wins.
Input #2
4 2
1 2
3 4
Output #2
Takahashi
No matter how Aoki plays, Takahashi wins.
Input #3
9 5
2 9
2 3
4 6
5 7
1 8
Output #3
Aoki
题目信息

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