summaryrefslogtreecommitdiff
path: root/other
diff options
context:
space:
mode:
authormzuenni <michi.zuendorf@gmail.com>2023-03-28 13:25:59 +0200
committermzuenni <michi.zuendorf@gmail.com>2023-03-28 13:25:59 +0200
commitfe5fa1141efeb7454c763dbd2645fb4ff04487a3 (patch)
treef2197bb94ce80ab2fae886177dfa9b0bd11538ac /other
parent3b91d2662310aee532cc84e1447824459671767e (diff)
merged
Diffstat (limited to 'other')
-rw-r--r--other/bitOps.cpp6
-rw-r--r--other/other.tex14
2 files changed, 10 insertions, 10 deletions
diff --git a/other/bitOps.cpp b/other/bitOps.cpp
index 98fc994..8079305 100644
--- a/other/bitOps.cpp
+++ b/other/bitOps.cpp
@@ -5,9 +5,9 @@ for (int subset = bitmask; subset > 0;
// Zählt Anzahl der gesetzten Bits.
int numberOfSetBits(int i) {
- i = i - ((i >> 1) & 0x55555555);
- i = (i & 0x33333333) + ((i >> 2) & 0x33333333);
- return (((i + (i >> 4)) & 0x0F0F0F0F) * 0x01010101) >> 24;
+ i = i - ((i >> 1) & 0x5555'5555);
+ i = (i & 0x3333'3333) + ((i >> 2) & 0x3333'3333);
+ return (((i + (i >> 4)) & 0x0F0F'0F0F) * 0x0101'0101) >> 24;
}
// Nächste Permutation in Bitmaske
diff --git a/other/other.tex b/other/other.tex
index cc89503..58c87a7 100644
--- a/other/other.tex
+++ b/other/other.tex
@@ -8,6 +8,11 @@
\sourcecode{other/compiletime.cpp}
\end{algorithm}
+\begin{algorithm}{Timed}
+ Kann benutzt werdem un randomisierte Algorithmen so lange wie möglich laufen zu lassen.
+ \sourcecode{other/timed.cpp}
+\end{algorithm}
+
\begin{algorithm}{Bit Operations}
\begin{expandtable}
\begin{tabularx}{\linewidth}{|Ll|}
@@ -39,9 +44,8 @@
\end{expandtable}
\end{algorithm}
-\begin{algorithm}{Timed}
- Kann benutzt werdem un randomisierte Algorithmen so lange wie möglich laufen zu lassen.
- \sourcecode{other/timed.cpp}
+\begin{algorithm}{Pragmas}
+ \sourcecode{other/pragmas.cpp}
\end{algorithm}
\begin{algorithm}{DP Optimizations}
@@ -99,10 +103,6 @@
\sourcecode{other/fastIO.cpp}
\end{algorithm}
-\begin{algorithm}{Pragmas}
- \sourcecode{other/pragmas.cpp}
-\end{algorithm}
-
\begin{algorithm}{Sonstiges}
\sourcecode{other/stuff.cpp}
\end{algorithm}