Goodbye Souvenir 题目描述I won’t feel lonely, nor will I be sorrowful… not before everything is buried. A string of $n$ beads is left as the message of leaving. The beads are numbered from $1$ to $n$ from left to right, e 2017-09-19 OI > Common Skill #Binary Indexed Tree #Divide-and-Conquer
Destiny 题目描述Once, Leha found in the left pocket an array consisting of $n$ integers, and in the right pocket $q$ queries of the form $l$ $r$ $k$. If there are queries, then they must be answered. Answer for t 2017-09-18 OI > Common Skill #Prefix Sum #Persistent #Segment Tree
Choosing Balls 题目描述There are $n$ balls. They are arranged in a row. Each ball has a color (for convenience an integer) and an integer value. The color of the $i$-th ball is $c_i$ and the value of the $i$-th ball is 2017-08-08 OI > Common Skill #Dynamic Programming
Vasya's Function 题目描述Vasya is studying number theory. He has denoted a function $f(a, b)$ such that: $f(a, 0)=0$; $f(a, b)=1+f(a, b-(a, b))$, where $(a, b)$ is the greatest common divisor of $a$ and $b$. V 2017-08-07 OI > Number Theory #GCD-LCM #Prime
Visit of the Great 题目描述The Great Mushroom King descended to the dwarves, but not everyone managed to see him. Only the few chosen ones could see the King. We know that only $LCM(k^{2^l}+1, k^{2^{l+1}}+1, \ldots, k^{2^r} 2017-08-05 OI > Number Theory #GCD-LCM #Multiplicative Inverse
Sereja and Subsequences 题目描述Sereja has a sequence that consists of $n$ positive integers, $a_1, a_2, \ldots, a_n$. First Sereja took a piece of squared paper and wrote all distinct non-empty non-decreasing subsequences of se 2017-08-04 OI > Common Skill #Dynamic Programming #Binary Indexed Tree
Vasya and Shifts 题目描述Vasya has a set of $4n$ strings of equal length, consisting of lowercase English letters “a”, “b”, “c”, “d” and “e”. Moreover, the set is split into $n$ groups of $4$ equal strings each. Vasya als 2017-07-30 OI > Number Theory #Linear Basis
Strange Radiation 题目描述$n$ people are standing on a coordinate axis in points with positive integer coordinates strictly less than $10^6$. For each person we know in which direction (left or right) he is facing, and his 2017-07-27 OI > Common Skill #Binary-Search
Coin Troubles 题目描述In the Isle of Guernsey there are $n$ different types of coins. For each $i \ (1 \le i \le n)$, coin of type $i$ is worth $a_i$ cents. It is possible that $a_i=a_j$ for some $i$ and $j \ (i \ 2017-07-27 OI > Common Skill #Dynamic Programming #Topological-Sort
Cow Program 题目描述Farmer John has just given the cows a program to play with! The program contains two integer variables, $x$ and $y$, and performs the following operations on a sequence $a_1, a_2, \ldots, a_n$ of 2017-07-24 OI > Common Skill #Implementation #Depth-First-Search