[Community puzzle] Elevator


Anyone knows the purpose of the validator 4 ? I pass all tests but this one and I don’t know why…


Maybe you don’t use big numbers (ie overflow).

Hi everyone,

I’d like to second the question, I have exactly the same problem (all tests clear then fail on validator 4).

I think I have exhausted the logic of the puzzle (I’ve added handling for situations not present in the tests), but no success.

I know it would defeat the purpose of validators in preventing people from hardcoding solutions, but maybe a bit of info could be nice on the validators.

Maybe something along the lines of :
-wrong output
-time out
-error: error message

I’ve noticed sometimes the validators get named, and sometimes it goes a long way. Like you fail the “Big Data Set” validator, probably is overflow/timeout.

Just my 2 cents.

If someone would like to PM me code that fails validator 4, I will investigate. I don’t see anything immediately obvious about it that would indicate a special case.

  • danBhentschel

I finished the puzzle, and all test cases pass. But when I click submit, the validator 4 and 6 fail. I did not hard code it.
Do we know what those two validators test for?

Who knows. I think validator have got errors.
So, validator don’t check the output of the floor border.
My solution have got 100% in validator.
But in case (1001 1000 999 1 4 ) my solution print 6, although it should be “IMPOSSIBLE”.

@player_one : i can’t send you my code by PM, I’ve got a 429 errors :sweat:

Keep retrying. The forum doesn’t like the extra traffic over the past few days, but if you’re persistent, then it eventually goes through.

… Nevermind! I got it! :slight_smile:

  • danBhentschel

Okay. So I have found the logic error in your code, and have put a new test into the puzzle entitled Where’s my floor? It is similar to Validator 4. Your code fails on this new test, but my solution (and a few other people’s solutions as well) passes this test.

  • danBhentschel

My solution passed this test, but it should not be pass the ALL tests!!!
My solution gave bad answer in cases like (1001 1000 999 1 4 ). My solution print 6, although it should be “IMPOSSIBLE”.
Your tests should fail my solution!

I feel the need to clear this up a bit. These aren’t “my” tests. :slight_smile: I neither wrote this puzzle, nor approved its addition. I’m just trying to help out here. No condemnation for those who did. It’s a decently fun puzzle.

That out of the way…

I’m not sure that every puzzle needs to protect against every possible bad (incomplete) solution. However, I guess I’m willing to add one more test case. Care to suggest a name for this test case? Also, you will need to provide a different Validator test (preferably via PM so that it remains secret) that exercises your code in such a way that it also fails.

  • danBhentschel

Excuse me, if I said roughly. I bad speak in English.
I said “your test” , I mean “your site’s tests”, “your organisation’s tests”, not more.
Name for test - would be “Elevator on the roof”, for example, or “Spurt out”.
test - anyone, where
high floor - last floor < B (floor down) And last floor - first floor < A (floor up) . In five minut I’ll send example for you in PM.

Hello All,

I really enjoyed this problem but my program (which is in C), keeps failing validator 3. I did not do any hard coding and I can’t see why it wouldn’t work. Is there any way of finding out what area validator 3 is checking without giving away the whole test?

Thanks in advance

Just to further clarify, for you or anyone else reading this… :slight_smile:

I am not an employee of CodinGame, nor do I represent them in any official capacity. I am just a conscientious member of the community, endeavoring to help out.

The Elevator puzzle, being a community puzzle, is not written, nor approved by anyone on CG staff. Nor are they obligated to maintain it. It originates from and belongs to the community.

  • danBhentschel

Thank you for your work, I see.
I also try to make this puzzle better.

1 Like

Anyone have any insight into what Validator 5 is checking? Only one I can’t quite seem to get right.


1 Like

Usually, validator 5 is similar to test 5.

The new test did the trick for me ! Just a hint of what kind of situation is tested is sometimes all we need to get it :wink:

Thanks a bunch !

Thanks a lot @Player_one, I’ve also found the bug in my code… It’s kinda… embarassing that I’ve shared with you my code now :stuck_out_tongue:

Nice puzzle !


To find out the bug in my code I use this debug line (Python3) :
print("{} <- {} -> {}".format(down_floor, current_floor, top_floor), file=sys.stderr)

I hope that helps.