Bryan Olson wrote: > Could be. Yet you did write: > > It's incredibly fast! I just was obliged to exclaim "It's incredibly fast!" because I THOUGHT your first version handled ALL TEN testcases from the input. But the code read from the *20-lines* input *ONLY 2* its first lines.
Usually they place heavy data testcase(s) at the end of the (whole) input. Like this: 3 2 3 1 7 4 5 6 1 2 7 3 ... ... ... 100000 456 2 6789 ... ... ... ... ... 55444 1 ... 234 Surely producing an answer for list [2, 3, 1] will be "incredibly fast" for ANY language and for ANY algorithm. > My first version bombed for the zero-length sequence. That was a > mistake, sorry, but it may not be one of their test-cases. In my turn I can bet there's not an empty sequence testcase in the input. > I > wonder how many of the accepted entries would perform properly. Info of such kind they keep in secret (along with what the input data are). One more thing. They (the e-judge's admins) are not gods and they don't warrant that if they put 9 sec timelimit for a problem then this problem can be "solved" in all accepted languages (e.g. in Python). > I never intended to submit this program for competition. "Competition" is not quite relevant word here. It just LOOKS as if it is a "regular" competetion. There nobody blames anybody. Moreover, judging on my own experience, there nobody is even interested in anybody. It's just a fun (but very useful fun). -- http://mail.python.org/mailman/listinfo/python-list