< Back to forum

reason for partial score/ the missing test cases

link to mysubmission    https://www.codechef.com/viewsolution/17560349

link to the problem     https://www.codechef.com/problems/UNIVMT/

why am i getting only 50% score......

Asked by: Abhishek_Chaudhary on April 7, 2019, 6:34 p.m. Last updated on April 7, 2019, 6:34 p.m.


Enter your answer details below:


Enter your comment details below:




2 Answer(s)

avatar

In your solution, you are using the variable 't' both as a counter denoting the number of test cases and to store the final result. Rename anyone of them it will work.

Anand_Jhunjhunwala last updated on April 7, 2019, 6:34 p.m. 0    Reply    Upvote   

avatar

Please, always analyse your code and match with the output format of the question. For the case where n is less than or equal to 3, you are printing 0. That fine but you are supposed to be printing the next output in a newline. While your code prints the output in the same line. For small codes, it is easy for us to debug where you are going wrong but had it been some code with 100s of lines, it would have been hectic for us to find those tiny errors.

Try this :

2

2

291

Link To Correct Solution

Rishabh_Sethi last updated on April 7, 2019, 6:34 p.m. 0    Reply    Upvote   

Instruction to write good question
  1. 1. Write a title that summarizes the specific problem
  2. 2. Pretend you're talking to a busy colleague
  3. 3. Spelling, grammar and punctuation are important!

Bad: C# Math Confusion
Good: Why does using float instead of int give me different results when all of my inputs are integers?
Bad: [php] session doubt
Good: How can I redirect users to different pages based on session data in PHP?
Bad: android if else problems
Good: Why does str == "value" evaluate to false when str is set to "value"?

Refer to Stack Overflow guide on asking a good question.