Horse Racing Duals puzzle discussion


Maybe your algorithm is not optimized enough?


Salut à tous! Je suis nouveau sur CG. Y’a des tests supplémentaires dans horse-racing, je ne sais pas comment les passer. Qcqn a une iddée?


Hi there !

Is someone using Kotlin for this puzzle ?
I passed all the tests except the ‘huge’ ones…

It seems that I can’t even store the int in array without timeout.

this code :

 for (i in 0 until N) {
        //val pi = input.nextInt()
        lesdadas+= input.nextInt()

without anything else make a timeout.
Is someone succeed in Kotlin?


I wanted to make a liste with the pi
I putted
10. liste.append(pi)

but it doesnt work, I got the message
SyntaxError: Non-ASCII character ‘\xc3’ in file on line 10, but no encoding declared; see for details

at not in a function on line 10

someone can explain ??


Did you try to use a non-ASCII character in Python 2?


what 's non ASCII character (sorry Im begginer)
Something like é, @ ??

No I didnt


Ok I found the problem. It was because I putted : " # We create a liste ".
I delete it and it worked.
But I dont understand why…


Nothing special in “# We create a liste” but maybe you printed an no-break space.


I’ve used lists instead of arrays and it worked. This is the only difference between your algo and mine.


Aaaaaaarg ! I just did it and it’s fine ! :slight_smile:
Thanks a lot !


Hello , can i get the validator test by private message too. I am facing the same error for “Shorter difference on the first 2 horses”. Thanks