Search:
|
Access:
» TopCoder contestRelated categories: Programming in generall Viewed: 2865 | Article date: 2006-04-21 11:38:56 We present TopCoder which hosts high-quality online programming contests at http://www.topcoder.com/. TopCoder has been hosting programming competitions since 2001
TopCoder hosts high-quality online programming contests at http://www.topcoder.com. TopCoder has been hosting programming competitions since 2001. Each contest consists of four phases:
TopCoder hosts weekly online competitions, or Single Round Matches (SRMs). SRMs are sometimes sponsored by outside companies such as Microsoft, VeriSign and award prize money. The TopCoder Collegiate Challenge and the TopCoder Open are the company’s annual flagship events. The TopCoder organization comprises several groups. Along with powering high visibility programming tournaments, TopCoder also acts as a recruitment center where companies can come and find programmers who are proven to be highly skilled. Additionally, TopCoder Software uses a competitive distributed development methodology for producing commercial grade reusable software components and applications. TopCoder design and development competitions are week-long competitions. New components are posted every Wednesday, and coders can choose a component from a list of Java and .NET components, and they have a week to design or develop their chosen component. Each week new components are posted. Development components are generally components that have been designed in a previous component design contest. Coders have since been divided into two divisions, Division I and Division II. Division I consists of all coders with a rating of at least 1200, and Division II consists of all coders with a rating of 1199 or less. Coders are grouped in rooms with other members of their division, in groups of up to 20 coders in such a way that within each division, the average coder ratings in each of the rooms are roughly equal. The Parts of a TopCoder Problem StatementLet's look at the composition of a typical TopCoder problem statement. First is the Introduction. Usually, a problem will start off with a high-level description of a situation. This description may be of a real-life situation or it may just be a completely fictional story, serving only to give some sort of context. For many problems the contextual-story itself is not particularly important in understanding the actual problem at hand. Next comes the Definition section. It gives you the skeleton of the solution you need to write: class name, method name, arguments, and return type, followed by the complete method signature. At the very least, you will need to declare a class with the given name, containing a method which conforms to the given method signature. The syntax given will always be correct for your chosen language. Sometimes Notes follow the method definition. These tend to be important reminders of things that you should pay attention to but might have missed, or they can be things that are helpful background knowledge that you might not know beforehand. If the notes section appears, you should make sure to read it - usually the information contained within is extremely important. The Constraints section is arguably the most important. It lists specific constraints on the input variables. This lets you know crucial details such as how much memory to allocate or how efficient your algorithm will have to be. Finally, a set of Examples is provided. These give sample inputs against which you can test your program. The given parameters will be in the correct order, followed by the expected return value and, optionally, an explanation of the test case.
Solving a TopCoder problemNow we'll walk through a simple problem and dissect it, bit by bit. Have a look at BettingMoney, the SRM 191 Division 2 Easy. First we identify the parts of this problem. In the statement itself, we first have the situation behind the problem - gambling. Then we have a little bit of background information about the betting itself. Then, we have a description of the input - data types, variable names, and what they represent. After this we have the task: to determine what the net gain is for the day and return the amount in cents. Also note the two explanatory paragraphs at the end; the first provides an example of the input format and types, and the second gives a completely worked example, which should be extremely helpful to your understanding. The definition section is uninteresting, but it is there for completeness' sake. The notes for this problem are fairly comprehensive. In terms of background information, you might not know that there are 100 cents in a dollar. And in terms of clarification, there is explicit confirmation that the return value may in fact be negative, and that the margin of victory (the variable finalResult) is all that matters when deciding which payoff to make. The constraints are fairly straightforward. The input arrays will contain the same number of elements, between 1 and 50, inclusive. (50 is a long-standing TopCoder tradition for input sizes). finalResult will be between 0 and that same size minus one (which means, if you give it a little thought, that someone will win their bet). Each element of each array will be between 0 and 5000, inclusive. This is most likely to make sure that integer arithmetic will do the job just fine. Finally, there's the examples section. Often, the problem statement section will contain an annotated example case, which will become example case 0. Then there are a couple of other example cases, some with explanation and some without. Also note that one of the examples tests for negative return values, to supplement the notes. A More Complicated ExampleNow have a look at Poetry, the SRM 170 Div 2 Hard. In this case, you may not be able to actually solve this in the time allotted. That's ok - the emphasis should first be on understanding what the problem says, even if you can't code it in time. The first section tells you immediately what you want to do - you'll be given a poem, and you will have to determine what its rhyme scheme is. The rest of the section clarifies what this actually means, in bottom-up fashion (from simpler concepts to more complicated ones). It defines what a legal word is and how to extract words from a poem, and then it defines what it means when two words rhyme - that their ending patterns are equal. The concept of ending pattern is then defined. After all this, we find out what it means to have two lines of the poem rhyme: their last words have to rhyme. Finally, (whew!) we are told how to actually construct the rhyme scheme and in what format to return it. This is a problem where a lot of terms need to be defined to get to the heart of things, and so all the definitions deserve at least a couple of read-throughs, especially if you're not sure how they all fit together. The next section is the problem definition section, just for reference. Then there is a single note that clarifies a point that may have been overlooked when it was stated in the problem statement itself: that blank lines will be labeled with a corresponding space in the rhyme scheme. The constraints are fairly standard for TopCoder problems: there will be between 1 and 50 lines in the poem, and each line will contain between 0 and 50 characters. The only allowable characters in the poem will be spaces and letters, and there will be only legal words in poem. Finally, there are a number of examples. Usually, problems which are trickier or which have more complex problem statements will have more examples, to clarify at least some of the finer points of the problem statement. Again, this doesn't mean that passing the example cases given is equivalent to having a completely correct solution, but there is a higher chance that you can catch any bugs or trivial mistakes if there are more examples that you know the answers to. Try it YourselfListed below are a number of additional problems, grouped roughly by difficulty of comprehension. Try them for yourself in the TopCoder Arena Practice Rooms. Even if you can't solve them, at least work on figuring out what the problem wants by breaking it down in this manner. Mentioned in this writeup: SRM 203 Div 2 Easy - UserName SRM 191 Div 2 Easy - BettingMoney SRM 203 Div 1 Easy - MatchMaking SRM 170 Div 2 Hard - Poetry Similar tasks: SRM 146 Div 2 Easy - Yahtzee SRM 200 Div 2 Easy - NoOrderOfOperations SRM 185 Div 2 Easy - PassingGrade SRM 155 Div 2 Easy - Quipu SRM 147 Div 2 Easy - Ccipher SRM 208 Div 1 Easy - TallPeople SRM 173 Div 1 Easy - WordForm SRM 162 Div 1 Easy - PaperFold More challenging tasks: SRM 197 Div 2 Hard - QuickSums SRM 158 Div 1 Hard - Jumper SRM 170 Div 1 Easy - RecurrenceRelation SRM 177 Div 1 Easy - TickTick SRM 169 Div 2 Hard - Twain SRM 155 Div 1 Med - QuipuReader
On the Nethttp://www.topcoder.com/tc?module=Static&d1=help&d2=index - Frequently Asked Questions URL http://www.topcoder.com/tc?module=Static&d1=tutorials&d2=alg_index - Algorithm Tutorials URL
|
|
Copyright C 2006 by Software Developer's Journal. All rights reserved.





SDJ Users:
Shopping Cart









