IOI 2017
All 6 IOI tasks from 2017, 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.
Books
There are n books on a shelf, forming a permutation P[0..n-1]. Book at position i should be at position P[i]. A librarian starts at position S and can move left or right, picking up and placing books. Each step costs...
Nowruz
This is an output-only task. We are given a grid with rocks (`\#') and free cells (`.'). We may turn some free cells into bushes (`X'). The remaining free cells must form a maze, i.e.\ for every two free cells there i...
Prize
There are several prize types, numbered by value. Type 1 is the unique diamond. If there are k prizes of type t-1, then there are strictly more than k^2 prizes of type t. For a query on position i, the grader returns...
Simurgh
We are given a connected graph. The hidden set of royal roads is a spanning tree. For one query we submit any spanning tree and receive how many of its edges are royal.
Train
A train travels on a directed graph with n nodes and m edges. Each node is either a ``charging station'' (good) or not. Each node is controlled by either player A or player B. Player A wants the train to visit chargin...
Wiring
We have red and blue points on a line. Each point must be incident to at least one wire of the opposite color, and the cost of a wire is the distance between its endpoints.