Shivigawdz ICOP1904 Debugging

I cannot understand what is wrong with my code here. I have applied sliding window algorithm over a range of possible length say k belonging to [A,B]. I just don’t understand where I went wrong. Please help me out.

@alathedarkwiz Your algorithm is completely right :smiley:

The only mistake you did is that you didn’t set the precision of the answer. It’s mentioned in the problem to set the decimal places to atleast 6.

Add a line in starting of your main();


You’ll get an AC

I’ve set the precision to 10 decimal places. You can set to any above 5

Okay just another question “long long arr[n+1];” is correct right?

Seems to be correct. But just take care about the constraints when you declare the array for each test case separately. Works fine here :slight_smile: