Hi to all sry if my English isn't good anyway at this problem B. Little Dima and Equation I tried this code my first try u can see It in test 1 ~~~~~ Input 3 2 8 Output 2 10 2008 Answer 3 10 2008 13726 Checker comment wrong answer 1st numbers differ — expected: '3', found: '2' ~~~~~
and NOW copy my code in your compiler and u can see it was correct in your pc why!!!! I tried a lot and I understood pow() in codeforces judge is ill :D
I don't know exactly, but I think pow() uses Taylor series, and for example pow(5, 5) can be little less or more than 625. But:
(int)(625 + eps) = 625
(int)(625 — eps) = 624
round() may fix this problem.
I changed your code a bit so it gets past the first test case. However, you have not accounted for the fact that the number must be greater than 0 and less than 10^9. Thus, it still gives wrong answer on test 10.
http://codeforces.net/contest/460/submission/7574790
what ceil(pow(a,b))?
How does this work? I understand the original problem, that pow(2, 2) can be 3.999, etc. but similarly, can't it be 4.000001, which makes your code wrong?
No, it can only be 3.999, etc.
Proof is that I got the code accepted using that.
Might just be weak test cases.
You can not use pow function.You must write your pow function.That is not so hard :)
first read the code & after that say
okay here is your AC code: http://codeforces.net/contest/460/submission/7575555
I'm wondering if the ill thing in here is Codeforces..
because U use pow !!!