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
Xoring Ninja
Cerinta completa An XOR operation on a list is defined here as the xor () of all its elements (e.g.: ). The of set is defined here as the sum of the s of all non-empty subsets of known as
XOR Subsequences
Cerinta completa Consider an array, , of integers (). We take all consecutive subsequences of integers from the array that satisfy the following: For example, if our subsequences will be: For each subsequence, we apply the bitwise XOR () operation
Winning Lottery Ticket
Cerinta completa The SuperBowl Lottery is about to commence, and there are several lottery tickets being sold, and each ticket is identified with a ticket ID. In one of the many winning scenarios in the Superbowl lottery, a winning pair
