counter-game: initial commit

This commit is contained in:
Dmitry Kokorin 2016-09-12 17:00:53 +03:00
parent e54cbddf9c
commit 9c577f8a75
2 changed files with 28 additions and 0 deletions

View file

@ -0,0 +1 @@
<https://www.hackerrank.com/challenges/counter-game>

View file

@ -0,0 +1,27 @@
#include <iostream>
#include <stdint.h>
int main()
{
using namespace std;
size_t T;
cin >> T;
while (T--) {
uint64_t N, count;
cin >> N;
--N;
for (count = 0; N; ++count) {
N &= N - 1;
}
cout << ((count & 1) ? "Louise" : "Richard") << endl;
}
return 0;
}