How to run code with very large input.

Revision en2, by TheOpChicken123, 2022-08-05 15:09:16

I have been trying to solve a question but I have a bug in my code which I need to fix. I also have files with inputs and corresponding outputs for this question. However the problem is that the input files are extremely big (about 3.5MB). Therefore, I cannot run it on my laptop as I get a segfault (I am certain it is because of stack overflow when I am doing dfs as I have done many tests). And I cannot run it on any online compiler, including codeforces, because the input file is too big. Most websites only allow input as big as a few hundred KB.

So my question is — How am i supposed to run my code with this input? The online grader where I found this problem only tells me if I got a testcase right or wrong or TLE, MLE, etc. It doesn't tell me anything as to the difference between expected and my output. So what should i do?

Note: I can't really find any smaller testcases either and every testcase that I make myself seems to work.

Edit: If you guys want to try on your own computers, here is the code: https://pastebin.com/fnWh1Xbc. And here is the input: https://paste.ee/p/FJKWt Please let me know if you don't recieve a segfault. Also note that if you want to copy the input, view the file as raw (there is a button on the linked website).

Also, this is the debug code that I used to make sure that the segfault is because of stackoverflow: https://pastebin.com/w9WV7Znx

The only difference between the two pieces of code is that in the debug code, I output "second" right before I go to a new node and the first thing that I do when I am at a new node is output "first". When I do this, the last thing my program outputs is "second" which means that it is the very act of calling the function which produces a segfault, which must mean that it is stackoverflow. Note that the dfs function is called "calculate_city_info"

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English TheOpChicken123 2022-08-05 15:09:16 904 In my last edit I have just added whatever is after "Edit:".
en1 English TheOpChicken123 2022-08-05 10:57:30 999 Initial revision (published)