Skip to content

Instantly share code, notes, and snippets.

@jianminchen
Created December 28, 2016 19:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jianminchen/d8d464fd19d3b8d38d3a7a4614dc6b82 to your computer and use it in GitHub Desktop.
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
#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