Tree Coordinates

Cerinta completa We consider metric space to be a pair, , where is a set and such that the following conditions hold: where is the distance between points and . Let’s define the product of two metric spaces, , to

The crazy helix

Cerinta completa Natural numbers from 1 to N have been placed in an increasing order over some helix ( a circular structure ). When the helix starts rotating, it is easy to find out The position of a given number

Starfleet

Cerinta completa In a galaxy far away, there is a constant battle between the republic and the droid army. The droid army decided to launch their final attack on the republic. They have N space-fighters. Initially the ith fighter is

Sum of the Maximums

Cerinta completa Alexey is playing with an array, , of integers. His friend, Ivan, asks him to calculate the sum of the maximum values for all subsegments of . More formally, he wants Alexey to find . Alexey solved Ivan’s

Unique Colors

Cerinta completa You are given an unrooted tree of nodes numbered from to . Each node has a color, . Let be the number of different colors in the path between node and node . For each node , calculate

Square-Ten Tree

Cerinta completa The square-ten tree decomposition of an array is defined as follows: The lowest () level of the square-ten tree consists of single array elements in their natural order. The level (starting from ) of the square-ten tree consists