## Greedy Students GRDSTD SOLUTION Code Chef

Greedy Students GRDSTD SOLUTION Code Chef Rafid is teaching his students plane geometry. Today they are talking about convex polygons. A convex polygon is a simple non-degenerate polygon such that each of its internal angles is strictly smaller than 180∘.   Rafid drew N points (numbered 1 through N) on a blackboard (a two-dimensional plane) … Read more

## Sequence Creation ARCRT SOLUTION Code Chef

Sequence Creation ARCRT SOLUTION Code Chef Chef has two sequences of integers (A1,A2,…,AN) and (B1,B2,…,BN). A sequence of integers is beautiful if it contains only distinct integers. For each valid i: Chef wants to create a beautiful sequence Si. Let’s denote the length of this sequence by Li and the sequence by Si,1,Si,2,…,Si,Li. The sequence … Read more

## Cool Subsets COOLSBST SOLUTION Code Chef

Cool Subsets COOLSBST SOLUTION Code Chef An integer X is cool if it has a primitive root modulo X. The coolness of a non-empty set of N distinct integers S={x1,x2,…,xN} is the number of cool divisors of ∏Ni=1xi.   You are given four integers L, R, A and B. Let S be the set containing … Read more

## Curious Matrix CURMAT SOLUTION Code Chef

Curious Matrix CURMAT SOLUTION Code Chef You are given a prime p and a matrix M with N rows (numbered 1 through N) and N columns (numbered 1 through N). For each row r and column c, the cell in row r and column c can either be empty or contain an integer Mr,c. Initially, … Read more

## Expected Number of SCCs RCTEXSCC SOLUTION Code Chef

Expected Number of SCCs RCTEXSCC SOLUTION Code Chef Expected Number of SCCs RCTEXSCC SOLUTION Chef has a matrix A with size M×N. He wants to fill each of its cells with a random integer between 1 and K (inclusive); these integers are independent. Then, Chef builds a directed graph on this matrix: for each ordered … Read more

## Stack-Queue Sort Challenge SQSORT SOLUTION Code Chef

Stack-Queue Sort Challenge SQSORT SOLUTION Code Chef There are B blocks (numbered 1 through B) distributed in N containers (numbered 1 through N). For each valid i, the weight of the i-th block is Wi kilograms.Stack-Queue Sort Challenge SQSORT SOLUTION   For each container i, you should decide if it will be used like a … Read more

## And-Or Game ORAND SOLUTION Code Chef

And-Or Game ORAND SOLUTION Code Chef And-Or Game ORAND SOLUTION  Chef is bored so he decided to play a game with two sets of numbers A and B of sizes N and M and an integer V initially equal to 0. Chef will play for a number of turns (possibly zero). Every turn in this … Read more

## Blackjack BLKJK SOLUTION Code Chef

Blackjack BLKJK SOLUTION Code Chef Blackjack BLKJK SOLUTION  Chef is playing a card game called Blackjack. He starts with a deck of N cards (numbered 1 through N), where for each valid i, the i-th card has an integer Ai written on it. Then he starts dealing the cards one by one in the order … Read more

## Chef and Ants ANTSCHEF SOLUTION Code Chef

Chef and Ants ANTSCHEF SOLUTION Code Chef Chef and Ants ANTSCHEF SOLUTION Chef has been researching ant colonies for many years and finally discovered all their secrets. An ant colony consists of N distinct lines (numbered 1 through N) that pass through a point O, which is the queen’s home. For each valid i, there … Read more

## Watching CPL WIPL SOLUTION Code Chef

Watching CPL WIPL SOLUTION Code Chef Watching CPL WIPL SOLUTION  Get excited, folks, because it is time for the final match of Codechef Premier League (CPL)! Mike and Tracy also want to watch the grand finale, but unfortunately, they could not get tickets to the match. However, Mike is not someone who gives up so … Read more

error: Content is protected !!
+