forked from jakao0907/CompetitiveProgrammingCodebook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcodebook.tex
447 lines (319 loc) · 12.1 KB
/
codebook.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
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
\documentclass[a4paper,10pt,twocolumn,oneside]{article}
\setlength{\columnsep}{10pt} %兩欄模式的間距
\setlength{\columnseprule}{0pt} %兩欄模式間格線粗細
\usepackage{amsthm} %定義,例題
\usepackage{amssymb}
%\usepackage[margin=2cm]{geometry}
\usepackage{fontspec} %設定字體
\usepackage{color}
\usepackage[x11names]{xcolor}
\usepackage{listings} %顯示code用的
%\usepackage[Glenn]{fncychap} %排版,頁面模板
\usepackage{fancyhdr} %設定頁首頁尾
\usepackage{graphicx} %Graphic
\usepackage{enumerate}
\usepackage{titlesec}
\usepackage{amsmath}
\usepackage[CheckSingle, CJKmath]{xeCJK}
% \usepackage{CJKulem}
%\usepackage[T1]{fontenc}
\titlespacing{\section}{0cm}{0cm}{0cm}
\titlespacing{\subsection}{0cm}{0cm}{0cm}
\usepackage{amsmath, courier, listings, fancyhdr, graphicx}
\topmargin=0pt
\headsep=5pt
\textheight=780pt
\footskip=0pt
\voffset=-40pt
\textwidth=545pt
\marginparsep=0pt
\marginparwidth=0pt
\marginparpush=0pt
\oddsidemargin=0pt
\evensidemargin=0pt
\hoffset=-42pt
%\renewcommand\listfigurename{圖目錄}
%\renewcommand\listtablename{表目錄}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\setmainfont{Consolas} %主要字型
\setmonofont{Monaco} %主要字型
\setCJKmainfont{Noto Sans CJK TC}
% \setCJKmainfont{Consolas} %中文字型
%\setmainfont{sourcecodepro}
\XeTeXlinebreaklocale "zh" %中文自動換行
\XeTeXlinebreakskip = 0pt plus 1pt %設定段落之間的距離
\setcounter{secnumdepth}{3} %目錄顯示第三層
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\makeatletter
\lst@CCPutMacro\lst@ProcessOther {"2D}{\lst@ttfamily{-{}}{-{}}}
\@empty\z@\@empty
\makeatother
\lstset{ % Code顯示
language=C++, % the language of the code
basicstyle=\footnotesize\ttfamily, % the size of the fonts that are used for the code
%numbers=left, % where to put the line-numbers
numberstyle=\footnotesize, % the size of the fonts that are used for the line-numbers
stepnumber=1, % the step between two line-numbers. If it's 1, each line will be numbered
numbersep=5pt, % how far the line-numbers are from the code
backgroundcolor=\color{white}, % choose the background color. You must add \usepackage{color}
showspaces=false, % show spaces adding particular underscores
showstringspaces=false, % underline spaces within strings
showtabs=false, % show tabs within strings adding particular underscores
frame=false, % adds a frame around the code
tabsize=2, % sets default tabsize to 2 spaces
captionpos=b, % sets the caption-position to bottom
breaklines=true, % sets automatic line breaking
breakatwhitespace=false, % sets if automatic breaks should only happen at whitespace
escapeinside={\%*}{*)}, % if you want to add a comment within your code
morekeywords={*}, % if you want to add more keywords to the set
keywordstyle=\bfseries\color{Blue1},
commentstyle=\itshape\color{Red4},
stringstyle=\itshape\color{Green4},
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\pagestyle{fancy}
\fancyfoot{}
%\fancyfoot[R]{\includegraphics[width=20pt]{ironwood.jpg}}
\fancyhead[L]{National Taiwan Ocean University HongLongLongLong}
\fancyhead[R]{\thepage}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\contentsname}{Contents}
\scriptsize
\tableofcontents
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newpage
\section{Basic}
% \subsection{.vimrc}
% \lstinputlisting{basic/vimrc}
\subsection{Increase Stack Size}
\lstinputlisting{basic/IncStack.cpp}
% \subsection{Increase Stack Size}
% \lstinputlisting{basic/IncStack_windows.cpp}
\subsection{Misc}
\lstinputlisting{basic/misc.cpp}
\subsection{check}
\lstinputlisting{basic/run.sh}
\subsection{python-related}
\lstinputlisting{basic/python_trick.py}
% \subsection{java-related}
% \lstinputlisting{basic/java-related.java}
\section{flow}
\subsection{ISAP}
\lstinputlisting{flow/isap.cpp}
\subsection{MinCostFlow}
\lstinputlisting{flow/MinCostFlow.cpp}
\subsection{Dinic}
\lstinputlisting{flow/dinic_BCW.cpp}
%\subsection{Hungarian}
%\lstinputlisting{flow/Hungarian.cpp}
%\subsection{Hungarian Unbalanced}
%\lstinputlisting{flow/HungarianUnbalanced.cpp}
\subsection{Kuhn Munkres 最大完美二分匹配}
\lstinputlisting{flow/KM2.cpp}
\subsection{Directed MST}
\lstinputlisting{flow/DMST.cpp}
\subsection{SW min-cut (不限S-T的min-cut)}
\lstinputlisting{flow/SW-mincut.cpp}
% \subsection{Max Cost Circulation}
% \lstinputlisting{flow/MaxCostCirculation.cpp}
%\subsection{Gusfield}
%\lstinputlisting{flow/gusfield.cpp}
\subsection{Max flow with lower/upper bound}
\lstinputlisting{flow/BoundedMaxflow.cpp}
% \subsection{Relabel to Front}
% \lstinputlisting{flow/relabelToFront.cpp}
\subsection{HLPPA (稠密圖flow)}
\lstinputlisting{flow/HLPPA2.cpp}
\subsection{Flow Method}
\lstinputlisting{flow/FlowMethod.txt}
\section{Math}
\subsection{FFT}
\lstinputlisting{math/FFT.cpp}
\subsection{NTT}
\lstinputlisting{math/ntt.cpp}
\subsection{Fast Walsh Transform}
\lstinputlisting{math/FWT.cpp}
\subsection{Poly operator}
\lstinputlisting{math/PolyOp_new.cpp}
\subsection{O(1)mul}
\lstinputlisting{math/O(1)mul.cpp}
\subsection{BigInt}
\lstinputlisting{math/Bigint_full.cpp}
\subsection{Linear Recurrence}
\lstinputlisting{math/linearRecurrence.cpp}
\subsection{Miller Rabin}
\lstinputlisting{math/Miller_Rabin.cpp}
% \subsection{Simplex 線性規劃}
% \lstinputlisting{math/Simplex.cpp}
\subsection{Faulhaber ($\sum\limits_{i=1}^{n}i^p$)}
\lstinputlisting{math/Faulhaber.cpp}
\subsection{Chinese Remainder}
\lstinputlisting{math/chineseRemainder.cpp}
\subsection{Pollard Rho 找因數}
\lstinputlisting{math/pollardRho.cpp}
\subsection{Josephus Problem}
\lstinputlisting{math/Josephus.cpp}
%\subsection{Poly Generator}
%\lstinputlisting{math/PolyGen.cpp}
%\subsection{Matrix Pseudo Inverse}
%\lstinputlisting{math/Square_Matrix_pinv.cpp}
\subsection{Gaussian Elimination}
\lstinputlisting{math/gauss.cpp}
\subsection{ax+by=gcd}
\lstinputlisting{math/ax+by=gcd.cpp}
\subsection{Discrete sqrt}
\lstinputlisting{math/DiscreteSqrt.cpp}
% \subsection{SchreierSims}
% \lstinputlisting{math/SchreierSims.cpp}
\subsection{Romberg 定積分}
\lstinputlisting{math/Romberg.cpp}
%\subsection{Discrete K-th sqrt}
%\lstinputlisting{math/DiscreteKthsqrt.cpp}
\subsection{Prefix Inverse}
\lstinputlisting{math/prefixInv.cpp}
\subsection{Roots of Polynomial 找多項式的根}
\lstinputlisting{math/rootsOfPolynomial.cpp}
% \subsection{inverse}
% \lstinputlisting{math/inverse.cpp}
%\subsection{Mod}
%\lstinputlisting{math/MOD.cpp}
\subsection{Primes}
\lstinputlisting{math/primes.cpp}
\subsection{Result}
\input{math/theorem.tex}
\section{Geometry}
% \subsection{Points class}
% \lstinputlisting{geometry/Points.cpp}
\subsection{Intersection of 2 lines}
\lstinputlisting{geometry/Intersection_of_two_lines.cpp}
% \lstinputlisting{geometry/halfPlaneIntersection.cpp}
\subsection{halfPlaneIntersection}
\lstinputlisting{geometry/Half_plane_intersection.cpp}
\subsection{Convex Hull}
\lstinputlisting{geometry/convex_hull.cpp}
\subsection{Convex Hull 3D}
\lstinputlisting{geometry/Convexhull3D.cpp}
\subsection{Intersection of 2 segments}
\lstinputlisting{geometry/Intersection_of_two_segments.cpp}
\subsection{Intersection of circle and segment}0
\lstinputlisting{geometry/Intersection_of_circle_and_segment.cpp}
%\subsection{Intersection of polygon and circle}
%\lstinputlisting{geometry/Intersection_of_polygon_and_circle.cpp}
\subsection{Intersection of 2 circles}
\subsection{Circle cover}
\lstinputlisting{geometry/CircleCover.cpp}
%\subsection{Li Chao Segment Tree}
%\lstinputlisting{dataStructure/LiChaoST.cpp}
\subsection{Convex Hull trick}
\lstinputlisting{geometry/ConvexHulltrick.cpp}
\subsection{Tangent line of two circles}
\lstinputlisting{geometry/Tangent_line_of_two_circles.cpp}
\subsection{KD Tree}
%\lstinputlisting{geometry/KD_Tree.cpp}
\lstinputlisting{geometry/KD_Tree1.cpp}
%\subsection{Poly Union}
%\lstinputlisting{geometry/polyUnion.cpp}
\subsection{Lower Concave Hull}
\lstinputlisting{geometry/lowerConcaveHull2.cpp}
% \subsection{Delaunay Triangulation}
% \lstinputlisting{geometry/DelaunayTriangulation.cpp}
\subsection{Min Enclosing Circle}
\lstinputlisting{geometry/mec.cpp}
\subsection{Min Enclosing Ball}
\lstinputlisting{geometry/minEnclosingBall.cpp}
%\subsection{Minkowski sum}
%\lstinputlisting{geometry/Minkowski_Sum.cpp}
% \subsection{Minkowski sum}
% \lstinputlisting{geometry/minkowski-convex-hull.cpp}
% \subsection{Min Enclosing Circle}
% \lstinputlisting{geometry/minEnclosingCircle.cpp}
%\subsection{Min/Max Enclosing Rectangle}
%\lstinputlisting{geometry/minMaxEnclosingRectangle.cpp}
\subsection{Min dist on Cuboid}
\lstinputlisting{geometry/minDistonCuboid.cpp}
\subsection{Heart of Triangle}
\lstinputlisting{geometry/triangle.cpp}
\section{Graph}
% \subsection{HeavyLightDecomp}
% \lstinputlisting{graph/HeavyLightDecomp.cpp}
\subsection{DominatorTree}
\lstinputlisting{graph/DominatorTree.cpp}
\subsection{MaxClique 最大團}
% \lstinputlisting{graph/MaxClique.cpp}
\lstinputlisting{graph/MaximumClique.cpp}
%\subsection{Number of Maximal Clique}
%\lstinputlisting{graph/NumberofMaximalClique.cpp}
\subsection{Strongly Connected Component}
\lstinputlisting{graph/kosaraju.cpp}
\subsection{Dynamic MST}
\lstinputlisting{graph/DynamicMST.cpp}
\subsection{Maximum General graph Matching}
\lstinputlisting{graph/generalMatching.cpp}
\subsection{Minimum General Weighted Matching}
\lstinputlisting{graph/Minimum_General_Weighted_Matching.cpp}
\subsection{Maximum General Weighted Matching}
\lstinputlisting{graph/BorrowedGeneralWeightedMatching.cpp}
\subsection{Minimum Steiner Tree}
\lstinputlisting{graph/MinimumSteinerTree.cpp}
\subsection{BCC based on vertex}
\lstinputlisting{graph/bcc_vertex.cpp}
\subsection{Min Mean Cycle}
\lstinputlisting{graph/MinMeanCycle.cpp}
\subsection{Directed Graph Min Cost Cycle}
\lstinputlisting{graph/DirectedGraphMinCycle.cpp}
\subsection{K-th Shortest Path}
\lstinputlisting{graph/KSP.cpp}
\subsection{SPFA}
\lstinputlisting{graph/spfa.cpp}
%\subsection{Graph Hash}
%\input{graph/graphHash.tex}
\section{String}
\subsection{PalTree}
\lstinputlisting{string/PalTree2.cpp}
%\subsection{SuffixArray}
%\lstinputlisting{string/Suffix_Array.cpp}
\subsection{KMP}
\lstinputlisting{string/KMP.cpp}
\subsection{SAIS}
\lstinputlisting{string/SAIS.cpp}
\subsection{SuffixAutomata}
\lstinputlisting{string/SAM.cpp}
\subsection{Aho-Corasick}
\lstinputlisting{string/Aho-Corasick.cpp}
\subsection{Z Value}
\lstinputlisting{string/zvalue.cpp}
\subsection{BWT}
\lstinputlisting{string/BWT.cpp}
\subsection{ZValue Palindrome}
\lstinputlisting{string/zvalue_palindrome.cpp}
\subsection{Smallest Rotation}
\lstinputlisting{string/minRotation.cpp}
%\subsection{Baker Bird}
%\lstinputlisting{string/bakerBird.cpp}
\subsection{Cyclic LCS}
\lstinputlisting{string/cyclicLCS.cpp}
\section{Data Structure}
\subsection{Segment tree}
\lstinputlisting{dataStructure/seg_tree.cpp}
\subsection{Treap}
\lstinputlisting{dataStructure/treap_split_key&kth.cpp}
\subsection{Link-Cut Tree}
\lstinputlisting{dataStructure/link_cut_tree.cpp}
\subsection{Disjoint Set}
\lstinputlisting{dataStructure/DisjointSet.cpp}
%\subsection{Pairing Heap}
%\lstinputlisting{dataStructure/pairing_heap.cpp}
%\subsection{Leftist Heap}
%\lstinputlisting{dataStructure/Leftist_Heap.cpp}
\subsection{Black Magic}
\lstinputlisting{dataStructure/extc_bt.cpp}
\section{Others}
\subsection{Find max tangent(x,y is increasing)}
\lstinputlisting{others/maxtan.cpp}
\subsection{Exact Cover Set}
\lstinputlisting{others/exactCoverSet.cpp}
%\subsection{\# of Intersection of segments}
%\lstinputlisting{others/painter.cpp}
\lstinputlisting{others/funny.cpp}
\end{document}