Created
December 28, 2016 19:32
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