Competitive Programming

IOI 2014

All 6 IOI tasks from 2014, organized as individual solution pages.

6 problem pages
6 editorials
6 C++ solutions
May 21, 2026 most recently updated solution

Problem set

Each entry below goes straight to the public problem page, with the statement, editorial, code, and raw resources kept together.

IOI 2014

Friend

A social network is built by adding people one at a time. Each new person i (i 1) has a ``host'' h_i (an existing person) and a protocol: IAmYourFriend (protocol 0): i becomes friends with h_i. MyFriendsAreYourFriends...

TeX C++
Open problem page
IOI 2014

Game

You play the role of an interactor. A player asks queries of the form ``Is there an edge between u and v?'' about a hidden graph on n nodes. You must answer each query consistently (there must exist some valid graph m...

TeX C++
Open problem page
IOI 2014

Gondola

A gondola system has n gondolas arranged in a circle, originally numbered 1, 2,, n. Over time, gondolas may break and be replaced: the k -th replacement gondola is numbered n + k. The circular order is preserved. Ther...

TeX C++
Open problem page
IOI 2014

Holiday

There are n cities on a line, each with a number of attractions a_i. You start at city S (0-indexed) and have D days. Each day you either move to an adjacent city or visit the current city (collecting its attractions,...

TeX C++
Open problem page
IOI 2014

Rail

There are n railway stations on a line, each of type C (``left-turn'') or type D (``right-turn''). Station 0 is type C at a known position. You may query the distance d(i,j) between any two stations. Using at most O(n...

TeX C++
Open problem page
IOI 2014

Wall

A wall has n columns, each initially of height 0. Process q operations: Add(l, r, h): for each i [l, r], set height[i] (height[i], h). Remove(l, r, h): for each i [l, r], set height[i] (height[i], h). Output the final...

TeX C++
Open problem page