So, I passed the Online Final Round
Thursday, September 29th, 2005I’ve passed the Online Final Round of the Star Baidu Programming contest. Honestly, I don’t know how
The contest itself is comprised of two problems, to be solved within 10 hours. I did the first one for six and a half hours, and the second one for three and a half hours. And I expected to get a ‘0′ for the contest.
The first problem is about hyperlinks from one website to another. It’s basically a graph theory problem, and I can tell you, that’s about all I know about the problem. And I didn’t know anything about graph theory either. All I know is that given a set of data containing a directed graph with weighted edges, we are to first divide them into connected subgraphs, then take away the edges one by one such that: 1. each resulting subgraph doesn’t have a connection with other subgraphs, 2. in each subgraph, there is one node from which we can go to any other node in the graph by following the edges and every node in a subgraph can be visited with at least one other node in the same subgraph, and 3. the sum of the weights of the edges of each subgraph is minimal.
Of course, I’ve never formally studied graph theory, so I didn’t know what to do first. Then I thought of a way to solve the problem: 1. given the data, for each node, find the edge directed to it, which has the smallest weight (this way we have subgraphs), then 2. add up the weights in each subgraph and output. I thought this would be correct (yes with a simple test case), but when I tested another test case, it’s wrong (at least I thought it was wrong). The problem lies with the algorithm itself, since (try not to laugh very hard here) if we do step 1 in the algorithm above, we could easily end up with subgraphs which are actually connected to each other in the first place. There was not much time left when I discovered this, so I decided to just give up (of course I submitted) and try the second problem.
The second problem is a decision-making tool. We are given a set of rules and facts, and from that data we are to logically predict the result. There are two modes of operation, one is the goal-oriented mode, in which from the facts given, we are to use the rules and facts to determine if a given goal is achievable. The other one is data-oriented mode, in which we are given a goal and try to work backwards, also to see whether it is achievable. In both modes of operation, we are to output the order in which the rules are used.
I thought this was easy — I was wrong. At least my computer told me that when there was just 5 minutes left and when I tested my program (I only finished the goal-oriented part), it always segfaulted. So I thougt, what the heck, let’s submit. And then I forgot all about the contest, since I knew I wouldn’t make it.
So on the 28th I didn’t check my score. But in the afternoon a Baidu representative called me. He told me I’ve passed the Online Final Round. So I checked their website just now, and found that I got 50 marks, which puts me in the 26th place.
Now I’m left wondering how I could have got that score, since I can’t even solve even half a problem correctly. I really don’t know how, I think they must’ve got a mix-up or something…


