2 ms·
42 minutes? I recall more than one ACM problem that could be bruteforced just within the running time (in C). Actually, I did really badly in one contest becaus
by JoachimSchipper 16y ago
42 minutes? I recall more than one ACM problem that could be bruteforced just within the running time (in C). Actually, I did really badly in one contest because I applied serious mathematics to one such problem (which gave a much faster program, but writing it took a lot of time and fast enough is fast enough.)
- DarkShikari 16y agoSure, some can be bruteforced, but typically it's intentional. A good example of what I mentioned was an assignment this week. Last week, the input size was constrained to a thousand or so, and Floyd-Warshall was able to solve the problem. This week, it's the same problem, but with inputs up to ~50,000 in size. The old program, run on the new test cases, doesn't finish in a day.