Cerinta completa Johnny is playing with a large binary number, . The number is so large that it needs to be compressed into an array of integers, , where the values in even indices () represent some number of consecutive
Two Subarrays
Cerinta completa Consider an array, , of integers. We define the following terms: Subsequence A subsequence of is an array that’s derived by removing zero or more elements from without changing the order of the remaining elements. Note that a
Tree Splitting
Cerinta completa Given a tree with vertices numbered from to . You need to process queries. Each query represents a vertex number encoded in the following way: Queries are encoded in the following way: Let, be the query and be
Training the army
Cerinta completa In the magical kingdom of Kasukabe, people strive to possess skillsets. Higher the number of skillset present among the people, the more content people will be. There are types of skill set present and initially there exists people
Toll Cost Digits
Cerinta completa The mayor of Farzville is studying the city’s road system to find ways of improving its traffic conditions. Farzville’s road system consists of junctions connected by bidirectional toll roads, where the toll road connects junctions and . In
The Story of a Tree
Cerinta completa One day Bob drew a tree, , with nodes and edges on a piece of paper. He soon discovered that parent of a node depends on the root of the tree. The following images shows an example of
The Great XOR
Cerinta completa Given a long integer , count the number of values of satisfying the following conditions: where and are long integers and is the bitwise XOR operator. You are given queries, and each query is in the form of
Tara’s Beautiful Permutations
Cerinta completa Tara has an array, , consisting of integers where each integer occurs at most times in the array. Let’s define to be a permutation of where is the element of permutation . Tara thinks a permutation is beautiful
Super Functional Strings
Cerinta completa We define a function, , on a string, , as follows: where: denotes the number of characters in string . denotes the number of distinct characters in string . Consuela loves creating string challenges and she needs your
Summing Pieces
Cerinta completa Consider an array, , of length . We can split into contiguous segments called pieces and store them as another array, . For example, if , we have the following arrays of pieces: contains three -element pieces. contains
