Ad
  • Default User Avatar

    done at some point

  • Default User Avatar

    Some operators in C++ have synonyms.

  • Custom User Avatar

    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.

  • Custom User Avatar

    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 number i.

  • Custom User Avatar

    Could you please provide any description option, which would be understandable for you?

  • Custom User Avatar

    Really difficult to understand :) The 1-based indexing puts even more confusion on top of everything.

  • Custom User Avatar

    Not a suggestion, and the initial solution does not have to compile.

  • Default User Avatar

    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.

  • Custom User Avatar

    Definitely. This should be a 6 Kyu Kata.

  • Custom User Avatar

    how you find a solution like that

    It is basically a parseInt variant

    Do you sit down with a piece of paper and start to think

    Sit down, yup. Only with brain

    How much time did it take you

    5~10 min i guess

  • Custom User Avatar

    If possible, try adding translations to more popular languages, C++ isn't so popular imho.

  • Custom User Avatar

    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.

  • Custom User Avatar

    Random variable names are never 1-char-long, and rand() can never result in NaN...

  • Custom User Avatar

    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 :(

  • Custom User Avatar

    Right, but then it should be written like that, otherwise it's invalid syntax according to mathematics

    Link to these so-called "mathematical syntax rules"?

    For example, the C compiler can't interpret that mess

    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...