TCS Examination EXAMTIME Solution Codechef

Codechef TCS Examination EXAMTIME Solution Two friends, Dragon and Sloth, are writing a computer science examination series. There are three subjects in this series: DSADSA, TOCTOC, and DMDM. Each subject carries 100100 marks. You know the individual scores of both Dragon and Sloth in all 33 subjects. You have to determine who got a better rank. The rank is decided as follows: … Read more

Chef and Fixed Deposits MINFD Solution Codechef

Codechef Chef and Fixed Deposits MINFD Solution Chef wants to make a purchase. For this, he needs XX gold coins, but he has none at the moment. Chef has NN fixed deposits, the ithith of which is worth AiAi coins. He wants to open the minimum number of these deposits so that he has at least XX coins. You have to tell Chef the minimum … Read more

Crying Colours CRYCOLR Solution Codechef

Codechef Crying Colours CRYCOLR Solution You have a total of 3N3N balls of colours RedRed, BlueBlue and GreenGreen. There are exactly NN balls of each colour. These 3N3N balls are now distributed to 33 boxes such that each box contains exactly NN balls. You are given the contents of each box. You would like the 1st1st box to contain all the red balls, the 2nd2nd box to contain all the green balls, and the 3rd3rd box to contain all … Read more

Power Sum POWSUM Solution Codechef

Codechef Power Sum POWSUM Solution You are given a sequence AA of NN integers such that every element is a non-negative power of 22. A sequence is called good if its sum is a non-negative power of 22. You would like to turn AA into a good sequence. To achieve this, you can perform the following operation on AA: Pick a non-empty subsequence of AA, pick a positive integer XX such … Read more

Sum and OR SUMANDOR Solution Codechef

Codechef Sum and OR SUMANDOR Solution Chef has two integers XX and SS. He is interested in sequences of non-negative integers such that the sum of their elements is SS and the bitwise OR of their elements is XX. Chef would like to know the shortest possible length such a sequence can have. Formally, find the smallest positive integer NN such that there exists a … Read more