Crash & Compile Sample Problems
These are 2 problems from the 1997 Crash & Compile contest.
Splat 2000
You have been contracted by the ABS (The American Barfing Society) to help write an embedded application for their
new Splat 2000. The Splat 2000 is an automatic barf scoring computer. This computer will be used in barf splat
contests to determine the size of the largest splat.
The computer takes a picture of the splat and using computer vision techniques it determines the coordinates for
the perimeter of the splat. The system was designed by a former Microsoft employee, and consequently the output
format of this machine is really asinine.
The Splat 2000 outputs a stream of coordinates of rectangles, which may or may not overlap. It is your job to write
a program that will figure out the total area occupied by the splat. The input will be one rectangle per input
line, and on each line are four integers. These four integers describe the rectangle (i1, i2) - (i3,i4). The input
will be terminated by four zeros.
Sample Input:
1,1,2,4
3,4,6,6
2,5,4,7
0,0,0,0
Sample Output:
The splat covers 12 splat units.
The Drunk Judge
Brian "Dink" Swenson came out of retirement to help judge the annual Crash & Compile contest. Unfortunately,
lunch at TA's, 6 mugs of beer and 8 Pixie Sticks just don't agree with him and he's got to puke now!
Brian can only hold it in for at most 5 seconds before he spews. Given the number of people milling about at the
Moon he can only move 3 feet a second. He has two choices of where to head to relieve himself -- the bathroom or
the balcony. Given the following map of the Moon at the Crash & Compile contest, determine whether it will
be faster to for him to run to the bathroom or the balcony, and if he makes it in time.
6 6 4
E -- F -- G -- Bathroom
5| |5
Balcony -- A -- B -- C -- D -- H
4 4 4 4 4
All Distances are in feet. Brian is assumed to start at an arbitrary lettered spot and must travel from point
to point in order to get to either the bathroom or the balcony.
Input consists of a series of starting points, and output consists of the shortest path and where he pukes en route
if he doesn't make it.
Sample Input:
B
D
Sample Output:
BA Balcony
CBA *puke* Balcony
Back to the main page...
|