Category CodeChef Solution

Single Operation Part 2 CodeChef Solution

Problem – Single Operation Part 2 CodeChef Solution Chef has the binary representation S of a number X with him. He can modify the number by applying the following operation exactly once: Chef wants to minimize the value of X after performing the operation. Help Chef in determining the…

View Answers

Odd Sum Pair CodeChef Solution

Problem – Odd Sum Pair CodeChef Solution Chef has 3 numbers A,B and C. Chef wonders if it is possible to choose exactly two numbers out of the three numbers such that their sum is odd. Input Format Output Format For each test case, output YES if you can choose…

View Answers

Good Pairs CodeChef Solution

Problem – Good Pairs CodeChef Solution You are given N integers: A1, A2, …, AN. You need to count the number of pairs of indices (i, j) such that 1 ≤ i < j ≤ N and Ai | Aj ≤ max(Ai, Aj). Note: Ai | Aj refers to bitwise OR. Input Output For each test case, output a single line containing…

View Answers

Hidden Numbers CodeChef Solution

Problem – Hidden Numbers CodeChef Solution Salmon has some hidden numbers that he wants you to find! Given an integer N, find and output any two integers A and B such that: ###Input: The first line of input consists of a single integer T (1≤T≤10^5)…

View Answers

The Rating Dilemma CodeChef Solution

Problem – The Rating Dilemma CodeChef Solution Chef really likes to compete on Codechef, and he has gained an impressive rating of X, where X>0. There is also a parallel universe, where ratings on Codechef are negative instead. The only thing that…

View Answers

Peaceful Party CodeChef Solution

Problem – Peaceful Party CodeChef Solution The mayor of your city has decided to throw a party to gather the favour of his people in different regions of the city. There are 3 distinct regions in the city namely A, B, C comprising of PA​, PB​ and PC​ number of…

View Answers

Passing Marks CodeChef Solution

Problem – Passing Marks CodeChef Solution Recently, Chef’s College Examination has concluded. He was enrolled in 3 courses and he scored A,B,C in them, respectively. To pass the semester, he must score at least Amin​,Bmin​,Cmin​ marks in the respective subjects along with a cumulative score of…

View Answers