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.
done at some point
Some operators in C++ have synonyms.
Sometimes when you are checking your solution by printing out each one of the instrutions make the buffer to get full. That is why the system tells it is timed out. Same thing happened to me, so I deleted the cout. All the problem got fixed.
Thanks!
The description for Input is changed to: the
i
-th number is the number of the friend who was given a present by friend numberi
.Could you please provide any description option, which would be understandable for you?
Really difficult to understand :) The 1-based indexing puts even more confusion on top of everything.
Not a suggestion, and the initial solution does not have to compile.
I hit this as well, and had to ignore "jnz" instructions with a non-existent register as the first argument. It comes up dozens of times in the tests (I output a message each time). And looking at those who solved this in Go, all of them skip "jnz" when the register doesn't exist.
Definitely. This should be a 6 Kyu Kata.
It is basically a parseInt variant
Sit down, yup. Only with brain
5~10 min i guess
If possible, try adding translations to more popular languages, C++ isn't so popular imho.
Yes, I tested it for 1 kyu (then I finished that kata honestly).
But in any case, this is against the rules.
I don't think it is good to finish even this kata like this.
Random variable names are never 1-char-long, and
rand()
can never result inNaN
...Expression evaluated by compiler has different spec than expressions in this kata. Compiler follows 'longest possible token' rule, and as Farekkusu said, it treats
--81
as decrementation of non-lvalue. However, it will happily accept-+-+-+-+81
or- - - - - - - 81
.Nan thing sounds suspicious tho. But I cannot check it now :(
Link to these so-called "mathematical syntax rules"?
Out of the 3 expressions you've mentioned only
--81 - -8736 * -7896
results in an error, and that's because the compiler doesn't understand that this is a double negation, and not decrementing an integer literal.Loading more items...