Enormous Input and Output Test

Terry Reedy tjreedy at udel.edu
Sat Oct 3 19:50:29 EDT 2009


n00m wrote:
> Hi, py.folk!
> 
> I need your help to understand how
> http://www.spoj.pl/problems/INOUTEST/
> can be passed in Python.
> 
> I see two guys who managed to get accepted:
> http://www.spoj.pl/ranks/INOUTEST/lang=PYTH
> 
> My code for this is:
> ===========================================
> import psyco
> psyco.full()
> 
> import sys
> 
> def noo(b):
>     b = b.split()
>     return str(int(b[0]) * int(b[1])) + '\n'
> 
> def foo():
>     ##sys.stdin = open('D:/1583.txt', 'rt')
>     a = sys.stdin.readlines()
>     a = a[1:int(a[0]) + 1]
>     a = map(noo, a)
>     sys.stdout.writelines(a)
> 
> foo()
> ===========================================
> 
> But it gets "Time Limit Exceeded" verdict.
> Any ideas?

Don't waste your time with problem sites that judge raw-clock time over 
(and before) accuracy, thereby greatly favoring low-level languages and 
hack tricks over clear high-level code.




More information about the Python-list mailing list