summaryrefslogtreecommitdiff
path: root/other/other.tex
diff options
context:
space:
mode:
authorGloria Mundi <gloria@gloria-mundi.eu>2024-11-05 21:51:20 +0100
committerGloria Mundi <gloria@gloria-mundi.eu>2024-11-05 21:51:20 +0100
commitad3856a6b766087df0036de0b556f4700a6498c9 (patch)
tree78037d83b823feee3f73d6594d6039442d7ca525 /other/other.tex
parentcfb19a7085895cdbcf09c123c37735586dbe7695 (diff)
parent8c33b4e0d3030cfed17fc64b4fe41133339f6d87 (diff)
merge mzuenni changes
Diffstat (limited to 'other/other.tex')
-rw-r--r--other/other.tex20
1 files changed, 13 insertions, 7 deletions
diff --git a/other/other.tex b/other/other.tex
index 044ad02..1760b01 100644
--- a/other/other.tex
+++ b/other/other.tex
@@ -9,7 +9,7 @@
\end{algorithm}
\begin{algorithm}{Timed}
- Kann benutzt werdem um randomisierte Algorithmen so lange wie möglich laufen zu lassen.
+ Kann benutzt werden um randomisierte Algorithmen so lange wie möglich laufen zu lassen.
\sourcecode{other/timed.cpp}
\end{algorithm}
@@ -23,7 +23,7 @@
Bit an Position j flippen & \code{x ^= (1 << j)} \\
Anzahl an führenden nullen ($x \neq 0$) & \code{__builtin_clzll(x)} \\
Anzahl an schließenden nullen ($x \neq 0$) & \code{__builtin_ctzll(x)} \\
- Anzahl an bits & \code{__builtin_popcountll(x)} \\
+ Anzahl an \code{1} bits & \code{__builtin_popcountll(x)} \\
$i$-te Zahl eines Graycodes & \code{i ^ (i >> 1)} \\
\hline
\end{tabularx}\\
@@ -227,7 +227,7 @@
\item \textbf{Centroid Decomposition:}
Wähle zufälligen Knoten und mache DFS.
Verschiebe ausgewählten Knoten in Richtung des tiefsten Teilbaums, bis Centroid gefunden. Entferne Knoten, mache rekursiv in Teilbäumen weiter. Laufzeit:~\runtime{\abs{V} \cdot \log(\abs{V})}.
- \item \textbf{Gregorian Calendar:} Der Anfangstag des Jahres verhält sich periodisch alle $400$ Jahre.
+ \item \textbf{Gregorian Calendar:} Der Anfangstag des Jahres ist alle $400$ Jahre gleich.
\item \textbf{Pivotsuche und Rekursion auf linkem und rechtem Teilarray:}
Suche gleichzeitig von links und rechts nach Pivot, um Worst Case von
@@ -259,7 +259,7 @@
\subsection{Tipps \& Tricks}
\begin{itemize}
- \item Run Time Error:
+ \item \textbf{Run Time Error:}
\begin{itemize}
\item Stack Overflow? Evtl. rekursive Tiefensuche auf langem Pfad?
\item Array-Grenzen überprüfen. Indizierung bei $0$ oder bei $1$ beginnen?
@@ -267,13 +267,19 @@
\item Evtl. Memory Limit Exceeded? Mit \code{/usr/bin/time -v} erhält man den maximalen Speicherverbrauch bei der Ausführung (Maximum resident set size).
\end{itemize}
- \item Strings:
+ \item \textbf{Strings:}
\begin{itemize}
\item Soll \codeSafe{"aa"} kleiner als \codeSafe{"z"} sein oder nicht?
\item bit \code{0x20} beeinflusst Groß-/Kleinschreibung.
\end{itemize}
+
+ \item \textbf{Zeilenbasierte Eingabe}:
+ \begin{itemize}
+ \item \code{getline(cin, str)} liest Zeile ein.
+ \item Wenn vorher \code{cin >> ...} benutzt, lese letztes \code{\\n} mit \code{getline(cin, x)}.
+ \end{itemize}
- \item Gleitkommazahlen:
+ \item \textbf{Gleitkommazahlen:}
\begin{itemize}
\item \code{NaN}? Evtl. ungültige Werte für mathematische Funktionen, z.B. \mbox{\code{acos(1.00000000000001)}}?
\item Falsches Runden bei negativen Zahlen? Abschneiden $\neq$ Abrunden!
@@ -281,7 +287,7 @@
\item Kann \code{-0.000} ausgegeben werden?
\end{itemize}
- \item Wrong Answer:
+ \item \textbf{Wrong Answer:}
\begin{itemize}
\item Lies Aufgabe erneut. Sorgfältig!
\item Mehrere Testfälle in einer Datei? Probiere gleichen Testcase mehrfach hintereinander.