My answer has been partially accepted but I am not able to rectify the mistake and it is showing “RE (SIGSEGV)” in subpart 2(70 marks). Here’s the link to my solution- solution. Please help.
In second test case, The constraints are 5×10^5 you have declared an array of 5000 only.
Then too if we are correcting it it is giving TLE in subtask 2.
Here is the link to the submission without RE:
Try removing the TLE yourself tho.
Try sorting the array and the number of elements at greater index will be larger than the number.