I am getting wrong answer for Test Case 4(Problem C) : http://codeforces.me/contest/546/submission/11226594
But When I run the same Code in Ideone and My Linux Machine I am getting the correct output.
MY code (same as submission Link above): http://ideone.com/NmWgjc
Don't Know why Such Weird Problem is happening. Any Help Will be Appreciated.
Try to submit your code again but without using pow function
Got it Thanks.
But can u still find the reason that pow function work well in Linux machine and Ideone and why not here in Codeforces Judge??
Pow function returns double value hence when you cast to int something like pow(2, 3) (which is actually 8) you can easily get 7, because 7 = (int)7.9999999999.
Btw, it was discussed like.. a lot.
11230498 got AC. If the result of pow should be an integer,you can add it by 0.5 before casting it,so things like 7.99999 will become 8.49999 and then become 8.