CF1383B.GameGame
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Koa the Koala and her best friend want to play a game.
The game starts with an array a of length n consisting of non-negative integers. Koa and her best friend move in turns and each have initially a score equal to 0 . Koa starts.
Let's describe a move in the game:
-
During his move, a player chooses any element of the array and removes it from this array, xor-ing it with the current score of the player. More formally: if the current score of the player is x and the chosen element is y , his new score will be x⊕y . Here ⊕ denotes bitwise XOR operation.
Note that after a move element y is removed from a .
-
The game ends when the array is empty.
At the end of the game the winner is the player with the maximum score. If both players have the same score then it's a draw.
If both players play optimally find out whether Koa will win, lose or draw the game.
输入格式
Each test contains multiple test cases. The first line contains t ( 1≤t≤104 ) — the number of test cases. Description of the test cases follows.
The first line of each test case contains the integer n ( 1≤n≤105 ) — the length of a .
The second line of each test case contains n integers a1,a2,…,an ( 0≤ai≤109 ) — elements of a .
It is guaranteed that the sum of n over all test cases does not exceed 105 .
输出格式
For each test case print:
- WIN if Koa will win the game.
- LOSE if Koa will lose the game.
- DRAW if the game ends in a draw.
输入输出样例
输入#1
3 3 1 2 2 3 2 2 3 5 0 0 0 2 2
输出#1
WIN LOSE DRAW
输入#2
4 5 4 1 5 1 3 4 1 0 1 6 1 0 2 5 4
输出#2
WIN WIN DRAW WIN
说明/提示
In testcase 1 of the first sample we have:
a=[1,2,2] . Here Koa chooses 1 , other player has to choose 2 , Koa chooses another 2 . Score for Koa is 1⊕2=3 and score for other player is 2 so Koa wins.