CS3233 - Competitive Programming

Introduction

This module aims to prepare students in competitive problem solving.

It will benefit NUS students who want to compete in ACM ICPC, invited high school students who want to compete in IOI, and NUS students in general who aspire to excel in technical interviews of top IT companies.

It covers techniques for attacking and solving challenging* computational problems. Fundamental algorithmic solving techniques covered include complete search, divide/reduce/transform and conquer, greedy, dynamic programming, etc. Domain specific techniques like graph, mathematics-related, string processing, and computational geometry will also be covered. Some additional topics may be included depending on how the semester progresses. Programming language libraries that are commonly used in problem solving will also be taught.

*We only study well-known/solved problems, not research problems.

Note: This introductory message will not be prominent the next time you visit this URL again. This behavior is normal. You can view it again by scrolling to the top of this page.

Course Registration

The quota of this class (Sem 2 AY2015/16) is ... technically only limited by the size of COM1-B-PL2 (46 PCs) ... but not that many NUS students are eligible (or dare enough) to take this extremely competitive module. In recent years, only ~20 NUS students were enrolled and only a few are female...

Useful information to help you decide on whether you should offline register for CS3233:

  1. Do you have national (but preferably international) programming competition background before? Examples: NOI (or IDN OSN, VNM VNOI, CHN NOIP, etc), IOI, ACM ICPC (especially ACM ICPC Asia Singapore Regional Contest 2015), Google Code Jam, Topcoder Open, Facebook Hacker Cup, etc?
    • The difficulty of this course is very extreme for those without such background... but typically those that satisfy the next requirement (see question 2) can survive just as well... We will study problems that require (advanced) data structure and/or algorithms that are typically asked in programming competitions, and we have to implement those solutions fast and without bug...
  2. Did you score well (at least A-) in CS2010 or equivalent (and preferably score A+ in all CS1101S+CS2020 or CS1010+CS1020+CS2010)?
    • This module has a very high performance bar and the average CAP of the students enrolled in the past four academic years were 4.33, 4.44, 4.43, and 4.45 (out of 5.00), respectively. You will need special permission from the instructor (Dr Steven Halim) if you do not satisfy the pre-requisites listed above (the filter is there for your own good).
  3. Are you OK to be tortured for one semester for a mere 4 modular credits (your other modules may also suffer)?
    • You may have to take lighter set of other modules or be ready to S/U other modules or to rush final assessment preparations for other modules only during study week (no final assessment for CS3233). Please do NOT take CS3233 module with another module that is known to be challenging unless you are very confident of yourself and have historical academic performance to back that up.
  4. Are you thinking on applying to top (or emerging) IT companies like Google, Facebook, Microsoft, Dropbox, MemSQL, Garena (NUS ACM ICPC official team sponsor), GrabTaxi, etc in the future?
  5. Do you want to learn interesting data structures, algorithms, and more importantly: On how to apply them properly — from teaching staffs who are deeply involved in such programming competitions?

If you have read all (scary) questions above and are still interested, simply notify Steven for offline registration before CORS round 3B (the last day of application). The offline registration will be closed as soon as the number of students hits 25 NUS students as we will be joined by about 20 SG high school students. To minimize the attrition rate, the pre-acceptance selection will be made rigorous.

Note: This course registration section will not be prominent from Thursday, 14 January 2016 onwards (after first lecture). This behavior is normal. You can view it again by scrolling to the top of this page.

News

Date News

(Temporary) Ranklist

This table lists the current interested students who will take CS3233 in S2 of AY 2015/2016 (some are forced to take). The list is currently in alphabetical order. This list is by no means complete and will be updated over time. Steven will look for 20 NUS students (including exchange students) who are eligible before accepting the other applicants who are put on hold (up to 25 students). This table is last updated on 30 November 2015, 10.29pm.

R Student Speed (40+21=61%) Diligence (15+10+13+14=52%) Total Gap
Sum Sum

Lesson Plan

