diff options
Diffstat (limited to 'content/other/josephus2.cpp')
| -rw-r--r-- | content/other/josephus2.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/content/other/josephus2.cpp b/content/other/josephus2.cpp index 33544ea..1c4295d 100644 --- a/content/other/josephus2.cpp +++ b/content/other/josephus2.cpp @@ -1,5 +1,5 @@ -int rotateLeft(int n) { // Der letzte Überlebende, 1-basiert. +ll rotateLeft(ll n) { // Der letzte Überlebende, 0-basiert. int bits = __lg(n); - n ^= 1 << bits; - return 2 * n + 1; + n ^= 1ll << bits; + return n << 1; } |
