Thread: Topcoder

  1. #1
    Cheesy Poofs! PJYelton's Avatar
    Join Date
    Sep 2002
    Location
    Boulder
    Posts
    1,728

    Topcoder

    Anyone here compete at least semi-regularly over at topcoder.com? I've done only a couple of matches and have a lot of fun - do really well in Division II but got whomped in both my Division I matches!

    Looking forward to my next whomping tomorrow night because I got promoted again to division I! I keep getting screwed up by little things like backwards brackets or accidentally returning the wrong variable...

  2. #2
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    you got my attention. Explain this thing. It's a tournament that get's you prize money and get's employers interested in you? How does it work and how much of my time would it occupy if I were to enter?
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  3. #3
    I lurk
    Join Date
    Aug 2002
    Posts
    1,361
    Yep, prize money, employment opportunity. I'm sure it will only occupy as much time as you allow. You can sign up for matches or skip em; see for yourself. www.topcoder.com

  4. #4
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    ok, read through their faq. So it appears you need to be standard compliant which means no VC++ apparently. what have your challenges been like?
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  5. #5
    cereal killer dP munky's Avatar
    Join Date
    Nov 2002
    Posts
    655
    what kind of contests are we talking about, i went to the site, but i mean, what are the contests
    guns dont kill people, abortion clinics kill people.

  6. #6
    I lurk
    Join Date
    Aug 2002
    Posts
    1,361
    Programming contests

  7. #7
    Cheesy Poofs! PJYelton's Avatar
    Join Date
    Sep 2002
    Location
    Boulder
    Posts
    1,728
    Well, standard compliance shouldn't really be an issue. Every algorithm I've written for them works just fine in VC++ - all you do is write the algorithm that solves the problem, any way you can. Doesn't matter if its the crappiest most inefficient program ever, if it produces the right result and takes less than 8 seconds to execute, you get the points!

    They just finished their big yearly competition last week, the winner took home $50,000 They have friendly (ie non money) matches every week. The next competition is tomorrow night, you should try it out! You only need spend as much time as you like, unless you want to become really good, which means you'd have to practice a lot. I've spent about one or two nights a month competing so far

    I'd recomment downloading the applet, and doing a practice match, preferably division II unless you are VERY confident in your algorithm capabilities. Basically, the way competition goes is like this: you are given three problems of varying difficulty and 75 minutes to solve them. To solve them, you write a class within their applet (or write it in something like VC++ and pasting it over)that contains at least one public function. This function takes parameters and should spit out the answer, all within 8 second execution time. The function should work no matter what parameters are passed to it. After reading the problem and some examples, you write the class, compile it, do some practice runs, then submit it. The faster you submit it, the more points you get. Then, after 75 minutes are passed, you get 15 minutes to look at what other people wrote, and if you think their code is wrong, you can challenge it, with the parameters you think will screw it up, and if you are right, they lose their points for that problem and you gain 50 pts, else you lose 50 pts. Last, all programs go through system checks where they pass up to 50 parameter sets to make sure your program works for all situations. Add up the points at the end to see how well you did, and your rating will increase or decrease depending on how you finished. Its a lot of fun!

    Some examples of problems:
    EASY: A snail is traveling up a well by day, and slips down a certain amount of feet at night. Write a function that given the amount the snail climbs during the day, the amount it slips at night, and the height of the well, spits back the number of days til it reaches the top.

    MEDIUM/EASY: A programmer is sorting his directories on his computer. Given an array of directory strings (ie {"/home/","/home/myprogs/","/usr/games/tetris/","/apps/", etc...}, spit back an array that contains these directories sorted. They must be sorted alphatecally and by shortest, ie /home/ comes after /apps/ but before /home/myprogs.

    MEDIUM/HARD: A farmer has a number of types of animals, represented by an array of feet. For example, if the farmer has birds, sheep, cows, and spiders, his farm array would look like: {2,4,4,8}. Now, given the farm array, AND the number of heads and feet of animals the farmer has (assume every animal has exactly one head), how many different combinations of animals can the farmer have?

    HARD: Ack, these take forever to write out, just take a look at them on the site!

    The medium/hard and above only appear if you are at division I, otherwise the hardest you get are about medium at division II.

  8. #8
    cereal killer dP munky's Avatar
    Join Date
    Nov 2002
    Posts
    655
    cool, thanks for writing all that out
    guns dont kill people, abortion clinics kill people.

  9. #9
    Cheesy Poofs! PJYelton's Avatar
    Join Date
    Sep 2002
    Location
    Boulder
    Posts
    1,728
    No problem, I'm at work and quite bored with nothing to do

  10. #10
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    so you make this class from an interface that they determine it must have? in other words it must compile and work with their wrapper app?
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  11. #11
    Cheesy Poofs! PJYelton's Avatar
    Join Date
    Sep 2002
    Location
    Boulder
    Posts
    1,728
    Errr... I won't pretend to know what type of work goes on behind the scenes, but its real easy on our part. For example, the snail problem I said above would look something like this: They tell you to name the class Snail, and the member function howManyDays(int, int, int). You would then write in their applet:
    Code:
    #include<iostream>
    .....
    using namespace std;
    
    class Snail {
      public:
        int howManyDays(int up, int down, int height) {
            ........ write algorithm here
            return numOfDays;
        }
    };
    Thats it. When tested, topcoder (or an opponant if they challenge it) will write down what parameters to test with, like say 10 up, 5 down, height of 50, and then sees to make sure your function returns the correct answer. If you want to write more member functions to simplify everything you can, but you don't have to. Just make sure that the function they tell you to write is the one recieving the parameters and returning the answer. The best way to get a feel is to try their practice matches.

  12. #12
    Its not rocket science vasanth's Avatar
    Join Date
    Jan 2002
    Posts
    1,683
    Well got something i always searched for.. the site is good and i registered.... But the problem is with the timings of the contest.. i live at the other end of the globe........ well dosent matter.. watin for the next contest.. solved a couple of practice questions of 250 points and 2 1000 points ones....

  13. #13
    that sounds really cool, and from the demographics questions asked in registration it seems like the employment opportunities feature is very active.good times

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Topcoder and UVA ACM problem
    By SilentStrike in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 07-10-2004, 05:15 PM
  2. Topcoder
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 07-14-2003, 12:07 AM