SAPO Evaluation Server

Welcome to the official evaluation server of the South African Programming Olympiad! This server is used for running the second and third rounds of the South African Programming Olympiad. You can also practise past papers (including first rounds) and find a variety of other training material here.

For more general information about the programming olympiad, you should visit the official website.


Contest Server

Current and future contests are hosted on the Contest Server, as well as a selection of past contests intended for preparation purposes.

For further help regarding the usage of the Contest Server, you can consult our documentation manual or watch the tutorial video below.


Language documentation

You may use any of the following documentation during the contest:

  • C/C++
  • Java
    • Java API specification [11]
  • Python
    • Python documentation [3.7]
  • Pascal

Here you can browse old SAPO problems. Many recent contests can instead be found on the Contest Server.

If you spot a mistake in a task, please send an email to admin@saco-evaluator.org.za.

For more specific help with SACO Final questions, you can also take a look at these SACO Editorials written by Andi Qu (2019 & 2020 Gold Medallist).


Second round

More recent first and second round question papers and solutions can be found here.

Download all the Round 2 papers up to 2010: R2.tar.gz [3.3Mb]

Year START OPEN Solutions
1999 - [PDF] -
2000 - [PDF] [Solutions]
2001 - [PDF] [Solutions]
2002 - [PDF] -
2003 - [PDF] -
2004 - [PDF] -
2005 - [PDF] -
2006 [PDF] [PDF] -
2007 - [PDF] [Solutions]
2008 - - [Solutions]
2009 - [PDF] [Solutions]
2010 - [PDF] [Solutions]

Final round

Year Day 1 Day 2 Handin system
1998 [PDF] [Word] [PDF] [Word] No
1999 [PDF] [Word] [PDF] [Word] No
2000 [PDF] [Word] [PDF] [Word] No
2001 [PDF] [Word] [PDF] [Word] No
2002 [PDF] [Word] [PDF] [Word] No
2003 [PDF] [Word] [PDF] [Word] No
2004 [PDF] [PDF] [Solutions] No
2005 [PDF] [Solutions] [PDF] [Solutions] No
2006 [Open] [Future stars] [Solutions] [Open] [Future stars] [Solutions] No
2007 [Open] [Future stars] [Solutions] [Open] [Future stars] [Solutions] No
[Taunter Pres] [Search Pres]
2008 [Open] [Future stars] [Solutions] [Open] [Future stars] [Solutions] Yes
2009 [PDF] [Solutions] [PDF] [Solutions] Yes
2010 [PDF] [Solutions] [PDF] [Solutions] Yes
2011 [PDF] [Solutions] [PDF] [Solutions] Yes
2012 [PDF] [PDF] Yes
2013 [PDF] [PDF] Yes
2014 [PDF] [PDF] Yes
2015 [PDF] [PDF] Yes
2016 [PDF] [Solutions] [PDF] [Solutions] Yes
2017 [PDF] [PDF] Yes
2018 [PDF] [PDF] Yes

Training

Every year, 4 finalists from the South African Computer Olympiad are selected to represent South Africa at the International Olympiad in Informatics.

Year Event Day 1 Day 2 Handin
2002 1st camp [PDF] [Word] [PDF] [Word] Yes
2nd camp [PDF] [Word] [PDF] [Word] Yes
3rd camp [PDF] [Word] - Yes
Web training See handin See handin Yes
2003 1st camp [PDF] [Word] [PDF] [Word] Yes
2nd camp [PDF] [Word] [PDF] [Word] Yes
3rd camp [PDF] [Word] - Yes
Web training See handin See handin Yes
2004 1st camp [PDF] [Word] [PDF] [Word] Yes
2nd camp [PDF] [Word] [PDF] [Word] Yes
3rd camp [PDF] [PDF] Yes
Web training See handin See handin Yes
2005 1st camp [PDF] [PDF] Yes
2nd camp [PDF] [PDF] Yes
3rd camp [PDF] [PDF] Yes
Web training See handin See handin Yes
2006 1st camp [PDF] [PDF] Yes
2nd camp [PDF] [PDF] Yes
3rd camp [PDF] [PDF] Yes
2007 1st camp [PDF] [PDF] Yes
2nd camp [PDF] [PDF] Yes
3rd camp [PDF] [PDF] Yes
2008 Online camp [PDF] [Solutions] Yes
1st camp [PDF] [PDF] Yes
2nd camp [PDF] [PDF] Yes
3rd camp [PDF] [PDF] Yes
Web training See handin See handin Yes
2009 1st camp [PDF] [Solutions] [PDF] [Solutions] Yes
2nd camp [PDF] [PDF] Yes
3rd camp [PDF] [PDF] Yes
Web training [PDF] [Solutions] [PDF] [Solutions] Yes
2010 1st camp [PDF] Yes
3rd camp [PDF] [PDF] Yes
2011 1st camp   [PDF] Yes
3rd camp [PDF]   Yes
2012 1st camp   [PDF] Yes
2nd camp   [PDF] Yes
3rd camp [PDF] [PDF] Yes

