当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

6892:Lunch

题目描述
Now it's time for lunch. Today's menu is chocolate!

Though every baby likes chocolate, the appetites of babies are little. After lunch, there are still $n$ pieces of chocolate remained: The length of the $i$th piece is $l_i$.

Using the remained chocolate, Baby Volcano is going to play a game with his teacher, Mr. Sprague. The rule of the game is quite simple.

Two player plays in turns, and Baby Volcano will play first:

1. In each turn, the player needs to select one piece of chocolate. If the length of the selected piece is equal to $1$, the player of this turn will lose immediately.
2. Suppose the length of the selected piece is $l$. Then the player needs to select a positive integer $k$ satisfying $k$ is at least $2$ and $k$ is a factor of $l$.
3. Then the player needs to cut the selected piece into $k$ pieces with length $\frac{l}{k}$.

The game continues until one player selects a piece of chocolate with length $1$.

Suppose both players plays optimally, your task is to determine whether Baby Volcano will win.
输入解释
The first line contains single integer $t (1 \leq t \leq 2 * 10^4)$, the number of testcases.

For each testcase, the first line contains a single integer $n (1 \leq n \leq 10)$.

The second line contains $n$ positive integers $l_i (1 \leq l_i \leq 10^9)$, representing the length of each piece.
输出解释
For each testcase, output char 'W' if Baby Volcano will win, otherwise output char 'L'.
输入样例
3
2
4 9
2
2 3
3
3 9 27
输出样例
W
L
L
来自杭电HDUOJ的附加信息
Recommend IceyWang

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-6892

最后修改于 2020-10-25T23:35:18+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
6000/3000MS(Java/Others) 524288/524288K(Java/Others)