On 8/3/2010 8:03 AM, Dodo Speaks wrote: > Hi, > I have seen on various coding competition sites that also take the time > taken by the algorithm code in consideration for judging purpose. Just > wanted to know how do we calculate this time, do we use any software for > that. Please let me know the way. I need to compute my algos time. > > Thanks.
Those systems time the executable while it is running. It isn't anything fancy. Given the input, some questions are whether or not you can spot the "trick" to getting it to run fast (i.e. figure out the one special test case that makes your program run slow). Generally, the limit on execution time is roughly 30 seconds. If your application exceeds that time limit, it gets killed off so the CPU is freed up. Depending on the system, there are sometimes memory limits as well (special C/C++ libraries compiled in that kill the program when too much RAM is allocated). Programming competitions should perhaps reflect the real world a bit better. If the program fails a test case due to performance reasons, it should spit out an alternate, similarly performing test case for the person to chew on. Of course, this requires creating many more test cases: A set for the programmers and a set for the system. I don't know of many systems where I get zero feedback from the system and have to blindly guess as to what the issue is. Taking this approach would allow for the creation of multiple tiers in programming competitions. A Beginner tier would get more feedback while the Expert tier would get the current limited feedback. -- Thomas Hruska CubicleSoft President Barebones CMS is a high-performance, open source content management system for web developers operating in a team environment. An open source CubicleSoft initiative. Your choice of a MIT or LGPL license. http://barebonescms.com/
