original constraints

In July challenge I’m not getting marks for the subtask 2 in which it is written original constraints.Please can anybody tell me how to overcome this problem and please tell what does original constraints means.

4 Likes

original contraints are the contraints which written written on the top subtask section and below output section.

if you getting a tle in subtask 2 you need to optimize the solution so that it fits in the time constraints

even i have the same issue i dont know what the subtask means

You’ll get full score if your solution is optimized and has optimal complexity, If not you’ll get partial score.

Constraint are the input against which your program will be test. in subtask 1 constraints are small so you are getting AC.while in case of original constraints input size increases which also increase the execution time and results in Tle.
you should learn time complexity of a algorithm (in case you don’t know).

4 Likes

i cannot find the original constraints where u are suggesting to find them. Please help.

They are provided in the question, right below the input & output formats and look like this. If you write a code keeping in mind that it will be tested even for these huge input constraints, you won’t get TLE. Try optimizing your code accordingly.

Constraints

  • 1≤T≤10
  • 2≤N≤10^5
  • 1≤Ai≤10^9 for each valid i
1 Like

thanks… now starting to learn this complexity… O(1) is luv haha

Means looking at the constraint and calculate them … like
10^8= o(n)
10^7=o(n)
10^6=o(n)
10^5=o(n*logn)
10^3-=(n^2)
now what i do? please tell me

1 Like