Understanding Subtasks

I am solving a contest problem (link) in which I don’t understand the sub-tasks, it says the following:


  • 1≤T≤100
  • 7≤N≤100
  • 350 ≤ Pi ≤ 750 for each valid i


Subtask #1 (30 points): N=7

Subtask #2 (70 points): original constraints

What does it mean by “N=7” and " original constraints". I submitted my code but it tells my answer is wrong and I am sure my logic is correct. So it has to do something with these subtasks and I ensure you that I took every input through user and I haven’t written the code for checking conditions for constraints.

Please help me I am taking part in contest for the first time.

1 Like

In the first subtask, N=7 means in all the test cases N has a fixed value 7
In the second subtask : original constaints means that rules which are given under constraints section will be followed i.e. 7<=N<=100


Does this mean that I should not take N through the user and give it a fixed value of 7, but then it
would viotlate the input conditions.

Or does this mean that I should initially give N a value of 7 then it may or may not be changed by the user.

1 Like

it means for some test cases the judge will give you a fixed value of N (= 7)

1 Like

Ok Now I understood. Thanks.

1 Like

If you’re getting WA, 100% your logic is wrong. Check for all types of cases like corner cases.

Okay I will see to it.

1 Like

Please Explain me these lines from the Question:

If there is no record of the price on some of the previous five days (because Chef has not started checking the price on that day yet), then Chef simply ignores that previous day ― we could say that he considers the price on that day to be infinite.

1 Like

If you’re checking the price on Day 3, you can only consider prices on Day 2 and Day 1 as days before that are not available. But if you’re checking on, say, Day 17, you have to consider last five days as they are available. Hope this example makes it clear for you.

If you have questions regarding a problem from an ongoing contest, please post a comment on the problem page at the bottom so the problem author or contest admin can answer your queries most accurately.

1 Like