Get Time
Search | Watch Thread  |  My Post History  |  My Watches  |  User Settings
View: Flat  | Threaded  | Tree
Previous Thread  |  Next Thread
3.2 Setting Up Your Environment/Keeping Track of Your Progress | Reply

Marathon Matches, as the name suggests, require a lot of time and effort, it is not enough to just submit a solution, you need to constantly make changes to the solution during the contest in order to improve it. After you spend a good amount of time improving your solution you will realize that a lot of that time and effort is spent on organizing the versions of code, deciding which solution performs better, recalling the changes done between two submissions and reverting them. All this can be avoided by organizing your solving environment properly.


Setting Up your Test Environment.

Choose Your Preferred Integrated Development Environment (IDE): Be sure to choose a good IDE because Marathon Matches usually requires writing a lot of code and a good IDE with a good debugger will save you a lot of time. I would recommend Eclipse for C++, Java and Python and Visual Studio Express for C++, C# and VB. Both are free and great IDEs but this is just a recommendation, you should choose the one you feel comfortable with.

Write a Naïve Solution: Once you have understood the problem statement the first thing you need to do is to write a naïve solution. By naïve solution I mean the simplest solution you can write, it doesn’t matter if the score of this solution is low, it is only important that it is a valid solution (gives a score greater than zero) and that it has as few lines of code as possible. An example will be just to return zero or an empty string, it will depends on the problem. For a concrete example take a look at the problem PolimerPaking, here the most simple solution will be to return an array of integers with length zero (return new int[0];), this is not a great solution but it is a valid solution that gives you a score greater than zero and will allow you to set up the environment.

Test Your Solution: After you wrote your naïve solution you will need to set up your test environment and test that solution. There are two ways to test your solution against TopCoder specifications, you can submit your solution to the TopCoder server or you can Download the Visualizer Tool and test it locally, this is much faster and flexible because you can run the visualizer in your computer as many times as you want.

Implement Your Own Tester: When you have your naïve solution and you tested that it gets a score greater than zero in the visualizer or in the TopCoder server then it will be a very smart move to implement the visualizer code directly in your solution, this will allow you to run more tests faster without using standard input and output to exchange information with the visualizer, it will also allow you to calculate the mean and variance of your scores and do other statistical analysis. It is very important when you rewrite the code of the visualizer to be sure that it returns the same score as the visualizer and the TopCoder server.
Subject Author Date
3.2 Setting Up Your Environment/Keeping Track of Your Progress amiune Dec 17, 2010 at 1:42 PM EST
Re: 3.2 Setting Up Your Environment/Keeping Track of Your Progress amiune Dec 17, 2010 at 1:45 PM EST