Ad
  • Custom User Avatar

    if words is an "", then *(tmp++) = *words; *tmp = 0; this will set 2 zeros.

    If each individual test gave the minimum required amount of memory for letters, then this solution, on empty words, would have exited and written out of memory limits for letters.

  • Custom User Avatar

    gcc -m32 ? (solution not suitable for 32 bit architectures?)

    Maybe the '1' should be extended to 'uint64_t' instead of 'long'?

  • Custom User Avatar

    Functions "findIndex" and "rotate" are non-standard and also not available in the viewable code. So how can everyone come to this solution?

  • Custom User Avatar

    I tried to avoid memory allocation. And also build the array of primes only once for all tests.

    Having looked at other people's solutions, I realized that you could think about replacing
    prime_numbers[i] <= n_div_2
    by
    prime_numbers[i] <= n_sqrt
    and then change the logic of the calculation (I admit, this part of the solution I did not work out very well).

    And also it is worth finding a threshold for the input number, above which my solution will contain fewer steps. Otherwise, use a simple solution.

    It was interesting for me to decide correctly (as far as I understand it), although it seems to me that it is a little higher than 7kyu.

    Hopefully someone can benefit from this.

    Good luck to everyone reading this!

  • Custom User Avatar

    @hobovsky - Thank you. (you can explain, I appreciate it.)

  • Custom User Avatar

    I take everything personally, too close to my heart. I am often told about this. ("This cruel world") Sorry.
    Or do you need a different genre of response? Continuation? Action?

    Okay, I fantasize and write:

    Ok, he's my enemy.

    I understand that the way to 1kyu in C is difficult, especially if you achieve everything yourself. There will be many obstacles in my way. But - "No King Rules Forever".

    dinglemouse - This user's profile is not available
    Blocked me? Ok. "Run, mouse, run!" - Horacek Petr.

    I will turn your evil into my motivation to be better.

    Have a nice day to everyone who read this! =)

  • Custom User Avatar

    Yes, I understand this.
    (You offend me.)
    Have a nice day for me! =)

  • Custom User Avatar

    I know this, but I have no way to fix it.

  • Custom User Avatar

    Yes, a mistake.

    I have already fixed this in the next submit.

    Obviously so - unsigned char arr['{'];

    If you need to explain something in detail for you, write to me in a personal.