Competitors wrote computer programs to solve eight problems, such as finding the longest route through a maze without ever crossing your path.Competitors wrote computer programs to solve eight problems, such as finding the longest route through a maze without ever crossing your path. (CBC)Canada is expected to hold its own when gold, silver and bronze medals are awarded to the world's top high school computer whizzes Friday in Waterloo, Ont.

The medal ceremony will close the 22nd International Olympiad in Informatics, which launched on Aug. 14 with Canada as host for the first time.

The annual competition drew 310 competitors from 81 countries this year — 301 boys and just nine girls. On Monday and Wednesday, the two competition days, they spent five hours daily writing computer problems to solve eight problems, such as finding the longest route through a maze without ever crossing your path.

Flat-screen computer monitors glowed within a grid of four-workstation clusters arranged neatly in an enormous gym. Competitors stared intensely at the screens, gnawed on their pens, scratched their heads and typed furiously.

Team Canada member Zhi Qiang Liu admitted the events aren't great spectator sports.

'The important thing is the medal,' says Amno Abo Turkia of Team Libya.'The important thing is the medal,' says Amno Abo Turkia of Team Libya. (CBC)

"Other people, when they look at us compete, they're like, 'They're not doing anything except typing on the keyboards," he said. "But for us, we're really squeezing the juice out of our brain. I mean, we're doing everything we can — trying everything possible — to solve these problems."

For Amna Abo Turkia of Team Libya — a notably all-female team — it's not trying your best that counts most. "The important thing is the medal," she said.

Cheating hack attempted

One student's computer was shut down after he appeared to cheat by trying to hack the system.

Organizer Troy Vasiga said similar attempts have been made before in the competition's 22-year history.

"Kids, you know — they want to push the limits to see what they can and can't do," he said. "But the rules are clearly stated."

Unofficial scoreboards were posted after each day's competition, so competitors already know what to expect on Friday.

Jacob Plachta, member of Team Canada, said the host country did well.

"We've a gold, silver and two bronze, so it's one of the best years for the Canadian team."

With files from Philip Lee-Shanok