Online Course Discussion Forum

USACO: under what size of data is it generally safe to use "brute force" solutions?

 
 
WangDr. Kevin的头像
Re: USACO: under what size of data is it generally safe to use "brute force" solutions?
WangDr. Kevin - 2023年02月15日 Wednesday 18:37
 

On the Bronze level, when the data size is $N=100$, there is no significant difference between $O(N^2)$ and $O(N^3)$.  It's like 0.01 second and 1 second, you notice the difference in speed, but it won't be that much.  When $N=10^5$ or something like that, it will be quite different.

To find the bug in your program, print out some more intermediate results to debug (or use the debugger in your IDE).