
Substitutes in Number
Andrew and Eugene are playing a game. Initially, Andrew has string s, consisting of digits. Eugene sends Andrew multiple queries of type ” d i → t i“, that means “replace […]
Andrew and Eugene are playing a game. Initially, Andrew has string s, consisting of digits. Eugene sends Andrew multiple queries of type ” d i → t i“, that means “replace […]
Peter had a cube with non-zero length of a side. He put the cube into three-dimensional space in such a way that its vertices lay […]
Roma found a new character in the game “World of Darkraft – 2”. In this game the character fights monsters, finds the more and more […]
Ann has recently started commuting by subway. We know that a one ride subway ticket costs a rubles. Besides, Ann found out that she can buy a […]
The start of the new academic year brought about the problem of accommodation students into dormitories. One of such dormitories has a a × b square meter wonder room. […]
You’ve got array a[1], a[2], …, a[n], consisting of n integers. Count the number of ways to split all the elements of the array into three contiguous parts so that the […]
Peter has a sequence of integers a 1, a 2, …, a n. Peter wants all numbers in the sequence to equal h. He can perform the operation of “adding one on the […]
There are n employees working in company “X” (let’s number them from 1 to n for convenience). Initially the employees didn’t have any relationships among each other. On each […]
One way to create a task is to learn from math. You can generate some random math statement or modify some theorems to get something […]
One way to create a task is to learn from life. You can choose some experience in real life, formalize it and then you will […]
A way to make a new task is to make it nondeterministic or probabilistic. For example, the hard task of Topcoder SRM 595, Constellation, is […]
There is an easy way to obtain a new task from an old one called “Inverse the problem”: we give an output of the original […]
One way to create task is to learn from game. You should pick a game and focus on part of the mechanic of that game, […]
Captain Marmot wants to prepare a huge and important battle against his enemy, Captain Snake. For this battle he has n regiments, each consisting of 4 moles. Initially, each […]
Mole is hungry again. He found one ant colony, consisting of n ants, ordered in a row. Each ant i (1 ≤ i ≤ n) has a strength s i. In order to make his […]
Permutation p is an ordered set of integers p 1, p 2, …, p n, consisting of n distinct positive integers not larger than n. We’ll denote as n the length of permutation p 1, p 2, …, p n. Your task is to find such […]