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.

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

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