CS3233: ace the component, not just read the notes
Your complete guide to National University of Singapore's competitive programming course. See where the marks are, work real practice questions, and study with an AI tutor that knows CS3233.
Sia generates CS3233 practice questions, walks through introduction and library mastery step by step, and quizzes you on the material the component that weights most heavily.
Find what is wrong
A contest problem asks for the number of pairs (i, j) with i < j and a[i] + a[j] ≤ K, for n up to 200 000. A student writes the following. What is wrong?
sort(a.begin(), a.end());
long long cnt = 0;
for (int i = 0; i < n; ++i)
for (int j = i + 1; j < n; ++j)
if (a[i] + a[j] <= K) ++cnt;
The code is correct but does 2×10¹⁰ comparisons for n = 200 000, far beyond a typical 1-2 second limit.
long long is needed: the count can reach about 2×10¹⁰, which overflows int, so option C makes it worse.
Starting j at 0 double-counts pairs and includes i = j, so option D is wrong.
The trap: Checking correctness on samples and forgetting the constraints. In CS3233 the constraints are the hint about which complexity is intended. classic slip!
One component decides 50% of your grade. Capped at 50%. This whole page is built around that.
Overview
What CS3233 is, and where it sits
CS3233 Competitive Programming is the NUS course that trains students for ICPC-style contests and the technical interviews of quantitative trading and large technology firms. Steven Halim, who also directs the Centre for Nurturing Computing Excellence, teaches it once a year in Semester 2 to a class capped at 39, admitted by application. This guide follows the Semester 2 AY2025/26 offering.
The twelve teaching weeks move through library mastery and bit manipulation, complete search and binary search on the answer, dynamic programming and greedy, network flow and graph matching, NP-hard problems in contest style, number theory and combinatorics, string processing with suffix structures, and computational geometry. Each Monday evening combines a three-problem mini contest with a lecture; industry sponsors visit several sessions. The textbook is Competitive Programming 4, Books 1 and 2.
There is no written examination. The published scoring scheme has two capped halves: a speed component from nine mini contests and two long team contests, and a diligence component from weekly reading homework, upsolving, Kattis sets and an achievement system. Each half is capped at 50%, and 60% in total secures at least a B+.
Always treat your own course outline and the exam timetable as authoritative.
Difficulty & time commitment
Is CS3233 hard, and how much time does it take?
CS3233 is manageable if you keep a weekly rhythm and treat the back half as the main event. The pattern is consistent: it starts gently and steepens, and the heaviest assessment is the part that separates grades.
The difficulty curve and the assessment weighting point the same way: the back half is harder and worth more. Front-loading effort there is the highest-return decision in the course.
Is this course for you
Who tends to do well, and who tends to struggle
You will likely do well if
- You already have national or international olympiad or ICPC experience, or a CodeForces rating comfortably above the entry bar.
- You can implement a known algorithm quickly and correctly in C++ without looking it up.
- You will read the assigned CP4 chapters every week; the diligence half depends on it.
- You are taking a lighter load in the same semester.
You may struggle if
- You expect lectures to teach algorithms from first principles; they assume CS2040 and CS3230 and focus on application.
- You are strong in one half only; each half is capped at 50%, so a 57% contest score is worth 50%.
- You code mainly in Python; the page warns about time limits.
- You are also taking another known-demanding course, which the page explicitly advises against.
- Upsolve problem B every week; it is worth 10% and doubles as contest practice.
- Track the achievement list from Week 1 — active-in-class and surprise-us stars are awarded through the semester, not at the end.
- Form your team early via the class Discord for the two team contests.
- Push your Kattis and CodeForces standings; both convert directly into achievement stars.
Syllabus
The 12 topics, week by week
The exam-weight marker on each topic shows where the marks concentrate. The amber topics carry the highest exam weight.
T1 · Introduction and languages
Week 1; CP4 preface to ch. 1C++17, Python 3 and Java 17 for contests; the mock contest and its standard.
T2 · Library mastery
Week 2; CP4 ch. 2STL, Python standard library and Java API; bit manipulation; Fenwick versus segment trees.
T3 · Complete search and binary search on the answer
Week 3; CP4 ch. 3, 4, 8, 9Backtracking with bitmasks, state-space search, meet in the middle, guessing the answer.
T4 · Dynamic programming and greedy
Week 4; CP4 ch. 3, 5, 6, 8, 9DP as a DAG; non-classical states and transitions; when greedy beats DP.
T5 · Network flow
Week 5; CP4 ch. 8Ford-Fulkerson variants, Edmonds-Karp, Dinic's; flow-graph modelling.
T6 · Graph matching
Week 7; CP4 ch. 4, 8Unweighted and weighted bipartite matching, Hungarian algorithm, DP-bitmask matching on small graphs.
T7 · Midterm team contest
Week 8Weeks 1-6 plus CS2040 material; 4.5 hours in teams of three.
T8 · NP-hard problems
Week 9; CP4 ch. 8Contest-style treatment of vertex cover, Steiner tree, TSP and related techniques.
T9 · Mathematics
Week 10; CP4 ch. 5, 9Big integers, combinatorics, extended Euclid, modular inverse, Fermat's little theorem, CRT, probability.
T10 · String processing
Week 11; CP4 ch. 6Suffix trie, suffix tree, suffix array and string hashing.
T11 · Computational geometry
Week 12; CP4 ch. 7, 9Points, lines, polygons, convex hull and the art gallery problem.
T12 · Final team contest
Week 13Whole course; 5 hours in teams of three; no written final.
How it's assessed
Assessment structure
| Component | Weight | Format & timing |
|---|---|---|
| Speed component (capped): nine weekly mini contests up to 36% and two team contests up to 21% | 50% | Nine weekly 75-minute mini contests of three problems (up to 36%) and two team contests of ten problems each, the 4.5-hour midterm and 5-hour final (up to 21%); strict accepted-or-not grading. Weekly, plus Weeks 8 and 13. Capped at 50%. |
| Diligence component (capped): weekly homework up to 15%, problem Bs up to 10%, Kattis sets up to 12%, achievements up to 20% | 50% | Ten weekly CP4 reading homeworks (up to 15%), solving last week's problem B at home (up to 10%), twelve weekly Kattis sets of three from seven problems (up to 12%) and a star-based achievement system (up to 20%). Weekly across the semester. Capped at 50%. |
- The two capped components sum to 100. Contest problems are graded accepted or not; there is no partial credit for near-solutions except weakened subtasks where offered. The published scheme states that 60% in total secures at least a B+. Students may drop without penalty in Week 2 or with a W grade by the end of recess week.
- There is no written examination. The midterm team contest (Week 8, 4.5 hours, ten problems) and the final team contest (Week 13, 5 hours, ten problems) are the long-form assessments; past contest problem sets are published on NUS Kattis for recent years.
This is a coursework course. Coursework carries 100% of the grade and the speed component (capped): nine weekly mini contests up to 36% and two team contests up to 21% is the single heaviest piece at 50%, so steady work across the semester decides your result more than any one sitting. Capped at 50%.
Final exam timing: During the examination period. Confirm the exact date and venue on your exam timetable.
How to actually pass it
A weekly rhythm, two checklists, and the traps to avoid
The course rewards consistency over cramming, and practice over re-reading. Here is the loop that works, then what to have nailed before each exam.
The weekly loop
Before the mid-semester checklist
- Implement Fenwick tree, segment tree and UFDS from memory.
- Formulate a non-classical DP state and transition under time.
- Model a problem as maximum flow and implement Dinic's.
- Recognise when binary search on the answer applies.
Before the final heaviest topics
- Model bipartite matching problems and solve weighted versions.
- Apply extended Euclid, modular inverse and CRT in code.
- Build a suffix array and answer substring queries.
- Compute a convex hull and handle polygon problems robustly.
The mistakes that cost marks
Relying on one half. Both components are capped at 50%; excess in either is discarded.
Dropping late. Dropping after recess week records a W grade; the page sets the no-penalty deadline in Week 2.
Python by default. Time limits are set for C++; the same algorithm in Python may TLE.
Teaching team
Who teaches CS3233
The bios below are factual. We do not rate lecturers; any star ratings are submitted by students who have taken CS3233.
Teaching team as listed in the course materials reviewed. AskSia does not rate lecturers; star ratings are submitted by students who have taken CS3233.
Formula & concept sheet
The vocabulary and formulas you must own
- Bitmask
- An integer whose bits encode a subset, enabling fast set operations.
- Fenwick tree
- A binary indexed tree supporting prefix sums and point updates in O(log n).
- Segment tree
- A tree over intervals supporting range queries and updates in O(log n).
- Meet in the middle
- Splitting a search space into two halves and combining, to cut exponential time.
- Binary search on the answer
- Guessing the answer and checking feasibility monotonically.
- Max flow
- The maximum rate from source to sink in a flow network; Dinic's algorithm is the workhorse.
- Bipartite matching
- A set of edges with no shared vertices in a bipartite graph; maximum cardinality or weight.
- Modular inverse
- The multiplier that undoes multiplication modulo a prime, via Fermat or extended Euclid.
- Suffix array
- A sorted array of all suffixes, enabling fast substring search.
- Convex hull
- The smallest convex polygon containing a set of points.
Set texts
The prescribed reading
The syllabus references map straight onto these.
Competitive Programming 4, Book 1 and Book 2
.
Where it fits
Prerequisites, related courses & why it matters
Prerequisites: at least A- in CS1010/variant and CS2040/variant, and formally CS2030/variant. 4 units; Semester 2 only; quota 39 by application. This guide follows the Semester 2 AY2025/26 offering.
Your CS3233 study toolkit
Study the course with Sia, not just read about it
Each tool already knows CS3233: your syllabus, your texts, and where the marks are. Grouped by how you study, from first contact to exam week.
FAQ
Frequently asked questions
Is CS3233 hard?
The six-factor rubric scores it moderately hard only because there is no written exam to weight; every other factor is near the top of the scale. The course page calls the difficulty very extreme for students without competition background, admits by application, and warns that other courses may suffer during the semester.
What is the assessment breakdown?
Two capped halves: speed (nine mini contests up to 36% and two team contests up to 21%, capped at 50%) and diligence (homework up to 15%, problem Bs up to 10%, Kattis sets up to 12%, achievements up to 20%, capped at 50%), per the published scoring scheme for S2 AY2025/26.
Is there a final exam?
No. The final team contest in Week 13 is the last assessment, and the page tells students to use the study week for their other courses.
Who can take it?
Students with at least A- in CS1010 and CS2040 variants (and formally in CS2030), by offline application; in AY2025/26 a CodeForces rating of at least 1400 was required for selection, with a quota of 39.
Which language should I use?
C++ is primary; Python is second and Java third. The page notes that Python solutions may exceed time limits where the same algorithm in C++ passes.
Who teaches it?
Steven Halim, with teaching assistants Nguyen Hoang Tien and Tan Yi Kai in S2 AY2025/26.
Study CS3233 with Sia
Work through introduction, library mastery, complete search and the rest of the course with a tutor that knows it and quizzes you on the topics the assessments weight most heavily.
Start studying with Sia