by JoachimSchipper · 16y ago · 0 comments
It would be nice if the boundary conditions were better specified (people seem to have been bitten by overflowing integers). This could be inferred if you told people that you're using a 32-bit machine (the sum of elements is at most SIZE_MAX * INT_MAX; if int and size_t are 32-bit, SIZE_MAX * INT_MAX < INT64_MAX.)
I was also somewhat surprised to see that my code compiles without #include <stdint.h>. I'm not sure this is correct (it could be solved by putting the code written by the candidate before the test code).
Finally, I assume you have proper sandboxing set up?
#include --- good catch! We are not very strict about missing includes, but this is definitely not something we want to penalize.
Sandboxing -- absolutely! :-)