March long challenge(Div2)

This month's long challenge was special because of codechef's 9th birthday. So they introduced divisions in the challenge.Which can be seen here

I started This challenge on 10 March and able to do first 3 easy problems and 4th and 6th problem partially.I tried 6 problem's out of 8.

1.Chef and Glove

    Prerequisite:- none

    This was easies problem challenge. 
   case:-1 check chef's finger[i] with glove's sheath[i]. If finger[i]<=sheath[i], then chef can wear that glove from front side.
    
   case:-2 check chef's finger[i] with glove's sheath[n-1-i]. If finger[i]<=sheath[n-1-i], then chef can wear that glove from back side.

solution

2. A Big Sale
   
     prerequisite:- none
   
   Original price = p
   increased x% price of p= p*(x/100)
   loss in reciepe p=(p+p*(x/100))*(x/100) - p*(x/100)
                              =p*(x/100)*(x/100)
                       
  calculate total loss for p in the array and add it.
 print ans with 10 precision.

solution

3. Mix the colors

   prerequisite:- none
  
    To make all pair district, add the maximum element to any number which is repeated. After adding new number will be maximum, add it to next repeated number and it goes on.

In this method we are making every repeated number maximum, so that new number is not present in the array.

If a number is repeating n times than we have to remove n-1 numbers repetition.  
solution
  
4. Minion Chef and Bananas
     This problem was pretty good.I almost spent 2 days to solve this problem, but I did not get more than 30 points.

  This problem was the practical application of your binary search knowledge. I couldn't recognize binary search pattern during the contest. Generally, in the long challenge, first 4 problems is brute force problems. But this time I can say my participation on this long challenge was worth it, despite my mid-sem exams. I learned the practical application of my binary search knowledge. 

Codechef Editorial

    

5. Chef and Easy Problem
  This problem was out of my league. I spent 2-3 hour on this problem. I also had difficulty to understand the editorial.

Codechef Editorial

My Solution based on the editorial.


6. Minions and Voting

    Prerequisite:- Binary search
   
   Codechef Editorial

    My solution base on the editorial

7. Pishty and Triangles
     
   Codechef Editorial

8. Embedding a Tree(Challenge)
  
    Codechef Editorial


Comments