<commit_before>\documentclass[9pt,a4paper,twocolumn,landscape,oneside]{amsart}
\usepackage{amsmath, amsthm, amssymb, amsfonts}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{booktabs}
\usepackage{caption}
\usepackage{color}
\usepackage{fancyhdr}
\usepackage{float}
\usepackage{fullpage}
%\usepackage{geometry}
% \usepackage[top=0pt, bottom=1cm, left=0.3cm, right=0.3cm]{geometry}
\usepackage[top=3pt, bottom=1cm, left=0.3cm, right=0.3cm]{geometry}
\usepackage{graphicx}
% \usepackage{listings}
\usepackage{subcaption}
\usepackage[scaled]{beramono}
\usepackage{titling}
\usepackage{datetime}
\usepackage{enumitem}
\usepackage{multicol}

\newcommand{\subtitle}[1]{%
  \posttitle{%
    \par\end{center}
    \begin{center}\large#1\end{center}
    \vskip0.1em\vspace{-1em}}%
}

% Minted
\usepackage{minted}
\newcommand{\code}[1]{\inputminted{cpp}{_code/#1}}
\newcommand{\bashcode}[1]{\inputminted{bash}{_code/#1}}
\newcommand{\regcode}[1]{\inputminted{cpp}{code/#1}}

% Header/Footer
% \geometry{includeheadfoot}
%\fancyhf{}
\pagestyle{fancy}
\lhead{Reykjavík University}
\rhead{\thepage}
\cfoot{}
\setlength{\headheight}{15.2pt}
\setlength{\droptitle}{-20pt}
\posttitle{\par\end{center}}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}

% Math and bit operators
\DeclareMathOperator{\lcm}{lcm}
\newcommand*\BitAnd{\mathrel{\&}}
\newcommand*\BitOr{\mathrel{|}}
\newcommand*\ShiftLeft{\ll}
\newcommand*\ShiftRight{\gg}
\newcommand*\BitNeg{\ensuremath{\mathord{\sim}}}

\newenvironment{myitemize}
{ \begin{itemize}[leftmargin=.5cm]
    \setlength{\itemsep}{0pt}
    \setlength{\parskip}{0pt}
    \setlength{\parsep}{0pt}     }
{ \end{itemize}                  }

% Title/Author
\title{.*RU.*}
\subtitle{Team Reference Document}
\date{\ddmmyyyydate{\today{}}}

% Output Verbosity
\newif\ifverbose
\verbosetrue
% \verbosefalse

\begin{document}

\maketitle
\thispagestyle{fancy}
\vspace{-3em}
% \addtocontents{toc}{\protect\enlargethispage{\baselineskip}}
\tableofcontents

\clearpage

\section{Code Templates}
    \subsection{Basic Configuration}
        \subsubsection{.bashrc}
        \bashcode{bashrc.sh}
        ProTip\texttrademark: setxkbmap dvorak on qwerty: \texttt{o.yqtxmal ekrpat}

        \subsubsection{.vimrc}
        \bashcode{vimrc.sh}

    \subsection{C++ Header}
        A C++ header.
        \code{header.cpp}

    \subsection{Java Template}
        A Java template.
        \code{template.java}


\section{Data Structures}

    \subsection{Union-Find}
        \ifverbose
        An implementation of the Union-Find disjoint sets data structure.
        \fi
        \code{data-structures/union_find.cpp}

    \subsection{Segment Tree}
        \ifverbose
        An implementation of a Segment Tree.
        \fi
        \code{data-structures/segment_tree_node.cpp}
        \ifverbose
        \code{data-structures/segment_tree_mnnode.cpp}
        \fi
        \code{data-structures/segment_tree.cpp}

        \subsubsection{Persistent Segment Tree}
        \code{data-structures/persistent_segment_tree.cpp}

    \subsection{Fenwick Tree}
        \ifverbose
        A Fenwick Tree is a data structure that represents an array of $n$
        numbers. It supports adjusting the $i$-th element in $O(\log n)$ time,
        and computing the sum of numbers in the range $i..j$ in $O(\log n)$
        time. It only needs $O(n)$ space.
        \fi
        \code{data-structures/fenwick_tree.cpp}

    \subsection{Matrix}
        \ifverbose
        A Matrix class.
        \fi
        \code{data-structures/matrix.cpp}

    \ifverbose
    \subsection{AVL Tree}
        \ifverbose
        A fast, easily augmentable, balanced binary search tree.
        \fi
        \code{data-structures/avl_tree.cpp}

        \ifverbose
        Also a very simple wrapper over the AVL tree that implements a map
        interface.
        \code{data-structures/avl_map.cpp}
        \fi
    \fi

    \subsection{Cartesian Tree}
        \code{data-structures/cartesian_tree.cpp}

    \ifverbose
    \subsection{Heap}
        An implementation of a binary heap.
        \code{data-structures/heap.cpp}
    \fi

    \ifverbose
    \subsection{Dancing Links}
        \ifverbose
        An implementation of Donald Knuth's Dancing Links data structure. A
        linked list supporting deletion and restoration of elements.
        \fi
        \code{data-structures/dancing_links.cpp}
    \fi

    \subsection{Misof Tree}
        \ifverbose
        A simple tree data structure for inserting, erasing, and querying the
        $n$th largest element.
        \fi
        \code{data-structures/misof_tree.cpp}

    \ifverbose
    \subsection{$k$-d Tree}
        \ifverbose
        A $k$-dimensional tree supporting fast construction, adding points, and
        nearest neighbor queries.
        \fi
        NOTE: Not completely stable, occasionally segfaults.
        \code{data-structures/kd_tree.cpp}
    \fi

    \subsection{Sqrt Decomposition}
        \ifverbose
        Design principle that supports many operations in amortized $\sqrt{n}$ per operation.
        \fi
        \code{data-structures/sqrt_decomposition.cpp}

    \subsection{Monotonic Queue}
        \ifverbose
        A queue that supports querying for the minimum element. Useful for sliding window algorithms.
        \fi
        \code{data-structures/monotonic_queue.cpp}

    \subsection{Convex Hull Trick}
        \code{data-structures/convex_hull_trick.cpp}
        And dynamic variant:
        \code{data-structures/convex_hull_trick_dynamic.cpp}

\section{Graphs}
    \subsection{Single-Source Shortest Paths}
        \subsubsection{Dijkstra's algorithm}
            \ifverbose
            An implementation of Dijkstra's algorithm. It runs in
            $\Theta(|E|\log{|V|})$ time.
            \fi
            \code{graph/dijkstra.cpp}

        \subsubsection{Bellman-Ford algorithm}
            \ifverbose
            The Bellman-Ford algorithm solves the single-source shortest paths
            problem in $O(|V||E|)$ time. It is slower than Dijkstra's
            algorithm, but it works on graphs with negative edges and has the
            ability to detect negative cycles, neither of which Dijkstra's
            algorithm can do.
            \fi
            \code{graph/bellman_ford.cpp}

        \subsubsection{IDA$^\star$ algorithm}
            \code{graph/idastar.cpp}

    \ifverbose<commit_msg>add note about CH trick<commit_after>\documentclass[9pt,a4paper,twocolumn,landscape,oneside]{amsart}
\usepackage{amsmath, amsthm, amssymb, amsfonts}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{booktabs}
\usepackage{caption}
\usepackage{color}
\usepackage{fancyhdr}
\usepackage{float}
\usepackage{fullpage}
%\usepackage{geometry}
% \usepackage[top=0pt, bottom=1cm, left=0.3cm, right=0.3cm]{geometry}
\usepackage[top=3pt, bottom=1cm, left=0.3cm, right=0.3cm]{geometry}
\usepackage{graphicx}
% \usepackage{listings}
\usepackage{subcaption}
\usepackage[scaled]{beramono}
\usepackage{titling}
\usepackage{datetime}
\usepackage{enumitem}
\usepackage{multicol}

\newcommand{\subtitle}[1]{%
  \posttitle{%
    \par\end{center}
    \begin{center}\large#1\end{center}
    \vskip0.1em\vspace{-1em}}%
}

% Minted
\usepackage{minted}
\newcommand{\code}[1]{\inputminted{cpp}{_code/#1}}
\newcommand{\bashcode}[1]{\inputminted{bash}{_code/#1}}
\newcommand{\regcode}[1]{\inputminted{cpp}{code/#1}}

% Header/Footer
% \geometry{includeheadfoot}
%\fancyhf{}
\pagestyle{fancy}
\lhead{Reykjavík University}
\rhead{\thepage}
\cfoot{}
\setlength{\headheight}{15.2pt}
\setlength{\droptitle}{-20pt}
\posttitle{\par\end{center}}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}

% Math and bit operators
\DeclareMathOperator{\lcm}{lcm}
\newcommand*\BitAnd{\mathrel{\&}}
\newcommand*\BitOr{\mathrel{|}}
\newcommand*\ShiftLeft{\ll}
\newcommand*\ShiftRight{\gg}
\newcommand*\BitNeg{\ensuremath{\mathord{\sim}}}

\newenvironment{myitemize}
{ \begin{itemize}[leftmargin=.5cm]
    \setlength{\itemsep}{0pt}
    \setlength{\parskip}{0pt}
    \setlength{\parsep}{0pt}     }
{ \end{itemize}                  }

% Title/Author
\title{.*RU.*}
\subtitle{Team Reference Document}
\date{\ddmmyyyydate{\today{}}}

% Output Verbosity
\newif\ifverbose
\verbosetrue
% \verbosefalse

\begin{document}

\maketitle
\thispagestyle{fancy}
\vspace{-3em}
% \addtocontents{toc}{\protect\enlargethispage{\baselineskip}}
\tableofcontents

\clearpage

\section{Code Templates}
    \subsection{Basic Configuration}
        \subsubsection{.bashrc}
        \bashcode{bashrc.sh}
        ProTip\texttrademark: setxkbmap dvorak on qwerty: \texttt{o.yqtxmal ekrpat}

        \subsubsection{.vimrc}
        \bashcode{vimrc.sh}

    \subsection{C++ Header}
        A C++ header.
        \code{header.cpp}

    \subsection{Java Template}
        A Java template.
        \code{template.java}


\section{Data Structures}

    \subsection{Union-Find}
        \ifverbose
        An implementation of the Union-Find disjoint sets data structure.
        \fi
        \code{data-structures/union_find.cpp}

    \subsection{Segment Tree}
        \ifverbose
        An implementation of a Segment Tree.
        \fi
        \code{data-structures/segment_tree_node.cpp}
        \ifverbose
        \code{data-structures/segment_tree_mnnode.cpp}
        \fi
        \code{data-structures/segment_tree.cpp}

        \subsubsection{Persistent Segment Tree}
        \code{data-structures/persistent_segment_tree.cpp}

    \subsection{Fenwick Tree}
        \ifverbose
        A Fenwick Tree is a data structure that represents an array of $n$
        numbers. It supports adjusting the $i$-th element in $O(\log n)$ time,
        and computing the sum of numbers in the range $i..j$ in $O(\log n)$
        time. It only needs $O(n)$ space.
        \fi
        \code{data-structures/fenwick_tree.cpp}

    \subsection{Matrix}
        \ifverbose
        A Matrix class.
        \fi
        \code{data-structures/matrix.cpp}

    \ifverbose
    \subsection{AVL Tree}
        \ifverbose
        A fast, easily augmentable, balanced binary search tree.
        \fi
        \code{data-structures/avl_tree.cpp}

        \ifverbose
        Also a very simple wrapper over the AVL tree that implements a map
        interface.
        \code{data-structures/avl_map.cpp}
        \fi
    \fi

    \subsection{Cartesian Tree}
        \code{data-structures/cartesian_tree.cpp}

    \ifverbose
    \subsection{Heap}
        An implementation of a binary heap.
        \code{data-structures/heap.cpp}
    \fi

    \ifverbose
    \subsection{Dancing Links}
        \ifverbose
        An implementation of Donald Knuth's Dancing Links data structure. A
        linked list supporting deletion and restoration of elements.
        \fi
        \code{data-structures/dancing_links.cpp}
    \fi

    \subsection{Misof Tree}
        \ifverbose
        A simple tree data structure for inserting, erasing, and querying the
        $n$th largest element.
        \fi
        \code{data-structures/misof_tree.cpp}

    \ifverbose
    \subsection{$k$-d Tree}
        \ifverbose
        A $k$-dimensional tree supporting fast construction, adding points, and
        nearest neighbor queries.
        \fi
        NOTE: Not completely stable, occasionally segfaults.
        \code{data-structures/kd_tree.cpp}
    \fi

    \subsection{Sqrt Decomposition}
        \ifverbose
        Design principle that supports many operations in amortized $\sqrt{n}$ per operation.
        \fi
        \code{data-structures/sqrt_decomposition.cpp}

    \subsection{Monotonic Queue}
        \ifverbose
        A queue that supports querying for the minimum element. Useful for sliding window algorithms.
        \fi
        \code{data-structures/monotonic_queue.cpp}

    \subsection{Convex Hull Trick}
        If converting to integers, look out for division by 0 and $\pm\infty$.
        \code{data-structures/convex_hull_trick.cpp}
        And dynamic variant:
        \code{data-structures/convex_hull_trick_dynamic.cpp}

\section{Graphs}
    \subsection{Single-Source Shortest Paths}
        \subsubsection{Dijkstra's algorithm}
            \ifverbose
            An implementation of Dijkstra's algorithm. It runs in
            $\Theta(|E|\log{|V|})$ time.
            \fi
            \code{graph/dijkstra.cpp}

        \subsubsection{Bellman-Ford algorithm}
            \ifverbose
            The Bellman-Ford algorithm solves the single-source shortest paths
            problem in $O(|V||E|)$ time. It is slower than Dijkstra's
            algorithm, but it works on graphs with negative edges and has the
            ability to detect negative cycles, neither of which Dijkstra's
            algorithm can do.
            \fi
            \code{graph/bellman_ford.cpp}

        \subsubsection{IDA$^\star$ algorithm}
            \code{graph/idastar.cpp}

    \ifverbose
{'fraction_non_alphanumeric': 0.11726434823019131, 'fraction_numerical': 0.00642862675238169, 'mean_word_length': 2.706084959816303, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6106799', 'n_tokens_mistral': 4209, 'n_tokens_neox': 4027, 'n_words': 873}