Rock Paper Scissors ROPASCI Solution Codechef

Rock Paper Scissors ROPASCI Solution

Rock Paper Scissors ROPASCI Solution There are NN players standing in a line, indexed 11 to NN from left to right. They all play a game of Rock, Paper, Scissors. Each player has already decided which move they want to play. You are given this information as a string SS of length NN, i.e, SiSi is equal to RR if player ii will play Rock. SiSi is equal to PP if player ii will … Read more

Valleys and Hills VANDH Solution Codechef

Valleys and Hills VANDH Solution

Valleys and Hills VANDH Solution Chef built a binary string SS that has exactly NN hills and MM valleys. A hill is any index 1<i<|S|1<i<|S| such that both its neighbors are strictly smaller than it, i.e, Si−1<SiSi−1<Si and Si+1<SiSi+1<Si. A valley is any index 1<i<|S|1<i<|S| such that both its neighbors are strictly larger than it, i.e, Si−1>SiSi−1>Si and Si+1>SiSi+1>Si. Chef thinks that his string SS is the shortest among all binary strings with NN hills and MM valleys. You don’t quite … Read more

List of Lists LISTLIST Solution Codechef

List of Lists LISTLIST Solution

List of Lists LISTLIST Solution You are given a positive integer NN and an array AA of size NN. There are NN lists L1,L2…LNL1,L2…LN. Initially, Li=[Ai]Li=[Ai]. You can perform the following operation any number of times as long as there are at least 22 lists: Select 22 (non-empty) lists LiLi and LjLj (i≠ji≠j) Append LjLj to LiLi and remove the list LjLj. Note that this means LjLj cannot be chosen in any future operation. Find the minimum number of … Read more

Codechef December Long Challenge 2021 Solution

Codechef December Long Challenge 2021 Solution

Codechef December Long Challenge 2021 is about to start in next few days. During November Long Challenge we were able to provide at least 70% of solution within next 6 days after the context got live. We got great response and reach in terms of audience and follower’s, if you haven’t followed us on telegram … Read more

Which Fuel is Cheaper CHEAPFUEL Solution Codechef

Which Fuel is Cheaper CHEAPFUEL Solution

Which Fuel is Cheaper CHEAPFUEL Solution The current price of petrol is XX rupees, and the current price of diesel is YY rupees. At the start of each month, the price of petrol increases by AA rupees and the price of diesel increases by BB rupees. Chef is curious to know which fuel costs less at the end of the KthKth month. If petrol is … Read more