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

Обсуждение задачи 1708. Сумма цифр 2

OMG! I've solve this
Послано DK [Samara SAU 1: X2008] 3 май 2009 18:49
Re: OMG! I've solve this
Послано Al.Cash 3 май 2009 21:27
Have you examined only forbidden sets (which can be replaced with the smaller set of digits, whose sum and sum of squares are equal to the initial), that contain not more than one maximal digit?

I can't prove any restrictions on such sets yet, so the answer would be very helpful.
Re: OMG! I've solve this
Послано DK [Samara SAU 1: X2008] 4 май 2009 01:20
I've just use folowing ideas:
A. Calculating lots of samples that are minimal (with length <= X = 55). There is not more than about 50m of them.
B. If there is a long enough (length >= Y = 13 (?) ) sequence of equal chars, there is '*' possible. E.g. "12222222222222" transforms to "12*"
C. There is no more than 2 '*' in any pattern
D. There is no patterns with "1*", except "1*2*"
E. No patterns likes "11*"

So, I've not used some specific ideas or facts.

This solution makes you right answer, but works too slow.

Then, I've precalculated all the difference from solution with X = 23, Y = 8 (I'm not sure in constants ) and right solution.
With lots of specific optimization, it is AC.
My first AC solution used 63K of source, 4.85 s. and 63M of memory
Good luck!
Re: OMG! I've solve this
Послано OpenGL 9 май 2009 01:46
2Al.Cash: I think you are wrong. For example 12355->4444.
Re: OMG! I've solve this
Послано shako 29 июн 2009 15:58
OpenGL писал(a) 9 мая 2009 01:46
2Al.Cash: I think you are wrong. For example 12355->4444.

Edited by author 29.06.2009 15:59