summaryrefslogtreecommitdiff
path: root/content/other/josephus2.cpp
diff options
context:
space:
mode:
authorGloria Mundi <gloria@gloria-mundi.eu>2024-11-16 21:43:46 +0100
committerGloria Mundi <gloria@gloria-mundi.eu>2024-11-16 21:43:46 +0100
commit3fe8ee352845741d97a76e2ed6a390cb1481d755 (patch)
tree92f43538f1094130676a2be5ffa4879586db3cb7 /content/other/josephus2.cpp
parent1880ccb6d85c6eb79e724593457877bab431951c (diff)
minor changes
Diffstat (limited to 'content/other/josephus2.cpp')
-rw-r--r--content/other/josephus2.cpp6
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;
}