Thursday, March 15, 2007

ICPC World Finals 2007 Day 4, Awards ceremony, and Surprise event

Today is the contest day. After the breakfast, Bill Poucher wandered around talking with the teams bringing the ACM ICPC Trophy with him. Many teams got chance to take picture with him and the Trophy as a "fake" champion. The spectators were invited to enter to the contest room at the back stage and then Bill Poucher invited all the team to enter the contest room with him. The background music that surrounds the contest room was very good (I don't know the title of the music, can anyone tell me?)


These pics were taken by our coach (which categorized as spectators)
There were a good music played in the background


Bill Poucher and Shingo Takada then officially start the ACM ICPC World Final 2007

As usual, Kurniady starts by preparing the computers with "batch" files to automate the compiling and testing because he is who understand the linux environment the most. The settings were more or less the same with one in Taiwan, very convenient. Andoko and I start reading the problem statements. There are 10 (A to J) problems presented in this World Final. The complete problem set can be downloaded here.

First accepted Problem B - Containers (24 Minutes)

I don't know why, when I first read this problem I didn't quite get the problem statement meaning. I asked Andoko to explain the problem statement to me according to his understanding. Don't know why, every time he finished his explanation (and I asked some cases to verify my understanding) I almost always want to code it right away.

This is the simplified problem statement: Given a word on a line consist of N (0 < N < 1001) letters (A..Z). One by one, we have to put these letters into M stacks with a constraint: if the stack is not empty, the letter inserted into that stack can only be smaller than or equal to the top of that stack. The question is: What is the minimum value of M?

I came up with a greedy + binary search algorithm for this problem: Binary search the M, and greedily test the solution. The greedy test is like this: if you have M stacks and you have to put a letter into one of these M stacks, choose the stack which its top has the closest value with the letter otherwise you will lose something.

Andoko doubt that this method will work, but I coded and submitted it anyway and got it Accepted, Yayy! I looked at the standings, we got 4th rank! Hmm.. a good start!


The ranklist showed that we were ranked 6. There must be 2 teams got two accepted problem this time, what a fast competition
Our yesterday's picture at the practice session showed up whenever we solved a problem (the same with other teams)

Second accepted Problem G - Network (209 Minutes)

Wow.. 185 Minutes idle?!? (its 185 minutes elapsed since problem B got accepted).

I really was having a bad day here! The problem was tricky because there is a word in a problem statement that easy to miss. The word is "consecutive". This generates a lot of discussion between Kurniady and Andoko.

The problem statement is this: There are N (1<=N<=5) messages numbered 1 to N to be sent over network. The N messages were split into M packets. Each packet is labeled with packet ID (which is the message number itself), the starting byte and the ending byte position for the packet. You are given the total size of each of the N messages, and the arrival order of the M packets. You have to determine the minimum size of the buffer needed in order to reconstruct the message. Any packet can go into the buffer and leave in any order.

Somewhere in the problem statement, there is a tiny word "consecutive" which means if you are currently constructing message number 3, you cannot in the same time constructing other messages! The other messages must go into the buffer. If only the word "consecutive" doesn't exist, it would make the problem much simpler (and we doubt that World Finals problem should be that easy): it become a simulation problem.

Because of the "consecutive" constraint, we need to permutate the order of the messages get constructed (5! possible permutation). Still, the problem was very easy (just brute-force). But since I was having a bad day, I got Runtime Error for the first submission (it was because of totally logic error and therefore wrong code). The second submission on this problem, I got Wrong Answer because of the logic error again (my algorithm didn't follow the "consecutive" constraint). At last, the third time after Andoko made several test cases and verified the answer, it got Accepted.

That's why it take 185 minutes! It appeared not only our team having this kind of problem, many teams didn't see the "consecutive" word (by the time they realize it, they need to re-code everything). See this TopCoder Thread for that discussion.


In the mean time, many teams already got accepted 3 to 4 problems

Third accepted Problem A+ - Consanguine Calculations (229 Minutes)

Wow, only 20 minutes elapsed, we got this problem accepted!?! Nope... Actually this problem has the worst story. We need 4 submissions to get it Accepted. Let me describe the silliness one by one.

The simplified problem statement: Given two parents' "ABO Blood Type" (A, B, AB, O) and Rh factor (+, -), determine their children's possible Blood Type and Rh Factor. Whattt?!? it's just another brute-force problem! Of course with added difficulties: you may be given one parent and his child Blood Type and Rh Factor, determine the other parent's Blood Type and Rh Factor. And also, there is some "nasty" (as misof often said) conversion between the Blood Type and the actual combination (A means AA and AO, B means BB and BO, Rh + means ++ and +-). We have to carefully convert the one to many combinations of the Blood Type when reading the input and convert it again from many to one when outputting the Blood Type and Rh factors.

I coded this problem somewhere between the frustrations of RTE and WA of problem G above, hence made me a little paranoid (I should've delegate this coding to Andoko!). So, my fear come true, we got WA for the first submission for this problem. It takes a long time to figure out the bug, since the code is really long! (I should've coded it in Ruby: no code, no error! and make me smarter than I think I am). Then after sometime, we found the bug: I forgot to convert the many to one for the output! Actually I was not forget, but the remove duplicates must be done twice: remove combinations duplicates and after convert it to Blood Types remove the duplicates again (I miss this second step). However, we still got WA! At this time, all of us became paranoid! We started making delusions! We thought the "sentinel" is wrongly handled: the "E N D" could be "E E E" or "E D N" or any thing... so we fix that and actually resubmit it \LOL. Of course this will get another WA :P but we have to make sure :D (entering "WA gak bayar mode").

Just after we got problem G accepted, Andoko instruct me to generate all possible input and print the output. He intended to check it one by one. Not long after I generate the input and run it, there appears the bug: The children's Blood Type is EMPTY! Hore, found the bug! The bug is there because of the second fix I made (the remove duplicate things). I forgot to update the code for a single Blood Type, what a silly and unnecessary mistake!.


The current standing: Our team got 49th rank with 3 solved problems
And the statistics for each problems also shown

There was about 71 minutes left (the contest were 5 hours). We attempt to solve 2 more problems (Problem F and C) and it seemed to be not a good idea since the time left were too short. If only everything went well on the first 3 problems, maybe I can get problem F accepted. Since it only need complete-search (A*) algorithm to solve it and I've solved many kinds of problem like that before. The "nasty" things about these world finals problem set is that it requires you to do a lot of coding but the algorithm itself is just brute-force, greedy, complete-search. I'm disappointed with the problem set.

Then the contest ends. By the time the contest ends, I really disappointed with the result. We should've done better than this! In the same TopCoder Thread I mentioned before, there were some teams also have disappointments with the "taste" of the problem sets.


Only 3 balloons :(
ardiankp's team approached us for explanation of problem G
Andoko told every scientific process he had with Kurniady to solve problem G
The culprit is the word "consecutive"

After the contest ends, we met sindu (the Indonesian TopCoder) at the outside of the competition room. Thanks sindu for coming :) Also in the afternoon we met Rudy Raymond Harry, Indonesian that works for IBM Research Tokyo. We discussed how life at IBM Research is.

Around 5PM, the contest results were up and we assembled in the competition room again for the Awards Ceremony.

The Judges decides the cut-off line for the ranks based on the number of solved problems and time. See my previous blog post for the contest results. The Top 12 teams were called on to the podium to receive awards. The photos of each 12 teams can be found in baylor site

Warsaw University got the World Champion! Congratulations!


After the Award Ceremony we had dinner.
Ainun Najib participate in singing during dinner (Left).
Crowds sang Y.M.C.A (Right)

Bill Poucher also sang and then invited us all to the Surprise event. The surprise event was Chinese Acrobatic performances, Pickpocket Entertainer Lecturer, Bob Arno, Piano Playing Jugglers, Wally Eastwood, and another Chinese Acrobatic performance.


The IBM's Celebration, the surprise event, opened with drum performance


The first performance is Chinese World Class Acrobatics


The second is Pickpocket Entertainer Lecturer Bob Arno
See the part of his action below


Whose "Cheap" watches are these belong to?!? You go to IBM using these watches!?!


I'm just warming up here!


Are you missing your wallet? (after went off the stage, he didn't realize that his tie was stolen)


Ok, whose underwear should I steal?


Bob Arno: "Relax, I won't TOUCH anything."
This is funny because John Clevenger said this repeatedly in practice session: "Do not TOUCH anything!".
Hearing Bob Arno saying "I won't TOUCH anything" made the audience laughing hard. It's just clicks!


Whoops.. my underwear!


Thank you very much Bob Arno!



Wally Eastwood, World Fastest Jugglers


Continued with another Chinese Acrobatics


Thank you very much for all the performers, I enjoyed the show!

Next : Day 5, Breakfast and leave (March 16, 2007)

Back to : Day 3, Practice sessions, Japanese Cultural Experience, and CyberCafe (March 14, 2007)



Wednesday, March 14, 2007

ICPC World Finals 2007 Day 3, Practice sessions, Japanese Cultural Experience, and CyberCafe

Today is the opening ceremony of the ACM ICPC 2007 World Final followed by two Practice Sessions. In the afternoon, we can try Japanese Cultural Experince (Shodo, Zazen, Origami, Aikido, Anime) and come ango for the CyberCafe.


One by one, the teams went into this room.


This is our seat. The camera crew took pictures of every team for tomorrow's contest.
The picture at the right will be shown (tomorrow) if we solved a problem


The ACM ICPC World Final is officially opened by Shingo Takada, the ACM ICPC 2007 World Final Contest Director


One by one, the board of ACM ICPC gave Greetings. The board consists of ACM Japan Chapter,
IBM Tokyo Research Lab, ACM, ICPC, IBM Executive Sponsor, UPE, World Finals Director,
Minister of State for Innovation, and IPSJ.


There were two performances during the Greetings:
The left is the Japan traditional dance for motivation
The right is the Japan traditional "Guitar" music which has unique sound


Bill Poucher, the Executive Director of ACM ICPC, gave awards to the board and volunteers for making this event successful
Then the Practice Session 1 begins


The Chief Judge answered the Question and Answer session after Practice Session 1 was over.
There were interesting announcements: Some of the teams try to hack the network/system,
also some of the teams were kicked off the practice session standings.
(Ini ada kejadian lucu: waktu kita di Taiwan, kan practice sessionnya gak dibatesin jumlah submission
jadi kita bisa submit ke 9 problems dan AC semua, otomatis kita jadi nomor 1 di practice session standings.
Nah, Lacotix keliatannya gak mau kalah lagi seperti di practice session Taiwan waktu itu, jadi mereka submit
sebanyak2nya ke semua problems. Tapi di World Final practice script hanya memperbolehkan submit ke salah satu problem!
Alhasil si Lacotix ditendang dari Standings \LOL)


Practice Session 2 continued after the Question and Answer Session
All teams left their Team Notebooks for inspection


The rest of the afternoon, there were Japanese Cultural Experience (Shodo, Zazen, Origami, Aikido, Anime)

A little description about the Japanese Cultural Experience:

  • Shodo (Japanese Calligraphy), this showed us how to write the characters. One can tell the spirit/emotion of the writer just by looking at the writing. At the end, we were allowed to write our own and take home the writing as souvenirs.
  • Zazen (Meditation), this is where you enter the "State of Nothingness". It's to empty your mind, hoping that new ideas can come up.
  • Anime (Graphic arts), I only took a quick look for this so I can't tell much about it.
  • Aikido (Self Defense Martial Arts), two kinds of moves were demonstrated and practiced in this experience. One is when you were caught from the back, and second is when your arm was caught. The moves show how to escape after get caught.
  • Origami (Paper folding), this tells you how to fold paper into some kind of form (birds, mountains, person, tea cup, etc... see the picture above).

I tried the Aikido, Zazen, Anime (at a glance), and Shodo. So I learned a bit how to escape, how to enter the "State of Nothingness" and how to write characters.


While waiting for Zazen (Meditation), I played chess with Kurniady :)
Then we have dinner at the Hotel


After dinner we went to CyberCafe to continue the second round with Kurniady
Then with Andoko. (hati2 ama mulut berbisanya Andoko, jangan sampe terhanyut, pasti kalah)
(Waktu maen ama ndok banyak banget undo nya \LOL)

Next : Day 4, ACM-ICPC World Final Contest, Awards ceremony, and Surprise event (March 15, 2007)

Back to : Day 2, IBM Tech Trek presentations and excursion to Disney Sea (March 13, 2007)