In this problem 557B - Pasha and Tea : I got a wrong answer with this submission 11854334 But I run the same program in my pc it can return the correct answer '1000000000'.
So I left a comment and asked for help, a nice guy 'brighterstill' helped and updated my code and get accepted : 11869049
So I now have two questions, why my code is wrong and why changed to double make it right ....
Please help, thanks
i think that in th test 46 the valuse of w is very big for int; double is larger than int so it works; 'n' can be int, it doesn't matter
oh sory not 'valuse' *value
you can edit your comment :D
as mentioned in the comment above and you can just replace
ans = a[0]*3*n
withans = 1LL*a[0]*3*n
insteadThanks very much, I get it now.