Can anybody please explain why I got wrong answer? (SIMPSTAT)

The simple program is giving wrong answer when I used “array of float” and as I changed it to “array of int” the It Gave correct answer, why so ?

PS :- This program requires to find the average of elements of some remaining element
after doing manipulation as given in question.

  1. Question Link : https://www.codechef.com/problems/SIMPSTAT

  2. Correct Answer : https://www.codechef.com/viewsolution/27474756

  3. Wrong Answer : https://www.codechef.com/viewsolution/27474569

1 Like