hamidrh's blog

By hamidrh, 12 years ago, In English

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

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

»
12 years ago, hide # |
← Rev. 2  
Vote: I like it +1 Vote: I do not like it

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.

»
12 years ago, hide # |
 
Vote: I like it +6 Vote: I do not like it

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.me/contest/460/submission/7574790

»
12 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

You can not use pow function.You must write your pow function.That is not so hard :)

»
12 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it
»
12 years ago, hide # |
← Rev. 2  
Vote: I like it -8 Vote: I do not like it

I'm wondering if the ill thing in here is Codeforces..

»
12 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

because U use pow !!!