my code gives the right outputs,but i get only 30 points for that, to receive 70 more points, i must not have “additional constraints”.I am new to competitive programming scene and don’t know what it means, any help will be appreciated.
It means the original constrains given.
Subtask 1: N\le100
Subtask 2: No additional Constraints.
This would mean that for Subtask 1, you should consider N\le100 and for Subtask 2, N\le10^5.
So how to overcome this problem???
I still did’nt get it.
You can make sure that for the Subtask 1, the N will be always less than or equal 100.
Similarly for Subtask 2, the will be less than or equal to 10^5 in all the test cases.
So sometimes, a brute force solution or a less optimized solution will give AC for Subtask 1 since N is small and it may not pass Subtask 2.
You have to write more efficient solution that will work for big inputs, such as here 10^5.
Only if you are getting TLE (Time Limit Exceeded) on Subtask 2 (this is visible on the submission’s page), then you need to write code that runs faster on larger values of N.
In a more formal way, your code should have better time complexity.
Read this : Understanding Time Complexity with Simple Examples - Geeks for Geeks
hey i am too new to programming and i’m too facing the same issue, can anyone please explain the concept in simple manner to overcome this issue in July long challenge problem chef and strings.
In basic terms, if you are getting AC on subtask 1 and TLE on subsequent subtask(s), it means that your solution (or rather your approach) is not optimized enough to pass the larger set of inputs within the time limit.
You either need to optimize your current approach quite a bit (which is not possible in most cases) or need to come up with a better, more optimized approach.
Google Time Complexities of Algorithms and try to understand it.
Even I’m stucked on the additional constraints parameter as my code was not able to pass those tests. Have you got any what’s exactly causing it?