Vikings win Triad Programming Contest


The scoreboard from the contest, showing the final standings. Correct solutions are indicated in green, and incorrect attempts are red.

This past Saturday, April 6, Northwest sent two teams to the annual Triad Programming Contest, hosted by NC A&T State University. The contest sees high school and college teams of two or three students compete to solve the most algorithmic problems in a three-hour window. Solutions must be in programmed in C, C++, or Java. The team with the most problems solved in the least time is deemed the winner, with a penalty for incorrect attempts.

One of the Northwest teams, consisting of seniors Michael Edwards, Binay Rijal and Franklin Wei, won this year’s competition, solving six of the nine problems and placing higher than every other high school and college team. Runners-up included a team from Elon University, which also solved six problems but was penalized for a longer completion time and incorrect attempts, and teams from High Point University, NC A&T, and Alamance Community College.

The team’s first-place finish earned each team member a $50 prize from the Institute of Electrical and Electronics Engineers (IEEE), an industry trade group. Prizes were awarded to high school and college teams separately.

“(The prize money) is a nice incentive to attract the top schools and best talent from the area,” Edwards said. “But regardless of the money, the real takeaway was the opportunity to apply our skills.”

There were nine problems in all, viewable here, ranging in difficulty from relatively simple tasks such as printing a sentence backwards to far more difficult problems, some of which involved weighted scheduling, graph partitioning, and solving a differential equation. The latter problem was so difficult, in fact, that no team–high school or college–was able to solve it correctly. A problem of intermediate difficulty is included below as an example.

“The problems themselves ranged from ones that seemed initially simple to ones that required many lines of code and algorithms we had to devise on the spot,” Rijal said. “The variety of problems meant that we had to play to our own strengths and prioritize problems that we knew how to approach. Then, as a team, we could approach the harder ones.”

This year is Northwest’s second appearance at the Triad Programming Contest. Last year, a team of three students took third place among high school teams, and a team consisting of Edwards and Wei took first place at a similar contest sponsored by UNC Greensboro.

All students on the team were pleased with their contest experience.

“I really enjoyed the fact that there were students from all around and of varying levels of experience,” Rijal said. “I got to catch up with a friend from another school who I didn’t even know was at the contest. It really helps provide us a place where we can challenge ourselves and interact with others.”

Sample problem:

Rabbit and Fox

A rabbit has several rabbit holes where is can go for safety.  When a fox shows up, the rabbit must get to a rabbit hole before the fox eats it.  The fox can run twice as fast as the rabbit. When a fox shows up, the rabbit runs in a straight line for a rabbit hole.  The fox sees where the rabbit is running and it will run for the same hole. If the fox gets to the hole before the rabbit, the rabbit will be eaten.

You are to write a program that displays the location of the hole where the rabbit should run to avoid the fox.  If there are multiple holes that would provide safety, you only need to display the location on one of them. If there is no hole that the rabbit can reach before the fox, then the program should display “The rabbit is doomed”.

Input is from the file rabbit.txt which first has an integer n indicating the number of rabbit holes.  There will be no more than 32 rabbit holes. The file then contains n pairs of floating point numbers indicating the locations of the holes.  This is followed by an integer m indicating the number of fox and rabbit positions. Each of the m positions will have four floating point numbers, the X and Y coordinate of the rabbit and the X and Y coordinate of the fox.  All coordinates are positive numbers.

For each pair of rabbit and fox positions, if the rabbit can get to a hole before the fox, display the coordinates of the hole.  If the rabbit cannot get to a hole before the fox, display “The rabbit is doomed”.