The lesson plan is easy to remember: All our face to face activities are on Wednesdays.

  1. Students read the assigned CP3 readings before coming to the Wednesday class.
  2. Then, students complete weekly homework (of previous week) before every Wednesday, 2.00pm.
  3. Then, students come to class, ready to attempt the weekly mini contest every Wednesday, 5.30-6.45pm.
  4. Then, TA will give immediate on-the-spot solution discussion until 7.15pm.
  5. Finally, after a short break, Steven will give more eye-opening lecture about related problem solving techniques every Wednesday, 7.30-9.00pm.
  6. We repeat this throughout the semester :).
Week Self Reading from CP3 before class (Flipped Classroom) Homework
(Wed, 2.00pm)
Contest
(Wed, 5.30-6.45pm)
Class Topics
(Wed, 7.30-9.00pm)
-05/-04/
-03/-02/
-01/00
As many pages from CP3; At least from preface up to the end of Chapter 4 Set up a (free) Kattis account, solve first problem @ Kattis, solve ≥ 20 Kattis problems for warming up, familiarize yourself with Ubuntu 14 with GNOME desktop No contest yet; But if you are not a multi-lingual programmer yet, pick up both C/C++ (main) and Java No class yet but some old teaching materials are available in this public website
01
13 Jan
Preface to Chapter 1 (all pages) plus simple Ad Hoc problems in Section 9.4, 9.14, 9.15, 9.19, 9.27, 9.28, and 9.34 Get ≥ 20 AC in Kattis by Sun, 17 Jan 16, 11.59pm if you haven't do so Mock
Ad Hoc
(after first lecture)
Let's Talk CP

Introduction; Brief Course Admins; Focus on delivering some "Wow Moments"; Mock/Preview Contest (not graded, but has high standard)
02
20 Jan
Chapter 2; Focus on Section 2.2 and 2.4.4; Read the rest of Chapter 2 by yourself

Decision to Drop CS3233 without penalty by 24 Jan 16
HW01 due
uHunt series #01 due
Mini 01
"Linear" Algorithms
Be A Librarian

Mastery of Libraries (C++ STL & Java API); Focus on Bit Manipulation and Binary Indexed Tree
03
27 Jan
Chapter 3, 4, and 8; Focus on Section 3.1-2, 4.2.2, 4.4.2-3, and 8.1-8.2; Read Section 3.3 and 3.4 by yourself HW02 due
Solve Mini 01 B/C
uHunt series #02 due
Mini 02
Libraries
Searching for Answers

Iterative Techniques; Recursive Backtracking; Focus on State-Space Search (harder form of SSSP, Graph modeling + BFS/Dijkstra's) with Meet in the Middle (Bidirectional Search)
04
03 Feb
Chapter 3 and 4; Focus on sections about basic DP: Section 3.5-3.7 and 4.7-4.7.1

1 week before CNY, do not disappear (yet)
HW03 due
Solve Mini 02 B/C
uHunt series #03 due
Mini 03
Search
Don't Forget to Take Note

Dynamic Programming (round 1, easier); Review of CS2010/CS2020 DP Materials; Focus on relationship between DP and DAG via discussion of several classic DP examples
05
10 Feb
Re-read Week 01-04 reading materials, Ch9, and CS1020/2010/2020 stuffs; Read "standard" graph topics by yourself (Section 4.1-4.5)

Chinese New Year (CNY) Week, we will do online team contest
Solve Mini 03 B/C
uHunt series #04 due DON'T FORGET
Post-CNY
Team Contest (Online)
CS2010/CS2020 and Week01-04 stuffs
5.30-9.00pm (3h 30m)
No face to face class, we will do Online Post-CNY Team Contest
06
17 Feb
Chapter 5, 6, 8, and 9; Focus on advanced sections that contains DP: Section 5.4, 5.6, 6.5, 8.3, 9.3, 9.5, 9.10, 9.20, 9.21, and 9.33

1 week after CNY, please return
HW04 due
uHunt series #05 due DON'T FORGET
Mini 04
DP1
(easier)
The Art of Stenography

Dynamic Programming (round 2, more challenging), Focus on formulating non trivial DP states + transitions; DP on Math; DP on String; Various DP tricks; DP speed up
Recess
24 Feb
Nobody prevents you to keep solving problems :)

Decision to Drop CS3233 with 'W' grade by 28 Feb 16
Solve Mini 04 B/C
uHunt series #06 due
DON'T FORGET
No class No class
07
02 Mar
Chapter 4 and 9; Focus on Section 4.6, 9.7, 9.13, and 9.23

