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

Обсуждение задачи 1846. НОД 2010

Avoiding TL
Послано vlyubin 11 апр 2012 08:21
I was barely able to pass the TL by using the segment tree. That part probably works OK, but what causes troubles is the way I locate the array index by given content value (i.e. we want do delete 8, so I search for 8's index and replace it with 0). For that purpose I was using map from STL and wasn't able to come up with anything better (except some hash-like storage). What did you use for that purpose or could you avoid such situation at all?

Thanks.
Re: Avoiding TL
Послано derkenbaev 4 июл 2017 16:34
I solved by exactly the same algorithm, but got TLE 16-21. Then I just changed my cin to scanf and got AC for 0.218
Re: Avoiding TL
Послано Mahilewets 4 июл 2017 17:53
Try ios::sync_with_stdio (false) .
Report was it success or not.
I am interested how useful is ios::sync_with_stdio(false) .
Re: Avoiding TL
Послано Sergey 6 авг 2017 06:31
Yes it does help. My solution (sqrt) was TLE 17. after this line it is AC 0.421.
Just put this into main as the first line.
thanks for the suggestion, I was too lazy to use scanf:)
dont forget though that if you use this, then you cannot use printf and scanf in the same program with cin