-
Notifications
You must be signed in to change notification settings - Fork 2
/
ref.tex
182 lines (137 loc) · 4.29 KB
/
ref.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
\documentclass[a4paper,oneside,twocolumn]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage[sc]{mathpazo}
\linespread{1.185}
%\usepackage{eulervm}
\usepackage[landscape,left=.75cm,right=.5cm,top=2.1cm,bottom=.5cm]{geometry}
\setlength{\columnseprule}{0.25pt}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[R,RO]{\bfseries\thepage}
\fancyhead[L,LO]{University of Pennsylvania}
\usepackage{listings}
\usepackage{sectsty}
\sectionfont{\normalsize}
\usepackage{xcolor}
\usepackage{textcomp}
\usepackage{fancyvrb}
\fvset{tabsize=2}
\lstset{language=C++,
basicstyle=\ttfamily,
keywordstyle=\color[rgb]{0,0,0.7},
stringstyle=\color[rgb]{0.5,0,0},
commentstyle=\color[rgb]{0,0.5,0},
morecomment=[l][\color[rgb]{0.5,0.5,0}]{\#},
breaklines=true,
tabsize=2
}
\newcommand{\SECTION}[2]{\section*{#1} \addcontentsline{toc}{subsection}{#1} #2 \begin{center}\rule{400pt}{0.25pt}\end{center}}
\newcommand{\sourcefile}[1]{\lstinputlisting{src/#1}}
\newcommand{\Csourcefile}[1]{\lstinputlisting[language=C++]{src/#1.cpp}}
\newcommand{\Cnotppsourcefile}[1]{\lstinputlisting[language=C++]{src/#1.c}}
\newcommand{\Psourcefile}[1]{\lstinputlisting[language=Python]{src/#1.py}}
%\begin{center}\textbf{#1.cpp}\end{center}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\newcommand{\NN}{\mathbb{N}}
\newcommand{\ZZ}{\mathbb{Z}}
\newcommand{\QQ}{\mathbb{Q}}
\newcommand{\RR}{\mathbb{R}}
\newcommand{\then}{\Longrightarrow}
\newcommand{\floor}[1]{\left\lfloor#1\right\rfloor}
\newcommand{\ceil}[1]{\left\lceil#1\right\rceil}
\newcommand{\paren}[1]{\left(#1\right)}
\newcommand{\brackets}[1]{\left[#1\right]}
\newcommand{\braces}[1]{\left\{#1\right\}}
\newcommand{\abs}[1]{\left\lvert#1\right\rvert}
\newcommand{\nequiv}{\not\equiv}
\newcommand{\ds}{\displaystyle}
\newcommand{\bigO}{\mathcal{O}}
\newcommand{\norm}[1]{\abs{\abs{#1}}}
\newcommand{\degree}{\ensuremath{^\circ}}
\newcommand{\defun}[5] {
\begin{array}{rrcl}
#1: & #2 & \longrightarrow & #3 \\
& #4 & \longmapsto & #5
\end{array}
}
\renewcommand{\le}{\leqslant}
\renewcommand{\ge}{\geqslant}
\renewcommand{\epsilon}{\varepsilon}
\newcommand{\stirfst}[2]{\genfrac{[}{]}{0pt}{}{#1}{#2}}
\newcommand{\stirsnd}[2]{\genfrac{\{}{\}}{0pt}{}{#1}{#2}}
\newcommand{\bell}[1]{\mathcal B_{#1}}
\newcommand{\seg}[1]{\overline{#1}}
\newcommand{\bmat}[1]{\begin{bmatrix}#1\end{bmatrix}}
\newcommand{\vmat}[1]{\begin{vmatrix}#1\end{vmatrix}}
\title{ACM ICPC Reference}
\author{University of Pennsylvania}
\begin{document}
\footnotesize{}
\maketitle
\thispagestyle{fancy}
\section{Data Structures}
\SECTION{Treap (balanced binary search tree)} {
\Csourcefile{\detokenize{treap}}
}
\section{Geometry}
\SECTION{Welzl's algorithm (minimum enclosing circle} {
\Csourcefile{\detokenize{welzl}}
}
\SECTION{Monotone chain (convex hull) and rotating calipers (farthest pair)} {
\Csourcefile{\detokenize{convexhull-rotatingcaliper}}
}
\SECTION{3d Convex Hull} {
\Csourcefile{\detokenize{3d-convex-hull}}
}
\section{Graph}
\SECTION{Min cost flow} {
\Csourcefile{\detokenize{mincostflow}}
}
\SECTION{Dinic's ($VE^2$ max flow)} {
\Csourcefile{\detokenize{dinic}}
}
\SECTION{Edmond's algorithm (unweighted general matching)} {
\Csourcefile{\detokenize{edmonds-blossom}}
}
\SECTION{Link cut tree} {
\Csourcefile{\detokenize{link-cut}}
}
\SECTION{Hungarian algorithm} {
\Cnotppsourcefile{\detokenize{hungarian/hungarian}}
}
\section{Strings}
\SECTION{KMP (linear string search)} {
\Csourcefile{\detokenize{kmp}}
}
\SECTION{Manacher (max palindrome substring)} {
\Csourcefile{\detokenize{manacher}}
}
\SECTION{Suffix array} {
\Csourcefile{\detokenize{suffix-array}}
}
\section{Math}
\SECTION{Chinese Remainder Theorem} {
\Csourcefile{\detokenize{crt}}
}
\SECTION{Fast Fourier Transform} {
\Csourcefile{\detokenize{fft}}
}
\SECTION{Simplex Algorithm (Linear programming)} {
\Csourcefile{\detokenize{simplex}}
}
\SECTION{Gaussian elimination} {
\Csourcefile{\detokenize{gaussian-elim}}
}
\SECTION{Karatsuba multiplication} {
\Csourcefile{\detokenize{karatsuba}}
}
\SECTION{Miller-Rabin (probabilistic primality testing)} {
\Csourcefile{\detokenize{miller-rabin}}
}
\end{document}