Enormous Input and Output Test
n00m
n00m at narod.ru
Sat Oct 3 09:54:21 EDT 2009
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?
More information about the Python-list
mailing list