ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1438. Time Limit Exceeded

If you have WA#9
Posted by rkhapov 16 Jul 2016 18:44
I set condition to terminate program:

while (!halt)
{
    //bla bla bla
    executed++;

    if (executed > MAX_EXECUTED)
          terminate_program();
}

to

while (executed < MAX_EXECUTED && !halt)
{
     //bla bla bla
     executed++;
}

if (executed >= MAX_EXECUTED && !halt)
    terminate_program();

It helps me and I got AC :)

Edited by author 16.07.2016 19:03

Edited by author 16.07.2016 19:04

Edited by author 16.07.2016 19:05