< Back to forum

Problem with the word subtask

What does 'subtask' mean in a question in competitive programming . I solved a question whose logic was correct ( as I crosscheck ed my output with theirs) and it should not give any errors. But when I uploaded it...it showed wrong answer. It showed an error something related to subtask. In the question itself there was a mention of subtask but I could not comprehend it.

Asked by: Soumyodeep_Dey 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:




1 Answer(s)

avatar

The code you submit on any online judge( Codechef, Hackerrank, etc) are run on multiple input data(test files). Each of these input data are stored in seperate files which form a subtask.
The example (sample) input/output provided with the question is provided just for explanation purpose. Getting your code to run on the sample input and getting results as in the sample output doesn't guarantee that your code is correct.
When you submit, your code is run on large no of test data. So during this step you may get a wrong answer if your code is not producing the desired results, implying that your logic is incorrect.

Shubham_Kumar_Gupta 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.