QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 512 MB Total points: 100

#7986. 游戏

الإحصائيات

题目描述

小 I 和小 J 又在玩游戏。

小 J 找来了一棵 $n$ 个点的树。树上的每条边有开启和关闭两个状态,初始树上每条边都是开启的。

初始树上有一颗棋子放在 $1$ 号节点。小 I 可以移动棋子,目标是将棋子移动到一个度数恰好为 $1$ 的节点上;小 J 可以关闭树上的边,目标是阻止小 I 将棋子移动到度数恰好为 $1$ 的节点上。

游戏分为若干轮,每轮有如下环节:

  1. 小 I 任务判定:如果棋子在度数恰好为 $1$ 的节点上,小 I 获胜,否则进入第 2 步;
  2. 小 J 行动:小 J 将一条目前开启的边,将这条边永久关闭,进入第 3 步,如果目前不存在开启的边则直接跳过行动进入第 3 步;
  3. 小 I 行动:小 I 选择一条连接当前棋子所在节点且开启的边,将棋子移动到这条边的另一个节点上。如果没有这样的边,小 J 获胜,否则进入新的一轮,回到第 1 步。

小 J 想知道,如果小 I 和小 J 知道这棵树的形态且绝顶聪明,谁会获胜。

输入格式

从标准输入读入数据。

第一行一个整数 $n (1 \le n \le 10^5)$ 表示树的节点数,接下来 $n-1$ 行每行两个整数 $u,v (1 \le u, v \le n)$,表示树上的一条边。

输出格式

输出到标准输出。

如果小 I 获胜,输出 You win, temporarily.,否则输出 Wasted.

样例

输入

6
1 2
2 3
2 4
1 5
5 6

输出

Wasted.

解释

小 J 的策略如下:

  • 小 J 将 $(1,2)$ 关闭,这样小 I 只能移动到 $5$;
  • 小 J 将 $(5,6)$ 关闭,这样小 I 只得移动回 $1$;
  • 小 J 将 $(1,5)$ 关闭,于是小 I 无法移动。

样例

输入

7
1 2
2 3
2 4
1 5
5 6
5 7

输出

You win, temporarily.
About Issues

We understand that our problem archive is not perfect. If you find any issues with the problem, including the statement, scoring configuration, time/memory limits, test cases, etc.

You may use this form to submit an issue regarding the problem. A problem moderator will review your issue and proceed it properly.

STOP! Before you submit an issue, please READ the following guidelines:

  1. This is not a place to publish a discussion, editorial, or requests to debug your code. Your issue will only be visible by you and problem moderators. Other users will not be able to view or reply your issues.
  2. Do not submit duplicated issues. If you have already submitted one, please wait for an moderator to review it. Submitting multiple issues will not speed up the review process and might cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
  4. Be sure your issue is related to this problem. If you need to submit an issue regarding another problem, contest, category, etc., you should submit it to the corresponding page.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.