Code is giving error

Que. link - https://www.codechef.com/problems/DIVSUBS

My code link - https://ide.codingblocks.com/s/571924

Please some one help

You need to assign mp[0] = 0 from the start itself. Here I corrected your code https://ide.codingblocks.com/s/571969

Why sir?? I am using mp for stroing 1st and last index of a repeating remaimder of prefix sum.

Yes sir I understand that if at any point remainder is Zero for some element then the subarray from zeroth to that index is a valid subarray

very Much thak you sir

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.