Cerinta completa Consider the following game for two players: There are two strings A and B. Initially, some strings A’ and B’ are written on the sheet of paper. A’ is always a substring of A and B’ is always
Turn Off the Lights
Cerinta completa There are bulbs in a straight line, numbered from to . Each bulb has a button associated with it, and there is a cost, , for pressing this button. When some button is pressed, all the bulbs at
Task Scheduling
Cerinta completa You have a long list of tasks that you need to do today. To accomplish task you need minutes, and the deadline for this task is . You need not complete a task at a stretch. You can
Superman Celebrates Diwali
Cerinta completa Superman has been invited to India to celebrate Diwali. Unfortunately, on his arrival he learns that he has been invited mainly to help rescue people from a fire accident that has happened in a posh residential locale of
XOR Matrix
Cerinta completa Consider a zero-indexed matrix with rows and columns, where each row is filled gradually. Given the first row of the matrix, you can generate the elements in the subsequent rows using the following formula: Each row is generated
Tree Flow
Cerinta completa Recall that a tree is an undirected, connected acyclic graph. We have a weighted tree, , with vertices; let be the total sum of edge weights on the path between nodes and . Let’s consider all the matrices,
Viral Advertising
Cerinta completa HackerLand Enterprise is adopting a new viral advertising strategy. When they launch a new product, they advertise it to exactly people on social media. On the first day, half of those people (i.e., ) like the advertisement and
Subset Component
Cerinta completa You are given an array with -bit integers: . BIT(x, i) = (x >> i) & 1, where is the lower bit of in binary form. If we regard every bit as a vertex of a graph G,
Super Reduced String
Cerinta completa Reduce a string of lowercase characters in range ascii[‘a’..’z’]by doing a series of operations. In each operation, select a pair of adjacent letters that match, and delete them. Delete as many characters as possible using this method and
Tower Breakers
Cerinta completa Two players are playing a game of Tower Breakers! Player always moves first, and both players always play optimally.The rules of the game are as follows: Initially there are towers. Each tower is of height . The players
