## Strict Permutation Codechef Problem Solution

Strict Permutation Codechef Problem Solution | STRPERM You are given an integer N. You have to find a permutation P of the integers {1,2,…,N} that satisfies M conditions of the following form: (Xi,Yi), denoting that the element Xi(1≤Xi≤N) must appear in the prefix of length Yi. Formally, if the index Read more…

## Accurate XOR Codechef problem Solution

Accurate XOR Codechef Problem Solution ( TREEXOR ) Chef has a tree consisting of N nodes, rooted at node 1. The parent of the ith(2≤i≤N) node in the tree is the node Pi . Chef wants to assign a binary value (0 or 1) to every node of the tree. Read more…

## Positive Array Codechef Problem Solution

Positive Array Codechef contest Problem Solution A 1-indexed array is called positive if every element of the array is greater than or equal to the index on which it lies. Formally, an array B of size M is called positive if Bi≥i for each 1 ≤ i ≤ M . Read more…

## Fill The Grid Codechef Problem Solution

Fill The Grid Codechef Solution | GRIDBL You have a grid with N rows and M columns. You have two types of tiles — one of dimensions 2×2 and the other of dimensions 1×1 . You want to cover the grid using these two types of tiles in such a Read more…

## Buy Lamp Codechef problem solution

Buy Lamps Codechef Problem Solution An electronics shop sells red and blue lamps. A red lamp costs X rupees and a blue lamp costs Y rupees. Chef is going to buy exactly N lamps from this shop. Find the minimum amount of money Chef needs to pay such that at Read more…

## Make Palindrome 2 Codechef problem solution

Make Palindrome 2 Codechef Problem Solution You are given a binary string S of length N. You want to obtain a palindrome from S by applying the following operation at most ⌊N2⌋ times: Choose an index i( 1≤ i ≤ |S| ), delete the character Si from S and concatenate Read more…

## Largest Family Codechef Solution

Largest Family Codechef Solution | LARGEFAM | (100/100) FULL | Codechef July Lunchtime | AC Code A certain parallel universe has exactly N people living in it. The i-th of these N people claims that they are the parent of exactly Ai of these N people. However, some of these Read more…

## Easy Pronunciation Codechef Solution

Easy Pronunciation Codechef Solution | EZSPEAK | (100/100) FULL | Codechef July Lunchtime | AC Code Words that contain many consecutive consonants, like “schtschurowskia“, are generally considered somewhat hard to pronounce. We say that a word is hard to pronounce if it contains 4 or more consonants in a row; Read more…

## Maximum Median Matching Codechef Solution

Maximum Median Matching Codechef Solution | MEDMAXMATCH | (100/100) FULL | Codechef July Lunchtime | AC Code N boys and N girls attend a dance class, where N is odd. For today’s practice session, they need to form N boy-girl pairs. The i-th boy has a happiness value of Ai Read more…