Cerinta completa Given a string consisting of the letters , and , we can perform the following operation: Take any two adjacent distinct characters and replace them with the third character. Find the shortest string obtainable through applying this operation
Tree Pruning
Cerinta completa A tree, , has vertices numbered from to and is rooted at vertex . Each vertex has an integer weight, , associated with it, and ‘s total weight is the sum of the weights of its nodes. A
Sorted Subsegments
Cerinta completa Consider an array of integers. We perform queries of the following type on : Sort all the elements in the subsegment . Given , can you find and print the value at index (where ) after performing queries?
Travel around the world
Cerinta completa There are N cities and N directed roads in Steven’s world. The cities are numbered from 0 to N – 1. Steven can travel from city i to city (i + 1) % N, ( 0-> 1 ->
The Blacklist
Cerinta completa A new gangster is trying to take control of the city. He makes a list of his adversaries (e.g. gangster , gangster , … gangster , gangster ) and plans to get rid of them. mercenaries are willing
Stone Piles
Cerinta completa There are piles of stones where the ith pile has stones in it. Alice and Bob play the following game: Alice starts, and they alternate turns. In a turn, a player can choose any one of the piles
Simplified Chess Engine II
Cerinta completa Chess is a very popular game played by hundreds of millions of people. Nowadays, we have chess engines such as Stockfish and Komodo to help us analyze games. These engines are very powerful pieces of well-developed software that
Staircase
Cerinta completa Staircase detail This is a staircase of size : # ## ### #### Its base and height are both equal to . It is drawn using # symbols and spaces. The last line is not preceded by any
Tower Breakers – The Final Battle
Cerinta completa Our unsung tower-breaking heroes (players and ) only have one tower left, and they’ve decided to break it for a special game commemorating the end of days of Game Theory! The rules are as follows: always moves first,
Tastes Like Winning
Cerinta completa Stephanie just learned about a game called Nim in which there are two players and piles of stones. During each turn, a player must choose any non-empty pile and take as many stones as they want. The first
