IOI 2014
All 6 IOI tasks from 2014, organized as individual solution pages.
Problem set
Each entry below goes straight to the public problem page, with the statement, editorial, code, and raw resources kept together.
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...
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...
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...
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,...
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...
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...