Alma_s's blog

By Alma_s, history, 3 weeks ago, In English

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

  • Vote: I like it
  • +10
  • Vote: I do not like it

»
3 weeks ago, # |
  Vote: I like it +1 Vote: I do not like it

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.