← All posts
← →

Baltic Olympiad 2002: problems in the Lithuanian parliament

2002

In April 2002 I went to the Baltic Olympiad in Informatics in Vilnius as part of the Latvian team. My code was LVA03. Everything that happened there survives thanks to my teammate Sergey Kozlovich: right afterwards he wrote a detailed report on his site prg.times.lv — “a guide for future olympiad contestants going beyond our small but proud republic”. What follows is based on his report and my memory.

The team. Latvia was represented by six people: Alexander Belov, Karlis Gandis, me, Sergey Kozlovich, Janis Ojers and Artur Verza. The team leaders were Mārtiņš Opmanis and Māris Vītiņš, and the team’s coach back in Riga was Sergey Melnik of Progmeistars.

How we made the team. You had to get through three rounds of the Latvian olympiad — school, district, national — and do well in the selection contest. All of us could have done much better in it. My program printed the answer in a column instead of a row. Sasha Belov swapped two lines of the output file and got zero instead of a hundred for the problem PARTY. Sergey’s program for TRANSFER printed one permutation too few, and for CARGO it printed only three cities on every test, even though it found the hard part, the required value, correctly. Many of us were tearing our hair out, and Sasha consoled us: “The selection exists only so you can pass it.”

The trip. Two contestants who weren’t yet 18 were taken off at the border: they didn’t have their birth certificates with them. The next day that border crew got a reprimand from the Ministry of Education, and the two, now with all the papers, made it across. Sergey summed it up with a Russian classic: “Without a paper you’re a bug; with a paper you’re a man.” To prove a person was born you need a piece of paper, not the living person — and you couldn’t learn that from the law books, because the law had changed the day before. Māris Vītiņš met them in Riga and sorted it out. They missed the opening ceremony — and, as Sergey wrote, lost nothing.

The opening. Long and hard on the contestants: Lithuanian folk songs and dances and plenty of speeches by Lithuanian politicians. You can see from the photo how Sasha and I felt about it.

Opening ceremony of BOI 2002

The opening ceremony. Photo from Sergey Kozlovich’s report.

After the opening came the trial session — one problem to get used to the computers and software; it didn’t count. Everyone from Latvia who tried it got zero — except Kārlis, who got 8 out of 12.

An olympiad in parliament. We competed in the building of the Lithuanian Seimas: everyone went through a metal detector at the entrance. We had lunch like members of parliament — in the Seimas. And while we were writing programs, tours were led through the building: people were curious to see contestants at work.

The contest hall in the Seimas

“This is how everyone wrote programs.” Photo from Sergey Kozlovich’s report.

Software. Windows 98, which froze on contestants several times during the rounds, and Free Pascal 1.0.4 with the buggiest IDE we knew: the debugger wouldn’t start a second time, and copy, paste and undo didn’t work right. Why they didn’t install the already released 1.0.6 beta without those bugs, or good old Borland Pascal 7.0, nobody knew. You could still write programs, though.

The problems. Day 0: stacks. Day 1: triangles, tennis, speed. Day 2: robots, bic, L-game.

Day one’s glitch. At five o’clock Mārtiņš brought the test results, and we were all surprised how few points we had. When the tests were checked by hand, it turned out the organisers’ grader was broken: it answered WRONG RESULT to correct output. The real results arrived only the next morning.

Letters to Riga. We emailed our results to Sergey Melnik — but without names, so he didn’t know who had scored what. He nearly killed us for that afterwards.

Free time. We played cards — both in the Seimas and at the hotel. We walked around Vilnius at night. In a toy shop we bought our team leader Mārtiņš a mask. We were taken on a tour of Vilnius in a bus without a roof — it got especially fun when it started raining.

Playing cards in the Seimas

Cards in the Seimas. Photo by Alexander Belov.

Results. First places went to the Poles and the Estonians. Ours: Sergey and Sasha — second place, Kārlis and I — third, Jānis and Artur — participation certificates. At the closing ceremony the composer Giedrius Kuprevičius played the synthesiser for a long time, and then some computer graphics effects were shown. They ran under Windows 2000: first nobody could get the cursor off the screen, then the screensaver kicked in a few times, and finally an error dialog popped up. The whole hall applauded.

We left a day earlier than the organisers had planned, on Saturday evening: some of us had to write Professor Andžāns’s open mathematics olympiad on Sunday.

Later that year came the bracket problem at the Latvian olympiad and IOI gold in Korea.

What I took from it: the output format is part of the solution. Printing the answer in a column instead of a row cost me points in the selection, and Sasha a hundred for two swapped lines. A grader won’t accept a correct answer printed the wrong way.