Find a random problem from either the USACO guide or the main site
a. Mentally categorize the problem type (if it isn’t from the USACO guide) to figure out how I’ll solve it
Write the solution to the problem
Submit and wait for grading server response
If I get WA and can’t figure out why, look at the test cases for the problem to figure out what I’m doing wrong.
My issue mainly stems from #4. When I get WA, I start from the first WA test case and compare the expected output to my program’s output. Usually this is enough for me to figure out the problem, but sometimes I open a test case and… it’s filled with hundreds upon hundreds of lines. Of course, this is way too much to reasonably look through and solve manually. Many times when I check the solution they have a very similar algorithm implemented, so it’s doubly confusing where exactly I went wrong.
Does anyone know a method to overcome this issue? It’s happened to me 3-4 times and concerns me a lot since I’m terrified of it happening mid-contest. Currently I’m just skipping the problems to review later since I already understand the concepts required to solve them and am able to AC similar questions.
Thank you.
PS: I do try to create my own test cases that fail; the questions I’m having problems with are the ones where all the test cases I make are passed by the program.
Both, depending on how much trouble I have with the question; I think the issue is that I miss some implied information in the problem itself that prevents me from figuring out the right solution. For example, in The Great Revegetation (Silver), I was failing most of the test cases because I didn’t realize that not every field was favored by a cow. After realizing this the next day, I was able to easily fix the issue and only ran into time errors from then on (which were much more manageable than WA).
So I think the real question is this: how can I prevent myself from missing information in this way? The general consensus around USACO seems to be to just practice more, which usually works for me, but in this case it seems like it doesn’t apply. Regardless of how much I practice, it feels like I continue to be unable to figure out specific nuances of some problems. This doesn’t seem to be a very common issue, so I was wondering if there was some method to ensure that one cannot “miss” things or make wrong assumptions.
I think such an error would be easily discovered if you just tried to generate test cases at random and comparing with a brute-force solution that checks all 2^N possibilities?
The issue was that I misinterpreted the question itself, so when I generated test cases I made it so that all integers 1…N were used by at least 1 cow.
Though that might just be a skill issue on my part, it circles back to my original question of how I’m having trouble with figuring out all the information provided by a problem. Is there some strategy that you or other competitors use to “map out” all the information present in a problem and avoid misunderstandings?