Don't Panic - Episode 1 - Puzzle discussion

Dear all, apparently the lag was introduced by the way I coded my different ifs and elseifs… I restructured the ifs, namely grouping them if they were doing the same action, and this fixed the lag. I don’t know why, but now works 100% :smile:

Thanks for the patience!

3 Likes

The night was good, I think. :wink:

1 Like

Hi, codingamers! I seem to be having a problem with this puzzle. First 5 test cases are fine, but the problem appears only at cases 6 and 7. Output screenshot below:

line 44 = cin >> cloneFloor >> clonePos >> direction; cin.ignore();
The test crashes, dunno why ._. Can you help me, please?

Hi, everyone.
I have some trouble with getting elevatorFloor and elevatorPos on C++.
I try to use “vector<pair<int, int>>” to store the data. And after “cin >> elevatorFloor >> elevatorPos;” I use “push_back(…)”. But it seems to ignore that.
I try to change vector to array, and the same effect.
It ignore my every actions in the a for-loop(
So, can you give me some advices)
Thanks)

Hello,
I’m new here and i started to code the medium training puzzles and when i got to this one i was like… Omg is this medium? Srsly? I thought that there could be multiple elevators in one floor and since there is limited amount of moves i thought about some solutions like dp, greedy, bfs, etc… And i ended up coding bfs which wasnt nice cuz after that, I saw other peoples codes and they literally had only 2 ifs in them…
I think a clarification like this will be really nice for newbs like me :slight_smile:
Thanks for your patience,
sane’.thePlayer

Hello,

I’m sorry you felt it was more difficult than needed. We could improve the statement for sure. What’s funny is that a “newb” like you will think about dp, greedy and bfs…

On the details page of the puzzle, isn’t it clear that the puzzle is not difficult? :slight_smile:

That’s my first solution: a BFS. :grin:

Hello,
I’m new in this, but can someone tell me how to get access to variables elevatorfloor and elevatorpos which are in for loop from while() loop?

Issue with test case 5, about 18 moves in the inputs start going wrong and it starts reading outputs wrong. Had inputs saying the lead clone was on floor 2 multiple turns after it had gone up a lift to floor 3, and then it started to block clones when the output said wait - which blocked off the lift and made it unsolvable

Definitely it’s an easy puzzle, BUT…it is not so easy, when u had a problems with detecting elevator position, as I had. I crashed my brain, trying to get an elevatorPos variable. I’m still trying to get how I could make this. Simlpe vector creating in the beginning and
elevatorPositionVec.push_back(elevatorPos);
in for loop doesn’t helps. vector is simply empty :smiley:
I will be happy if someone gives an advice how to get that elevator position in cpp.
p.s. yep, I’m newbie…

whaaaat!??!

Hello ! I am having a problem with the episode 1. I am coding in C. I figured that the elevatorFloor and their matching elevatorPos were not in order from part5 to 7. I used a bidimensional table that contained those two integers. With a simple test, I can get the elevatorPos of my leading alien’s floor. It works perfectly for level 7 but for lvl 6, my test return an elevatorPos of 0 for the second floor, while it is located on 10 or 12.
I would not ask if my code wasn’t working on lvl7 but now I am really confused…

This puzzle was ridiculously easy.

I think there is a bug in test 05 and 06 for golang.
I’ve logged the elevator input for test 06 here:

ELEVATORS: Floor 3 position 10
ELEVATORS: Floor 4 position 12
ELEVATORS: Floor 6 position 12
ELEVATORS: Floor 5 position 10
ELEVATORS: Floor 1 position 10
ELEVATORS: Floor 0 position 12
ELEVATORS: Floor 7 position 10
ELEVATORS: Floor 2 position 12

…however there are 9 floors in this test, confirmed by clones reaching floor 8 and not being able to find the elevator. In test 05 I solved it by blocking before hitting the lasers at pos 1, however theres not enough turns to do this in test 06.

Note: The elevators floor order is not the problem in my solution. The missing elevator is the problem.

Try to set the debug mode on the replay viewer (click on the small wheel) and you’ll understand your issue. What you logged is correct, there is no missing elevator.

Facepalm :dizzy_face: exitFloor exitPos
Thanks for helping out

Hello,

The validator place the clone spawn point at position 11 while the width of the area is 13 (you have to stop clone at 12). But if you stop at 12, clones can’t spawn thus you can’t validate the puzzle …
Can you give a look at this please ?
Thank.

Hi, i think i found some bug in don’t panic. In level 5 elevator on floor 0 has position 18, but elevator on floor 3 has position 10, i think it’s(elevator on floor 3) position must be greater then 18. Or am i wrong?

use massive int *elevatorPos = new int[nbElevators];
for (int i = 0; i < nbElevators; i++) {
int elevatorFloor; // floor on which this elevator is found
//int elevatorPos; // position of the elevator on its floor
cin >> elevatorFloor >> elevatorPos[i]; cin.ignore();
}

1 Like

In fact this is not a bug, I think they juste don’t put it in the right order.
I used a loop in order to find the elevator floor matching to the clone floor.
Use cerr << "Elevator floor: " << elevatorFloor[i] << endl
<< "Elevator pos: " << elevatorPos[i] << endl;