The 29th International Olympiad in Informatics (IOI) 2017 was held in Tehran, Iran from 28th July to 4th August. The Malaysian team comprised Zi Song Yeoh, Jia Qing Tan, Jen Khai Yew and Zhi Wei Gan. The leaders were Yihang Ho and Chris Boo, and the visitors were Shien Jin Ong, ex-leader for the Malaysian team, and Mark Chang, the main sponsor of MIPS.

Mind-setting Camp

The trip was preceded by a week-long mind-setting camp, which was held at the Sungai Long Campus of Universiti Tunku Abdul Rahman (UTAR). Before departing for Tehran, all of us (leaders included) stayed at Parkway Inn in Sungai Long for 3 days for the purposes of bonding and getting to know one another better. The mood was kept light and hearty.


The flight to Tehran was a direct 8 hour flight via AirAsia X. The team touched down at the Imam Khomeini Airport at 1 am, and was greeted by our guide and soon-to-be good friend, Mahdi, with roses.

Traffic was surprisingly still heavy at that hour. We arrived at the Parsian Evin Hotel at approximately 6am Malaysian time. Unsurprisingly, we fell asleep as soon as we made physical contact with our beds.


The Evin Hotel is located near the foot of the Alborz mountains. The entire hotel was seemingly booked for the purposes of the IOI. Two recreation areas were set up in the hotel: one on the 1st floor, equipped with air hockey and foosball tables. This was to be the site of the entire Malaysian contingent’s (contestants, leaders, guests, everyone) defeat in first-to-three table tennis by Shien Jin. There was just too much spin.

The other recreation room was on the 4th floor, where there was an assortment of games, both electronic and tabletop. The games room was the perfect place to unwind before and after stressful contest days, and also a prime venue for intermingling with other contestants. Over a game of Quoridor, we learnt about the dizzying flight path taken by the participant from El Salvador.

A short sample of the games we played include: Pylos, Ingenious, Sushi Go!, Mascarade, Nox, etc. The board games collection was eclectic and varied, and more mystifyingly, changing from day to day. The cause: a man. Throughout the week we sometimes saw him wheeling around a pushcart full of games. He told us about the board games cafe he owned in Tehran, and would instruct us about the rules of this or that, remarking that so-and-so game was “very good, but only for two players”, with an earnest smile and the generosity of spirit of a true board games connoisseur.

Contest Days

On each contest day, the 300+ contestants from 84 countries gather in the contest hall which is spread out over 2 floors. A sense of anticipation hangs in the air before the start of each contest. As you may well know, there are two contest days, each consisting of 5 hours of contests.

Day 1

The problems were: Nowruz, Wiring and Toy Train.

Nowruz is the Persian New Year, and this problem is about building a tree on a 2d plane with blocked cells; the tree has to contain as many leaves as possible.

Wiring seems like a simple problem at first read, and is about connecting points of different colours using wires, and the goal is to minimize the length of wire used to complete the task.

Toy Train is about twins playing with a toy train and the winner is determined by whether the train gets stuck in a cycle with a charging station, or if it runs out of power eventually.

As an indication of how tough the problems were, the bronze cutoff for the Day 1 was only 50 points, as compared to 150 points for most years.

Day 2

The problems were: The Big Prize, Simurgh and Ancient Books.

The Big Prize was a problem that required you to find a diamond by asking how many better prizes there were on each side of a specific item with a limited number of queries, given the fact that the nature of the prizes were hidden from you. It appeared that all you needed was binary search (a widely known algorithm) to solve it, however Jen Khai had a square root decomposition solution which earned him 90 points.

Simurgh is a benevolent mythical bird in Iranian folklore. It was about finding a “Golden” spanning tree, by querying Simurgh which will then return the number of “Golden” edges in the queried set.

Ancient Books is about a librarian who wants to sort some books in an alphabetical order, however he can only carry one book at a time. The task was to minimize the number of steps he had to take to do so, presuming that each step brought him to another pedestal (on which originally the books were kept).

We are very proud that Zi Song Yeoh brought home a Bronze Medal.


We had the chance to taste many different types of Iranian food over the week that we were there. For example, food and drinks such as Doogh (a type of sour yoghurt drink) and Saffron rice.


The excursions were an amazing opportunity for us to explore Tehran. Our welcoming hosts organised tours to the Bird Garden, Gonbad Mina Planetarium, Nature Bridge, Dolphin Show, Milad Tower, Botanical Garden, Water Park, and the Grand Bazaar. The Milad tower was a spectacle to behold, towering 1400 feet above us. At the base of the tower, there was a luxury shopping mall, where we tasted some delicious Saffron ice cream.

The Grand Bazaar was unlike any other, with some corridors spanning up to 10km in length. We went on a great hunt to immerse ourselves in a true artifact of Iranian culture - tea houses. We walked a great distance, following the direction of friendly English-speaking pedestrians. When we finally stumbled upon the tea house, it was an amazing Iranian experience. Instead of having sugar cubes to sweeten our tea, we were given crystallized saffron sugar sticks.


On the day of the closing ceremony, those of us who opted for an early 5 am start had a very relaxed hike on a trail at Darband. The trail was scattered with small fruit stores and cafes, including one which sold particularly tasteful blackberries. We were back in the hotel by 8:30. The rest of the day was unhurried; We made sure our bags were packed and that we remembered the names of our new friends to add them on social media.

We left for the Closing Ceremony at the International Convention Center of Iran, and watched the show put together, which included performances and speeches littered in between the handing out of medals. The ceremony was followed by a dinner, and they served Iranian delicacies in addition to some of the food which had grown on us over the past week.

We left for Imam Khomeini Airport right after the dinner, and flew back to Malaysia, landing at KLIA2 in the afternoon.

Thank you to our wonderful hosts for such an amazing experience!