Contents

  1. First Round
  2. Second Round
    1. Learning Python
    2. Practice
    3. Algorithms and Data Structures
    4. General Advice
    5. Ask Questions
  3. Final Round
    1. Practice
    2. Algorithms and Data Structures
    3. Other Contests
  4. International Olympiad in Informatics (IOI)
  5. External Links

First Round

The first round of SAPO is open for one week in July or August. The contest lasts for 1 hour and consists of three questions, each containing usually four to six test cases of varying complexity. The questions will ask you to write and debug a program that solves a given task.

This round tests the basic fundamentals of programming. For example, if you're familiar with if-statements, for loops, while loops and basic arrays/lists, then the first round should not be much trouble.


Second Round

The second round is open on a given day, usually within three weeks of Round 1. The contest itself is 2 hours long and consists of three to five questions of a more challenge nature than that of the previous round. Each question may consist of different subtasks of increasing difficulty. The aim of this round is similar to the previous round (write code to solve a problem), however this time you will be required to submit your code on our online evaluator. It therefore must produce the exact correct output for every test case in order to score full marks.

This round goes beyond programming basics and tests elementary algorithms and data structures. The sections below outline how to prepare for the second round from learning to program to mastering the more challenging questions.

Learning Python

If you have no experience with programming then Python is a great language to start with. If you have learned Java, Pascal or Delphi at school, or any other language for that matter, you might also be interested in learning Python as a new programming language.

The free ebook A Byte of Python is targeted at beginner programmers (i.e. if you have little or no knowledge of programming). You can read it online or download a PDF. It covers downloading and installing Python so those instructions won't be repeated here.

Dive Into Python is another free ebook, but targeted at experienced programmers looking for a rapid jump into Python. It is useful if you are already thoroughly understand another programming language. You can read it online as a PDF here.

Practice

The Computer Olympiad website has a collection of past first and second round papers dating back to 2009 here. Some solutions are available here. Solving these problems as practice will prepare you well for the second round. You should also time yourself, remembering that the paper is two hours long.

For those who complete all the past second round papers and want more challenging problems to practice on, there are plenty of such resources! One place you can go is the USACO Training Program, which allows you to progress from easy to very challenging problems as well as testing your code against secret test data. This is an excellent resource and has several problems with a wide range of difficulty. A more modern resource is USACO Guide, which has many explanations of algorithms and data structures as well as example problems and their solutions.

Algorithms and Data Structures

In the second round, the last problem (as well as sometimes the one before it) almost always tests algorithms and/or data structures. The USACO Training Program and USACO Guide mentioned above have many great articles. Another useful collection of articles on data structures and algorithms is by Bruce Merry, the most successful SAPO contestant to date, available here.

General Advice

There are many aspects of contest programming that differ from everyday programming. You do not need to check that the input matches the constraints -- these are only there to give you a guarantee on the input.

Time is everything. You only have two hours to solve four problems in Round 2. If you think the problems are easy, try timing yourself while doing one of the past papers. This is where Python becomes useful, as the code is almost always less than half the length of Java, C++ or Pascal code. You do not need to go for the most complex solution, just one that solves the problem for the provided test cases in a reasonable amount of time and memory. The last problem (and sometimes also the one before it) will require a clever solution, even if a brute force solution could work on smaller data.

