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

Общий форум

look inside
Послано King Without Kingdom 8 апр 2004 03:26
i want to exit from my brute force program after 3 (for example)seconds from its start.Give me please an example of code in С/C++ that will help me.
Re: look inside
Послано Vesper 21 апр 2004 19:12
Grab the timer interrupt and set global flag in your calculations. After 3 seconds drop the flag by your interrupt handler and quit the main program. And do not forget to restore interrupt vector.
Not very universal, but oftenly help.
Послано ronobe (aka oberon) 21 апр 2004 20:04
Calculate amount of iterations in your brute force cycle.
If IT - (amount of iterations) exceed maximum value which is set by hands and individually, you just stop bruteforcing.
You can set MaxIT = 1 million. If it gets WA in 0.4 second, then you can increase MaxIT twice. Hope this clear.