IOI 1991
All 3 IOI tasks from 1991, 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.
Island
This is the classic connected-components-on-a-grid problem, solved by flood fill. Algorithm Iterate through every cell (i, j) in the grid. When an unvisited land cell is found, increment the island counter and perform...
Mangoes
This is a weighted interval scheduling problem. Each tree defines a job with interval [d_i, d_i + k - 1] and weight a_i. We must select a set of jobs (at most one per day) to maximize total weight. Greedy with Max-Hea...
Matrix Game
Minimax with Bitmask Memoization This is a two-player zero-sum game solved by minimax: State: A pair of bitmasks $(rowMask, colMask)$ indicating which rows and columns remain, plus a boolean for whose turn it is. Tran...