Chefs Game
Chef loves that his cooks involve themselves in group activities. This month, Chef has involved his cooks in a rather very curious game. It involves all his cooks, standing in a circle. Each cook is given one integer to keep, which may be positive or negative (or zero). The sum of all the integers, given to the cooks, is positive.
D-Power Permutations
Let N be a positive integer and S = {1, 2, 3, ..., N}. For a given positive integer d the function f : S --> S is called d-power permutation if there exists a bijection g : S --> S such that g ( g ( ... g ( x ) ... ) ) = f(x) for each x from S , where g is repeated exactly d times.
You are given some bijection f : S --> S and a positive integer D. You need to find the number of those d <= D such that f is d-power permutation.
Sines Sum Queries
You are given a sequence of integers A0, A1, ..., AN-1. Initially Ai=i for all i. You need to perform some strange queries with it. Each query has the form "L R D" where 0 <= L <= R < N and D is an integer. If D=0 then you need to find the sum of sines of the numbers AL, AL+1, ..., AR that is sin AL + ... + sin AR.
Attack of the Clones
A boolean function is a function of the form f: Bn -> B, where B = {0, 1} and n is a non-negative integer called the arity of the function. Some Boolean functions are projections: pnk(x1, ..., xn) = xk. And given an m-ary function f, and n-ary functions g1, ..., gm, we can construct another n-ary function: h(x1, ..., xn) = f(g1(x1, ..., xn), ..., gm(x1, ..., xn)), called their composition.
| ‹ previous | 8 of 25 | next › |