Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!newsfeed.eweka.nl!eweka.nl!feeder3.eweka.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'algorithm': 0.03; 'suppose': 0.07; 'python': 0.09; 'incorrect': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'regression': 0.09; 'terry': 0.09; 'url:)': 0.13; 'languages.': 0.15; '10x': 0.16; 'instance)': 0.16; 'limit.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'subject:Regular': 0.16; 'subject:expression': 0.16; 'timed': 0.16; 'wrote:': 0.17; 'jan': 0.18; '>>>': 0.18; 'equivalent': 0.20; 'trying': 0.21; 'subject:problem': 0.22; 'solutions.': 0.23; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; '[1]': 0.27; 'correct': 0.28; 'header:X-Complaints-To:1': 0.28; 'run': 0.28; 'post': 0.28; 'thus,': 0.29; "i'm": 0.29; 'seconds': 0.30; 'point': 0.31; 'not.': 0.32; 'running': 0.32; 'could': 0.32; 'problem': 0.33; 'to:addr:python-list': 0.33; 'know.': 0.33; 'program,': 0.34; 'faster': 0.35; 'pm,': 0.35; 'there': 0.35; 'received:org': 0.36; 'but': 0.36; 'test': 0.36; 'enough': 0.36; 'correctly': 0.37; 'ones': 0.37; 'quite': 0.37; 'subject:: ': 0.38; 'fact': 0.38; 'sure': 0.38; 'to:addr:python.org': 0.39; 'easily': 0.39; 'header:Received:5': 0.40; 'most': 0.61; 'first': 0.61; 'solve': 0.62; 'close': 0.63; 'times': 0.63; 'here': 0.65; 'limit': 0.65; 'answer.': 0.71; '2:30': 0.84; 'original.': 0.84; 'received:fios.verizon.net': 0.84; 'remember,': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: Regular expression problem Date: Mon, 11 Mar 2013 16:23:21 -0400 References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-173-75-251-66.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130215 Thunderbird/17.0.3 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 33 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1363033451 news.xs4all.nl 6890 [2001:888:2000:d::a6]:59828 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:41089 On 3/11/2013 2:30 PM, Serhiy Storchaka wrote: > On 11.03.13 04:06, Terry Reedy wrote: >> On 3/10/2013 1:42 PM, mukesh tiwari wrote: >>> Hello all >>> I am trying to solve this problem[1] >>> [1] http://www.spoj.com/problems/MAIN12C/ >> >> As I remember, and as it still appears, this site severely penalizes >> Python solvers by using the same time limit for all languages. Thus, a >> 'slow' python program may work correctly but the site will not let you >> know. > > I'm sure the time limits are enough to solve most (if not all) of > problems. Actually all submitted solutions on Python for this problem > run from 0.47 to 0.61 seconds (http://www.spoj.com/ranks/MAIN12C/). You do not see the solutions that timed out. I suppose you are pointing to the fact that for this problem there are solutions close to but under the time limit. However, algorithm running times are not evenly distributed. Suppose, for instance) there is a correct O(n**2) solution and a correct O(n) solution and that the ones listed are the O(n) solutions. Then the Python O(n**2) solutions could easily take 10x longer to run and time out, while equivalent C solutions do not. Mukesh is not the first to post here a reasonable looking solution for that site that he could not judge because the test quite and refused to answer. I point out again that he was 'happy' to have a faster but incorrect program, even though it might have been a regression from his original. -- Terry Jan Reedy