Separate the chocolate

Cerinta completa Chinese Version Russian Version Tom and Derpina have a rectangular shaped chocolate bar with chocolates labeled T, D and U. They want to split the bar into exactly two pieces such that: Tom’s piece can not contain any

Sales by Match

Cerinta completa There is a large pile of socks that must be paired by color. Given an array of integers representing the color of each sock, determine how many pairs of socks with matching colors there are. Example There is

Play with words

Cerinta completa Shaka and his brother have created a boring game which is played like this: They take a word composed of lowercase English letters and try to get the maximum possible score by building exactly 2 palindromic subsequences. The

Roads in HackerLand

Cerinta completa John lives in HackerLand, a country with cities and bidirectional roads. Each of the roads has a distinct length, and each length is a power of two (i.e., raised to some exponent). It’s possible for John to reach

Problem solving

Cerinta completa There are N problems numbered 1..N which you need to complete. You’ve arranged the problems in increasing difficulty order, and the ith problem has estimated difficulty level i. You have also assigned a rating vi to each problem.

Permutation game

Cerinta completa Alice and Bob play the following game: They choose a permutation of the numbers to . Alice plays first and they alternate. In a turn, they can remove any one remaining number from the permutation. The game ends

Sansa and XOR

Cerinta completa Sansa has an array. She wants to find the value obtained by XOR-ing the contiguous subarrays, followed by XOR-ing the values thus obtained. Determine this value. Example Subarray Operation Result 3 None 3 4 None 4 5 None

Rust & Murderer

Cerinta completa Detective Rust is investigating a homicide and he wants to chase down the murderer. The murderer knows he would definitely get caught if he takes the main roads for fleeing, so he uses the village roads (or side

Roads and Libraries

Cerinta completa Determine the minimum cost to provide library access to all citizens of HackerLand. There are cities numbered from to . Currently there are no libraries and the cities are not connected. Bidirectional roads may be built between any