Created
December 28, 2016 19:32
-
-
Save jianminchen/d8d464fd19d3b8d38d3a7a4614dc6b82 to your computer and use it in GitHub Desktop.
HackerRank - week code 27 - zero nim sum - submission from https://www.hackerrank.com/yaray
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> | |
using namespace std; | |
int main() | |
{ | |
cin.sync_with_stdio(0); | |
long cases, n, s, x = 0; | |
for (cin >> cases; cases--; ) { | |
s = 0; | |
cin >> n; | |
while (n--) { | |
cin >> x; | |
s ^= (x+1^1)-1; | |
} | |
cout << "WL"[!s] << '\n'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment