You are viewing a single comment's thread. Return to all comments →
And how about this?
unsigned t; unsigned long n; const auto size = sizeof(n) * 8; cin >> t; while (t-- > 0) { cin >> n; unsigned long last, count = 0, mask = 1UL << (size - 1); for (unsigned i = 0; i < size; i++, mask >>= 1) if ((mask & n) != 0) count++, last = i; auto isOdd = (count + (size - last)) % 2 == 1; cout << (isOdd ? "Louise" : "Richard") << endl; }
Seems like cookies are disabled on this browser, please enable them to open this website
Counter game
You are viewing a single comment's thread. Return to all comments →
And how about this?