ANEO Sponsored Puzzle discussion

For test 5, the second light is 1500m away. At 78 km/h you cover 78 / 3.6 = 21.67 m/s, so you need ~69sec to reach it. Since that light has a duration of 20sec, you reach it when it’s red.

1 Like

Ohhh… so i do not have calculate the total distance of the light ? The light turns green automatically when i pass the previous one ?
From the Puzzle descriptions I thought that ALL lights turn green when i begin the rout. Well anyway thank you for you help :slight_smile: it is highly appreciated.

Yes it does.

They all do turn green at the start of the route.
But the distance given is also from the start, not from the previous light.

This puzzle is slightly too pedantic with the integer requirements, in my opinion. And the inconsistency of rounding the value of a calculation doesn’t help either. A calculation that has a value of 67.499999 returns 67.5, while a calculation that has a value of 9.999999 returns that same value.

4w6iqa

6 Likes

The most challenging part of the puzzle was floating point arithmetic. Learned something new.
I can’t find contributions from other programmers. I would appreciate it if they were made available to compare methodologies and solutions.

this is the only puzzle where the solutions are not available to the players once they solved it, because it’s a sponsored challenge.

1 Like

Thank you for your response. At first I thought it was an error on my side.
I understand that different services fit different customers needs. In this case, the sponsor’s requirements.

That is not good. It would help me to see how the Pros are doing this.

the only rounding i used in rust is casting from f32 to i32
and it passed all the tests.

I think there is something wrong with the answer on the first test. Its a straight forward calculation:
(200(distance)/1000(conversion to km)/(15(sec)/3600(conversion to hours) =48 km/h
But it expects the answer to be 50 km/h. Am I missing something?

Nothing wrong in this puzzle. And the thing you are missing is probably the goal of the puzzle, I’m not sure to understand what you are trying to calculate… I invite you to give a second read to the statement.

1 Like

Hello!

I wanted to know if you had a email address that I could reach out to Aneo on this puzzle. I have an article I want to draft around problem solving, using this puzzle (and the solution I made), and I want to get their permission before I post anything around the solution. I understand they may not want solutions readily available on the internet, and I realize they may permit me publishing an article as long as it doesn’t have the solution I made in it.

2 Likes

I’ll try to get ahold of someone in Aneo’s team who could help

I’m calculating distance/time to get speed, right? I cannot see how the right answer should be 50 km/h

Yes. But what speed do you think you gonna find by dividing the distance from the start of the road to the traffic light, by the time that this traffic light stay on each color ? I’m curious :thinking:

Thank you so much for your help.

That line: “You cannot drive through a light the second it turns red” is confusing, because a second is a length of time, not a moment in time.

It wouldn’t be the 1000ms after the moment it turns red, because it’s obvious that you can’t drive through then. So is it the 1000ms before the moment it turns red? The 1000ms around the moment it turns red?

This puzzle taught me more about accurate problem specs than about floating point calculation.

It’s an expression, similar to “the instant it turns red”, there should be no confusion here.

1 Like