Ad
  • Custom User Avatar

    oh yea, you're right. I should debug more. really interesting that this worked under the cpp compiler and passed all the tests. Thank you for this commend :)

  • Custom User Avatar

    please blame your own code before you blame the tests (there have been more than 3,000 completions in C as you can see at the top of the page, so such a glaring mistake is unlikely). debug your code locally. if you don't know what input causes your code to crash, add a

    printf("input was %d\n", n);
    fflush(stdout);
    

    at the beginning of your function (flushing the standard output stream will ensure that you will see it even if the program crashes). i tried your code in a debugger and you do not allocate enough memory in inst->num_array. you allocate enough space for 5 integers, while a 32-bit integer can have as many as 10 digits.

  • Custom User Avatar

    the c environment is broken. same code passes everything with c++ compiler but crashed with c compiler. please fix it :(

  • Custom User Avatar