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

Обсуждение задачи 1695. Работа для роботов

got tle , need help.
Послано William Chou 11 апр 2011 10:16
I have tried so many times , but i have no idea to avoid tle.
I use memory search to solve it , and get tle on #58.
Although i use random method when i choose a node , but it doesn't work.
I just know that somebody have accepted this problem use the same method one years ago.
Maybe he also get tle after rejudged.
e...I think this is a NP problem.
Could anybody help me?
Thank you!
sorry for my poor English.
ありがとう ございます。
Re: got tle , need help.
Послано William Chou 11 апр 2011 10:22
I use C++ stl map to save information.
And it's a Red-Black Tree(O(logn)).
Will it be faster if i use hash(O(1)) instead of map?
If anybody know how to solve it , please tell me.
Here is my e-mail : 419481620@qq.com.
Re: got tle , need help.
Послано William Chou 11 апр 2011 13:11
I also have tried to use hash instead of map to save information.
But still tle #58.
Here is my code.
After i accept , i will delete my code (if i could get accept , and i wish so , haha...).
[code deleted].

Edited by author 13.04.2011 08:22
Re: got tle , need help.
Послано William Chou 12 апр 2011 08:06
Oh ! after i use a new way to random , i got tle #69 now.
faint.
Re: got tle , need help.
Послано svr 12 апр 2011 08:47
I think that jury has some ideas for quick algo without random absolutely.
Try to find mathematical ways to speed up.
Re: got tle , need help.
Послано William Chou 13 апр 2011 08:25
Oh ! I got AC now.
Just a little Optimization.