Help in milkvisits USACO gold 2019

Revision en2, by vrooooom, 2019-12-21 06:07:03

Hey guys!

I was having trouble solving milkvisits on the USACO gold contest. I solved it using heavy light decomposition, and I messed up on the implementation. I realize that you can solve this problem in a different, faster, and easier way, but I want to know what went wrong in my implementation. I looked at the test cases, but the smallest test case that I got a wrong answer on is of size 100, 000, so I had trouble visualizing the graph.

Here is my code, the input is in this google drive folder. I am supposed to output 1, but instead I am outputting 0. It would be of great help to me if you could tell me why my code is failing, and generally speaking, how you manage to debug problems with large inputs, if you use the inputs at all.

Thanks in advance.

Tags usaco, debug, #general advise

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English vrooooom 2019-12-21 06:07:03 72 Tiny change: 'Hey guys!\n`adfs`I was havi' -> 'Hey guys! '\n' I was havi' (published)
en1 English vrooooom 2019-12-21 05:59:14 964 Initial revision (saved to drafts)