What is the USA Computing Olympiad (USACO)?

This Friday is the first 2014-2015 contest.

The contest format

The USA Computing Olympiad is an online individual competition, where the top 4 US high school students represent the United States in the International Olympiad of Informatics (IOI). Approximately 4 to 6 times per year, anybody in the world can make an account on usaco.org and participate in the competition (post-high-school individuals can participate as ‘observers’). New accounts begin in the ‘bronze’ division, where the top scorers are promoted to the ‘silver’, then ‘gold’, and then finally the ‘USACO camp top 16’. Once promoted to a level, the student stays in that level. Only US high school students are permitted to enter the top 16.

The competition consists of 3 to 5 programming problems, which the individual has 3 to 5 hours to complete. Each problem is an “input output matching” problem, where the student’s program must read an input file and write an output file. Problems can be written in either C, C++, Java, Pascal, or Python, but the USACO recommends not using Python. Programs must also run within a small time frame (1 second for C,C++,and Pascal. 2 seconds for Java and Python), and programs must use limited memory.

Try a bronze problem on a piece of paper

Problem 3 of the 2014 March Contest is called “Cow Art”. Students are given an input file which contains a grid (up to 100 x 100 in size, although this example is 5 x 5):


The question asks you to print two numbers.

Part 1: Print how many different patches of R, G, or B there are. In the example, there are 4 regions:


Part 2: Print how many different patches of R, G, and B there are if you treat R and G as the same color. In the example, there are 3 regions:

Thus, the output file should be formatted as: “4 3”

Here’s the code that solves the problem:



Try a silver problem:

Problem 3 of the 2011 December Contest was called “Umbrellas for Cows”. Students were given an input file representing the positions of cows (in stalls) and the cost of various sized umbrellas. Here is a sample positions of cows:

And the umbrellas:

Size 1 umbrella: $2
Size 2 umbrella: $3
Size 3 umbrella: $4
Size 4 umbrella: $4
Size 5 umbrella: $8
Size 6 umbrella: $9
Size 7 umbrella: $15
Size 8 umbrella: $16
Size 9 umbrella: $17
Size 10 umbrella: $18
Size 11 umbrella: $19
Size 12 umbrella: $19

The goal is the decide which umbrellas to buy in order to cover all the cows for the total lowest price.

View post on imgur.com

The solution, above, shows that you can cover all the cows with one size 4 umbrella, one size 1 umbrella, and one size 2 umbrella. The cost is 4 + 2 + 3 = $9.


Leave a Reply

Your email address will not be published. Required fields are marked *