Regarding a hackerblock problem


sir this is a divisible subarray problem and I am getting test case failure can you please check the program
https://hack.codingblocks.com/app/practice/3/1065/problem

You did not initialise the pre array with zero. Also before test case, you should update all the values of pre array as 0. So it is recommended to define the pre[1000005] = {0}; inside the test cases loop or use a vector (initialised with 0) and clear it after each test case.

If further doubts, feel free to raise the query again.


mam i am still getting test case failure

I said to define the array inside the test cases loop but you only initialised it by 0.
I have updated the code and please check now.