+/- Rectangle 题目描述You are given four integers: $H, W, h$ and $w$. Determine whether there exists a matrix such that all of the following conditions are held, and construct one such matrix if the answer is positive: 2017-06-23 OI > Common Skill #Greedy #Constructive Algorithm
Memory and Scores 题目描述Memory and his friend Lexa are competing to get higher score in one popular computer game. Memory starts with score $a$ and Lexa starts with score $b$. In a single turn, both Memory and Lexa get s 2017-06-22 OI > Number Theory #Dynamic Programming #Prefix Sum #Combinatorics
Shrinking 题目描述Snuke can change a string $t$ of length $N$ into a string $t’$ of length $N-1$ under the following rule: for each $i \ (1 \le i \le N-1)$, the $i$-th character of $t’$ must be either the $i$-th o 2017-06-21 OI > Common Skill #Implementation
Colorful Hats 题目描述There are $N$ cats. We number them from $1$ through $N$. Each of the cats wears a hat. Cat $i$ says: “there are exactly $a_i$ different colors among the $N-1$ hats worn by the cats except me.” Det 2017-06-21 OI > Common Skill #Implementation
Imbalanced Array 题目描述You are given an array $a$ consisting of $n$ elements. The imbalance value of some subsegment of this array is the difference between the maximum and minimum element from this segment. The imbalan 2017-06-20 OI > Common Skill #Dynamic Programming #Union Find #Divide-and-Conquer #Monotonic Stack #Inclusion-Exclusion Principle
Really Big Numbers 题目描述Ivan likes to learn different things about numbers, but he is especially interested in really big numbers. Ivan thinks that a positive integer number $x$ is really big if the difference between $x 2017-06-19 OI > Common Skill #Binary-Search
Colored Balls 题目描述There are $n$ boxes with colored balls on the table. Colors are numbered from $1$ to $n$. $i$-th box contains $a_i$ balls, all of which have color $i$. You have to write a program that will divide 2017-06-18 OI > Common Skill #Greedy
Book Pile 题目描述There is a pile of $N$ books on the table. Two types of operations are performed over this pile: a book is added to the top of the pile, top $K$ books are rotated. If there are less than $K$ book 2017-06-17 OI > Data Structure #Deque #Self-Balancing Binary Search Tree
The Lazy Programmer 题目描述A new web-design studio, called SMART (Simply Masters of ART), employs two people. The first one is a web-designer and an executive director at the same time. The second one is a programmer. The d 2017-06-16 OI > Common Skill #Greedy #Priority Queue