SOI adjusted Competitive Programmer's Handbook (see https://github.com/pllk/cphb for the original)
Go to file
Salil03 bcea4ea706
Create README.md
2018-12-14 11:54:18 +05:30
README.md Create README.md 2018-12-14 11:54:18 +05:30
book.pdf Update PDF 2018-07-03 15:16:48 +03:00
book.tex Adjust font size 2017-06-01 22:29:08 +03:00
chapter01.tex Small fixes 2017-12-10 12:06:32 +02:00
chapter02.tex Small fixes 2017-12-10 12:06:32 +02:00
chapter03.tex Fix typo 2017-10-11 18:33:07 +03:00
chapter04.tex Small fixes 2017-05-25 23:28:05 +03:00
chapter05.tex Small fixes 2017-12-10 12:06:32 +02:00
chapter06.tex Fix variable name [closes #59] 2018-01-04 16:24:31 +02:00
chapter07.tex Fix index variable 2017-07-29 11:29:21 +03:00
chapter08.tex Improve language 2017-05-25 23:05:43 +03:00
chapter09.tex Improvements [closes #44] 2017-05-21 12:34:44 +03:00
chapter10.tex Fix algorithm implementation [closes #61] 2018-07-03 15:11:36 +03:00
chapter11.tex Small fixes 2017-05-28 12:07:31 +03:00
chapter12.tex Small fixes 2017-12-10 12:06:32 +02:00
chapter13.tex Fix Bellman-Ford example [closes #60] 2018-07-03 14:48:22 +03:00
chapter14.tex Improve 14.3 2017-05-29 00:54:46 +03:00
chapter15.tex Small fixes 2017-12-10 12:06:32 +02:00
chapter16.tex Fix topological sort graph 2017-08-02 10:47:28 +03:00
chapter17.tex Improve language 2017-05-29 20:39:30 +03:00
chapter18.tex Improve language 2017-05-29 21:23:47 +03:00
chapter19.tex Fix directed Eulerian path requirement 2018-07-03 14:58:22 +03:00
chapter20.tex Improve language 2017-05-29 22:11:00 +03:00
chapter21.tex Fix modpow data type [closes #55] 2017-10-15 14:55:34 +03:00
chapter22.tex Small fixes 2017-05-30 19:59:15 +03:00
chapter23.tex Small fixes 2017-05-30 19:59:15 +03:00
chapter24.tex Small fixes 2017-05-30 19:59:15 +03:00
chapter25.tex Small fixes 2017-05-30 19:59:15 +03:00
chapter26.tex Fix typo 2017-05-25 15:58:45 +03:00
chapter27.tex Small fixes 2017-05-30 20:50:04 +03:00
chapter28.tex Improve language 2017-05-31 22:59:00 +03:00
chapter29.tex Small fixes 2017-05-31 23:23:04 +03:00
chapter30.tex Improve language 2017-05-14 13:51:27 +03:00
list.tex Update Polish contest site link 2017-10-15 15:00:08 +03:00
preface.tex Update month and year 2018-07-03 15:13:18 +03:00

README.md

Competitive Programmer's Handbook

The purpose of this book is to give you a thorough introduction to competitive programming. It is assumed that you already know the basics of programming, but no previous background in competitive programming is needed.

The book is especially intended for students who want to learn algorithms and possibly participate in the International Olympiad in Informatics (IOI) or in the International Collegiate Programming Contest (ICPC). Of course, the book is also suitable for anybody else interested in competitive programming.

It takes a long time to become a good competitive programmer, but it is also an opportunity to learn a lot. You can be sure that you will get a good general understanding of algorithms if you spend time reading the book, solving problems and taking part in contests.

The book is under continuous development. You can always send feedback on the book to ahslaaks@cs.helsinki.fi.

Webpage of the book: https://cses.fi/book/ Download the book (PDF)

Other Versions of the Book

alt text

Guide to Competitive Programming is a printed book published by Springer. It is based on Competitive Programmer's Handbook, but also discusses more advanced topics such as suffix arrays, treaps, dynamic programming optimization, and parallel binary search. You can buy the book, for example, through Springer or Amazon


alt text

Олимпиадное программирование (Olympiad Programming) is a Russian version of Guide to Competitive Programming, published by DMK Press. More information about the book is available on their website.

Table of contents

Part 1: Basic techniques

  1. Introduction
  2. Time complexity
  3. Sorting
  4. Data structures
  5. Complete search
  6. Greedy algorithms
  7. Dynamic programming
  8. Amortized analysis
  9. Range queries
  10. Bit manipulation

Part 2: Graph algorithms

  1. Basics of graphs
  2. Graph traversal
  3. Shortest paths
  4. Tree algorithms
  5. Spanning trees
  6. Directed graphs
  7. Strong connectivity
  8. Tree queries
  9. Paths and circuits
  10. Flows and cuts

Part 3: Advanced topics

  1. Number theory
  2. Combinatorics
  3. Matrices
  4. Probability
  5. Game theory
  6. String algorithms
  7. Square root algorithms
  8. Segment trees revisited
  9. Geometry
  10. Sweep line algorithms

Do you want to practice the topics discussed in the books? The CSES Problem Set provides a collection of practice problems, ranging from easy to difficult.

To-do

  • Add exercises at the end of a chapter from sources other than CSES Problem Set
  • Change the loops in graph algorithms to memset
  • The analysis of nim and examples could be improved

Other Contests and resources

  • IOI

The International Olympiad in Informatics (IOI) is an annual programming contest for secondary school students. Each country is allowed to send a team of four students to the contest. There are usually about 300 participants from 80 countries. The IOI syllabus regulates the topics that may appear in IOI tasks. Almost all the topics in the IOI syllabus are covered by this book.

  • ICPC

The International Collegiate Programming Contest (ICPC) is an annual programming contest for university students. Each team in the contest consists of three students, and unlike in the IOI, the students work together; there is only one computer available for each team. The topics that may appear at the ICPC are not so well specified as those at the IOI. In any case, it is clear that more knowledge is needed at the ICPC, especially more mathematical skills.

  • Online contests

There are also many online contests that are open for everybody. At the moment, the most active contest site is Codeforces, which organizes contests about weekly. In Codeforces, participants are divided into two divisions: beginners compete in Div2 and more experienced programmers in Div1. Other contest sites include AtCoder, CS Academy, HackerRank and Topcoder. There are already some books (besides this book) that focus on competitive programming and algorithmic problem solving:

  • Books

    • S. S. Skiena and M. A. Revilla: Programming Challenges: The Programming Contest Training Manual
    • S. Halim and F. Halim: Competitive Programming 3: The New Lower Bound of Programming Contests
    • K. Diks et al.: Looking for a Challenge? The Ultimate Problem Set from the University of Warsaw Programming Competitions
    • T. H. Cormen, C. E. Leiserson, R. L. Rivest and C. Stein: Introduction to Algorithms
    • J. Kleinberg and É. Tardos: Algorithm Design
    • S. S. Skiena: The Algorithm Design Manual