WA in LADDU - please help


just read the input section.
you are not taking input for length of the activities .According to ur code, it will get executed for single activity.

still getting WA

Your code is giving wrong answer for the given test-case in problem statement:


Output should be:


The bugs are the following:

  • Read the problem statement carefully, it says that if the person has won the contest, he is sure to get 300 points and look at your code logic in the CONTEST_WON section.
  • Ask yourself what is the spelling of CONTRIBUTER is, I think you should really check your code by yourself first then post here, otherwise, you would embarrass yourself because of this silly bugs.


  1. Write code which is easy to understand, at least when you post on forums, properly indent your code, it really helps people who are looking at your code, because if you don’t do this, it just a waste of time for us, after wasting the time, we find that there is a silly bug in your program which can be easily found if the code was written properly.

  2. Don’t use using namespace std i.e. namespace std for the whole file rather limit the scope of namespace std as much as possible.
    Refer: Why I don't "using namespace std" - YouTube.

  3. Write understandable variable names such that its purpose becomes very clear when someone looks at your code.

Solution Code In C, C++ and Python

Competitive-Programming/Code-Chef/Laddu at master · strikersps/Competitive-Programming · GitHub.

1 Like

I am extremely sorry I will definitely work on all this things.

why there is Need to put Second Loop?Can anyOne please explain

Loop on ------->number of activities