Skip to main content

Posts

Showing posts from November, 2020

Dice Combinations Cses Problem set problem code solution

 Dice Combinations Cses Problem set problem code solution - Dice Combinations Cses Problem set problem code solution  dynamic programming code. Problems statement- Your task is to count the number of ways to construct sum  n n  by throwing a dice one or more times. Each throw produces an outcome between  1 1  and  6 6 . For example, if  n = 3 n = 3 , there are  4 4  ways: 1 + 1 + 1 1 + 1 + 1 1 + 2 1 + 2 2 + 1 2 + 1 3 3 Input The only input line has an integer  n n . Output Print the number of ways modulo  10 9 + 7 10 9 + 7 . Constraints 1 ≤ n ≤ 10 6 1 ≤ n ≤ 10 6 Example Input: 3 Output: 4 link- https://cses.fi/problemset/task/1633/ solution-

Codechef December long challenge solution|| Codechef December long challenge editorial 2020

   Codechef December  long challenge solution- Hey guys Welcome Again, A small update CodeChef December  long challenge starting from 4th December  2020 to 14 th November 2020. Codechef long challenge is one of the popular contests of CodeChef you should participate in codechef December  long challenge. Contest link- https://www.codechef.com/DEC20?itm_campaign=contest_listing I will post the solution after 14 December.Stay tuned. About CodeChef December  Long Challenge: CodeChef Long Challenge is a 10-day monthly coding contest where you can show off your computer programming skills. The significance being - it gives you enough time to think about a problem, try different ways of attacking the problem, read the concepts etc. If you’re usually slow at solving problems and have ample time at hand, this is ideal for you. We also put in a lot of efforts in getting quality problems, which would, in turn, foster your learning while solving them. 1- Even Pair sum solution 2- Positive Prefixes

Chef and IPC Certificates codechef November cook off challenge solution

 Chef and IPC Certificates  codechef November cook off challenge solution- Problem statement- There were  N N  students (numbered  1 1  through  N N ) participating in the Indian Programming Camp (IPC) and they watched a total of  K K  lectures (numbered  1 1  through  K K ). For each student  i i  and each lecture  j j , the  i i -th student watched the  j j -th lecture for  T i , j T i , j  minutes. Additionally, for each student  i i , we know that this student asked the question, "What is the criteria for getting a certificate?"  Q i Q i  times. The criteria for getting a certificate is that a student must have watched at least  M M  minutes of lectures in total and they must have asked the question no more than  10 10  times. Find out how many participants are eligible for a certificate. Input The first line of the input contains three space-separated integers  N N ,  M M  and  K K . N N  lines follow. For each valid  i i , the  i i -th of these lines contains  K + 1 K +