Time Limit ("The Bridge")


#1

Hi,

I’ve a generic question regarding the time limit. Currently I am solving The Bridge, which states that a response has to be given in <= 150ms.
No I am running in a timeout on test 12, and i am not sure why. I’ve deactived all output for this, only timestamps (with perf_counter()):

    Standard Error Stream:
    Start Time : 9812224385.245ms
    Game information:
    Approaching bridge...
    Speed 0
    1 bike remaining.
    Standard Error Stream:
    Bikes 1, Survivors required 1
    Length of bridge: 30
    Time after all Inputs : 277.348ms
    Speed: 0
    Bike 0 at 0,2 with state 1
    Time Cummulative: 277.518ms
    Time Cummulative: 277.553ms
    Time Cummulative: 277.586ms
    [...] 
    Time Cummulative: 281.644ms
    Time Cummulative: 281.676ms
    Time Cummulative: 281.722ms
    Time Cummulative: 281.748ms...
    Game information:
    Timeout: your program did not provide an input in due time.
    Speed 0
    1 bike remaining.

As you can see, it takes >270ms to get the inputs only, my DFS then takes ~0.1ms per Iteration.

So how dows CG apply the 150ms limit? Including or Excluding the time the Host takes to generate the input for my program?


#2

The timer start after the reading of the first input.