ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1009. K-based Numbers

I got 89 for the example, not 90, why?
Posted by David Yin [ECUPL] 27 Dec 2015 21:00
I got 89 for the example: 2 10, not 90, why? Any one know this?
Re: I got 89 for the example, not 90, why?
Posted by ToadMonster 29 Dec 2015 19:36
9*10=90;
9 - count of possible first digits (zero not allowed);
10 - count of possible second digits.

How did you get 89?
Re: I got 89 for the example, not 90, why?
Posted by Burakov Alexander 25 Feb 2016 17:46
it's because of pow-function
pow(10,2)==99
U may:
if ( result_of_pow % 9 == 0) result_of_pow++;

Edited by author 25.02.2016 17:48
Re: I got 89 for the example, not 90, why?
Posted by ToadMonster 25 Feb 2016 18:39
> pow(10,2)==99
It's really weird if some language's standard library doesn't work in so visible way. User mistake is much more likely.
So what is language and "pow" function declaration?

Probably you use any floating numbers pow, like "C++, double pow (double base, double exponent)".
In this case I expect pow returns approx. 100 (99.999 for example) and then you convert double to int in wrong way.

Edited by author 25.02.2016 20:35
Re: I got 89 for the example, not 90, why?
Posted by David Yin [ECUPL] 19 Jun 2016 14:02
I missed placed 2 as k and 10 as n, ar, that's stupid.