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

Обсуждение задачи 1321. Табло в лифте

WA:9
Послано SPbETU#1 15 апр 2004 17:02
Who can helpme with some hint about this problem?

Any right answers, any tests...

I've got WA:9, and I can't find mistake
Re: WA:9
Послано breeze 18 апр 2004 19:26
5->4
6->4
7->4
8->4
9->4
10->8
11->8
12~19->6
20~39->11
40->99->31
100~119->71
120~199->51
200~399->101
400~999->301
and so on......i use this rule and got AC.
maybe it is a bad methodology......

Edited by author 18.04.2004 19:35
Re: WA:9
Послано HybridTheory 3 ноя 2004 21:09
Why the answer is 4 when n is from 5 to 9?
Re: WA:9
Послано Pio (Pio@mail.by) 5 мар 2006 14:10
to breeze: thanks... you tests very helped me...
Re: WA:9
Послано Zeva [USU] 7 май 2006 21:00
But if input:
1000 - 701?
1100 - 701?
1200 - 501?
1300 - 501?
2000 - 1001?
4000 - 3001?
I have WA#11
Re: WA:9
Послано yuhch 25 окт 2007 17:57
[deleted]

Edited by author 25.10.2007 17:59
Re: WA:9
Послано yuhch 25 окт 2007 17:57
why the answer to n=40 is 31?
Re: WA:9
Послано Denis Koshman 12 авг 2008 03:39
Because range 1..5 has each lamp in ON and OFF states, and it appears to be the smallest range for all 5<=N<=9

My solution is checking all A..B ranges for the 1st digit. If B-A>1, then I set it as A999999999 till B00000000. If B-A=1, then I try all ranges for the 2nd digit. It appears that no more recursion is necessary, so the answer will be minimal among all BD000000... - AC9999... where A..B covers all lamp states for the 1st digit (consider their existence too and treat zero as all-off) and 0..C together with D..9 covers all lamp states for the 2nd digit.