forked from lrvideckis/programming_team_code
-
Notifications
You must be signed in to change notification settings - Fork 0
/
25_pg-reference.tex
223 lines (184 loc) · 10.2 KB
/
25_pg-reference.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
% a4 paper gives us over 2000 more square mm per page, for a total of
% almost 5/6 of a page extra space
\newif\ifuseletter
%\useletterfalse
\uselettertrue
% if you need extra room to staple, adjust textheight and topmargin.
\ifuseletter
\documentclass[12pt,letterpaper,twocolumn,landscape]{article}
\textheight 8.25in
\textwidth 10.75in
\evensidemargin -0.875in
\oddsidemargin -0.875in
\topmargin -0.875in
\else
\documentclass[12pt,a4paper,twocolumn]{article}
\textwidth 200mm % a4 paper is 210mm wide
\textheight 287mm % a4 paper is 297mm high
\evensidemargin -1in
\oddsidemargin -1in
\topmargin -1in
\addtolength{\evensidemargin}{5mm}
\addtolength{\oddsidemargin}{5mm}
\addtolength{\topmargin}{5mm}
\fi
\headheight 15pt
\headsep 4pt
\addtolength{\textheight}{-14pt}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{listings}
\usepackage{xcolor}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\lhead{South Dakota School of Mines and Technology}
\rhead{Page \thepage}
\newlength{\lstlinewidth}
\setlength{\lstlinewidth}{0.5\textwidth}
\addtolength{\lstlinewidth}{-6pt}
% used to make sure that lstlisting aligns every character in a column
\newlength{\normalbasewidth}
\settowidth{\normalbasewidth}{\ttfamily m}
\newlength{\smallbasewidth}
\settowidth{\smallbasewidth}{\ttfamily\small m}
\newlength{\footnotebasewidth}
\settowidth{\footnotebasewidth}{\ttfamily\footnotesize m}
\newlength{\scriptbasewidth}
\settowidth{\scriptbasewidth}{\ttfamily\scriptsize m}
%% \makeatletter
%% \lstdefinestyle{mystyle}{
%% basewidth=\footnotebasewidth,
%% basicstyle=\ttfamily\lst@ifdisplaystyle\ttfamily\footnotesize\fi
%% }
%% \makeatother
\makeatletter
\lstdefinestyle{mystyle}{
basewidth=\scriptbasewidth,
basicstyle=\ttfamily\lst@ifdisplaystyle\ttfamily\scriptsize\fi
}
\makeatother
\makeatletter
\lst@CCPutMacro\lst@ProcessOther {"2D}{\lst@ttfamily{-{}}{-{}}}
\@empty\z@\@empty
\makeatother
% choose the colors you like below.
\lstset{
language=C++,
linewidth=\lstlinewidth,
style=mystyle, % set basic font and spacing
captionpos=t, % sets the caption position to top
columns=fixed,
mathescape=false,
breaklines=true, % sets automatic line breaking
breakatwhitespace=true, % automatic breaks should only happen at whitespace
extendedchars=false, % ASCII printing characters only
% escapechar={`}, % Anything between backtics is escaped
% escapeinside={{(*}{*)}},
% frame=single, % adds a frame around the code
frame=tlrb, % adds a frame around the code
rulecolor=\color{black},
xleftmargin=1pt,
xrightmargin=1pt,
% frameround=fttf,
% framesep=3pt,
% rulesep=3pt,
framerule=0.5pt,
% framexleftmargin=10pt,
% framexrightmargin=10pt,
% framextopmargin=10pt,
% framexbottommargin=10pt,
%% %fillcolor=\color{SkyBlue},
%% %rulesepcolor=\color{SkyBlue},
%keywordstyle=[1]\color{blue}, % keyword style
%keywordstyle=[2]\color{cyan}, % keyword style
%keywordstyle=[3]\color{orange},
keywordstyle=\color{blue}, % keyword style
stringstyle=\color{magenta}, % string literal style
commentstyle=\color{gray}\itshape,
morecomment=[l][\color{orange}]{\#},
identifierstyle=\color{purple},
%numberbychapter=true,
numbers=none, % where to put the line-numbers; (none, left, right)
%numbersep=15pt, % how far the line-numbers are from the code
%numberstyle=\tiny\color{gray}, % the style that is used for the line-numbers
postbreak={\mbox{$\hookrightarrow\space$}},
showspaces=false, % show spaces everywhere adding particular underscores
showstringspaces=false, % underline spaces within strings only
showtabs=false, % show tabs within strings adding particular underscores
stepnumber=1, % the step between printed line-numbers.
tabsize=4 % sets default tab character size to 8 spaces
}
\begin{document}
\lstlistoflistings
\newpage
\lstinputlisting[caption={\textbf{GEOMETRY}}]{null}
\lstinputlisting[language=C++, lastline=219, caption={Geometry}]{geometry/geometry.cpp}
%\lstinputlisting[language=C++, lastline=207, caption={Geometry}]{geometry/geometry1.cpp}
\lstinputlisting[language=C++, lastline=57, caption={Convex Hull}]{geometry/convexHullInt.cpp}
\lstinputlisting[language=C++, lastline=46, caption={Pick's Theorem}]{geometry/picksTheorem.cpp}
%\lstinputlisting[language=C++, lastline=126, caption={Rectangle Union}]{geometry/rectangle_union.cpp}
\lstinputlisting[language=C++, lastline=31, caption={Closest Pair of Points}]{geometry/closestPairOfPoints.cpp}
\lstinputlisting[caption={\textbf{GRAPHS}}]{null}
\lstinputlisting[language=C++, lastline=70, caption={Bipartite Matching}]{graphs/bipartite.cpp}
\lstinputlisting[language=C++, lastline=60, caption={Bridges}]{graphs/bridges.cpp} \lstinputlisting[language=C++, firstline=0, lastline=60, caption={Centroid Decomposition}]{graphs/centroid.cpp}
\lstinputlisting[language=C++, lastline=71, caption={Count Paths of Each Length}]{graphs/countPathLengths.cpp}
\lstinputlisting[language=C++, lastline=55, caption={Cut Vertices}]{graphs/cutVertices.cpp}
%\lstinputlisting[language=C++, lastline=22, caption={Dijkstra's Algorithm}]{graphs/dijkstra.cpp}
\lstinputlisting[language=C++, lastline=10, caption={Floyd Warshall}]{graphs/floydWarshall.cpp}
\lstinputlisting[language=C++, lastline=59, caption={DSU on Tree}]{graphs/dsuTree.cpp}
\lstinputlisting[language=C++, lastline=47, caption={Lowest Common Ancestor (LCA)}]{graphs/lca.cpp}
\lstinputlisting[language=C++, lastline=66, caption={Strongly Connected Components (SCC)}]{graphs/scc.cpp}
\lstinputlisting[caption={\textbf{MAX FLOW}}]{null}
\lstinputlisting[language=C++, lastline=74, caption={Dinic's Max Flow}]{maxflow/dinic.cpp}
\lstinputlisting[language=C++, lastline=48, caption={Hungarian Algorithm}]{maxflow/hungarian.cpp}
\lstinputlisting[language=C++, lastline=75, caption={Min Cost Max Flow}]{maxflow/minCostMaxFlow.cpp}
\lstinputlisting[caption={\textbf{STRINGS}}]{null}
\lstinputlisting[language=C++, lastline=64, caption={KMP String Matching}]{stringAlgs/kmp.cpp}
\lstinputlisting[language=C++, lastline=27, caption={Manachers (Palindromes)}]{stringAlgs/manachers.cpp}
\lstinputlisting[language=C++, lastline=37, caption={Suffix Array}]{stringAlgs/suffixArray.cpp}
\lstinputlisting[language=C++, lastline=53, caption={Trie}]{stringAlgs/trie.cpp}
\lstinputlisting[language=C++, lastline=23, caption={Z Algorithm}]{stringAlgs/zAlg.cpp}
\lstinputlisting[caption={\textbf{DATA STRUCTURES}}]{null}
\lstinputlisting[language=C++, lastline=62, caption={Longest Increasing Subsequence (LIS)}]{ds/LIS.cpp}
\lstinputlisting[language=C++, lastline=48, caption={Count Rectangles}]{ds/cntRectangles.cpp}
\lstinputlisting[language=C++, lastline=88, caption={Disjoint Set}]{ds/disjointSet.cpp}
\lstinputlisting[language=C++, lastline=7, caption={Indexed Set}]{ds/indexedSet.cpp}
\lstinputlisting[language=C++, lastline=30, caption={Largest Range Where Element Is Max/Min}]{ds/largestMinElementRange.cpp}
\lstinputlisting[language=C++, lastline=35, caption={Online Convex Hull}]{ds/onlineConvexHull.cpp}
\lstinputlisting[language=C++, lastline=49, caption={Queue Max}]{ds/queueMax.cpp}
\lstinputlisting[language=C++, lastline=78, caption={Two Sat}]{ds/twoSat.cpp}
\lstinputlisting[caption={\textbf{RANGE DATA STRUCTURES}}]{null}
\lstinputlisting[language=C++, lastline=54, caption={Mo's Algorithm}]{rangeDS/MosAlgo.cpp}
\lstinputlisting[language=C++, lastline=59, caption={Fenwick Tree}]{rangeDS/fenwickTree.cpp}
\lstinputlisting[language=C++, lastline=24, caption={Fenwick Tree 2D}]{rangeDS/fenwickTree2D.cpp}
\lstinputlisting[language=C++, lastline=80, caption={Search Buckets}]{rangeDS/searchBuckets.cpp}
\lstinputlisting[language=C++, lastline=75, caption={Seg Tree}]{rangeDS/segTree.cpp}
\lstinputlisting[language=C++, lastline=23, caption={Sparse Table}]{rangeDS/sparseTable.cpp}
\lstinputlisting[language=C++, lastline=32, caption={Sparse Table 2D}]{rangeDS/sparseTable2D.cpp}
\lstinputlisting[caption={\textbf{MATH}}]{null}
\lstinputlisting[language=C++, lastline=43, caption={Chinese Remainder Theorem}]{math/chineseRemainderTheorem.cpp}
\lstinputlisting[language=C++, lastline=86, caption={Combinatorics, FastPow, ModInv}]{math/combinatorics.cpp}
\lstinputlisting[language=C++, lastline=3, caption={Commonly Used Primes}]{math/commonprimes.txt}
\lstinputlisting[language=C++, lastline=75, caption={Count Primes}]{math/countPrimes.cpp}
\lstinputlisting[language=C++, lastline=59, caption={Discrete Log}]{math/discreteLog.cpp}
\lstinputlisting[language=C++, lastline=64, caption={Fast Fourier Transform (FFT)}]{math/fft.cpp}
\lstinputlisting[language=C++, lastline=8, caption={Fibonacci Sequence}]{math/fib.cpp}
\lstinputlisting[language=C++, lastline=76, caption={Fractions}]{math/fraction.cpp}
\lstinputlisting[language=C++, lastline=25, caption={Gaussian Elimination}]{math/gaussElimination.cpp}
\lstinputlisting[language=C++, lastline=27, caption={Matrix Multiplication}]{math/matrixMultPow.cpp}
%\lstinputlisting[language=C++, lastline=23, caption={Partition Number}]{math/partition.cpp}
\lstinputlisting[language=C++, lastline=83, caption={Pollard Rho}]{math/pollardRho.cpp}
\lstinputlisting[language=C++, lastline=59, caption={Mobius Prime Sieve}]{math/primeSeiveMobius.cpp}
\lstinputlisting[language=C++, lastline=50, caption={Rabin-Miller Primality Test}]{math/rabinMiller.cpp}
\lstinputlisting[language=C++, lastline=32, caption={Sum Floor Arithmetic Series}]{math/sumFloorArithSeries.cpp}
\lstinputlisting[language=C++, lastline=66, caption={Sum of Kth Powers}]{math/sumOfKthPowers.cpp}
\lstinputlisting[language=C++, lastline=19, caption={Euler's Totient}]{math/totient.cpp}
\lstinputlisting[caption={\textbf{MISCELLANEOUS}}]{null}
\lstinputlisting[language=C++, firstline=0, lastline=6, caption={Random Numbers}]{misc/random.cpp}
\lstinputlisting[language=C++, firstline=0, caption={Josephus Problem}]{misc/josephusProblem.cpp}
\lstinputlisting[language=C++, firstline=0, caption={Farey Sequence}]{misc/farey.py}
\lstinputlisting[language=Python, firstline=0, caption={Python Test Cases}]{misc/tests.py}
\lstinputlisting[language=Python, firstline=0, caption={The only thing that matters}]{misc/vimrc}
\pagebreak
\end{document}