## 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…