Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
I meant O(n log(n)). And considering the number of people complaining about timeouts, they wrote a O(n^2) one.
Not sure if possible, but you could perhaps #define while cheat_detection(); while
It doesn't matter that that turns it into two statements, just as long as the cheat_detection() is called you will (silently) fail the test. Be sure to VERY CLEARLY state that 'while' is not allowed to be used ;).
If people know you do this they can work around it, of course.
I am not happy. I spent a lot of time on writing a solution that is O(log(n)) because the description said it was necessary to write an efficient algorithm (and it should be); then I find out that everyone else wrote a simplistic O(n) "solution" and got away with it. :/ That is not right.
The program of Complex #2 jumps passed the end of the program.
It ends with:
...
jnz 5 10
mov c a
So, that DOES jump - because it jumps when 5 != 0, and
advances 10 places, which is way behond the end of the program.
I'm a speed freak, so I always try to write a solution that is fast - but you beat me with this solution lol. You're totally right though: since the answer had to fit in a long long, there are only a very limited number of possibilities. I think you cracked/invalidated this kata!