Cerinta completa Kitty has a tree, , consisting of nodes where each node is uniquely labeled from to . Her friend Alex gave her sets, where each set contains distinct nodes. Kitty needs to calculate the following expression on each
Functional Palindromes
Cerinta completa Let’s define a function, , on a string, , of length as follows: where denotes the ASCII value of the character in string , , and . Nikita has a string, , consisting of lowercase letters that she
Find the permutation
Cerinta completa Consider a permutation, , of integers from to . Let’s determine the of to be the minimum absolute difference between any consecutive integers in : Generate a lexicographically sorted list of all permutations of length having a maximal
Find Maximum Index Product
Cerinta completa You are given a list of numbers . For each element at position (), we define and as: = closest index j such that j < i and . If no such j exists then = 0. =
Dynamic Array
Cerinta completa Declare a 2-dimensional array, , with empty arrays, all zero-indexed. Declare an integer, , and initialize it to 0. You need to process two types of queries: Query: Compute . Append the integer to . Query: Compute .
Costly Intervals
Cerinta completa Given an array, your goal is to find, for each element, the largest subarray containing it whose cost is at least . Specifically, let be an array of length , and let be the subarray from index to
Box Operations
Cerinta completa Alice purchased an array of wooden boxes that she indexed from to . On each box , she writes an integer that we’ll refer to as . Alice wants you to perform operations on the array of boxes.
Beautiful Segments
Cerinta completa You are given an array, , consisting of integers. A segment, , is beautiful if and only if the bitwise AND of all numbers in with indices in the inclusive range of is not greater than . In
Array and simple queries
Cerinta completa Given two numbers and . indicates the number of elements in the array and indicates number of queries. You need to perform two types of queries on the array . You are given queries. Queries can be of
Arithmetic Progressions
Cerinta completa Let denote an arithmetic progression (AP) with first term and common difference , i.e. denotes an infinite . You are given APs => . Let denote the sequence obtained by multiplying these APs. Multiplication of two sequences is
