https://www.codingame.com/training/easy/1000000000d-world
Send your feedback or ask for help here!
Created by @awnion,validated by @tutubalin,@codybumba and @SelrahC-Twin.
If you have any issues, feel free to ping them.
https://www.codingame.com/training/easy/1000000000d-world
Send your feedback or ask for help here!
Created by @awnion,validated by @tutubalin,@codybumba and @SelrahC-Twin.
If you have any issues, feel free to ping them.
Hi! Cool puzzle, I’m enjoying it so far.
Although I think my solution is correct and I have tested it over multiple cases, I don’t find why I’m failing Test 5 (and Validators 3 and 5). I don’t get what makes these specific tests so special. Do you have any hint?
Thanks!
You are probably using int instead of long
Nope, I’m really using long but thanks for your answer!
EDIT : you were right!! I was using long to store the result but I also needed to use long to store amounts and values of the differents pairs in each vector. Thanks!
Hello !
I’m a bit confused, I passed all the tests and validators but validator 6 ! I read again my code to try to understand where was the mistake but I can’t figure out what’s wrong… Does the validator 6 have something special ?
Many thanks in advance !
Nothing special really, just make sure your code can handle negative numbers correctly wherever they are
Thanks for your answer !
I missed a condition, I wrongly assumed I was at the end of a sequence at some point… Weird that my code passed all the tests…
I have passed all the tests adding the products of the elements one by one.
[1000 1] * [1000 1] = 1*1 + … (1000 times)
You should have a performance test that would fail on such an algorithm.
Pretty sure that cannot be done due to size reasons. You have only 256MB of heap which will not allow for more than 4 million numbers; Now halve that for 2 arrays. Now halve if again because on some languages like JS the array are keyed and you have to store both the key - which are numbers and the values.