It's not enough to check that your program works only on the example inputs given in the task statement. Also test larger test cases (up to the highest values the input can be) as well as corner cases (which might not get tested if one only generates random test data).

Ask Questions

The best way to learn is to ask questions. For questions regarding administration and general matters, send an e-mail to info@olympiad.org.za. For training matters, please approach your IT teacher, or on of the many forums that deal with algorithms or specific languages.


Final Round

The top ~15 contestants from the second round are invited to participate in the final round of the SAPO. This is a lot tougher than the second round, making preparation vital.

Practice

There is a large collection of past final round and even more challenging training camp problems available here. There is an online evaluation system for the problems going back to 2002 available here, where you can submit solutions for evaluation. The evaluation system is the same as you will use for the final round, so it would be a good idea to become familiar with it beforehand.

Continue churning through the USACO Training Program and USACO Guide mentioned above. As you progress you will find that the problems quickly reach very challenging levels.

Algorithms and Data Structures

Algorithms and data structures become far more important in the final round. With a decent understanding of dynamic programming and graph theory you will do well.

Other Contests

Competitive programming has becoming very popular in recent years and there are now many programming contests. USACO hosts a number of contests, although none are between our first and final rounds. Codeforces is another great platform which hosts a 2-3h contest every few days.


International Olympiad in Informatics (IOI)

If you perform well enough at the final round then you will be invited to the training camps. This forms the basis of team selection for the IOI and if you make it this far, preparation will become much more intense.


External links

  • Other Olympiads and training facilities
    • IOI website: This page has all past IOI problems, as well as links to many national and regional Olympiads. You might also find the IOI syllabus to be useful.
    • USACO Guide: A free collection of curated, high-quality resources about many common techniques in programming olympiads, along with extensive problemsets to use for practise.
    • CP-Algorithms: a resource to learn about competitive programming algorithms and data-structures. It is a translation of the Russian website e-maxx.ru/algo.
    • Codeforces: hosts online contests once every few days. They have a rating system and most contests are in the afternoon in South African time.
    • CSES Problemset: contains a collection of algorithm programming practice problems. They also host some past papers of a few European Informatics olympiads.
    • UVa online judge: has thousands of problems with online evaluation.
    • oj.uz: An online judge that can be used to test solutions to many past IOI and other olympiad problems.
    • ICPC: the big international university contest.
  • Programming books

Every year, 2-6 camps are held to train the team members for the International Olympiad in Informatics. Part of these camps involves presentations on useful topics, mostly by the students themselves.

Topics are covered several times over the years. The best presentations for the most notable topics have been selected.

If you are having trouble loading the PDF presentations in your browser, try downloading them offline by right-clicking the link, and then clicking "Save Link As".

Recommended Presentations

  • Competition Strategy [pdf] (Robin Visser)
  • Introduction to Big-O notation [pdf] (Bronson Rudner)
  • Mathematics of Big-O notation [pdf] (Robin Visser)
  • Computational Number Theory [pptx] (Jacques Amsel)
  • Intro to Union-Find [pdf] (Robin Visser)
  • Union-Find with problems [pdf] (Andi Qu)
  • Dynamic Programming [pdf] (Robin Visser)
  • String Hashing [pdf] (Robin Visser)
  • Minimum Spanning Tree [pdf] (Tian Cilliers)
  • Line Sweep Algorithms [pdf] (Robin Visser)
  • Segment Trees and Fenwick trees [pdf] (Yaseen Mowzer)
  • Topological Sorting [pdf] (Tian Cilliers)
  • Lowest Common Ancestor [pdf] (Andi Qu)
  • Bridges, Articulation points and Biconnectivity [pdf] (Graham Poulter)
  • Strongly Connected Components [pdf] (Kenna Geleta)
  • Tries [pdf] (Adri Wessels)
  • Square Root Decomposition [pdf] (Benjamin Kleyn)
  • Balanced Binary Search Trees [pdf] (Yaseen Mowzer)

All presentations.