NOI 2016 Competition, Sat, 06 Mar 16?
HW05 due
uHunt series #07 due
Mini 05
DP2
(harder)
How to Prevent Flood?

Graph (round 1): Network Flow Overview; Max Flow algorithms: Ford Fulkerson's, Edmonds Karp's, Dinic's; Focus on Flow Graph Modeling skill and applications
08
09 Mar
Chapter 4 and 9; Focus on Section 4.7.4, 9.5, 9.10, 9.12, and 9.24 HW06 due
Solve Mini 05 B/C
uHunt series #08 due
Mini 06
Graph1
Network Flow
Social Development Network

Graph (round 2): Graph Matching and applications; Unweighted or Weighted MCBM or MCM; Focus on Bipartite Graph Modeling skill and applications
09
16 Mar
Chapter 5 and 9; Focus on Section 5.3-5.5; Read the rest of Chapter 5 by yourself; Plus Section 9.8, 9.9, 9.21, and 9.26

NOI 2016 Prize Giving Ceremony, Sat, 19 Mar 16?
HW07 due
Solve Mini 06 B/C
uHunt series #09 due
Mini 07
Graph2
Matching
NUMB3RS

Mathematics Overview; Focus on Java BigInteger, Combinatorics, Number Theory, a bit of Cycle-Finding
10
23 Mar
Chapter 6; Focus on Section 6.6; Read the rest of Chapter 6 by yourself

Good Friday and Easter Sunday Week
HW08 due
Solve Mini 07 B/C
uHunt series #10 due
Mini 08
Mathematics
A Glance at Bioinformatics

String Processing; Focus on Suffix Trie, Suffix Tree, and Suffix Array
11
30 Mar
Chapter 7; Focus on Section 7.2 and 7.3; Read the rest of Chapter 7 by yourself HW09 due
Solve Mini 08 B/C
uHunt series #11 due
Mini 09
String
Inside Video Games

(Computational) Geometry; Focus on Algorithms Points, Lines, and Polygon
12
06 Apr
Something from Chapter 2/3/8 and something not found in CP3 HW10 due
Solve Mini 09 B/C
uHunt series #12 due
Mini 10
(Comp) Geometry
The Last Lecture
13
13 Apr
The entire book and beyond Solve Mini 10 B/C
uHunt series #13 due
Final team contest
Week01-12 stuffs
5.30-9.00pm (3h 30m)
No new lecture topic
Reading
Week
Time for you to study for your other modules No more HW :) Join NUS ACM ICPC teams No final assessment

Hall of Fame

This table records the previous top students of CS3233 under Dr Steven Halim (rank 1 up to at most rank 2) of that Academic Year and their current known affiliation.

AY (Iteration) Rank Flag and Name Best ICPC Record Current Job
2008/09 (1) 1 Ngo Minh Duc World Finalist 2009 (HM) & 2010 (HM) Previously Facebook
2008/09 (1) 2 Nguyen Hoanh Tien World Finalist 2009 (HM) & 2010 (HM) Microsoft
2009/10 (2) 1 Trinh Tuan Phuong World Finalist 2012 (HM) & 2013 (joint-48) Quantcast
2010/11 (3) 1 Koh Zi Chun World Finalist 2012 (HM) Microsoft
2010/11 (3) 2 Harta Wijaya World Finalist 2012 (HM) & 2013 (joint-48) Garena
2011/12 (4) 1 Yang Mansheng N/A ?
2012/13 (5) 1 Nguyen Tan Sy Nguyen World Finalist 2013 (joint-48) & 2016 (TBC?) 4th year UG
2013/14 (6) 1 Nathan Azaria World Finalist 2014 (joint-19) & 2015 (joint-28) 3rd year UG
2013/14 (6) 2 Jonathan Irvin Gunawan World Finalist 2014 (joint-19) & 2015 (joint-28) 3rd year UG
2014/15 (7) 1 Stefano Chiesa Suryanto Fifth place in Regional Bangkok 2014 2nd year UG
2014/15 (7) 2 Vu Dinh Quang Dat World Finalist 2015 (joint-28) 2nd year UG
2015/16 (8) 1 TBA TBA TBA