Cerinta completa White Falcon was amazed by what she can do with heavy-light decomposition on trees. As a resut, she wants to improve her expertise on heavy-light decomposition. Her teacher gave her an another assignment which requires path updates. As
Coolguy and Two Subsequences
Cerinta completa Coolguy gives you a simple problem. Given a -indexed array, , containing elements, what will be after this pseudocode is implemented and executed? Print . //f(a, b) is a function that returns the minimum element in interval [a,
Company Retreat
Cerinta completa The LRT Company has employees. Each employee has a unique ID number from to , where the director’s ID is number . Every employee in the company has exactly one immediate supervisor — except the director, who has
Heavy Light White Falcon
Cerinta completa Our lazy white falcon finally decided to learn heavy-light decomposition. Her teacher gave an assignment for her to practice this new technique. Please help her by solving this problem. You are given a tree with nodes and each
BST maintenance
Cerinta completa Consider a binary search tree T which is initially empty. Also, consider the first N positive integers {1, 2, 3, 4, 5, ….., N} and its permutation P {a1, a2, …, aN}. If we start adding these numbers
Array Pairs
Cerinta completa Consider an array of integers, . Find and print the total number of pairs such that where . Input Format The first line contains an integer, , denoting the number of elements in the array. The second line
Find the Running Median
Cerinta completa The median of a set of integers is the midpoint value of the data set for which an equal number of integers are less than and greater than the value. To find the median, you must first sort
Burger Happiness
Cerinta completa In Burger Town new burger restaurants will be opened! Concretely, restaurants will open in days, while restaurant will be opened on day and will be located at . The town should be imagined as an one dimensional line
Fibonacci Numbers Tree
Cerinta completa Shashank loves trees and math. He has a rooted tree, , consisting of nodes uniquely labeled with integers in the inclusive range . The node labeled as is the root node of tree , and each node in
2D Array – DS
Cerinta completa Given a 2D array, , an hourglass is a subset of values with indices falling in the following pattern: a b c d e f g There are hourglasses in a array. The is the sum of the
