Блог пользователя Alma_s

Автор Alma_s, история, 4 месяца назад, По-английски

Here is the 263750088 in my compiler it is running fine but getting runtime error at CF.

  • Проголосовать: нравится
  • +10
  • Проголосовать: не нравится

»
4 месяца назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

You have a division by zero on line 295.

You can spot errors like this by writing another program to generate test cases, and running your code on those test cases. Usually it's good to generate small test cases, but in your case the error only turned up once I generated a test with $$$n = 1000$$$.

Some runtime errors, like out-of-bound array accesses may be silently ignored on your computer, to search for these, it's good to compile your program with -fsanitize=address.