ENG  RUSTimus Online Judge
Online Judge
Задачи
Авторы
Соревнования
О системе
Часто задаваемые вопросы
Новости сайта
Форум
Ссылки
Архив задач
Отправить на проверку
Состояние проверки
Руководство
Регистрация
Исправить данные
Рейтинг авторов
Текущее соревнование
Расписание
Прошедшие соревнования
Правила
вернуться в форум

Обсуждение задачи 1009. K-ичные числа

I got 89 for the example, not 90, why?
Послано David Yin [ECUPL] 27 дек 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?
Послано ToadMonster 29 дек 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?
Послано Burakov Alexander 25 фев 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?
Послано ToadMonster 25 фев 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?
Послано David Yin [ECUPL] 19 июн 2016 14:02
I missed placed 2 as k and 10 as n, ar, that's stupid.