need faster io for python programming !!

The problems which I solved in c and Java are getting TLE in Python. I saw many submissions in python with very less time, in current contest.

May be, I am using slower io ?? Please guide me about faster io in Python.

I am new in python see this thread … http://discuss.ww2.codechef.com/questions/8773/which-scripting-language-should-i-learn

Hoping to get some help.

1 Like

Have a look at some tips

Also regarding input

import sys
n, m = map(int, sys.stdin.readline().split(' '))

is faster than

n, m = map(int, raw_input().split(' '))
2 Likes

did’nt worked still getting TLE.

The simplest and most powerful way to get your java program started is by using jigy Generator link text

@bugkiller, can you please tell me among these, which one is faster?

import sys
n, m = map(int, sys.stdin.readline().split(’ '))

or

n,m = [int(i) for i in raw_input.split()]