Thanks for the help
I had the same issues as you CodinBros; my issue was with the case where the input time was within 10 seconds of 256 (4:16). Try debugging your output and manually setting the input time to some values in that range to see what your output is. The edge case issue became clear once I did that.
oooh thats a good point so my code return 0:4 instead of 0:04 if there are less than 10 seconds left
This was my issue; needed to pad the seconds if <10. Thanks.
Many thanks!! My code wrongly displayed 0:9 instead of 0:09. I pass it. Thx
Thanks, my mistake!
Never mind.
Hello everyone first test fails after submitting even if my result matches with the expected one. IDE told me the solution was correct.
I have added a new test to the end of the suite, called āDown to the last secondsā so that others donāt stumble over this in the future.
- danBhentschel
Thank you. Iāve been fighting this for weeks. Never crossed my mind that the formatting was off.
Terrible problem definition.
The time reference is based on a timer counting backwards. Itās not a date, just the count of a timer.
The explanations refer sometimes to an absolute time, sometimes to this floating reference.
āthe timer changes based on players joiningā is plain wrong. The timer keeps counting toward zero regardless of people joining. What changes is the date at which the game might be started (what I call the ārush dateā since it can only make the game start earlier).
I especially wondered at this āset the new time instead of starting the gameā directive. I have no idea what that means so I simply ignored it. Luckily for me it didnāt seem to matter neither for tests nor validation.
The tests send you timestamps corresponding to players joining after the game started, as if people could join in mid-game or something. There is not a word said about this in the problem definition.
When that occurs, the rush date has no longer any effect, obviously, but if you still take it into account youāll most probably produce a wrong result (as if this player joining late had delayed the game start).
Agreed, the problem is nice, but the explanation is really confusing, some sentences are useless ("If a player joins at the same time the game is supposed to start, set the new time
instead of starting the game.ā), some other are confusing (āp is the number of players in the roomā, yeah, but itās the number of player in the room before the player join, the explanation leads to believe itās including the current player), maybe somebody could rewrite it ?
The problem is fairly straightforward; the hard part is understanding the ambiguous description:
- does ācurrent timeā mean the time since the timer started, the time until the game starts, or the time currently displayed on the timer?
- is āpā the number of players in the room before or after the player who is joining?
Most importantly, the purpose of a timer is to count down to when the game will start. If the game starts before the timer reaches 0:00 then the timer is BROKEN! (unless 8 players join)
The challenge of a puzzle should be finding a way to implement a solution, not struggling to understand the badly-written spec.
HATED IT!
I have a problem I passed all the test in C langage but the fonction malloc canāt found enough place sometimes so my rate when i send my code depend only of this. With the same code, i can get 33% and next a 58%ā¦ How can i solve this?
If you have solved it, can you tell me if p is the number of players before or after the new player joined the game ?
Before. You may also deduce that by following the example in the statement.