Slashdot Mirror


Introduction to Competitive Programming

chrisjrn writes "Last year, I unexpectedly found myself entered in the Australian Computer Programming Competition, and somehow did well in it. As a result I decided to write a guide as an introduction, for high school-level students (and others, I suppose,) into the world of programming competitively based on my experience, and how to go about successfully competing in competitions." Article looks like a good start, I'm sure Slashdot readers can add many more tidbits of wisdom.

211 comments

  1. Programing out of Necessity by guildsolutions · · Score: 2, Insightful

    My programing skills came from Necessity, a group of people I was with needed a website and nobody could do it. I knew the basics of C programing so I picked up PHP and went from there. Tidbits like this can be very helpfull to the self taught, school taught and clueless.. Personal experiences with programing is golden, always.

    1. Re:Programing out of Necessity by Nuclear+Elephant · · Score: 5, Insightful

      My team competed (and won first place in) several high school computer programming contests at the colleges in New England back in my day (Plymouth State, St. Anselm, etc). I'm not sure what today's competitions look like, but the team concept made things work here. I was the code monkey of the group, and the rest had their own strengths. Prior to my coming onboard, the team continually lost - not because they weren't smart, but they weren't complete. They were very strong in figuring out solutions to problems, while I was very strong at taking those solutions and laying them out in code. That's one of the reasons I'm suspicious of the 'one-man' competitions, as real-life work challenges are often team-oriented. As adults, most of us have learned to wear many of the different hats (problem solving, mathematics, coding, etc), but building a strong team based on members' strengths still usually makes the difference between mediocre products and works of art. That's just my 2c.

    2. Re:Programing out of Necessity by Anonymous Coward · · Score: 0

      Where did you go to school? I did the same thing, but don't seem to remember you.

    3. Re:Programing out of Necessity by w98 · · Score: 4, Insightful
      well, not every situation in life is a team effort though - there are tasks that one must do alone at work from time to time, so being able to at least sludge your way through a project on your own can be a real benefit to the company.

      My last job had a total of three programmers, and we all worked on different areas of the system, and only towards what was the eventual end of my employment there (I left for a much better job) did we actually interact and connect some of the pieces together.

      You're right though, in a team situation, things can be done so much faster if you've got a team leader who can recognize skills and traits and assign tasks accordingly. But not every company will have a team of that many people on everything.

      Even at my current job, where we have a very large development team, there are still individual jobs to get done, and there are other jobs that require a team of 3-4 or even collaboration between two or three whole departments.

      And that's my $0.02 ;o)

    4. Re:Programing out of Necessity by ScrewMaster · · Score: 2, Insightful

      On the other hand (and I'm not really disagreeing with you, but) historically, the greatest works of art in any field have been created by individuals. Bach, Michelangelo, Leonardo Da Vinci ... all were inspired individuals with the vision and the talent to create a masterwork.

      Of course, you're correct in that a lot of modern engineering tasks (software or any other kind) are complex beyond any single person's abilities, no matter how much of a genius they may be. And yes, teamwork is the way. However, if you look at most of the best engineering teams (I've been fortunate to work with a few along the way) there is often one individual that is the creative spark. He or she is the one that the others go to for inspiration, and that keeps the original vision of the project alive until it is complete. What makes a good team, in that context, is having someone capable of providing a stable sense of direction, and teammates that are happy working within the context of someone else's vision.

      Of course, having a good design in the first place helps a lot too.

      --
      The higher the technology, the sharper that two-edged sword.
    5. Re:Programing out of Necessity by Nuclear+Elephant · · Score: 0, Flamebait

      well, not every situation in life is a team effort though

      True, Karma whoring is a one-man show.

    6. Re:Programing out of Necessity by Anonymous Coward · · Score: 0

      Programming (or software engineering, more specifically) isn't fine art, you know. Competence overrules creativity generally.

      Unlike "arts," software needs to be good for something (of practical use). :-)

  2. Good Public Relations by dshaw858 · · Score: 4, Insightful

    Hopefully this type of a story will encourage other high school and college students to go into competitive programming. I know that I, at least, am nervous to start in programming competitions, but I think that having a real "just like me" article/guide on the subject will help boost interest.

    All in all, good PR.

    - dshaw

    1. Re:Good Public Relations by corvair2k1 · · Score: 1

      Really, the best way to encourage current high schoolers and college students is support at the school level. Many colleges now sponsor teams every year, even having courses whose sole purpose is teaching strategies for these competitions. High schools have the same kind of support through clubs and such. Somebody just has to get the ball rolling.

    2. Re:Good Public Relations by Nuclear+Elephant · · Score: 3, Funny

      Really, the best way to encourage current high schoolers and college students is support at the school level.

      Hot college chicks running the contests always helped encourage me.

    3. Re:Good Public Relations by AndreiK · · Score: 1

      I myself have participated in a few of those types of competitions while still in college.

      Some of the competitions were fun, and there are a lot of them out there - ASCL and ACM are just two of the national ones.

    4. Re:Good Public Relations by Anonymous Coward · · Score: 2, Interesting

      The worst that could happen is you not get any questions right. Funny thing is, you'd probably do better than at least 10 teams.

      I've done college level programming contests, and the atmosphere was always "ok, be prepared, but this is for fun" We had a free lodging, free travel, and free food for the entire weekend. It was cool. Did we win? God no, we came in 12th IIRC, but it was a fun learning experience.

      Some tips I remember:

      1. Know who's good at what. We could only let 1 person from our 4 man group in the computer room at a time. He had to be able to type fast, correctly, and fix our mistakes. Basically the star of the show.

      2. Know how your group works best. We found out the hard way that we worked 10x faster in 1 group on the same problem than 3 people + 1 on the computer working on different problems. I solve this problem, you help with that part, we move as fast as the fastest guy, and we provide each aspect. Algorythm, code, SA+D, etc.

      3. Sometimes is good to write down the different parts of the problem. Especially on the graphical questions, and geometrical problems.

    5. Re:Good Public Relations by WeeLad · · Score: 1
      2. Know how your group works best

      Well said. I participated in a few of the ACM regional programming contests in college. At one, we absolutely did NOT know how to work as a team. We each took a problem and went our own way, spending all of our time figuring out our own problems, code, and mistakes. This made our own time at the shared workstation very valuable and that of our teammates seem less so. Eventually tempers flared and hissy fits ensued.

      At another one we mixed up the teams and did much better. One guy didn't even go to the workstation. He just stayed in the "thinking" area and served as a second set of eyes and second brain for the others. He was probably the most valuable person on that team.

      We still did lousy in all the contests because in the end, we're probably only mediocre programmers. But the experiences are almost always fun.

      --
      Seriously, Don't take anything I say seriously.
    6. Re:Good Public Relations by rjshields · · Score: 1

      Why the obsession with programming competitions? If you're smart enough to do well in a competetion, go and join an open source software project and do something that makes a real difference and will look good on your resume. Competitions may offer a learning experience, but they have little other practical value.

      --
      In this world nothing is certain but death, taxes and flawed car analogies.
  3. Code before competition by Aneurysm · · Score: 4, Interesting

    The article mentions writing template code before the competition begins. How much code do these competitions generally let you rock up with? Could you turn up with huge preprogrammed libraries ready to deal with any situation? I know the questions would probably be rather obscure, but surely you get an unfair advantage by coming with preprepared code. Surely only allowing competitors standard libraries is the easiest way to make things fair.

    1. Re:Code before competition by chrisjrn · · Score: 2, Insightful

      If you don't get your own teminal, sometime it can only be what you can write in 1-5 minutes. So generally, you can only code what I put in the article.

    2. Re:Code before competition by Syrae · · Score: 1

      For the ICPC sponsored by ACM, participants are allowed to bring in as many paper materials as they want. This means that some people literally come in with libraries in bookbags and totebags. It really helps if you've got the most important stuff written out on a few sheets of paper. Use the books to look up some stupid algorithm you forgot.

    3. Re:Code before competition by corvair2k1 · · Score: 1

      Some competitions allow you to bring in some amount of bound materials (including materials bound by you), usually limited to 3 or five pounds. No electronic gadgets are allowed, and no floopy disks of code can be brought in.

    4. Re:Code before competition by Aneurysm · · Score: 2, Insightful

      Did you get preparation time before the questions were unveiled to write some preemptive code?

    5. Re:Code before competition by chrisjrn · · Score: 4, Informative

      In the Competition in India, we had around 10 minutes to get used to the IDE and compiler, and we used that to have our code ready. Most other comps are the same.

    6. Re:Code before competition by Aneurysm · · Score: 2, Insightful

      Cool, thanks for the replies and info. Know of any competitions in England by any chance? :)

    7. Re:Code before competition by Syrae · · Score: 2, Informative

      In the ICPC, we were given a test problem to work on. We had an hour to complete it, and it was a chance for them to work out any bugs with the network answer submission process before the competition started. Unfortunately, anything we coded up in that hour got wiped before the start of the real competition. The practice problem was also easy. It was something like, take 10 strings from this file, reverse them, and print them to the screen.

    8. Re:Code before competition by DiogoFerreira · · Score: 1

      Actually rules changed, you can only bring a 20-page thingie now, and you have to send it to them, so that they can print it and give it to you on the competition day.

    9. Re:Code before competition by chrisjrn · · Score: 2, Informative

      I don't, but I'd assume that you have a National Informatics Olympiad. The best thing to do would be to Google it :).

    10. Re:Code before competition by Syrae · · Score: 2, Informative
      Cool, thanks for the replies and info. Know of any competitions in England by any chance? :)

      If you're in college still, ICPC = "International Collegiate Programming Contest." The site seems down at the moment, but it's usually at http://acm.baylor.edu/acmicpc or http://icpc.baylor.edu/icpc/

    11. Re:Code before competition by Aneurysm · · Score: 2, Interesting

      I graduated University last Summer. I did Computer Science and never heard anything about competitive programming. Is it a biggish thing in the states?

    12. Re:Code before competition by Syrae · · Score: 1

      Well, poo to them! It was fun watching the students come in with blunt objects used... to.. er.... Well, I don't think I've ever seen any casualities. I think that guy in the corner was just taking a nap break... during the competition... and the paramedics putting that blanket over his head was just so the lights wouldn't wake him from his nap. Yeah.

    13. Re:Code before competition by Syrae · · Score: 3, Informative
      Not really. Someone else posted further down about a few other competitions. The ICPC isn't too old, but many of the other competitions are pretty new. It's a fairly recent (last 10-15 years, but really expanding in the last 5 years) phenomina.

      I learned about it only because my school's chapter of the ACM always participated. The division I'm in covers the mcuh of the west coast of the US and the west coast of Canada. There were over 100 teams last year. It really sucks to be in the same division as Stanford, UC Berkeley, and British Columbia.

    14. Re:Code before competition by Anonymous Coward · · Score: 0

      For the secondary school level, here.
      http://www.christs.cam.ac.uk/bio/

      And of course, if you're in University, the ACM ICPC is the way to go.

    15. Re:Code before competition by Juanvaldes · · Score: 1

      tell dev to kick last years-years-years freshman in the ass for me ;)

    16. Re:Code before competition by jlarocco · · Score: 1
      It really sucks to be in the same division as Stanford, UC Berkeley, and British Columbia.

      Why? If you beat them, it's an accomplishment, and if you lose, nobody cares because it's mostly expected. (no offense)

      If your chapter had only shitty community colleges and schools known for their poor computer science skills, if you won, nobody would care because it was expected. And losing would be embaressing.

    17. Re:Code before competition by hburch · · Score: 3, Informative
      For high school students, the answer would be the British Informatics Olympiad.

      Could become a representative for Great Britian to the International Olympiad of Informatics next summer, to be held in Mexico.

      If you're in northern Ireland, you'd compete in the Irish Schools' Programming Competition.

      You can also compete in online contests such as USA Computer Olympiad (operated in the USA, but open to everyone), or a quick google search will yield more.

    18. Re:Code before competition by The_Wilschon · · Score: 1

      acm.baylor.edu or icpc.baylor.edu

      Ok, this creeped me out just very slightly... How does it come about that this site is hosted at a baylor.edu domain? I'm sitting in my dorm room on Baylor's campus right now... Are there other sites hosted at other universities, or is Baylor just special somehow? I never had the impression that our CS dept was really much good (physics is my business).......

      --
      SIGSEGV caught, terminating

      wait... not that kind of sig.
    19. Re:Code before competition by ockegheim · · Score: 1

      Being able to produce:

      using namespace std;
      #include <iostream>
      #include <vector>
      #include <stdlib.h>

      ...etc. only demonstrates a basic knowledge of C, which is not what the competition organisers would be interested in, so I think basic templates should be fine (as any good programmer will use them anyway). In a good competition the problems would be of the kind that could be found in any number of non-standard libraries, so I imagine the best preparation would be a few standard templates and a willingness to be creative.

      --
      I’m old enough to remember 16K of memory being described as “whopping”
    20. Re:Code before competition by glitch0 · · Score: 1

      This is why Java has a huge advantage over all the other languages, especially at the high school level.

      I've been to many competitions where we'll get problems that can be done in less than 20 lines of Java because of the huge class library. Need to check if a number is prime? Just use BigInteger.isProbablePrime(). Need to work with dates? Just use the Java.util.Date class. Need to parse input? You can do it in one line with StringTokenizer.

      These are all things I've used in competitions, and this is coming from a member of the (new) number one team which is the reigning champion of Florida (Celebration High School)

      --
      -Glitch "We all know Linux is great...it does infinite loops in 5 seconds." - Linus Torvalds
    21. Re:Code before competition by alfalfro · · Score: 1

      Not really. If you're on the team or a professor who likes to brag, then it's big. Recruiters like to see it on resumes too. (Additionally, Americans are much more competitive in nature than *most* countries IMO) My uni was apparently really good at these competitions and won a lot.

      Out of 1100 or so undergraduates in the program, I only knew one guy who was on a team. He was a good coder, but in a class competition, my Robocode robot beat his. :) But perhaps he got a bigger laugh by his free trip to the programming championships ... in Prague.

      --
      Support your local brewery.
    22. Re:Code before competition by Fahrenheit+450 · · Score: 1

      I've been to many competitions where we'll get problems that can be done in less than 20 lines of Java because of the huge class library. Need to check if a number is prime? Just use BigInteger.isProbablePrime().

      Sure, then they throw a Carmichael number in the data set, and you're screwed...

      --
      -30-
    23. Re:Code before competition by Syrae · · Score: 1

      That, I can do. ;)

    24. Re:Code before competition by Syrae · · Score: 1

      Hey, I don't know. It's a static link that the ACM has been using for at least three years. Maybe ACM has just got your CS or IT department whipped... or maybe Baylor is just some front for some computer geek mafia!!!

    25. Re:Code before competition by brlewis · · Score: 1

      Interesting post, but where's the part about the Java language having an advantage? The Java class library and the Java language are two distinct things. You can use one without the other.

    26. Re:Code before competition by glitch0 · · Score: 1

      At every high school competition I've been to here in Florida (greater than 10) I've never seen them disallow the class library.

      Now, I have HEARD of them disallowing certain parts of it, I remember hearing about a competition where awt (I think) wasn't allowed.

      --
      -Glitch "We all know Linux is great...it does infinite loops in 5 seconds." - Linus Torvalds
    27. Re:Code before competition by glitch0 · · Score: 1

      Yeah, because obviously everyone who writes programming problems has also taken extremely advanced math classes.

      But that would be a terribly hasty generalization.

      Sorry for sarcasm, it's built into my personality.

      --
      -Glitch "We all know Linux is great...it does infinite loops in 5 seconds." - Linus Torvalds
  4. Big Competitions not Mentioned In TFA by Anonymous Coward · · Score: 5, Informative

    - ACM International Collegiate Programming Contest: http://icpc.baylor.edu/icpc/ (Big competition between colleges worldwide - sort of the equivalent of the IOI at the university level).

    - TopCoder: http://www.topcoder.com/tc (weekly matches, yearly competition with large cash prize, also hosts the Google Code Jam (http://google.com/codejam)).

  5. Good Info... by Knight+Thrasher · · Score: 4, Funny

    Just one tip:
    Needs more Caffeine.

    1. Re:Good Info... by Anonymous Coward · · Score: 0

      This won't work. I assure you.
      (Unless you've got a caffeine addiction, which in that case you've gotta have more of that stuff anyway)

    2. Re:Good Info... by crownrai · · Score: 1

      You sure? I think it could use more cowbell.

  6. invalid code by Anonymous Coward · · Score: 0

    using namespace std;
    #include ...

    is wrong, it should be
    #include ...

    using namespace std;

  7. Why? by NumberOneFan · · Score: 3, Insightful

    Why is "competetive programming" so great? I'm not trying to troll, but is this for some lack of being able to compete in sports or something? Why does this too have to be competitive? It seems like everything in here has to be tested and ranked.

    My university had a team, I went to one meeting and realised how stupid and hokey it was. Half of it was an intellectual circle-jerk and the other half was some practicing. All too l4m3.

    1. Re:Why? by Olentangy · · Score: 1

      I agree.

      I wonder why there isn't a competitive pottery competition too?

    2. Re:Why? by Anonymous Coward · · Score: 0

      I find it fun because it's something where it's easy to measure your progress. It gives a huge motivation to learn all about STL (or the Java library, if you're so inclined). For me, this has definitely been useful. Once you're at the top it's less fun, but by then you graduate and then you move on to something else.

      Just because I'm AC doesn't mean you can't mod me up.

    3. Re:Why? by Helios1182 · · Score: 5, Insightful

      As opposed to the non-intellectual circle jerk that makes up most high school sports? These are students that like to program, ar probably good at it, and enjoy some competition. You can compete in almost everything. Chess, cooking, football, programming, rock climbing, gardening... If it drives you to become better at something you love, whats wrong with it?

    4. Re:Why? by KhaZ · · Score: 2, Interesting

      Competitive programming is a great way in the way that sex for sport is good.

      If you're nervous, scared of your skills, etc: nothing's better then just straight immersion. You can't get too anxious if you're just *doing* it. You have to jump in with both your feet and start, or else you'll never get anywhere.

      It's really great for those of us who are scared of a particular domain, of not understanding problems, and all in all it really does help in solidifying domain ideas and promoting learning.

      A good example is something like the [url="http://www.unearthedgames.com/main/devdiary/ rapid-prototyping-boot-camp"] "Game in a Day" [/url] type ideas, as you can learn an immense amount by just 'doing', and even better, just 'doing' it with someone else to see where you go wrong.

      Yes, I used programming and sex in the same sentence; it's one of those things I've always wanted to do.

      --
      - - - -

      KickingDragon

    5. Re:Why? by KhaZ · · Score: 1

      Sigh. I hate Slashdot's stupid markup. Here's the link, in a clickable form:

      http://www.unearthedgames.com/main/devdiary/rapid- prototyping-boot-camp

      --
      - - - -

      KickingDragon

    6. Re:Why? by Jeff85 · · Score: 1

      Even though half the teams never planned on winning or even doing well, many teams of 3 from my high school went to local programming contests that allowed many teams from the same school just because it was fun to hang out with your friends and peers. Many who spent the whole two hour programming period and only getting one or two problems still enjoyed the competitions, maybe because they liked attempting to solve problems.

      I guess it also helped that there's usually pizza and soda, and we'd play ultimate frisbee or some other sport after the contest while waiting for the hosts to tally the results. Yes, nerds and geeks can play sports, too -- and many students you'd consider to be non-geeks competed as well.

      --
      Fetch Text URL - Firefox Extension
    7. Re:Why? by Anonymous Coward · · Score: 1, Interesting

      Simple really... to see if your skills best the other students. Nothing tests and grows one skills like competition.

    8. Re:Why? by Anonymous Coward · · Score: 1, Funny

      Yeah, HTML is tough, huh?

    9. Re:Why? by Sin(O)+Cos(O) · · Score: 1

      Have you ever seen a geek bench press contest?

    10. Re:Why? by Anonymous Coward · · Score: 0

      Olentangy wrote:
      >
      > I wonder why there isn't a competitive pottery competition too?

      Just leaf through any ceramics trade journal and you'll soon see there are plenty (even discounting the competition involved in just making a living as a professional potter).

      Pretty much any time you have one person better than another at something there'll be competition. The larger the field and the more interest there is in competition the more formalized that competition will get (again, from an organized hiring practice, to competing for fun).

      Now, whether competition in any given field is a good or bad thing (most certainly a mix of both) is another question. But the computer field can't be accused of being some sort of exception to the otherwise non-competative nature of human beings. Quite the opposite is the case.

    11. Re:Why? by sydneyfong · · Score: 1

      In general you'll meet people who like programming (I'm just referring to "programming" in the narrower sense, which doesn't include other computer-related-stuff that you guys may relate to when talking about "programming"), and through trying to solve the tasks there's a sense of accomplishment when you finally get it right.

      Of course, it's not for everyone, and I know people who are gurus in computers and tech in general yet clueless in these competitions, and OTOH I know some people whose computer literacy is little more than knowing how to fire-up an IDE and type do well in these competitions.

      If you expect these competitions to be any "computer related", you're going to be disappointed. It's all about programming (in the narrower sense), algorithms and problem solving.

      --
      Don't quote me on this.
    12. Re:Why? by Austerity+Empowers · · Score: 1

      That's been my experience with engineering in general, one giant intellectual circle jerk. No one knows everything, humility is a virtue. But you'd like Real Ultimate Truth actually exists in the minds of a select few who are also tasked with rating and ranking the unwashed masses based on silly questions or agreement some groupthink.

      The only competitive programming that matters is solve a problem no one else has solved. You have your whole life to do it, you may begin....wait for it....now.

    13. Re:Why? by Anonymous Coward · · Score: 0

      Sigh. I hate Slashdot's stupid markup

      Slashdot uses standard HTML. You seem to think the whole world uses vBulletin.

      Which leads me to conclude, quite correctly, that you don't know shit.

      Cheers.

    14. Re:Why? by shobadobs · · Score: 1

      Why is "competetive programming" so great? I'm not trying to troll, but is this for some lack of being able to compete in sports or something? Why does this too have to be competitive? It seems like everything in here has to be tested and ranked.

      My university had a team, I went to one meeting and realised how stupid and hokey it was. Half of it was an intellectual circle-jerk and the other half was some practicing. All too l4m3.


      Why is "football" so great? I'm not trying to troll, but is this for some lack of being able to compete in academic competitions or something? Why does this too have to be competitive? It seems like everything in here has to be tested and ranked.

      My university had a team, I went to one meeting and realised how stupid and hokey it was. Half of it was a ball-juggling circle-jerk and the other half was some practicing. All too lame.

    15. Re:Why? by Ravatar · · Score: 1

      Because I like to gauge my skills as a designer, and a programmer. What better way than through competition?

    16. Re:Why? by NumberOneFan · · Score: 1

      I understand now oh wise master. Thank you for showing me the path. I was lost in the woods and you have shown me the way. If it was not for you, I would have been eaten by a bear. Again thank you kind sir!

    17. Re:Why? by Anonymous Coward · · Score: 0

      How about building something of real world use that takes a year or more of your time? You will learn far more than you ever will in a programming competition. Plus you will learn something about yourself along the way.

      Don't get me wrong. I love competition. Just don't see the need to make programming a competition. Kinda reduces it to a game. I wouldn't even consider hiring someone only because they won a competition. Nope I treat them same as everyone else. Here is a complex algorithm. Come back tomorrow and let's see what you got.

    18. Re:Why? by cabazorro · · Score: 1

      I couldn't agree more.
      It reduces us software developers to code-monkeys jump-througg-fire-hoops, juice-box-drinker, tall- latte-chugger, granola-bar-chewer, regurgitating Monty Python 20 yr old jokes and snickering everytime we write log std::flush.
      Preposterous.
      TFA is right pointing out that in the world of coding there is no such thing as a "one language fits all" although lately we have been inundated with this script-mania where techies in their pissing-contest meetings argue endlessly about the killer-script (Pyton, Ruby, Perl, Tcl, VBS, Java-Script).

      --
      - these are not the droids you are looking for -
    19. Re:Why? by KhaZ · · Score: 1

      To be honest, the HTML isn't so much tough as it is unexpected. The majority of posting that I do uses some sort of format that tries to make what you input into the textarea box into what actually gets represented on screen.

      It's especially surprising considering the HTML items that Slashdot *does* support could easily be done using some other notation (BBCode, DokuWiki) that's more analogous to the way one would write a normal letter.

      Also, I believe what I meant by 'hate the format' was the wacky <URL:...> stuff.

      Anyhow, just my opinion: your mileage will *definitely* vary on how useful you find it. :)

      --
      - - - -

      KickingDragon

    20. Re:Why? by Ravatar · · Score: 1

      For me, it's not about adding a line to my resume. It's about seeing how competitors write code in comparison to me. Am I using the best approaches and methods? Competition is a good way to find out.

  8. Competitive high school programming teams ... by Average_Joe_Sixpack · · Score: 5, Funny

    Now there's a scary yearbook shot

    1. Re:Competitive high school programming teams ... by Spy+der+Mann · · Score: 2, Funny

      Now there's a scary yearbook shot

      You think that's scary? Wait till you go to anime conventions!

    2. Re:Competitive high school programming teams ... by Anonymous Coward · · Score: 0

      Everyone pretty much looks normal.. just don't try and talk to any of them.

      I know, I'm one of them. We're wierd!!111

    3. Re:Competitive high school programming teams ... by LifesizeKenDoll · · Score: 0

      I was in the American Computer Science League, and I have to say that the whole team was pretty funny.

      We went to Pennsylvania to compete, and we were a group of 5.

      Contestant #1: The .NET guy. He's a lot like a performance-enhancer pot guy. "Hey that was awesome. You know what'd be even better? If it were done with .NET" .NET can surely do no wrong. Caffeine Addiction.

      Contestant #2: The cultured Asian kid. He brought a skateboard everywhere on the trip and got yelled at several times during the competition for riding in the hallway. He was easily the smartest among us. He wrote 2 of the 5 programs we were given. In Mathematica, no less. Did a lot of pot.

      Contestant #3: The Indian kid. He was the timid one, but he was still smart. Granted, he didn't really contribute anything, as he only knew Java, and we for sure wouldn't let that beast ruin us. He kept his computer running through some kind of magic, because it broke at least every week. Also did a lot of pot.

      Contestant #4: The complete slacker. Now you'd assume that he was addicted to pot, but no, just Everquest. His contribution was keeping track of what problems we solved. He also came up with one or two unit tests. He was the youngest cause he skipped a grade or something. He was also my roommate for Junior and Senior year.

      Contestant #5: Me. I wrote 3/5 programs in Python, because the .NET guy messed up the one I assigned him. I would do drugs but it's not in my budget. I also don't believe in sleep. I find it a horrible waste of time. I also am tring to become an adult film maker.

      Everyone of us is batshit insane in at least some part of our lives. Probably not the Indian kid, though, he was cool.

      Also, we still think that our mentor worked for the NSA previously, but these rumors were never confirmed. Hush hush.

      In the end, we got 6th place, which was kinda sad. It's mostly my fault, because I made one typo. I pressed 3 instead of making it depend on the length of the given array. If that hadn't happened, we would've gotten 2nd.

      Now the school we went to said that if we "placed" they would pay for our dinner.

      To this day, the School thinks that we got 5th place, because we didn't want to split that dinner.

  9. Here's a BIG Hint... by Syrae · · Score: 3, Interesting
    Don't party the night before. Being drunk usually isn't good (for most people, though a few code better while inebriated), but being hung over is much worse.

    My school participated in a competition once, and we didn't do too well. One of our teams coming in hung over and running on two hours of sleep probably didn't help.

    1. Re:Here's a BIG Hint... by Stevyn · · Score: 1

      I usually code better when I've been drinking a little. It helps me to see the problem and solution a lot more clearly. I also don't mind commenting the code so much. When I look at it the next day, I think, "hey, it looks good, and runs fine...but how the hell does it work?"

  10. Practice makes perfect by Anonymous Coward · · Score: 0

    Competitive programming differs from the normal corporate paid programming practice. Competitive programming requires you to be real fast at arriving and implementing solutions and almost always the stress levels are high. In the corporate world there is an essential latency from design to implementation so the programmers have in effect more time and resources to perform their actions.

    http://topcoder.com/ is a good starting point for experiencing competitive programming although the paradigm is a little different.

  11. TopCoder by Da+Twink+Daddy · · Score: 5, Interesting

    Want to get involved with some competitive programming, right now?

    TopCoder is always looking for more members. The algorithm compeitions only take a few hours, and can pay good money. Plus discussion of the algorithms afterwards with the other members can be quite enlightening.

    They also do design and development competitions, which take a bit longer, but pay a lot better. You can also pick up cash by being a reviewer for these compeitions, if you pick up enough "scratch" in the compeitions themselves.

    You get individually rated on each of the 3 competitions and TC also provides some measure of employment services.

    Back when algorithm competitions always paid, I earned my 1/2 of rent through them. After I graduated from college I paid my bills through a combination of design / development / reviewing. Now I work for TopCoder as a salaried employee.

    Check it out, and look me up. My member handle is the same as my /. handle, just without the spaces.

    TopCoder can be very rewarding. I hope every programmer that reads this at least looks at the website.

    1. Re:TopCoder by /dev/trash · · Score: 1

      How does one get started?

    2. Re:TopCoder by tolkienfan · · Score: 1
      Go to www.topcoder.com and register.

      The next "Single Round Match" is Fri Sept 9.

      Run the applet, log in, and try some of the practice rooms.

      Too bad the Google Code Jam, and TopCoder Open competitions are already well on their way...

    3. Re:TopCoder by Geoffreyerffoeg · · Score: 1

      TopCoder is always looking for more members

      over the age of 18, apparently. I have an account with them but I couldn't figure out what to do with it since a bunch of the activities require you to be 18 or older.

      Normally I wouldn't complain (TopCoder sounds great, why else would I have registered?), but the article was about high school programming competitions. In fact, the SEARCC that he mentioned has a requirement of being under 18.

    4. Re:TopCoder by Anonymous Coward · · Score: 0

      hehe, you're my neighbor then. At Tallan, we have had "top coder" competitions ever since the company was founded. The people that started TopCoder were from Tallan and that's where they got the idea. There's a lot of bad blood from what I understand but I don't buy into it.

      I think TopCoder style competitions should be happening at every company. It gives little programmers a chance to impress everyone with their skills when otherwise they'd be stuck in their cubicle with the downsizing axe over their head.

  12. sorry by hurfy · · Score: 1

    sounds cool

    I got distracted trying to figure out if a programming competition was nerdier than math or not ;)

    Too bad i'm old enough to have been out of school before programming anything was common :(

    On the other hand we did win one of the earliest regional math competitions.

  13. Programming Challenge by Anonymous Coward · · Score: 0

    Throwing down the gauntlet here. Who can code support for a new BIOS chip into flasher for linux the quickest? Extra points for adding new hardware support.

  14. Why I like competitive programming. by DiogoFerreira · · Score: 5, Interesting

    Competitive programming can be addicting, I started on highschool just for fun on a small local contest, then me and my mate moved to the national olympiads, we were there just for the fun of it, but i actually got a good place. Then it started to get addicting, we were participating on every kind of contest, i won the national olympiad that year and therefore went to the International Olympiads in Informatics. This year i went to the IOI again. Just a word of wisdom, do _NOT_ get carried away by these contestes, they are good for fun but if you get addicted, they can even harm your studies.

    1. Re:Why I like competitive programming. by ScrewMaster · · Score: 1

      Well, if they harm your contestes you have a bigger problem.

      --
      The higher the technology, the sharper that two-edged sword.
    2. Re:Why I like competitive programming. by ScrewMaster · · Score: 1

      My apologies for that last one, but I'm stuck at home with a 101 degree fever and I couldn't help myself.

      --
      The higher the technology, the sharper that two-edged sword.
    3. Re:Why I like competitive programming. by DiogoFerreira · · Score: 1

      I noticed that 2 secs after clicking the submit button. I thought, well the average person can understand it's a common mistake, but i guess you are just bellow the average.

    4. Re:Why I like competitive programming. by DiogoFerreira · · Score: 1

      No hard feelings, i hope you get better.

    5. Re:Why I like competitive programming. by bani · · Score: 1

      Wheres +1 humility when you need it, dammit.

    6. Re:Why I like competitive programming. by Pyrowolf · · Score: 1

      Olympiads of programming?!? It's one thing to have a contest, it's another to call national versions "Olympiads". You would think they would have taken the opportunity to pick a better name for nationals than Olympiads.

    7. Re:Why I like competitive programming. by DiogoFerreira · · Score: 1

      I think it goes after the International Olympiads, which comes from the International Maths' Olympiads.

  15. Texas Competitions by Jeff85 · · Score: 2, Interesting

    I used to compete in programming competitions during my junior and senior years in a Texas high school. I competed in TCEA and UIL. I did pretty well, though there were never any cash prizes. I always had a lot of fun due to the camaraderie with fellow classmates from my school, and I guess I got recognition for winning. However, the problems were relatively easy, with no complicated graph theory problems and the like.

    My school had a great computer club with a enthusiastic sponsor that went to local programming contests held by other high schools about once or twice a month. HP (previously Compaq) also holds their own annual competition in Houston, called Code Wars. I guess it was easy for me to get involved because this was part of a school club.

    Now I'm in college and the ACM ICPC and high level TopCoder problems kick my butt. I need to learn more algorithms.

    --
    Fetch Text URL - Firefox Extension
  16. Real World competitive programming. by team99parody · · Score: 4, Interesting

    The company I'm at has a big C#/ASP.NET application, but a couple marketing guys were doing UI prototyping in Ruby/Rails that appears to be nearing feature completion faster than the "real product". It's kinda fun to see - but in the end only one of the two solutions will survive - perhaps with quite a few people's jobs on the line as the prize.

    1. Re:Real World competitive programming. by Anonymous Coward · · Score: 1, Insightful

      When your Real Product needs some Real Power years from now, will you be happy with whatever language decision you made?

      Competition based on speed can be rather stupid.

    2. Re:Real World competitive programming. by Anonymous Coward · · Score: 0
      Yes. One of the core requirements is that the system scales linearly with additional nodes (not unlike a Google cluster or a TerraServer cluster).

      Time to market for the solution that meets the specs is indeed the most important requirement.

    3. Re:Real World competitive programming. by RAMMS+EIN · · Score: 1

      ``When your Real Product needs some Real Power years from now, will you be happy with whatever language decision you made?''

      I would say that Ruby is at least as good a bet as C# there. There may be a lot of libraries for C#, but Ruby is definitely the more concise and flexible language, and it's almost trivial to extend with C code if you need extra speed or low-level OS functionality.

      I don't have first hand experience with ASP.NET or Rails, but from the comments I hear, ASP.NET is not awfully intuitive nor flexible, whereas Rails seems to be blowing other frameworks out of the water these days.

      ``Competition based on speed can be rather stupid.''

      Yes. Like any other assessment based on a single metric. But in the market place, being able to develop features more rapidly than the competition is a definite win. See also Paul Graham's essay Beating the Averages.

      --
      Please correct me if I got my facts wrong.
    4. Re:Real World competitive programming. by RAMMS+EIN · · Score: 1

      ``The company I'm at has a big C#/ASP.NET application, but a couple marketing guys were doing UI prototyping in Ruby/Rails that appears to be nearing feature completion faster than the "real product".''

      Oh dear! The apocalypse is near! The marketing department is beating the programming department on creating an actually useful and featureful product. This can't be good.

      --
      Please correct me if I got my facts wrong.
  17. Re:wow, another new low... by techno-vampire · · Score: 4, Insightful
    this is not newsworthy and it's not very interesting

    If you're not interested, don't read it. Some of us do find it interesting, either because we're programmers or because we like to compete. Slashdot carries many articles on different topics, making it more interesting for more people. If all you want is stories that interest you, and don't want any others posted, why don't you found your own site, so that you have the final editorial say?

    --
    Good, inexpensive web hosting
  18. Make sure you know the IDE by GWBasic · · Score: 2, Informative

    Make sure you know the IDE(s) that you'll have to use. When I went to my first competition, I was only familar with Borland's C++ IDE. Unfortunatly, I could only use Visual Studio. If it wasn't for my partner being familar with Visual Studio, I would have lost time getting used to it.

    1. Re:Make sure you know the IDE by DiogoFerreira · · Score: 1

      Most competitions these days provide you with a variety of IDEs on different platforms

      On this year's IOI there you could chose between Linux and Windows, most people use Linux, because the grading system will use Linux+gcc/fpc/javac to compile your program and test it automatically.

      Anyway, you don't need an IDE for these contests, a text editor such as VIM or EMACS (ok, this is more like an IDE) will sufice.

    2. Re:Make sure you know the IDE by glitch0 · · Score: 1

      Or just learn to code in a regular text editor and compile it manually...

      --
      -Glitch "We all know Linux is great...it does infinite loops in 5 seconds." - Linus Torvalds
    3. Re:Make sure you know the IDE by GWBasic · · Score: 1

      ... But then you have to know the arguments to the compiler, which can differ greatly.

  19. cooperating like code chickens by milktoastman · · Score: 1

    Me and my friend used to try this, pitting ourselves against each other (and sometimes against our Intro C++ Prof) to see if the psychology of direct competition generated more enthusiasm for clever coding ideas. However, instead of being isolated bitter enemies (within the code world) we ended up cooperatively competing and made a final, ultimate frisbee of a whirly executable. I guess, as they say, I made the butter, he made the jelly, they didn't mix, but the roll (as in electrons 'rolling' with holes, on/off) tasted guuuuuuuuuud.

    1. Re:cooperating like code chickens by Syrae · · Score: 2, Funny

      If I hit my head against this wall, that almost makes sense.

    2. Re:cooperating like code chickens by ScrewMaster · · Score: 1

      I'm running a fever at the moment. I can't believe I got some kind of stupid upper-respiratory-tract infection on my vacation, dammit. Hell, I've been coughing up liquid Kryptonite for the past twelve hours ... probably time for some antibiotics, I guess. Whatever this is it nailed some of the other engineers in my group: I had hoped I'd escaped it. Ah well.

      However, because of the higher-than-normal body temperature, my cerebral cortex is operating much more efficiently than it ordinarily does. I can therefore state, almost unequivocally, that the grandparent poster's remark still makes no sense, so you may refrain from further injury to your braincase.

      --
      The higher the technology, the sharper that two-edged sword.
  20. you can pick your language? by Nick+haflinger · · Score: 0, Troll

    When I was in high school the competitions were conducted in ugh Pascal. It shifted to C after I graduated. If you can pick a language why not use perl with all of cpan at your disposal you should be able to crush the competition.

    1. Re:you can pick your language? by Anonymous Coward · · Score: 0

      The competitions you were involved were not hard enough. Perl is good on string manipulation and related stuff, but otherwise it's slow and unpredictable in terms of time and memory complexity, and in these programming competitions the difference between a O(n), O(nlgn) and O(n^2) etc, would basically mean whether you "win" or not. There aren't many things you could use CPAN for in these competitions really... they are engineered for real life uses, and the tasks in these competitions are anything BUT real life...

      In my opinion, C++ is the best language in terms of speed, efficiency, predictability and features for most of these competitions, but many people use pascal or the like and aren't really at any significant disadvantage.

      I'm guessing that most of the China team in the IOI (who got impressive results in IOI2004 and 2005) use Pascal as their primary language (C and C++ are also available).

  21. Not a 'great' guide, but good points by OverlordQ · · Score: 2, Funny

    I know a couple of the comments he makes to make you better like creating a template can and most likely are against the rules (I can attest to at least one competition that it is). And he is correct that more languages you know the easier it is if you switch between them. I remember one problem, that was easily solved in 2 short lines of Perl, which required the C coders to write quite a few more then that.

    --
    Your hair look like poop, Bob! - Wanker.
    1. Re:Not a 'great' guide, but good points by randomac · · Score: 1

      As an APL'er, 2 lines seems excessive to me. What was the problem?

  22. ICFP by Anonymous Coward · · Score: 4, Informative

    One of the best known contests is the ICFP (International Conference on Functional Programming) Contest. One great thing about it is that entries can be in any language. Therefore many consider it a competition between languages as much as between programmers.

    The winners to the 2005 ICFP contest are set to be announced this month (Sep 27th). Here're a couple of slashdot threads about it:

    http://developers.slashdot.org/article.pl?sid=05/0 5/30/036201&tid=156&tid=162

    http://it.slashdot.org/article.pl?sid=05/06/26/001 8252&tid=156&tid=8

  23. My experience with topcoder by merreborn · · Score: 4, Interesting
    I participated in a handful of events at topcoder.com, including last year's Google Code Jam, for which I got this nifty shirt I'm wearing right now.

    The problems I encountered there (which I solved in java) were far more difficult than the stuff I do at work (as a PHP/Javascript/MySQL lead web dev). One of the Google Code Jam problems was a real brain twister:

    Two rocks are dropped in a pond, and create square ripples. For example, a rock of weight 8 is dropped at a point -- at time zero, it creates a ripple of height 8 at the point it was dropped. at time zero, it creates a 3x3 square ripple of height 7, like so:
    777
    7 7
    777


    The problem: given these rules, find the highest ripple height given the locations, drop times and weights of two stones. (If two ripples overlap, the height is equal to the sum of their heights - i.e. if a height 3 and height 4 ripple both occupy the same point, the height at that point is then 7)

    The solution 90% of us tried was to simply brute force the problem, creating an array, and updating the array over and over again, comparing the ripple heights to the previous max. The maximum area we were supposed to check was 2000 x 2000 -- so the brute force method timed out (there's a pretty short execution time limit).

    The correct solution was to consider time as a third dimension; each rock creates a 4 sided pyramid. Then you only need to check 3 points, which can be done with simple equations: the 'peak' of each pyramid (the height of which happens to be the weight of the corresponding rock) and the intersection of the two pyramids.

    Did I mention that there were 4 problems, of which this was the second, all of which had to be solved in a grand total of 90 minutes? And that your score decreases every minute you spend on a problem?

    Yeah... TopCoder's rough. And no, custom pre-written libraries won't win this for you -- but they will save you a little time.
    1. Re:My experience with topcoder by sydneyfong · · Score: 3, Interesting

      > And no, custom pre-written libraries won't win this for you
      Um... those "professional" contestants would have already solved a similar task like you've just mentioned 10 times before... The "libraries" are basically hard-wired into their brains.

      I despise those competitions that put too much restraint on time given to solve the tasks. To get "good" at it, you have to grind through hundreds (if not thousands) of problems to the extent that when you see the tasks in the competition, you can immediately relate: "aha! this is almost identical the XXX that I solved a year ago!". I'd describe these people as "solution generating machines". And the time and effort spent to train to that state is a total waste of human resources, IMHO.

      It's like playing chess with a 5 second time limit for every move...

      And yes, I had been involved in these competitions for years. (A few local/national competitions and the IOI 2003, I wonder if there are any slashdotters who was also there... :-p) It's a good thing that the rules in the "Olympiad in Informatics" give (partial) credit to non-standard, partial or even downright bizzare solutions instead of the rigid rules of the ACM ICPC, Topcoder and the like (to have to solve the problem completely). And 5 hours for 3 problems, plenty of time to think, and that's the part which I think is most fun and challenging.

      --
      Don't quote me on this.
    2. Re:My experience with topcoder by Josuah · · Score: 1

      How is what you've just described any different than what "experts" in a field have developed themselves into?

      Being able to take what you've learned (experience), apply it to new situations in new combinations, and to see the relationships and patterns involved, quicker and better than others.

    3. Re:My experience with topcoder by Anonymous Coward · · Score: 0

      Since the problems aren't necessarily real ones, training to them creates only an artificial ability at programming. Becoming an expert, on the other hand, implies capability of dealing with the "real thing."

      Whether or not the competition problems do have some relation to real ones, this difference is an important one to consider. Nobody, for example, would say without reservation that the people ranked highest on Topcoder are the greatest programmers in the world. That's because of this difference.

    4. Re:My experience with topcoder by sydneyfong · · Score: 1

      At least most other "experts" do contribute (whether positively or negatively) to society and humanity in some ways.

      And these "experts" are "experts in solving algorithmic problems in 30 minutes", yet an intelligent person well versed in algorithms etc would be able to solve them in a few hours without all those mindless grinding that they do.

      I don't doubt that there are people who could become "experts in solving algorithmic problems in 30 minutes" without all that grinding, but from what I've seen this would be the exception rather than the norm.

      I'm not saying there's nothing to be gained from all that practice, but when it becomes excessive, it's doing more harm than good.

      Reverting again to my previous analogy, "chess experts" don't limit themselves to 5 second moves. I believe "programming experts" need that time too. Otherwise they are simply "high-level code monkeys", trained to produce code that solves familiar problems that they have been trained to do again and again.

      --
      Don't quote me on this.
    5. Re:My experience with topcoder by UOZaphod · · Score: 1

      For some reason, that particular example sounds more like a mathematics problem than a programming challenge.

      Solving the "secret" of that problem had nothing to do with programming, and everything to do with mathematics and geometry.

      Yes, I know that there are a lot of mathematics involved in programming, but being good at math doesn't always involved being good at programming. Having a greater understanding of mathematics certainly doesn't hurt either; one wouldn't want to undertake designing a 3d game without a good understanding of the geometry involved.

      To me, a true programming contest would use real-world tasks as a basis for the challenges, and would judge the results based on efficiency, documentation (important in the real world!), creativity, and overall style. To heck with 90 minute time limits... I think a whole day would be needed to really draw out the best in the programmers, and give them the time to add the documentation.

      --
      "The unicode stuff in the latest version is working fabulously well. My russian mafia friends are ecstatic."
    6. Re:My experience with topcoder by merreborn · · Score: 1

      I'd argue that becoming an expert TopCoder programmer is no less useless than becoming an expert cup stacker, or an expert Everquest player. Thousands, millions, who knows how many man-hours are devoted to those hobbies... with little real-world application.

      At least an expert topcoder user can write you a string parser that works the first time. I'm currently working with a programmer for whom that'd be a massive improvement.

      In fact, even more, major companies (Google, for one!) are actually using TopCoder competitions as a recruiting tool -- when I qualified in the 2004 Google Code Jam, I got a "visit our recruiting site" letter along with my shirt.

      So clearly at least the guys at google think TopCoder users might actually be hirable programmers.

    7. Re:My experience with topcoder by TrekkieGod · · Score: 1
      huh...since we only have to consider two stones, wouldn't the highest peak always occur in an easy to calculate place? Either the point where the heaviest stone was dropped or the point of first intersection? First find the direction from stone 0 to stone 1 so that you may find the distance along the shortest path.

      Now...let's say that stone 1 (weight 12) was dropped at t=3 after stone 0 (weight 15), 20 units away from stone 0. So you subtract 3 from 20, and find the midpoint of the remaining distance of 17, which is 9 units away from stone 1. Calculate the peak at that point at time t=3+9=11. Stone 0: 15-11=4, Stone 1: 12-11=1, peak at intersection = 5, which is less than peak of heaviest stone, which is 15.

      Warning: I won't be held responsible for stupid errors in the above. It's late, and I decided to make a quick post before going to sleep :)

      --

      Warning: Opinions known to be heavily biased.

    8. Re:My experience with topcoder by TrekkieGod · · Score: 1
      Solving the "secret" of that problem had nothing to do with programming, and everything to do with mathematics and geometry.

      Yeah, but the math makes the efficiency. Most people were brute forcing it, when there was a much faster way. That's what good programming is all about, right? Finding out how to apply your knowledge (mathematics, obscure functions, previous experience or whatever else) to making a program more elegant and efficient is what good programming is all about.

      To me, a true programming contest would use real-world tasks as a basis for the challenges, and would judge the results based on

      efficiency,

      which was what the above test was all about

      documentation,

      Yeah, true enough. Finding out no one comments in the real world was a moment of great joy for me because I realized I wouldn't have to comment. And then I realized that in the real world I had to read and learn other people's code (and 'real world' to me is grad school, I can imagine the shock if I ever leave school and actually join the real 'real world'). Makes for difficult grading and long competitions though (as you pointed out yourself), and I guess they try to avoid that.

      creativity,

      Which brute forcing through the above problem is not, and yet most people reportedly tried it. Seems like they're trying to force people to be creative by giving them problems with obvious but inneficient solutions.

      I'm actually sort of disappointed that in a programming competition people would try to brute force something like that as a first option. It doesn't seem that complicated to me (I posted a solution that I think works as reply to the parent, although it's late and I haven't really thought it out, so it might not work...anyway, took me about 10 seconds to think of it, I'd at least try my ideas to see that they work instead of trying to brute force something like that).

      --

      Warning: Opinions known to be heavily biased.

    9. Re:My experience with topcoder by LordFnord · · Score: 1
      It's like playing chess with a 5 second time limit for every move...

      +1

      In speed chess, each player has five minutes on the clock for their whole game. It's not exactly the five seconds per move you suggest - you get your opening out as quickly as possible to conserve time for the endgame - but it's pretty close. If you've memorised a huge litany of openings and you're good at seeing the board rather than the pieces, it's a lot of fun (especially when time starts running out).

      Playing speed chess is a good way to test your knowledge, find out what your peers are up to, and maybe meet some interesting people or think some interesting thoughts along the way. Ultimately, though, it's not as fulfilling as getting completely lost in a full-length game that you actually care about.

      A programming competition is a good way to test your knowledge, find out what your peers are up to, and maybe meet some interesting people or think some interesting thoughts along the way. Ultimately, though, it's not as fulfilling as getting completely lost in a full-length project that you actually care about.

    10. Re:My experience with topcoder by Sartak · · Score: 1

      Don't let this post discourage the less able coders among us. This is a difficult division I problem. I myself am in division II which has simpler problems. The division II easy problem is usually a matter of knowing the basics of your language (like how to get and set individual characters in a string). The div II hard sometimes has things such as dynamic programming and breadth-first searches.

      Give it a shot, you might find you like it. It's a great learning too whatever your skill level.

    11. Re:My experience with topcoder by po8 · · Score: 1

      Yes. You have to be a little careful of odd/even distances, and because the proper metric is not Euclidean distance but whichever is longer of the x and y axis distances, and of potential non-intersection (consider e.g. two stones dropped in the same location at different times), but your basic idea is sound. Anyone who tried to simulate to solve this missed the spirit of these competitions---they're really about mathematical modeling more than computer programming.

    12. Re:My experience with topcoder by TrekkieGod · · Score: 1
      Yeah, absolutely right. I did think about the x and y distances, non-intersection occured to me in the case where the ripples die out, but not in the case of where the stones are dropped in the first place. I figure if I were on the competition that would be a completely careless mistake of my part.

      Now, you mention that the competition is about mathematical modeling more than computer programming, and I know what you mean by it, but I don't share your definition of what computer programming is. See, I think programming is not about knowing the syntax and memorizing functions and libraries. It's about getting a computer to do the things you want it to do. So even though both the simulation and mathematical solutions are 'programs' obviously one is more elegant and efficient than the other. Thus it surprised me that in a programming competition, most people were trying what is obviously an inferior approach--they can't expect to win. The problem didn't require me to know advanced math...it just required me to think about what's happening. I would have expected almost everyone to have come up with my solution, and the winner would be decided based on what people forget to account for (in my case, I'd lose points for not accounting for two stones dropped in the same place). I think things like that really are programming problems, and the fact that math is used as a tool doesn't make it any less so.

      Sorry about the rambling, I didn't get the impression that you disagree with me on that point or anything, but I just wanted to clarify since there was at least one poster that thought the problem wasn't a good problem for a programming competition since it was 'mathematical' in nature.

      --

      Warning: Opinions known to be heavily biased.

  24. Back in my day we didn't pick our language by WillAffleckUW · · Score: 1

    When I was in high school the competitions were conducted in ugh Pascal. It shifted to C after I graduated. If you can pick a language why not use perl with all of cpan at your disposal you should be able to crush the competition.

    Ah, but in college when I went in 1980, it was in Algol, as only math dweebs used Pascal, and then it became C.

    I agree about perl - both elegant and powerful, and it's a true test of programming. But I still hate the fact it treats zero (0) values as nulls - have to alter database queries to return zero (0) values as negative one (-1) instead or it ignores them.

    --
    -- Tigger warning: This post may contain tiggers! --
  25. Re:this, from the expert by chrisjrn · · Score: 1

    You could read TFA - This isn't a documentation of a one-off event, rather many. I only found myself entered in the first one unexpectedly...

  26. Ontario Highschool Fun by AdamPiotrZochowski · · Score: 1

    In Ontario (Canadian province in case you are wondering) there is highschool competition organized by the ECOO (Educational Computing Organization of Ontario) http://www.ecoo.org/ecoocs/Contests.html. when I took part in them there was no age restriction, I took part in all of them once I knew of their existance.

    Its generally is in teams of 4 and you are provided a set of 4 problems and have 2 hours to solve them. 4 people 4 problems, does not sound bad, until you notice you have 30mins to code and test. There are bonus points for handing in sollutions earlier (the faster you do, the better bonus), also, there is bonus for flawless first attempt.

    As per the language, I dont think there is a restriction. First year we wrote in QuickBasic (closest to my c64 basic), the other years we wrote in Turing (another Ontario specific thing, Turing is a language developed for Ontario Highschools by HoltSoft / University of Toronto http://www.holtsoft.com/turing/).

    Choose a language you know well and dont have alot of trouble getting to work with. One year a team showed up with their own pc (requirement at higher levels), but could not work with their tools.

    Some questions are simple, here are some I remember:
    1) draw a star provided you know the number of spikes
    2) game of life
    3) kernel / process simulation

    It is assumed you know what a highschool student should know, hence trigonometry is not explained, but for game of life or the kernel/process simulation the problem was explained in detail.

    One question we were given (third stage) was:
    1) here is a formula for volume of tetrahedron
    2) here are 4 points, calculate the volume
    3) here is another point, tell us if this point lies within the tetrahedron
    we were at a loss, how were we to know if the point lies or not? My friend who had this problem (I had kernel/process simulation, but was writting way too verbose code that amounted to nothing) knew that answer lies within the question, and tried to get us to help him, but 4 people 4 problems, everyone had own thing to do.

    So what we did? cheated... ;D ... we calculated the volume, and then just always said 'yes' that the 5th point was within. We got volume properly on all counts and 3 of the points properly. The Judge told us that our neighbouring team coded 'no' for the answer, hence got only 2 of the points right and was contemplating weather to rerun the test (judges have alternative data sets for second runs) and hope if they could get better results ;D.

    For Canadian Highschoolers there is another contest being run, this time by one of the Worlds best computer universities, the University of Waterloo (watcom = Waterloo Compilers, Sybase and RIM are also Waterloo graduate startups). Its called Canadian Computing Competition http://cemc.uwaterloo.ca/ccc/index.shtml. Unfortunatelly I never took part in this as no one at my school knew of it, and when I became informed it was too late.

    Finally, for university studs there is the ACM competition, the mother of all computer competitions. Checkout the problems archive, if you solve one question a day you will have years of fun http://www.inf.bme.hu/contests/tasks/

    Both in my highschool and my university people who were interested in competition banded together and ran clubs that were mentored by knowledgable people who were out to help us.

    In highschool by last grade we coded basic stuff in ASM, C, C++, Watcom Basic, QBasic, Watcom Pascal, Borland/Turbo Pascal, Turing, OOTuring. I with my friend for class project did simple statistics based AI in bp. Heck, we went through all sorting methods. I had nothing to do at University for first 2 years, computer programming wise.

    ahh, those were the times...

    1. Re:Ontario Highschool Fun by Profound · · Score: 1

      How to work out whether a point lies inside a tetrahedron?

      Treat all of the sides as 2D planes, with the top (ie planes "up") facing inside the volume. If the point is on the top-side of all planes, it's inside. If it is below one, then it's outside.

      bool pointInsidePlane {
              foreach plane {
                      if( point is below the plane )
                              return false;
              }
              return true;
      }

    2. Re:Ontario Highschool Fun by Sigma+7 · · Score: 1

      Treat all of the sides as 2D planes, with the top (ie planes "up") facing inside the volume. If the point is on the top-side of all planes, it's inside. If it is below one, then it's outside.


      That's half the solution. You still need to know how to determine which side of the plane a point is on. While this is possible with high-school math, this is generally only taught at the end of the high school career. Lower levels are more concerned by the false "fact" that negative numbers don't exist.

      (This is also the general reason why I was ill-prepared for the math contests during highschool - I could try to learn by myself, but there was neither the foundation nor resources appropriate for my level.)

      A slight correction, though - you want to make sure that the two other points reside outside of the plane. If you use the above/below system, you are highly likely to invert the iurection of the plane without knowing it - clockwise information isn't distributed with raw paints is space.
    3. Re:Ontario Highschool Fun by Anonymous Coward · · Score: 0

      A better solution:

      Calculate the volume of the original tetrahedron. Then calculate the volumes of the four tetrahedrons formed by the new point and each unique set of 3 vertices. If the sum of the four volumes is equal (of course, allowing for error in the calculations, so use an epsilon) to the original volume, then the point must be inside the original tetrahedron.

      This solution also builds on the previous steps, so the volume calculation is free.

  27. My experience by Reality+Master+101 · · Score: 4, Funny
    When I was fifteen, I was in a programming team competition (about 25 years ago). I think we all had Pascal computers or some such. We knew going in that there was going to be one "primary" problem, along with several lesser problems. We would be scored based on the "correctness" of the algorithm, the speed of execution, that sort of thing. The team agreed that I would take the primary problem, and others would work on the other ones.

    So I'm a hot shot junior programmer, ready to take on my assignment. Here was the problem: "You have a number of cities mapped on an x,y grid. A travelling salesman wants to find the shortest route between the cities. Calculate the shortest route." We had two hours or something.

    I'd never heard of this problem before.

    So I was like, "Hey, no problem. This is eeeeeasy." So I went off in my youthful exuberance with a blank piece of paper, figuring out how to solve it. Hmmm. That idea was good -- except it wouldn't work for this one case. How about this idea -- nope, that one will hang up on this other case.

    Minutes ticked away as I sweated the problem. There HAD to be a solution to this. Half an hour, then an hour -- I'm growing desperate. What the hell? This problem is freaking hard. Finally I'm like, "screw it" and threw something together at the last minute. We ended up losing because I spent too much time thinking about it.

    I still think it was goddamn unfair to give an UNSOLVED PROBLEM in a programming contest for high school students. I'm still pissed about it to this day. Grrr. :D

    --
    Sometimes it's best to just let stupid people be stupid.
    1. Re:My experience by Anonymous Coward · · Score: 1, Informative

      The problem isn't unsolved, its just NP-Complete, and would have taken the computer longer than the 90 minutes allotted to solve a data set of an meaningful size.

    2. Re:My experience by Anonymous Coward · · Score: 0

      Traveling salesman isn't an "UNSOLVED PROBLEM." It is NP complete, all that means is you can't do it quickly. You either need an algorithm class or to just calm down.

    3. Re:My experience by Anonymous Coward · · Score: 0

      I think the problem you are talking about can be solved, although not in polynomial time.

    4. Re:My experience by Reality+Master+101 · · Score: 1

      Sheesh, of course I meant that an efficient solution is unsolved.

      --
      Sometimes it's best to just let stupid people be stupid.
    5. Re:My experience by lucm · · Score: 2, Funny
      The travelling salesman problem is a textbook example of neuronal networks application.

      Now please don't ask me about those neuronal networks theories. My knowledge of neuronal networks does not go any further than the travelling salesman problem because I found out a while ago that there is now way I will ever need to know more about it, and still I could use it to impress my dates or the mouth-breather in the adjacent cubicle.

      Now if you are skilled in the field of analytical behaviorism you could guess from the above paragraph that I am indeed a very good Perl programmer.

      And in order to win (or at least do well) in a programming contest, how would a good Perl programmer solve the travelling salesman problem in one hour?

      He would spend 5 minutes writing a fairly reliable random function and spend 55 minutes obfuscating the code. In the end the output would be somehow similar to whatever crap other people wrote using STL or QBasic and at least half of the fun would be to look at judges while they try to extract a solution from an ascii chef-d'oeuvre.

      --
      lucm, indeed.
    6. Re:My experience by Anonymous Coward · · Score: 0

      I went to the Science Magnet in Dallas. I didn't get started programming until I was a junior so I wasn't the greatest. I was still pretty disappointed to not come in the top three at state, though.

      I liked those programming contests so much, and the community they engendered, that I became a computer science major. I didn't find out until college (seriously) that most programmers are solitary, and that a sense of camraderie and mutual benefit among the programming crowd is a rarity.

      I learned more in those two years of intensive learning and collaboration than I did in my first three years in college, and I had a lot more fun.

    7. Re:My experience by krappie · · Score: 1

      When did you go to the science+engineering magnet school in dallas? I knew those guys in 2001, it was the first year that school went to ACSL.

    8. Re:My experience by krappie · · Score: 1

      By the way, you're right.. I was learning way more in highschool and the people were cooler and it was much more fun. College kinda sucks.

    9. Re:My experience by Wavicle · · Score: 1

      Here was the problem: "You have a number of cities mapped on an x,y grid. A travelling salesman wants to find the shortest route between the cities. Calculate the shortest route." We had two hours or something.

      I still think it was goddamn unfair to give an UNSOLVED PROBLEM in a programming contest for high school students.

      Not sure if I'm being pedantic or not, but the problem, as you stated it, is neither NP nor unsolved. The shortest distance between two points is solvable in better than factorial time. You could convince yourself of this by thinking carefully about it: if all path costs are positive and my current path cost is greater than the best candidate path I've found so far, then this path, and all possible sub-paths need not be considered any longer. The traditional traveling salesman problem involves finding the shortest path that visits every point.

      --
      Education is a better safeguard of liberty than a standing army.
      Edward Everett (1794 - 1865)
    10. Re:My experience by Anonymous Coward · · Score: 0

      (not the same AC)

      That was one of the last years we actually competed well. That team did a lot of great things, but after they left, we had none of the old breed left and no leadership. Things get hard when the freshmen don't get taught :(

    11. Re:My experience by customiser · · Score: 1

      Nice! I'm sure most people there thought they were "this close" to solving it :)

      The problem of course has a brute force solution (trying all permutations) but this quickly becomes impractical as the number of possible paths for n cities is n! or something.

      It is also a case of an NP-complete problem, which if/when solved efficiently (i.e. by an algorithm of polynomial complexity) will lead to the solution of all other similarly hard NP problems.

    12. Re:My experience by Da+Twink+Daddy · · Score: 1

      I'm pretty sure that the general TSP is NP-Complete, but TSP on the Euclidean plane (or in any metric space that satisfies the triangle inequality [1]) actually has a (severely complicated) solution in ploynomial time.

      [1] Crap, I've forgotten my definition of metric spaces from Advanced Cal.; maybe they have to satisfy the triangle inequality?

    13. Re:My experience by Surt · · Score: 1

      Solving TSP is easy:

      1) Compute the list of all possible tours.
      2) Select the shortest tour.

      Granted, there's no efficient way to solve the problem, but that's not the same as unsolvable. In fact TSP is proved to be NP-complete, so there are lots of translations to other solved problems available.

      --
      "Who is the Journal of Quantum Physics going to believe?" --Stephen Hawking
    14. Re:My experience by Anonymous Coward · · Score: 0

      I graduated in 1999. Did you know Daniel Wu? He was a freshman when I was a senior, so he might have been around to meet you.

    15. Re:My experience by krappie · · Score: 1

      Are you referring to the years afterwards at the science and engineering magnet school?

      Yeah. It seems pretty "hit or miss". I dont know how I found some of the two smartest people I've ever met that became my partners. We were badass for the time for simply a public school

    16. Re:My experience by krappie · · Score: 1

      Which school are you referring to?

      I just searched all my very old conversations and I sont see any refernce to a Daniel Wu.

      If he was part of the magnet school, we'd only talk to them for a while before or after the contests. I think we were the only ones that really respected each other.. because everyone else sucked.

  28. My experience by krappie · · Score: 1

    I got roped into those computer science contests in highschool. My teacher just told me what time to show up after doing something nice for me.. so I couldnt tell her how lame I thought those competitions were, and how I'd rather stay up all night drinking stolen grocery store alchohol and doing acid. So I went..

    If you're into programming in your spare time, the competitions against other local highschools are embarrasingly easy. I think out of about 13 competitions, my team easily won 1st place in 10 of them. I live in Houston, Texas and the only real competition we'd ever have is when sometimes the science+engineering magnet school in Dallas would drive down for some competitions. The local public highschools are a joke.

    I was even in a winning senior division team of the US National ACSL competition. For the higher up competitions, its important to know the style of each competition and what kind of problems they give. ACSL even has a written section of the competition with strange concepts, it helped by just going through all their old written materials.

    If you're in teams, it also helps to have the badass fast typer for those simple programs, in addition to the brilliant minded programmers to think about the hard ones while the others are typing.

    Its good experience and usually a fun time I guess. But in the end, even winning a national competition usually doesnt do anything for you. I think my school won a scanner and some software that I never saw again. Yay

  29. Don't be too smart when brute force will do by cos(x) · · Score: 2, Insightful

    In 2004, my team won the eliminations in New Zealand and we went on to the ICPC World Finals in Prague. Up to the finals, we were expected to write clever programs using efficient algorithms that ran blazingly fast. Then, at the finals, it was all about hacking up crude semi-brute-force approaches that didn't work efficiently at all but got the job done. We were by far not the only team to do badly because at the finals because it took us hours to figure out that the clever algorithms we were coming up with were not necessary here at all.

    So, my advice is, try to find out as soon as possible (preferably before the competition, at the very beginning otherwise) whether they want smart algorithms or just something that works. It can save you a lot of time during the contest.

    Online contests are a good practice. For example, the Saratov State University (http://acm.sgu.ru/) has harsh time and memory limits while other contest sites give you heaps of resources to use.

    Live online contests are also great fun and practice. I remember winning a T-Shirt and some money at Bitwise a couple of years ago solving some neat problems in the process.

    Finally, practice makes perfect. Get old problems and practice, practice, practice, ...

    1. Re:Don't be too smart when brute force will do by gvc · · Score: 1

      The 2004 world final was a bit of a marathon. I'm not sure I'd say that any old solution would do, but the contest was overburdened with a large number of tedious case-analysis and geometry problems. It lacked "algorithms" problems.

      I think there's general consensus among the coaches that the 2005 problem set was more appealing. It had brain teasers and algorithms. The top 4 teams were struggling with 3 different problems in the last hour. The winner, Shangai, happened to be the ones who figured out the problem they tackled, not the fastest typers.

      Let's hope that 2004 was an anomaly and future contests are more like 2005.

  30. A Very Usefull Article by TheComputerMutt.ca · · Score: 2, Interesting

    I wrote the Canadian Computing Competition (Junior Level) last year. I was in grade 10, most of the contestants were grade 11, and I placed tenth out of about 550. If I had read that article beforehand, I would still have placed tenth out of about 550.

  31. Bogus Template by sconeu · · Score: 0, Redundant

    What the hell is ?

    Shouldn't his template use instead of and instead of , not to mention probably #include'ing ?

    --
    General Relativity: Space-time tells matter where to go; Matter tells space-time what shape to be.
    1. Re:Bogus Template by sconeu · · Score: 1

      Bloody slashdot...

      Should read:

      What the hell is <strings.h>

      Shouldn't he #include cstdlib and cstring instead of stdlib.h and string.h (assuming that's what the typo was), not to mention including <string>

      --
      General Relativity: Space-time tells matter where to go; Matter tells space-time what shape to be.
    2. Re:Bogus Template by chrisjrn · · Score: 1

      and are basically the same thing, and work in the same way. I've been forced into using Borland Turbo C++ (from 1992) before: You have a much better chance of the older C libraries being available than the new C++ ones.

  32. Programming Competitions? - Booooooooo! by Neelay+Thaker · · Score: 2, Insightful

    I have always been reluctant to try a hand at programming competitions because of the time factor that they entail. Different kinds of problems are suited for different kinds of programming languages. In a competition where the programmers are hammered with one problem after another, it is difficult to make a switch from one programming language to the other in a matter of minutes, even if you have been programming extensively in two or three languages. Refering to books and other resources for syntactic reference doesnot do good as it takes time. I find these competitions more a measure of typing speed and quick fix solutions rather than an assessment of creativity, quality programming and problem solving skills. In my opinion, a problem solving contest would be a better idea, where contestants could write down or type algorithmic solutions to problems and the most efficient solution would get rewarded. Ofcourse, evaluating such a contest would be more difficult too.

    1. Re:Programming Competitions? - Booooooooo! by gvc · · Score: 1

      By "these competitions" do you mean TopCoder? IOI and ACM are both 5 hours long. While typing speed may be a bit of an asset in these, it is a minor consideration.

  33. Good stuff... by dantheman82 · · Score: 1

    It was a neat thing for students at Stevens Institute of Technology, my alma mater, who were involved in ACM to take top 10 in the greater New York Regional contest for the last 4 years (while I was in school). Although I would have loved to take part, due to the timing of practice sessions and competition, I couldn't. However, I knew the leadership and others involved, and they became much better programmers as a result of this. We were competing against many larger and more well-funded schools like NYU, Cornell, Yale, Columbia, and so on. One major organizer behind it all is now working at Amazon right out of college, for what it's worth.

    --
    This sig donated to Pater. Long live /.
  34. Competive programming? by bloodgroove · · Score: 1

    Is this anything like the UFC?

  35. Some more tips by ESarge · · Score: 2, Interesting

    I was part of a University team that did quite well during the years. Our best result was 2nd in New Zealand for one competition.
    Anway - some tips:
    1. Read the question extremely closely before you start. It is frustrating to miss an important detail *after* you've written a lot of code.
    2. Plan carefully before you start. One of my team members was very talented at finding approaches that would work without problems. The other two members of our team could then implement them reliably. You cannot waste time on an incorrect approach.
    3. Have some algorithms pre-prepared. Examine previous questions for clues. Generally, we always saw date style problems (what day of the week is 24 November, 3100?) and area style (take a sheet of metal, cut out some shapes, what area is left?) problems. Both of those tended to be difficult and worth a lot to fix. Having an infinite precision math library ready to go is very useful.
    4. Keep track of time and don't ever give up coding. You might get the answer in just before the deadline and that can be the difference.

  36. Top Coder.... by oliverthered · · Score: 1

    Some people appear make a living out of it.
    Top Coder run competitions on a monthly basis (e.g. who can write the best version of a s/foo/bar).. It's not open to people outside the US though.

    --
    thank God the internet isn't a human right.
    1. Re:Top Coder.... by Wavicle · · Score: 1

      Wow... That's one of the most uninformed posts about TopCoder I've read.

      TopCoder runs algorithm competitions weekly. The top 5 algorithm coders in TC are:

      SnapDragon - A Canadian
      Petr - A Russian
      Tomek - A Pole
      Eryx - Another Pole
      Misof - A Slovakian

      Too bad TC hasn't figured out that its best coders aren't US citizens. Why, those people might get kicked out!

      --
      Education is a better safeguard of liberty than a standing army.
      Edward Everett (1794 - 1865)
    2. Re:Top Coder.... by oliverthered · · Score: 1

      Well, the email I received said that I wouldn't received any money if I lived outside the US, not that I couldn't take part.

      --
      thank God the internet isn't a human right.
  37. Problem solving is key by xRelisH · · Score: 2, Insightful

    I think there was too much focus on the coding itself in the guide. When it comes down to it, its the ability to solve problems.

    The best way to practice for a programming competition is to treat it like a math competition. If you can think of efficient solutions and apply them quickly, you will do well. Remember that a lot of these competitions have runtime limits (usually 2-3 seconds on a predetermied isolated machine), so coding up the simplest solution won't always work.

    Practice is also very important. Try ACSL, there are some sample problems available there, practice doing them and time yourself!

    Also, for those who say that programming competitions are useless, they have no clue what they are talking about. What sets you apart in real-world development involves thinking up efficient solutions to difficult problems. Making the code easy to maintain and expand is just a simple step up when you do development in the industry.

  38. If you include hardware... by jd · · Score: 1
    Then there are two programming contests that I know of - Robot Table Tennis and the long-in-the-whisker Micromouse Tournament.


    Robot Table Tennis is simple enough - build a machine that is capable of hitting a table tennis ball over the net, either from a serve or from a return. (The umpire serves.)


    The Micromouse Tournament is also simple. Build a machine capable of solving a maze and navigating to the centre in the shortest possible time. In order to be competitive, these days, you've got to have a micromouse that has long-range sensors and variable-speed motors. The days you could get away with stepper motors, simple switches on each side and a crude hardwired brain (no cpu) are long passed, although plenty such mice are run in the contests and are surprisingly close to being in the running.

    --
    It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
  39. it's always competetive by wzzzzrd · · Score: 1

    when you're a developer and aim for interesting projects, it's always pure competition. someone reviews your code behind your back and decides wether you stay two weeks or two years on that project. i got used to it, i do not recognize it anymore. and i never lost :)

    --
    On second thought, let's not go to Camelot. It is a silly place.
  40. Re:TSP by Anonymous Coward · · Score: 0

    To be fair, the TSP is not an unsolved problem: it can be naively solved solved by using factorially many steps in the worst case (*grins and ducks*). Perhaps you meant unsolved in polynomial time? :)

    These days most people believe it's not possible to solve the TSP in polynomial time, but maybe they still thought it might be possible in 1980, and they were trying to get "fresh eyes" to find the solution? Today we have (very good) polynomial approximations for the TSP based on minimum spanning trees, and there are also solutions to NPC problems that are faster than strict exponential time, so you could reduce the TSP to one of them and beat the naive factorial solution.

    Anyway, you forgot to tell us how many cities and roads were involved. If it was only 5-6 cities, you might have been able to do it by hand even fully connected. If it was 10 cities, then you could have easily solved it on machines of the day using the brute force method. However, if it was 50 or 100, then you were probably SOL unless there weren't many roads.

  41. Rounders by Nuttles1 · · Score: 2, Insightful

    As with many things this story can be understood by relating it to Rounders the movie. When Knish says, "Alimony, child support, my kids eat. I'm not playing for the thrill of f**king victory." Competitive programming, oh my, I program for money, not prizes. Even if those prizes are some cash. At the end of the day I want my check every time, I don't care if I am the absolute best, crap, I am better than most without even putting effort in. If I want to gamble I go to the Hold'em tables.

  42. Re:wow, another new low... by sydneyfong · · Score: 1

    > why don't you found your own site, so that you
    > have the final editorial say?
    I've been thinking (fantastizing) of this for quite some time lately.

    I mean, I come to slashdot to read the comments, not to see what the lame editors have to say. All they do is clicking the "approve" button from the submissions they get, and god knows what they do with their spare time. Quoth the famous saying "I could replace you (editors) with a very small shell script.".

    It would be great if somebody with a big pipe and a few machines would start an alternate slashdot and dump this crap filled (as regards to "stories") one for good.

    (Yes I know kuro5hin, but it's different...)

    --
    Don't quote me on this.
  43. Corewars - competitive programming since 1984 by neo · · Score: 1


    Let your programs fight each other while surreptitiously learning about assembly language.

    www.corewar.info

  44. Re:wow, another new low... by Anonymous Coward · · Score: 0
    i call your bluf.

    i will build this site. i shall call it dotslash.org

    "news for me,stuff that matters"

  45. I won 2 statewide..years later judged them by OsirisX11 · · Score: 1

    I won first place in both the ACTE, as well as the Computer Olympiad programming compteitions, years later they asked me to judge them both.

    I'd be happy to answer any questions.

    1. Re:I won 2 statewide..years later judged them by Anonymous Coward · · Score: 0

      I'll give you a tough one...

      Why did the chicken cross the road?
      O.o

  46. Recently competed in the UNSW ProgComp by chendo · · Score: 4, Interesting

    I recently competed in the UNSW ProgComp ('largest competition within Australia'). We only came third place, due to good competition this year (we won in 2003 with VB against Perl, Haskell and C++, heh :).

    Although I think the article fails to mention the organisation of 'computer time'. The Australian Computer Programming Competition and the ProgComp both allow three members in a team, but only one computer between the three of them. This means that you have to organise the priority and the division of problems amongst your teammates. Also, learning to code on paper is another important skill, as you won't have access to a keyboard the whole time. Therefore, having access to a printer is extremely helpful as you can just print and debug your code.

    Due to the nature of some languages, they restrict languages like Java and Python in the bigger competitions (IOI, ACPC) due to the large amount of standard libraries they get to play with. For example, I wasted half an hour coding Task 4 before I realised we could switch languages halfway through the competition and got it done in 15 lines with Python with regex.

    Finally, you do not need to have a team that consists entirely of programmers. In our team (for this year), we had two programmers, one to do the algorithmic ones (my friend, who represented Australia in the International Informatics and returned with a bronze medal), one to do the string-based ones (me), and another person to solve the problems by hand. Although, due to ProgComp deciding to have less algorithmic questions, my friend was only able to use his skill effectively on one question and the rest were split up between us. We had our third team member solve Task 3 though, and just coded a small program to decode it using the supplied decryption matrix.

    I won't be able to compete in high school competitions anymore as it is my final year, but I wish the rest of you, who are still able to compete, luck.

    --
    Founder of Mirror Moon - Tsukihime Game Trans
    1. Re:Recently competed in the UNSW ProgComp by chendo · · Score: 1

      And my friend just told me... he's far left in the small photo on the page :o

      Large version here.

      --
      Founder of Mirror Moon - Tsukihime Game Trans
  47. I Once Found Myself in the ACM by reidbold · · Score: 1

    Waterloo kicked my ass.

    --
    -Reid
  48. My opinion is this... by xquark · · Score: 1

    C++/STL/BOOST (graph and multi-index libraries and lambda)

    If the competions gave these as options, there really wouldn't be
    a competition. It would be a battle of who can figure which routines
    to use in which order... Or in other words it would be a slaughtering
    of people using any other language by people using the C++/STL/BOOST combo.

    --
    Arash Partow's Philosophy: Be a person who knows what they don't know, and not a person who doesn't know.
    1. Re:My opinion is this... by exp(pi*sqrt(163)) · · Score: 1

      Um...have you programmed in anything other than C++? A large chunk of STL and Boost are poor imitations of features found in other programming languages. Much of Boost is quite consciously modeled on functional programming languages. Maybe you should try some of these languages. For example, if you like lambda, why not use a language where concepts from lambda calculus are natural?

      --
      Doesn't it make you feel good to know that our freedoms are protected by politicans, lawyers and journalists.
  49. nothing to see here, move along by yagu · · Score: 1

    From the article/post:

    Article looks like a good start
    which may be the overstatement of the posting year.

    For those who don't want to go read the article, here's the summary:

    • he likes languages Basic (apologetically), C++, and Python
    • he recommends a main procedure
    • write a space based parser in advance (is that even fair?)
    1. Re:nothing to see here, move along by chrisjrn · · Score: 1

      Yes, writing a Space Parser in advance is fair, if your language doesn't have it built in - gives an extremely unfair advantage to C++ coders if you don't.

  50. Re:wow, another new low... by TheDefenistrator · · Score: 1

    The shift key is only several centemeters from home position. Give it a shot so next time you do not come off as another clueless idiot.

  51. Regional ACM competitions by Saturn49 · · Score: 2, Interesting

    I did a couple Regional ACM competitions, a few local ones, etc. They were fun, after the first one. My recommendations:

    1. Know your environment. The competitions I've been to give you some time on the computers before the competition to get to know the environment, compiler, IDE, etc. Make good use of it. If they have Eclipse, what version of Java, gcc, pascal, etc. Know the editor you are going to use. Do they have emacs, vi, etc? Knowing your environment will greatly reduce your write-compile-test time, which is critical during a competition.

    2. If writing templates beforehand is not allowed, bring one in on paper and take the 2 minutes beforehand (with the fastest typest in the group) to type it up. Ours consisted of an input loop/string parser with a loop that could be easily changed to accept input from the terminal (required for submitted programs) or a file (easier for testing sample input files.)

    3. Know your language(s). Know what's allowed in the competition, have several references handy for each language you plan to use. My team tended to use Java, but at the time there wasn't a built-in priority queue in Java. Dijkstra's shortest path algorithm requires a priority queue, so I spent some time before hand coming up with a very easy to type ( 1 page) general purpose priority queue. We weren't allowed any electronic resources, but if you can type fast enough, you can create any basic structure you need very quickly. When built-in structures are available, USE THEM, and use them extensively.

    4. Do the easiest problems first. Simple math will show you that you get the most points this way.

    5. Study existing problems. The local competitions tended to repeat problems from other regional (or national) competitions. We used those to practice from, so it made it a breeze when those problems came up.

    6. Don't get hung up on a problem. You'll waste tons of time, and there's ALWAYS the possibility that the submission checker is WRONG and your problem is right. Its happened at both regional competitions. They eventually find their mistake and your previous submission will be counted as correct.

    7. Practice. You'll get used to the problems and be able to analyze how long a particular problem will take much easier. You'll get to know your teammate's strengths and weaknesses. One teammate of mine was very good at solving problems but his coding skills were a bit off. He'd write up the solution, I'd debug his programs. We did quite well that way.

  52. Write some software instead by burris · · Score: 2, Insightful

    Competitive programming looks like fun and I think you can learn quite a bit from it. You can also earn reputation capital that can help in getting a job. I would think most employers would be more impressed with a high rank on a competitive site than with paid certs.

    That said, I think "undiscovered developers wanting to get a break" should spend most of their time writing some useful software or web application instead. You get more experience than just solving puzzles at breakneck speed. Writing a good piece of software or site that your interviewer has used goes further than anything short of a personal recommendation. When people use your software and are impressed with your skillz, work comes to you. Plus, you could end up founding a software business that makes you a millionare.

    There are a lot of opportunities out there.

  53. Not really, chap... by zanderredux · · Score: 1
    I'm sure Slashdot readers can add many more tidbits of wisdom

    I'm feeling a little competitive today, so I think I better keep my tricks to myself. As the saying goes, "my win, your loss", right?

    Have a nice day.

  54. Tips by schnitzi · · Score: 4, Informative

    I competed and coached for several years in the ACM Scholastic programming competitions. To this day, my school (the University of Central Florida) routinely places all three of their teams in the top ten of every regional, so it's safe to say that our method is tried and true.

    Some of the major facets that we coach:

    1. Easiest problems first. Appropriately applying a concept from computer science itself, the goal of a contest is to maximize your throughput. Since easy problems are worth as much as hard ones, effort should be made to discern which problems are easiest (as opposed to most interesting!).

    2. Team roles. Back when contests had four people to a team, we had two people as "bangers" (i.e. people who sit at the terminal and quickly compose solutions to the easier problems) and two were "software engineers", who sat away from the terminal and worked on paper. Note that after the first hour or two of the competition, EVERYONE is a software engineer.

    3. Specialize. In addition to roles, team members would typically have a specialty. Some people are good at algorithms; others at text processing; others at math problems, etc... This should all be worked out during practice to the point where every member of the team should be able to read a problem set and immediately tell who on the team will likely end up working on each problem.

    4. Do as much work away from the terminal as possible. Since you only have one terminal (in the ACM contests), it should be considered a scarce resource. Priority should be placed on entering new code; if you are debugging and someone has written out new code that's ready to enter, take a printout of your program and let the other person on. An exception is made when the person debugging feels they are within five minutes of a solution.

    5. Test extensively. This is the difference between a good team and a great team, in our experience. It is extremely tempting to submit your code once your program produces the correct output for the sample data. But it is not worth a failed submission.

    6. Consistency. We didn't mandate particular coding conventions, but we did mandate that team members at least HAVE coding conventions. E.g. array names -- are they the plural or singular form of the word (node[i] vs. nodes[i])? Similarly for variables that keep count, method names, etc. Recalling such things while typing wastes valuable minutes.

    7. Have practices that are genuine contest simulations. We even went so far as to shine lights in team member's faces and make lots of distracting noises, to simulate contest environments. On occasion we would even intentionally make mistakes in the problem sets and judging, just to prepare people for that (since it ALWAYS happens in the actual competition!).

    There were others, but I can't give away all our secrets! Well, okay, maybe I just don't remember them all.

    In our experience, it's the teams that consider contests to be all about "hacking" or "typing fast" that typically do very poorly. Those that apply good coding practices, and are consistent and organized are the ones that come out on top.

    --



    I object to that article, and to the next reply.
    1. Re:Tips by SwashbucklingCowboy · · Score: 1
      Glad to hear UCF is still doing well.

      I was a member of the team that placed 4th nearly 20 years ago. Also, was an alternate for the team that placed 2nd.

  55. Re:this, from the expert by Loconut1389 · · Score: 1

    I'll be honest when I say I at least skimmed the article, and my post wasn't meant to be a troll or point the finger at you so much.

    What I said at the bottom part is true, so often, someone who knows barely anything writes the definitive guide- apparently though this does not apply to you and I'm sorry I got that wrong.

  56. Re:TSP by Reality+Master+101 · · Score: 1
    I don't think they thought anyone was going to come up with a miracle solution, I think they were just trying to be cute and see what people would come up with. I don't think it had a specific number of cities; you had to come up with a general solution. That's what doomed me -- I assumed there had to be a "perfect" solution to the general problem that wasn't brute force. After all, they wouldn't give us a problem that couldn't be solved, would they?

    Bastards. :)

    --
    Sometimes it's best to just let stupid people be stupid.
  57. Re:this, from the expert by Loconut1389 · · Score: 1

    btw, I just looked at the article again, maybe I missed it, but I still don't see anywhere that gives any indication of how many events you went/have been to?

  58. Re:this, from the expert by chrisjrn · · Score: 1

    The article mentions about three comps that I've been in, but they were fairly well hidden. SOrry for the confusion. Over the past year, I've been involved in about 4 (Australian Computer Programming Competition, twice, UNSW ProgComp and the SEARCC comp). Sorry for the confusion.

  59. Applicability questioned by Tablizer · · Score: 1

    The thing that most seems to separate programming contest problems from real world problems is the "dirtiness" of real-world (rw) problems. Most abstractions one finds in rw often fall victim to the 80/20 rule, where 80% of instances fit the abstraction, but 20 percent don't. Most of the fiddle-faddle is dealing with the 20%.

    Languages and techniques that make for snap-together abstractions needed for contests may not necessarily be the best to deal with the rw deviations from the abstractions, ie the "messy parts".

    This seems to be because programming contests have to make the problem statements relatively short. If's, and's, and but's make for hard to read, hard to write, and hard to varify programming contest problems.

  60. Another programming-intensive contest: by Tammuz · · Score: 1

    The Mathematical Contest in Modeling is a highly competitive worldwide contest that relies heavily on programming skill. In the 84 hours after the question is revealed, teams of 3 must formulate a modeling approach to the problem, implement it and write a paper on their method. An average winning paper will be a 60-90 page research paper plus 3-5K lines of source code.

    Senior undergraduates are most successful as the problems require some sophistication to approach. In the end, it's probably a way for the sponsor to cheaply generate an enormous amount of quick research on their selected topic.

    PS. Thank you, TopCoder, for paying for a semester of my college education! Yay competitive programming!

  61. I encountered this when i was about 12 by grahamsz · · Score: 1

    Unbeknownst to me, my math teacher sent me off to find a counter-example to Femat's last theorem. Certainly kept me quiet for a few hours.

  62. Coding Competitions Reward Bad Practice by Jekler · · Score: 2, Insightful

    I'm not a big fan of programming competitions. They score people on bad programming practice. The skills that make you the best competitor are frequently the same habits that make you the guy everyone venomously whispers about in the cafeteria.

    They reward you for coding fast, hacking out make-shift solutions (i.e. Code that could never pass QA), and the given problems are too narrow to be representative of a real programming problem. You can ignore things like portability issues, standards compliance, elegance, orthogonality, modularity and maintainability.

    Real programming skills, the things that really set the master programmers apart, play absolutely no role. Namely: Source control and documentation. Most types of "competitive science" won't work well. At least the type where you can't build your project ahead of time. You're going to get the same quality work out of "speed programming" that you'll get out of "speed chemistry". Wouldn't that be fun? Get a room full of chemists together with a bunch of components and tell them to mix real fast, no time for measuring!

    That's my take on the whole Competitive Coding atmosphere.

  63. Collaborative Programming by sepiroth · · Score: 2, Informative

    The most interesting thing I learned at the university later on was it is the cooperation that counts. I do not know why students should compete with each other when they will most often work in a team in their future jobs.

    That is why I value Google Summer of Code so much; because it forces students to work together with ones they do not know: they learn the social part of programming. This is what most programmers lack; including me of course. Or else I would not be reading and contributing to this very forum...

  64. Other different contests by Anonymous Coward · · Score: 0

    Here are some more contests, accessible to everybody (not only students):

    http://www.mathworks.com/contest/
      which is a collaborative(!) competition

    http://codewalkers.com/php-contest.php
      holds a nice PHP contest, but seems to be inactive

    http://dinsights.com/POTM/
      holds a nice permanent contest, but there is nothing to win

    http://www.recmath.org/contest/index.php
      holds a tough contest, which just finished.
      With IFCP, it's the hardest contest I'm aware of.

  65. Language Restrictions? by Anonymous Coward · · Score: 0

    Do these competitions have rules dictating what languages one is allowed to use.

    Seems it would be a bit unbalanced to force C paradigm coders to spend 15 minutes haggling thier way through something that a K guru or APLer could bang out in 30 seconds.

    Just wondering.

  66. As if we need more competition in society... by master_p · · Score: 1

    People don't realize the power of software: it can change the world, if used correctly. Software must be like air: free for use, for everyone. Stupid competitions like this may enhance creativity but also make people forget how important software is, and how free software must be. For if some top algorithm is found, it must be available for everyone to use without any fees whatsoever.

  67. Re:this, from the expert by Loconut1389 · · Score: 1

    No worries ;o)

    I (as well as other slashdotters probably) have varying levels of 'reading'. My first pass, I probably read about 40% of it, my second pass I probably read about 75% of it, and perhaps if I get a chance Ill do a more focused read and take in all of it.

    As for my original post, it does bug me when there's someone who writes about their first and yet somehow definitive experience with something. I really did not intend to sound like a troll, but I suppose my wording left a stabbing tone- again 100% unintended.

    -Looking forward to your next post.

    (*cuts this sub-thread*)

  68. Solution by Lifewish · · Score: 1

    I'm guessing from your comment that you know how to do this now but, for the less mathematically-literate slashdotter, here's the solution, in words of one syllable.

    In vector maths, one of the most useful operators is the dot product. It is useful because it has both an algebraic and a geometric formulation. The algebraic formulation is that (a,b,c).(d,e,f) = (ad,be,cf) - this allows you to calculate the damn thing on a computer. The geometric formulation is that, for two vectors X and Y, X.Y = |X| |Y| cos theta, where |V| gives the length of a vector V and theta is the angle between X and Y.

    Say you have a plane in space, passing through the origin (the zero point). Consider a vector N that's normal to the plane (at right angles to every vector that lies on the plane). From the geometric formulation of the dot product, you can see that the set of points {X such that X is in the plane} is precisely the set of points {X such that X.N = 0} because, if a point is in the plane, the vector from the origin to that point is at right angles to N.

    Unfortunately, we can't assume that our plane passes through the origin, so we need to generalise this a bit. What we find is that a plane is a set {X such that X.N = k}, where k is a constant equal to the minimum distance from the plane to the origin, or minus that distance (depending on which way the normal points).

    So, we can now develop a strategy. If the corners of the tetrahedron are points A, B, C, D and we're trying to determine whether point X is in the tetrahedron, we need to figure out , for each set of three corners (for example A, B, C), whether X is on the same side of the plane generated by those points as the fourth point (for example D). You'll note that three points are sufficient to determine a plane.

    If we can figure out the normal to that plane, we can take any point in it (A, for example) and thus find the magic constant k representing the displacement of the plane from the origin. We can then compare that constant to the values X.N and D.N - if X.N and D.N are on different sides of the constant k then the point X is definitely outside the tetrahedron; otherwise, X may be inside.

    So now all we need to figure out how to do is find a normal to the plane. Sounds easy, but I'd wager that you won't be able to easily do it without the operator I'm about to describe: the cross product.

    The cross product is the other important operator in vector maths. Just as the dot product represented (broadly speaking) the extent to which two vectors point in the same direction, so the cross product represents (broadly speaking) the area mapped out by the two vectors. The difference is that the cross product returns a vector rather than a scalar, and that vector always points at right angles to the two input vectors - it's normal to them. See what I'm getting at here?

    I'll forgo long discussion of what the cross product is used for; I'll just say that it's often used to find volumes and is, in fact, the easiest way to find the volume of the tetrahedron. It is calculated as follows: (a,b,c)*(d,e,f) = (bf-ce, cd-af, ae-bd). I'll leave off describing where that expression comes from - the important thing is that we now have a normal to the plane generated by two points and the origin.

    So, our algorithm will look something like:

    - for each corner of the tetrahedron (call it D), take N = (B-A)*(C-A).
    - calculate k = A.N
    - if X.N k > D.N then X is not in the tetrahedron. Otherwise, repeat the above, choosing a different corner to start with.
    - if none of the four iterations fail, the point is inside the tetrahedron.

    And we're done :)

    --
    For the love of God, please learn to spell "ridiculous"!!!
    1. Re:Solution by NTmatter · · Score: 1

      With regards to the dot product, it's worth pointing out that it's (a,b,c).(d,e,f) = ad + be + cf. The sum of the products of the corresponding elements of the vector.

  69. Programmer of the Month by Peredur · · Score: 1

    http://dinsights.com/POTM/ is a semi-monthly contest that I have been watching for a while now. The problems are fun and interesting. The main objective is get the best "score" in the shortest amount of time. The solutions to past problems are very interesting reading. It's amazing what people do in the various languages. There was a problem several years ago that I still remember and think about: Take a map that gives various terrain altitude changes and find the shortest route (including distances traveled up and down) from point A to point B and back without crossing your "path".

  70. Other competition formats by base_chakra · · Score: 2, Informative

    I was introduced to a different type of programming competition when my team participated in New Mexico's Adventures in Supercomputing Challenge (in association with LANL) during my junior year of high school. We were granted time on a Cray, afforded accounts on a box running OSF/1 and a mentor from Sandia National Labs, and accommodated at a three-day programming retreat. Yet with all that preparation, we were totally unprepared for the presentational aspect of the competition, which was similar to a science fair. Our FORTRAN code was functional and the results were there, but we were unable to present our results effectively.

  71. I think there should be 3 styles of coding by Timberwolf0122 · · Score: 1

    In a coding comp. it is unfair to fight different styles agains each others in the same way that F1, monster truck and rally cars rarely compete.
    So here are the 3 groups I want:
    Text Book Class The code should be well laid out, commented, structured, follow and approved methodology and have full documentation.
    Freestyle This is how you code at home and only has occasional comments, there are a few messy bits and losely follows a methodology, documentation optional.
    Real World Work Place (RWWP) There is a design document but it bare little or and resemblence to the finished product and cyrptic comments. At random intervals the edjudicators will randomly change the specification and the competion .

    --
    In the not too distant future, next Sunday A.D.
    1. Re:I think there should be 3 styles of coding by cnettel · · Score: 1
      I wonder how fun a chess competition would be if each player would have to write a detailed spec on how they chose each move. Put another way: programming competitions with any restrictions of style easily puts much of the fun out of it.

      That said, TopCoder (as mentioned elsewhere) also have the design/development competitions, where you code real commercial code. I wouldn't keep doing that without the chance of payments, though. "Algorithmic" competitions, on the other hand, are fun in their own right.

  72. Great attempt trying to slip in a Family Guy line by boy_afraid · · Score: 0

    Not sure if I'm being pedantic or not, but the problem

    Lois: Ah, what's the worst that could happen?

    PETER ( to " Rock Me, Amadeus" ): I'm a tumor, I'm a tumor I'm a tumor, I'm a tumor, I'm a tumor I'm a tumor, I'm a tumor, I'm a tumor Oh, oh, oh, I'm a tumor.

    The Administration's plan for peace in the Middle East is shallow and pedantic. I agree. Shallow and pedantic.

    Peter: Mmm, I agree, as well. Shallow and pedantic. Hmm.

    Lois: Everything all right, Peter?

    Peter: Well Lois, since you asked, I find this meat loaf rather shallow and pedantic.

    Brian: What is this? You're gonna talk down to everyone just because you won a game of Trivial Pursuit?

    Peter: Perhaps.

    http://familyguy.wikicities.com/wiki/Petarded/Tran script

  73. team programming by c0reboarder · · Score: 1

    When I did my undergrad I spent my last 3 years doing the IBM competition. It was limited to a 3 person team, so many questions and a 5 hour time limit. Written materials allowed, no internet access or digital material (ie pre made code). My team got pretty Successful by our last year, just finishnig 7 seats out from going to worlds (not bad for a school nobody had ever heard of). Anyways, I found success in team programming competitions came from a bit of experience and building the right team. Since there was only one terminal you only need one person that knows the language you're coding. We had 1 guy that was truely amazing with C, and he did all the coding. the other two of us were much better problem solvers. The key was having a bit of practice and knowing how to pick out the easiest problems. Solve those as fast as you can, to rack up points quick. Then once we'd get a couple and be semi-stuck our coder would find one that wasn't too hard but would take a while to hack out. He'd work on that while the other 2 of us started tackling the difficult ones burning chalk on the blackboard and writing Pseudo code. By the time the easy one was done one of the other two could have pseudo code that the coder could quickly code while the other both problem solvers finished the partially solved one, or if too stuck could move on to any problems left. I think our team was successful because of balance, something any team benefits from. While I was a descent coder and so was the other problem solver, neither of us could code a doubly linked - circular linked list in a matter of minutes with no reference like the 3rd guy. However he would never have solved the problem to a point that he knew he needed that datastructure as fast as myself. So competative coding needs experience, balance of skills, and in a team situation, keep someone coding at all times if possible!

  74. Competitve Programming by Anonymous Coward · · Score: 0
  75. Dammit by Lifewish · · Score: 1

    I figured I'd get something wrong, but that's just... blatant :(

    --
    For the love of God, please learn to spell "ridiculous"!!!