2024 Camps

  • Heavy-Light Decomposition [pdf] (Noah Jacobsen)
  • Maximum Flow [pptx] (Erik Senekal)
  • Prefix Tries [pdf] (Youkum Kim)
  • Strongly Connected Components [pdf] (Yian Xu)
  • Suffix Arrays [pptx] (Muhammed Khan)

2023 Camps

  • Balanced Binary Search Trees [pptx] (Tengjun Liu)
  • Connectivity [pdf] (Benjamin Kleyn)
  • Lowest Common Ancestor [pdf] (Emmanuel Rassou)
  • Maximum Bipartite Matching [pdf] (Ruan Schoeman)
  • Number Theory [pdf] (Muhammed Khan)
  • Strongly Connected Components [pdf] (Darren Peng)

2022 Camps

  • Bipartite Matching [pdf] (Emmanuel Rassou)
  • Square Root Decomposition [pdf] (Benjamin Kleyn)
  • String Hashing [pdf] (Louis van der Walt)
  • Strongly Connected Components [pptx] (Jacques Amsel)
  • Strongly Connected Components [pdf] (Kenna Geleta)

2021 Camp 3

  • Balanced Binary Search Trees [pptx] (Ruan Schoeman)

2021 Camp 2

  • Big Integers [pdf][pptx] (Ruan Schoeman)
  • Line Sweep [pptx] (Brent Butkow)

2021 Camp 1

  • Longest Increasing Subsequence [pdf] (Brent Butkow)
  • Persistent Datastructures [pptx] (Andi Qu)

2020 December Training Event

  • Basic Computational Number Theory [pptx] (Jacques Amsel)
  • Disjoint Set Union [pdf][pptx] (Andi Qu)
  • Dynamic Programming [YouTube][pdf] (Minkyum Kim)
  • Intro & Big-O [pdf][tex] (Bronson Rudner)
  • Sorting [YouTube][pptx] (Brent Butkow)

2020 Camp 2

  • C++ Debugging [pdf] (Bruce Merry)
  • Fenwick Trees [pdf] (Bruce Merry)
  • Line Sweep [pptx] (Adri Wessels)

2019 Camp 3

  • Computational Geometry [pdf] (Andi Qu)
  • Longest Increasing Subsequence [pdf][pptx] (Adri Wessels)
  • Maximum Bipartite Matching [pdf][pptx] (Ralph McDougall)
  • Minimum Spanning Trees [pdf][pptx] (Tian Cilliers)
  • Substring Algorithms - Rabin-Karp, KMP [pdf][pptx] (Taariq Mowzer)

2019 Camp 2

  • Balanced Binary Search Trees [pdf][pptx] (Ralph McDougall)
  • Lowest Common Ancestor [pdf] (Andi Qu)
  • Quickselect and Quicksort [pdf][pptx] (Retief Louw)
  • Segment Trees & Related Topics [pdf][pptx] (Tian Cilliers)
  • Tries [pdf][pptx] (Adri Wessels)

2018 Camp 3

  • Tries [pdf][pptx] (Tian Cilliers)

2018 Camp 2

  • Computational Geometry [pdf] (Jordan Arenstein)
  • Longest Increasing Subsequence [pdf] (Taariq Mowzer)
  • Range Queries and Fenwick Trees [pdf] (Yaseen Mowzer)
  • Topological Sorting [pdf][pptx] (Tian Cilliers)

2018 Camp 1

  • Introduction to Graph Theory [pdf][pptx] (Bronson Rudner)
  • Java Programming for IOI [pdf][pptx] (Laurens Weyn)

2017 Camp 3

  • Balanced Binary Search Trees [pdf] (Yaseen Mowzer)
  • Bridges and Articulation Points [pdf] (Taariq Mowzer)
  • Persistent Data Structures [pdf] (Robin Visser)
  • Tries [pdf][pptx] (Ralph McDougall)

2017 Camp 2

  • Computational Number Theory [pdf] (Taariq Mowzer)
  • Maximum Bipartite Matching [pdf] (Robin Visser)
  • Range Queries and Fenwick Trees [pdf] (Yaseen Mowzer)
  • Topological Sorting [pdf][pptx] (Ralph McDougall)

2017 Camp 1

  • Big O Notation [pdf] (Robin Visser)
  • C++ Basics [pdf] (Laurens Weyn)
  • Dynamic Programming [pdf] (Robin Visser)
  • Union Find [pdf] (Robin Visser)

2016 Camp 1

  • Contest Strategy [pdf] (Robin Visser)
  • Introduction to Dynamic Programming [pdf] (Robin Visser)

2015 Camp 3

  • Line Sweep Algorithms [pdf] (Robin Visser)

2015 Camp 2

  • Computational Geometry [pdf] (Ulrik de Muelenaere)
  • Knuth-Morris-Pratt String Searching Algorithm [pdf] (Robin Visser)
  • Topological Sorting [pdf] (Yaseen Mowzer)

2015 Camp 1

  • C++ Feature Overview [pdf] (Robert Spencer)

2014 Camp 3

  • Compression [odp][pdf] (Ulrik de Muelenaere)
  • Computing time complexity of recursive functions [pdf] (Yaseen Mowzer)
  • Eulerian Tours [pdf][pptx] (Shaylan Lalloo)
  • Linear-time sorting and order statistics [pdf][pptx] (Thomas Orton)
  • Rabin-Karp algorithm [pdf][pptx] (Robin Visser)

2014 Camp 2

  • A Few C++11 Tips [pdf] (Bruce Merry)
  • Computational Geometry [pdf][pptx] (Robin Visser)
  • Floyd-Warshall and Bellman-Ford graph algorithms [pdf][pptx] (Thomas Orton)
  • Greedy Algorithms [pdf] (Ulrik de Meulenaere)
  • Interval Trees [pdf] (Bruce Merry)
  • Knuth-Morris-Pratt String Searching [pdf] (Bruce Merry)
  • Lambda Functions [pdf] (Yaseen Mowzer)

2014 Camp 1

  • Big-Oh Notation [pdf] (Robert Spencer)
  • C++ debugging [pdf] (Bruce Merry)
  • C++ tips and tricks [pdf] (Bruce Merry)
  • Introduction to Dynamic Programming [pdf] (Ashraf Moolla)
  • Introduction to Graph Theory [pdf] (Robert Spencer)
  • Longest Increasing Subsequence [pdf] (Robert Spencer)
  • Problem Strategy [pdf] (Ashraf Moolla)
  • Testing [pdf] (Robert Spencer)

2011 Camp 1

  • Combinatorics [odp][pdf] (Gregory Jackson)
  • STL Data Structures [pdf] (Keegan Carruthers-Smith)
  • String Processing [pdf] (Julian Kenwood)

2009 Camp 2

  • Brute Force [pdf1][pdf2][ppt2] (Gwylim Ashley and Schalk-Willem Kruger)
  • Complexity Analysis [pdf][ppt] (Charl du Plessis and Robert Ketteringham)
  • Dynamic Programming Problems [pdf] (Kosie van der Merwe and Michiel Baird)
  • Eulerian Paths and Cycles [pdf][ppt] (Francois Conradie)
  • Linear Recurrences [pdf] (Graham Manuell) , with handout [odt1][odt2]

2009 Camp 1

  • Big Numbers [cpp][pdf] (Julian Kenwood and Ben Steenhuisen)
  • Boyer Moore String Matching [ppt] (Haroon Moolla)
  • C++ Macros (Marco Gallotta) , with handout [pdf]
  • Combinatorics [odp][pdf] (Graham Manuell) , with handout [pdf]
  • Contest Strategy [pdf] (Marco Gallotta) , with handout [pdf]
  • Debugging (Max Rabkin) , with handout [pdf]
  • Juggling Bits [pdf] (Marco Gallotta)
  • Line Sweep [odp][pdf] (Schalk-Willem Kruger) , with handout [odt][pdf]
  • Mathematical Proofs [pdf][ppt] (Kosie van der Merwe and Francois Conradie)
  • Minimax [pdf] (Gwylim Ashley)
  • Numerical Algorithms [pdf] (Michiel Baird) , with handout [pdf]
  • Trees [pdf][ppt] (Charl du Plessis)

2008 Camp 3

  • Eulerian Tours [odp][pdf] (Schalk-Willem Kruger)

2008 Camp 2

  • Computational Geometry [pdf] (Mark Danoher)
  • Dynamic Programming Part 2 [pdf][ppt] (Harry Wiggins)
  • Hashing [pdf] (Robert Ketteringham)
  • Minimal Spanning Trees [pdf][ppt] (Schalk-Willem Kruger) , with handout [odt][pdf]
  • Network Flow [pdf] (Raeez Lorgat)
  • Standard Template Library - STL [pdf][ppt] (Richard Baxter and Julian Kenwood) , with handout [pdf][png]
  • String Matching [pdf] (Saadiq Moolla)
  • Union-Find [pdf][ppt] (Haroon Moolla)
  • Vertex Cover [odp][pdf] (Marco Gallotta)

2008 Camp 1

  • Dijkstras and Floyd Warshall [pdf] (Julian Kenwood and Richard Baxter)
  • Dynamic Programming [pdf] (Harry Wiggins)

2007 Camp 3

  • Interval Trees [odp][pdf] (Marco Gallotta)
  • Optimised Search Techniques [ppt] (Mark Danoher)
  • State Machines and Strings [odp][pdf] (Bruce Merry)

2007 Camp 2

  • Big numbers [odp][pdf] (Bruce Merry)
  • Computational geometry handout (Charles Bradshaw) , with handout [doc]
  • Greedy algorithms [ppt] (Dirk-B Coetzee)
  • Queues, stacks and heaps [ppt] (Mark Danoher)
  • Transform and conquer [ppt] (Saadiq Moola)

2007 Camp 1

  • Contest strategy [odp][pdf] (Bruce Merry)
  • Dynamic programming [ppt] (Carl Hultquist)
  • Shortest paths [odp][pdf] (Timothy Stranex)
  • Strings [pdf] (Marco Gallotta)

2006 Camp 2

  • Approximation algorithms [pdf][ppt] (Dario Fanucchi)
  • Eulerian paths and cycles [odp][pdf] (Max Rabkin)
  • Range trees [odp][pdf] (Keegan Carruthers-Smith)
  • String matching [pdf][ppt] (Joshua Yudaken)

2006 Camp 1

  • Computational Geometry [doc][pdf] (Migael Strydom)
  • Union-find [pdf] (Bruce Merry) , with handout [pdf]

2005 Camp 3

  • Biconnectivity [pdf] (Graham Poulter)
  • Strings [odp][pdf] (Timothy Stranex) , with handout [pdf]
  • Strong connectivity [pdf] (Graham Poulter)

2005 Camp 2

  • Network flow [ppt] (Migael Strydom)
  • Union-find [pdf] (Keegan Carruthers-Smith)

2004 Camp 3

  • Eulerian tour [ppt] (Marco Gallotta)
  • Hierarchical data structures [pdf] (Bruce Merry)

2004 Camp 2

  • Big numbers [pdf][ppt] (Dirk Basson)
  • Computational geometry [pdf][ppt] (Nick Pilkington) , with handout [doc][pdf]
  • Minimum spanning trees [pdf][ppt][zip] (Marco Gallotta) , with handout [doc][pdf]
  • Modulo arithmetic [pdf][ppt] (Richard Starfield) , with handout [doc][pdf]
  • Network flow [pdf][ppt] (Linsen Loots)
  • Optimisation [pdf] (Bruce Merry)
  • Travelling salesman [pdf][ppt] (Marietjie Venter)

2004 Camp 1

  • Big-O notation [pdf] (Bruce Merry)
  • Data structures [pdf][ppt] (Nicholas Pilkington)
  • Dynamic programming [pdf][ppt] (Richard Starfield)
  • Graph theory [pdf] (Bruce Merry) , with handout [pdf]
  • Greedy algorithms [pdf][ppt] (Dirk Basson)
  • Hashing [pdf][ppt] (Linsen Loots)
  • Heuristics [pdf][ppt] (Carl Hultquist)
  • Recursion [pdf][ppt] (Marco Gallotta)
  • Sorting [pdf][ppt] (Marietjie Venter)