Prof. Dr. Tobias Friedrich

(Advanced) Competitive Programming 2

BSc/MSc Vorlesung - Winter 2023/24

People: Prof. Dr. Tobias Friedrich, Dr. Kirill Simonov, Dr. Sarel CohenDr. Christopher Weyand (KIT)
Links: Courses Bachelor/Master, Algorithm Engineering Moodle*

* If you do not have access to Moodle (e.g., not enrolled at HPI), please contact Dr. Kirill Simonov.

UPD 16.10: It is now possible to enroll in the course on Moodle.


This course is a continuation of the (Advanced) Competitive Programming course. During the semester, we will cover algorithms and data structures that, due to their efficiency and comparatively easy implementation, see extensive usage in competitive programming (and often in real-world applications too!). While the previous course focused on basic algorithms, in this semester we focus on more advanced topics, for example treaps, min-cost flows, lazy segment trees.

Every topic is first introduced in detail during the lecture, and afterwards we provide a set of exercises, to be solved by implementing the solution in a programming language and submitting it to an automated testing system. The highlight of the course are the live contests, where the students compete between themselves in teams of three, just like in the official ACM ICPC competitions.

This time, the course is once again held in cooperation with the Institute of Theoretical Informatics at KIT in Karlsruhe. The lecture content is synchronized, and we provide a common forum as well as a common scoreboard, so that HPI- and KIT-teams can directly compete and also keep in touch, i.e., by discussing solution ideas.


Passing (Advanced) Competitive Programming is required for admission to this course.
Moreover, it is not possible to add the course to the Master progrram for those students who already took the "Competitive Programming 2" course during their Bachelor.

The lectures and the tasks will be given in English.

Teaching format

The lectures are complemented by exercise sessions, where we will discuss various approaches for solutions to homework, tips and tricks, etc. Throughout the course, we will cover various advanced topics in competitive programming, as well as helpful supplementary concepts such as best workflow practices and debugging procedures. For each topic, a set of tasks will be given to be solved as homework. In addition, participants will take part in live contests. Each student solves the tasks of the weekly contest by themselves in order to learn first-hand the methods presented in the lectures. On the other hand, the live contests are to be solved in teams. All tasks are evaluated vi the online testing system, and for all tasks we will eventually discuss the solution in class. At the end of the semester, a final contest takes place.


The final grade is based on the homework and live contests (during the semester) as well as on the final contest (takes place after the end of the teaching period), and split as follows:

  • 40% homework (to submit in two weeks after the respective topic is presented),

  • 30% live contests (10% per contest),

  • 30% final contest (30% per contest).


The course takes place in person, in auditorium K-1.04.
The time slots for the course are Friday 13:30-15:00 and 15:15-16:45. The first meeting is on 20.10.2023 at 13:30.

The date for the final contest will be announced later. This will be considered as the exam date for the course.

Lecture team

The following persons are involved in this lecture:

Dr. Kirill Simonov


Office: K-2.06
E-Mail: Kirill.Simonov(at)hpi.de

Dr. Sarel Cohen


E-mail: sarel.cohen(at)hpi.de

Konrad Letz


E-mail: Konrad.Letz(at)student.hpi.de

Tobias Röhr


E-mail: Tobias.Roehr(at)student.hpi.de