CS302 -- Lab 2
Your assignment is simple:
- Part 1: Do the 500-point problem from Topcoder SRM 496, Division 1.
You must solve it as I describe in
the notes on SRM-496-D1-500. You must comment
your code very cleanly, and explain each step that you do. You are not
allowed to solve this code in a different manner than the one I describe. That's
because it's too easy to cut and paste other people's code from Topcoder.
- Part 2: Do the 500-point problem from Topcoder SRM 337, Division 1.
I have notes to help you.
Once again, your commenting here must be flawless, and must describe each step
that you are doing, so that the TA's can be sure that you know what you're doing.
In each case, you will get a zero if your code takes three seconds or longer on
an unloaded machine (type top to find out if anyone is CPU-hogging your
The whole point of this lab is to use the proper data
structures to make your programs run in O(n log2 n)
You will only submit two files:
BuildingAdvertise.cpp. The TA's will compile them with the drivers
and run the gradescript on them.
For the gradescript
Go ahead and compile the first program and move the executable to a.out-496.
Put the second one's executable into a.out-337. Then the gradescript runs
as normal. The gradeall also tells you a rough timing of your program.