vsanjay_nitdgp's blog

By vsanjay_nitdgp, history, 8 years ago, In English

Recently,I solved a problem.

This is one of my step in my solution:

ans=ans-(2*b*c[n]);

ans is double variable,b is integer,c[n] is double; my answer was judged wrong.

when i changed the step to

double p=2*b*c[i];
ans=ans-p;

My solution got ACCEPTED.Could anyone say,why this occur,so that it would be very helpful for future problems of this kind.

Thanks.

  • Vote: I like it
  • -21
  • Vote: I do not like it