The HKOI Organizing Committee will be providing a platform for secondary school students to practice programming (via HKOI Online Judge). Exercises will be available in both Chinese and English, and in Pascal and C programming language. Note: not intended for assessment purposes as all contents are available to the public.
Special thanks to Ian Wong from Pui Ching Middle School for his help to translate statements into Chinese.
Creative Commons Attribution-ShareAlike 4.0 International. The full text of the license is available at https://creativecommons.org/licenses/by-sa/4.0/legalcode.
The statement contains the main problem description, the input specifications and output specifications. At the end there will be a few sample test cases.
A step-by-step tutorial to complete the exercises.
Includes answers to the worksheet, sample solution program, as well as answers to the bonus questions. Supplementary notes will be helpful to debug students' programs. Possible alternative solutions will also be discussed.
Currently, 57 exercises are proposed. We expect that more exercises will be added later.
Overall progress: 196/228 = 85.96%
ID | Name | Statement | 中文 | Test cases | Solutions |
---|---|---|---|---|---|
Basics, If (13) | |||||
D100 | A+B problem | 2016-09-10 | 2016-09-10 | 2016-09-10 | 2016-09-10 |
D101 | Phone number | 2015-06-17 | 2015-07-15 | 2015-06-17 | 2015-06-17 |
D102 | Bus fare | 2015-06-17 | 2015-07-15 | 2015-06-17 | 2015-06-17 |
D103 | Area of triangle | 2015-06-16 | 2015-07-16 | 2015-06-16 | 2015-08-01 |
D104 | Roots of quadratic equation | 2015-06-22 | 2015-07-16 | 2015-07-01 | 2015-08-01 |
D105 | Date comparison | 2015-06-22 | 2015-07-17 | 2015-07-01 | 2015-08-01 |
D106 | Ordinal number | 2015-07-01 | 2015-07-17 | 2015-07-01 | 2015-08-01 |
D107 | Square and trianglar numbers | 2015-06-22 | 2015-07-18 | 2015-07-01 | 2015-08-01 |
D108 | Simple calculator | 2015-07-01 | 2015-07-18 | 2015-07-01 | 2015-08-01 |
D109 | Giving changes | 2015-07-01 | 2015-07-19 | 2015-07-01 | 2015-08-01 |
D110 | King movement | 2016-09-10 | 2016-09-10 | 2016-09-10 | 2016-09-10 |
D111 | Body Mass Index | 2020-11-09 | 2020-11-09 | 2020-11-09 | 2020-11-09 |
D112 | Bitwise operations | 2020-11-09 | 2020-11-09 | 2020-11-09 | 2020-11-09 |
Loops (9) | |||||
D201 | Fibonacci numbers | 2015-07-01 | 2015-07-19 | 2015-07-01 | 2015-08-01 |
D202 | Factors | 2015-07-01 | 2015-07-21 | 2015-07-01 | 2015-08-01 |
D203 | Clap 7 | 2015-07-03 | 2015-07-21 | 2015-07-03 | 2015-08-01 |
D204 | Text graphics | 2015-07-03 | 2015-07-21 | 2015-07-03 | 2015-08-01 |
D205 | Prime factorization | 2015-08-01 | 2015-08-02 | 2015-08-01 | 2015-08-01 |
D206 | 3n+1 Problem | 2015-07-03 | 2015-07-23 | 2015-07-03 | 2015-08-01 |
D207 | GCD and LCM | 2015-07-03 | 2015-07-23 | 2015-07-03 | 2015-08-01 |
D208 | Maximum and second maximum | 2015-10-01 | 2015-10-08 | 2015-10-01 | 2015-10-01 |
D209 | Sequence validation | 2020-11-09 | 2020-11-09 | 2020-11-09 | 2020-11-09 |
D210 | Area of polygon | 2020-11-09 | 2020-11-09 | 2020-11-09 | 2020-11-09 |
Strings (9) | |||||
D301 | Story generator | 2015-07-08 | 2015-07-27 | 2015-07-08 | 2015-08-02 |
D302 | String length and words | 2015-07-08 | 2015-07-28 | 2015-07-08 | 2015-08-02 |
D303 | String reverse and palindrome | 2015-07-08 | 2015-08-02 | 2015-07-08 | 2015-08-02 |
D304 | Hangman | 2015-07-08 | 2015-08-04 | 2015-07-08 | 2015-08-02 |
D305 | Check digit calculation | 2015-07-15 | 2015-08-10 | 2015-07-15 | 2015-08-02 |
D306 | Email address validator | 2015-07-15 | 2015-08-12 | 2015-07-15 | 2015-08-02 |
D307 | Tic-tac-toe | 2015-07-15 | 2015-08-14 | 2015-07-15 | 2015-08-02 |
D308 | Substrings | 2015-07-15 | 2015-10-09 | 2015-07-15 | 2015-08-02 |
D309 | Case-insensitive comparison | 2015-07-16 | 2015-10-09 | 2015-07-16 | 2015-08-02 |
Arrays (6) | |||||
D401 | Sieve of Eratosthenes | 2015-08-04 | 2015-10-10 | 2015-08-04 | 2015-08-04 |
D402 | Supermarket | 2015-07-16 | 2015-10-10 | 2015-07-29 | 2015-08-04 |
D403 | Scrabble | 2015-07-16 | 2015-10-10 | 2015-07-29 | 2015-08-04 |
D404 | MTR fare | 2015-07-17 | 2016-09-10 | 2015-07-29 | 2015-08-04 |
D405 | Simple maze | 2015-07-17 | 2016-09-10 | 2015-07-29 | 2015-08-04 |
D406 | Remove duplicates | 2020-11-09 | 2020-11-09 | 2020-11-09 | 2020-11-09 |
File manipulation (5) | |||||
D501 | Heung Shing Bank | 2016-09-16 | 2016-09-16 | 2016-09-16 | 2016-09-16 |
D502 | Weather statistics | 2016-09-16 | 2016-09-16 | 2016-09-16 | 2016-09-16 |
D503 | Textual bar chart | 2016-09-16 | 2016-09-16 | 2016-09-16 | 2016-09-16 |
D504 | SVG bar chart | ||||
D505 | Give grades | ||||
Writing custom functions (4) | |||||
D601 | Currency formatting | ||||
D602 | Random number generator | ||||
D603 | Input helper with validation | ||||
D604 | Tower of Hanoi | ||||
Data structures (6) | |||||
D701 | Queue | 2015-07-19 | 2016-09-13 | 2015-08-14 | 2015-08-14 |
D702 | Stack | 2015-07-19 | 2016-09-13 | 2015-08-14 | 2015-08-14 |
D703 | Linked list representation | 2015-09-25 | 2016-09-13 | 2015-09-25 | 2015-09-25 |
D704 | Linked list: insertion | 2015-09-25 | 2016-09-13 | 2015-09-25 | 2015-09-25 |
D705 | Linked list: deletion | 2015-09-25 | 2016-09-13 | 2015-09-25 | 2015-09-25 |
D706 | Cyclic queue | 2016-09-16 | 2016-09-16 | 2016-09-16 | 2016-09-16 |
Algorithms (9) | |||||
D801 | Binary search | 2015-07-23 | 2016-09-10 | 2015-09-26 | 2015-09-26 |
D802 | Bubble sort | 2015-07-23 | 2016-09-10 | 2015-09-26 | 2015-09-26 |
D803 | Insertion sort | 2015-07-25 | 2016-09-10 | 2015-09-29 | 2015-09-29 |
D804 | Merging arrays | 2015-07-25 | 2016-09-10 | 2015-10-01 | 2015-10-01 |
D805 | Merging sub-arrays | 2015-07-25 | 2016-09-10 | 2016-09-10 | 2016-09-10 |
D806 | Merge sort | 2016-09-10 | 2016-09-10 | 2016-09-10 | 2016-09-10 |
D807 | Quick sort: partitioning | 2016-09-10 | 2016-09-10 | 2016-09-10 | 2016-09-10 |
D808 | Quick sort: analysis | 2016-09-10 | 2016-09-10 | 2016-09-10 | 2016-09-10 |
D809 | Counting sort |