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

Обсуждение задачи 1254. Крепкий орешек

A USEFUL HINT for those TLE authors!!!
Послано 198808xc 1 сен 2008 12:31
Many people got TLE on this problem.
However, there are ways to avoid TLE.
I viewed some topics before, and they told me to use vectors instead of float numbers.
I tried, but it doesn't work for my bad programming.

After that, I tried to think another way...

Many people got TLE, but they only use 7 or 8 sec.
Here is a method to make the time derive to half:

First, find all avaliable task, and assume the staring point is No.0
then, instead of calculating all the shortest paths,
we can calculate this:
Shortest from No.1 to No.0 and No.2, (add them up)
Shortest from No.3 to No.2 and No.4, (add them up)
......
thus we can easily save half of the time,
and My program got AC in 2.8 sec (previously TLE)

Sorry for my bad English.
Good luck for EVERYONE~