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

Обсуждение задачи 1042. Центральное отопление

How to choose from answers the shortest one?
Послано Aram Shatakhtsyan 2 ноя 2008 16:05
This problem can be solved by equations, for example
we make equations for the input:

3
1 2 -1
1 2 3 -1
3 -1

whe construct the matrix

1 1 0 = 1
1 1 0 = 1
0 1 1 = 1

since 1st and 2nd equations are the same, it means that
you are free to choose the value for the 3rd variable,
but in fact if you choose its value arbitrarily,
answer length can be changed, two possible answers
are 1,2 and 3, but only 3 is the right answer, because
it's the shortest. What to do with that?
Re: How to choose from answers the shortest one?
Послано Phan Hoài Nam (HUFLIT) 30 сен 2010 17:52
this test is incorrect, because 1 combine 3 = 2