Created
December 28, 2016 19:05
-
-
Save jianminchen/7b9b2a8ebab53b39e5df2a410069d519 to your computer and use it in GitHub Desktop.
week code 27 - zerom nim sum
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cassert> | |
#include <cstdio> | |
#include <math.h> | |
#include <iostream> | |
#include <algorithm> | |
#include <vector> | |
#include <time.h> | |
#include <set> | |
#define ll long long | |
using namespace std; | |
int main() { | |
int T; | |
cin>>T; | |
for(int t=1;t<=T;t++) { | |
int n; | |
cin>>n; | |
int g=0; | |
for(int i=0;i<n;i++) { | |
int x; | |
cin>>x; | |
if (x&1) { | |
g ^= (x+1); | |
} else { | |
g ^= (x-1); | |
} | |
} | |
if (g==0) | |
printf("L\n"); | |
else | |
printf("W\n"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment