Skip to the content.

Foundations

These problems don’t require any data structure or complicated algorithm. They help get used to the submission system and the various forms of input. As mentioned in the introduction, within each category, problems are listed from easiest to not so easy, in my opinion.

Sequence

These problems can be solved without any if-statements or loops. You may need to use abs, min or max to avoid if-statements.

  1. Hello World! (1 LOC): See the Input and Output section for details.

  2. Simple Addition (1 LOC): See the Input and Output section for details.

  3. Solving for Carrots (1 LOC): See the Input and Output section for details.

  4. Faktor (2 LOC): A little arithmetic tongue-in-cheek problem about the academic obsession with bibliometrics. The problem description explains the necessary concepts.

  5. Planina (1 LOC): Compute the number of points on a grid, after n iterations of a given procedure to create points. Once the formula has been derived, the code is trivial, using the power operator **.

Selection

These problems can be solved with if-statements alone. No loops required.

  1. Quadrant Selection (6 LOC): Given the x and y coordinates of a point, print in which quadrant it is.

  2. Moscow Dream (5 LOC): Check that four integers satisfy some conditions.

  3. Wizard of Odds (5 LOC): Check that two integers satisfy a condition.

  4. Judging Moose (7 LOC): Describe the antlers of a moose.

  5. Eating Out (3 LOC): Check if people in a restaurant, each choosing a certain number of dishes, may end up not choosing the same dish. Easy to code, but requires some thinking to get the formula.

Iteration

These problems require a for- or while-loop because either the input contains multiple lines, or the problem itself requires a loop.

  1. R2 (3 LOC): Given the average of two integers and one of them, find the other one. The input has two integers per line, until the end of the file.

  2. A Different Problem (4 LOC): See the Input and Output section for details. Doesn’t require if-statements.

  3. Left Beehind (11 LOC): See the Input and Output section for details.

  4. Thanos (7 LOC): Simulate the growth of a population and find out in which year the resources aren’t enough. A nice simple problem that uses a for-loop to process all test cases, and a while-loop to solve each test case.

  5. Tarifa (6 LOC): Given the allowance on a data plan and the past monthly consumption, how much data is available this month? Unused data carries forward.

Floats

These problems involve floating-point numbers, some of which can be tricky due to precision and rounding issues. You may need the math library for some of the problems.

  1. A Real Challenge (3 LOC): Given the area of a square pasture, how long is the fence? No if-statements or loops.

  2. Pizza Crust (2 LOC): What percentage of a pizza has cheese, knowing the width of the crust? No if-statements or loops.

  3. Euler’s Number (6 LOC): Approximate Euler’s number through a series of factorials. This problem doesn’t require mathematical knowledge: just translate the given formula to code.

  4. Roaming Romans (5 LOC): Convert English miles to Roman paces. No loops. Requires some care because Python rounds floats to the nearest even integer, not necessarily up.

  5. Herman (4 LOC): What is the area of a circle in normal and in Manhattan/taxi geometry? Draw on grid paper to see the latter. No if-statements or loops.

Strings

Almost every problem requires printing a string as part of the output, but these problems require some string processing: comparing strings, matching substrings with the in operator, calculating the length with the len function, formatting the output, etc.

  1. IsItHalloween.com (2 LOC): Check if the input is one of two dates. No loops required.

  2. Avion (7 LOC): Report which given strings have a particular substring.

  3. Cryptographer’s Conundrum (4 LOC): Given a string, count how many letters must be replaced to obtain another string.

  4. Help a PhD candidate out! (3 LOC): See the Input and Output section for details.

  5. Drinking Song (12 LOC): Print out the ‘99 bottles of beer’ song for any drink and number of bottles. The text varies when there’s one or no bottle left.