Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Did Pascal beat C++ at the 2010 International Olympiad in Informatics? (wired.com)
34 points by smharris65 on Nov 30, 2010 | hide | past | favorite | 25 comments


The question of programming languages used is one of the least interesting things in that article.


Maybe for some, but for me I was very surprised that the top contestant would use Pascal and do so well. And when the journalist specifically lists total lines of code in his article and makes it a point to differentiate the programming languages of the two contestants it was very interesting to me.


But the difference (at least in the example code shown) is entirely in the choice of algorithm. The better / shorter algorithm just happens to be in Pascal...


Actually, both programs use the same algorithm, but they represent its flow of control very differently. The Pascal program could be written elegantly in any language.


That's because Pascal was predominant programming language used in Soviet academia in the 90s and in many schools that's still the case.


I know personally some of the IOI gold medalists, and, as far as I can tell, they all use C++, though not all of them like it -- it is just that C++ has STL with set, heap and map, while C and Pascal do not. It is just time saver.

I once knew one crazy guy, who in his free time practiced implementing algorithms and data structures commonly used in such contests (e.g. AVL trees, Dijkstra, KMP), just to waste less time writing them down.


We all do that. Precious time is lost when you have to "figure out" how to write Dijkstra's in Java/C++. Technically, the ICPC allows you to bring a print out, but other competitions do not.


Just read the article today, which really had nothing to do with language wars, and everything to do with some really smart kids. I commend all the participants in these contests, and am a bit jealous of their skills.

I also really didn't like Kolstad's comment about "will he die a virgin." It reeked of extremely petty jealousy, and was just crass.


There are many disciplines in which many people have become known for their dedication and commitment: sports. art. music. People who are successful one of these fields are treated with reverence and respect for their attainment, and rightfully so. Yet I fear that hackers will forever stay the group where enthusiasm, talent and determination is met with stereotypical comments like this:

> “He was ahead for 98 percent of the competition. The question is,” Kolstad says slowly and with utter gravity, “will he die a virgin?”


And that was said by the US coach. He should know better.


This doesn't really translate to anything in the real world.

If the goal is to write code quickly, Pascal does beat C & C++. But there are tons of other languages that aren't available.


Choice of programming language doesn't matter much in competitive programming.

Say, Pascal (or sometimes Delphi dialect of it) is historically very popular in Russia / Belarus, it's still a primary language in schools.

However, lots of student teams participating in ACM ICPC moved to Java just because it has more data structures in its standard library and it can handle bignums out of the box, meaning you have more time to think about solutions instead of coding long division.


I did a much easier one of these sponsored by a state university with a team in high school when I was learning Java, it was fun. Though it's ridiculous that they should limit programming language choice so; it's not like it's hard to automate compilation/interpreting and diffing even with different compilers/interpreters. Are people worried that Python may have an "import problemsolution" available? Guess you should make the problems harder... (Yes, they can't support everything, but they should at least support a substantial fraction of languages on say http://projecteuler.net/index.php?section=statistics )


Actually, it is kind of hard to make a secure solution that takes arbitrary submitted source code, compiles it, runs it, and finally times it with high precision. Sandboxing in a VM is unfortunately not feasible since timing is very hard to do.

And as for the question if this is a legitimate paranoia: yes it is. Many contestants are very smart, and there have been hacks and security breaches in high-profile contests.


The real problem is, the time limit for most questions is 1 second, and pretty much all of managed environments take significant times to start, so they're out. But why ocaml or haskell aren't available, i don't know


I don't know, did it? Why ask the question in the headline instead of answering it?


This is one of the things I dislike most about this forum: people want to attract attention to their articles by changing titles.

The original title "Teen Mathletes Do Battle at Algorithm Olympics" is not much better, but at least describes correctly the subject.


I wasn't trying to attract attention to my post by changing the title. I just thought it was the most interesting part of the article. I was hoping to get feedback on why a contestant would be able to compete very well with Pascal over C++. If I posted using the original title how would I generate that specific discussion?


I was hoping to get feedback on why a contestant would be able to compete very well with Pascal over C++.

Because that's what he's been practicing with. CS courses in schools in Eastern Europe are tought in Pascal, or at least used to be.

In the end it's as interesting as the brand of chess pieces at a chess tournament. If you look at the solutions to Google Code Jam (http://www.go-hero.net/jam/10/languages/0) for example then you'll see that it's mostly disgusting code made of arrays and loops and you can do those in pretty much any language. People get good at algorithms by sitting down, learning and implementing them, not by sweating the choice of language.


Perhaps appending a "How" or "Why" to your title might have made your intention clearer.

And in answer to your question: meh, Pascal and C are pretty much the same damn language with a couple of minor changes, and C++ mostly just adds a bunch of junk which is useless for small projects.


Wu's solution for the Cluedo puzzle seems inefficient. Could've saved an array assignment by doing mur[] and wep[] at the same time since they are of the same length.

Also, there might be a bug in Wu's solution. It seems the first time through the while loop, the parameters for the Theory function are off by 1. i.e. m=6, l=10, w=6.


It's awesome seeing Rob Kolstad as the US coach. Some of remember him sponsoring the Junior Programming League for high school Plato accounts at the University of IL in the early mid-80s.


I kept bumming myself out reading the article by automatically going on and reading the answer to the problems.


sweet... reminds me days when i spend hours practicing simple algorithms on pascal. I bet very few ppl could type something like "for i:=1 to n do begin end;" faster back in that time...


You know it's something with math, when almost everyone in the picture is Asian.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: