Ad
  • Default User Avatar

    Another question in the same vein as some below: running this in C#, getting correct answers, but the full test suite times out.
    For n=20000, m=30000 (above the test limit), this still only takes 808ms. How much faster does it need to be?
    Edit: down to 640ms, still no luck.

  • Default User Avatar

    Here's another one:

    [ [ 2, 6 ], [], [ 0 ], [ 1, 2 ], [ 2, 2, 6, 3 ], [], [] ]
    Capacity:  5
    

    My log: [ 0, 2, 4, 6, 4, 3, 2, 1, 0 ]

    expected [ 0, 2, 4, 6, 4, 3, 2, 1, 0 ] to have the same members as [ 0, 4, 3, 2, 1, 0 ]
    

    Similar case, where the first floor takes on people.

  • Default User Avatar

    Thanks for that, I don't remember that being there!

    As I thought, my solution did give that expected result above. My solution only fails one random test occasionally, and sometimes completely passes. Just rerunning the tests now 'til I get another failed test short enough to see the expected.

  • Default User Avatar

    Well my solution seems to have deleted itself, so I can't check anymore! But that solution you got seems to match what I got as a result, but the test failed.

  • Default User Avatar

    Potential issue with Typescript tests.

    I have this test case:

    [ [ 3 ], [], [ 1, 4 ], [ 1, 4, 0, 0 ], [], [ 4 ] ]
    Capacity:  5
    

    which has this solution

    [ 0, 5, 4, 3, 2, 1, 0 ]
    

    According to the question, people can get on the ground floor at the start of the problem. So why does this lift not stop at Floor 3 before proceeding to Floor 5? And in that case, it would also stop at 2 and 4 on the way up.

  • Default User Avatar

    Done :)

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    The two sets of random tests use the exact same generation method, the only difference is the grid size (and hence start/end locations) and the time cutoff.

    The only invalid inputs I am aware of would be starting or ending on an Infinity square, which is accounted for in the random tests.

    With regards to your particular heuristic issue, could you comment on how your computation was incorrect, so I could add a non-random test case for it?

  • Default User Avatar

    Agreed :)

  • Default User Avatar

    Added a couple of grid cases. I suppose there's no harm in them being there, not exactly overwhelming.

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Loading more items...