\begin{thebibliography}{9} \bibitem{aho83} A. V. Aho, J. E. Hopcroft and J. Ullman. \emph{Data Structures and Algorithms}, Addison-Wesley, 1983. \bibitem{ahu91} R. K. Ahuja and J. B. Orlin. Distance directed augmenting path algorithms for maximum flow and parametric maximum flow problems. \emph{Naval Research Logistics}, 38(3):413--430, 1991. \bibitem{and79} A. M. Andrew. Another efficient algorithm for convex hulls in two dimensions. \emph{Information Processing Letters}, 9(5):216--219, 1979. \bibitem{asp79} B. Aspvall, M. F. Plass and R. E. Tarjan. A linear-time algorithm for testing the truth of certain quantified boolean formulas. \emph{Information Processing Letters}, 8(3):121--123, 1979. \bibitem{bel58} R. Bellman. On a routing problem. \emph{Quarterly of Applied Mathematics}, 16(1):87--90, 1958. \bibitem{ben00} M. A. Bender and M. Farach-Colton. The LCA problem revisited. In \emph{Latin American Symposium on Theoretical Informatics}, 88--94, 2000. \bibitem{ben86} J. Bentley. \emph{Programming Pearls}. Addison-Wesley, 1986. \bibitem{cod15} Codeforces: On ''Mo's algorithm'', \url{http://codeforces.com/blog/entry/20032} \bibitem{dij59} E. W. Dijkstra. A note on two problems in connexion with graphs. \emph{Numerische Mathematik}, 1(1):269--271, 1959. \bibitem{dir52} G. A. Dirac. Some theorems on abstract graphs. \emph{Proceedings of the London Mathematical Society}, 3(1):69--81, 1952. \bibitem{edm65} J. Edmonds. Paths, trees, and flowers. \emph{Canadian Journal of Mathematics}, 17(3):449--467, 1965. \bibitem{edm72} J. Edmonds and R. M. Karp. Theoretical improvements in algorithmic efficiency for network flow problems. \emph{Journal of the ACM}, 19(2):248--264, 1972. \bibitem{eve75} S. Even, A. Itai and A. Shamir. On the complexity of time table and multi-commodity flow problems. \emph{16th Annual Symposium on Foundations of Computer Science}, 184--193, 1975. \bibitem{fan94} D. Fanding. A faster algorithm for shortest-path -- SPFA. \emph{Journal of Southwest Jiaotong University}, 2, 1994. \bibitem{fen94} P. M. Fenwick. A new data structure for cumulative frequency tables. \emph{Software: Practice and Experience}, 24(3):327--336, 1994. \bibitem{fis06} J. Fischer and V. Heun. Theoretical and practical improvements on the RMQ-problem, with applications to LCA and LCE. In \emph{Annual Symposium on Combinatorial Pattern Matching}, 36--48, 2006. \bibitem{flo62} R. W. Floyd Algorithm 97: shortest path. \emph{Communications of the ACM}, 5(6):345, 1962. \bibitem{for56} L. R. Ford and D. R. Fulkerson. Maximal flow through a network. \emph{Canadian Journal of Mathematics}, 8(3):399--404, 1956. \bibitem{gal14} F. Le Gall. Powers of tensors and fast matrix multiplication. In \emph{Proceedings of the 39th International Symposium on Symbolic and Algebraic Computation}, 296--303, 2014. \bibitem{gar79} M. R. Garey and D. S. Johnson. \emph{Computers and Intractability: A Guide to the Theory of NP-Completeness}, W. H. Freeman and Company, 1979. \bibitem{goo16} Google Code Jam Statistics (2016), \url{https://www.go-hero.net/jam/16} \bibitem{gro14} A. Grønlund and S. Pettie. Threesomes, degenerates, and love triangles. \emph{2014 IEEE 55th Annual Symposium on Foundations of Computer Science}, 621--630, 2014. \bibitem{gus97} D. Gusfield. \emph{Algorithms on Strings, Trees and Sequences: Computer Science and Computational Biology}, Cambridge University Press, 1997. \bibitem{hel62} M. Held and R. M. Karp. A dynamic programming approach to sequencing problems. \emph{Journal of the Society for Industrial and Applied Mathematics}, 10(1):196--210, 1962. \bibitem{hie73} C. Hierholzer and C. Wiener. Über die Möglichkeit, einen Linienzug ohne Wiederholung und ohne Unterbrechung zu umfahren. \emph{Mathematische Annalen}, 6(1), 30--32, 1873. \bibitem{hop71} J. E. Hopcroft and J. D. Ullman. A linear list merging algorithm. Technical report, Cornell University, 1971. \bibitem{hor74} E. Horowitz and S. Sahni. Computing partitions with applications to the knapsack problem. \emph{Journal of the ACM}, 21(2):277--292, 1974. \bibitem{huf52} D. A. Huffman. A method for the construction of minimum-redundancy codes. \emph{Proceedings of the IRE}, 40(9):1098--1101, 1952. \bibitem{iois} The International Olympiad in Informatics Syllabus, available at \url{https://people.ksp.sk/~misof/ioi-syllabus/} \bibitem{kar87} R. M. Karp and M. O. Rabin. Efficient randomized pattern-matching algorithms. \emph{IBM Journal of Research and Development}, 31(2):249--260, 1987. \bibitem{kas61} P. W. Kasteleyn. The statistics of dimers on a lattice: I. The number of dimer arrangements on a quadratic lattice. \emph{Physica}, 27(12):1209--1225, 1961. \bibitem{knu982} D. E. Knuth. \emph{The Art of Computer Programming. Volume 2: Seminumerical Algorithms}, Addison–Wesley, 1998 (3rd edition). \bibitem{knu983} D. E. Knuth. \emph{The Art of Computer Programming. Volume 3: Sorting and Searching}, Addison–Wesley, 1998 (2nd edition). \bibitem{kru56} J. B. Kruskal. On the shortest spanning subtree of a graph and the traveling salesman problem. \emph{Proceedings of the American Mathematical Society}, 7(1):48--50, 1956. \bibitem{lev66} V. I. Levenshtein. Binary codes capable of correcting deletions, insertions, and reversals. \emph{Soviet physics doklady}, 10(8):707--710, 1966. \bibitem{mai84} M. G. Main and R. J. Lorentz. An $O(n \log n)$ algorithm for finding all repetitions in a string. \emph{Journal of Algorithms}, 5(3):422--432, 1984. \bibitem{ore60} Ø. Ore. Note on Hamilton circuits. \emph{The American Mathematical Monthly}, 67(1):55, 1960. \bibitem{pac13} J. Pachocki and J. Radoszweski. Where to use and how not to use polynomial string hashing. \emph{Olympiads in Informatics}, 7(1):90--100, 2013. \bibitem{pri57} R. C. Prim. Shortest connection networks and some generalizations. \emph{Bell System Technical Journal}, 36(6):1389--1401, 1957. \bibitem{q27} 27-Queens Puzzle: Massively Parallel Enumeration and Solution Counting. \url{https://github.com/preusser/q27} \bibitem{sha81} M. Sharir. A strong-connectivity algorithm and its applications in data flow analysis. \emph{Computers \& Mathematics with Applications}, 7(1):67--72, 1981. \bibitem{sta06} P. Stańczyk. \emph{Algorytmika praktyczna w konkursach Informatycznych}, MSc thesis, University of Warsaw, 2006. \bibitem{str69} V. Strassen. Gaussian elimination is not optimal. \emph{Numerische Mathematik}, 13(4):354--356, 1969. \bibitem{tar75} R. E. Tarjan. Efficiency of a good but not linear set union algorithm. \emph{Journal of the ACM}, 22(2):215--225, 1975. \bibitem{tar84} R. E. Tarjan and U. Vishkin. Finding biconnected componemts and computing tree functions in logarithmic parallel time. \emph{25th Annual Symposium on Foundations of Computer Science}, 12--20, 1984. \bibitem{tem61} H. N. V. Temperley and M. E. Fisher. Dimer problem in statistical mechanics -- an exact result. \emph{Philosophical Magazine}, 6(68):1061--1063, 1961. \bibitem{war23} H. C. von Warnsdorff. \emph{Des Rösselsprungs einfachste und allgemeinste Lösung}. Schmalkalden, 1823. \end{thebibliography}