You are not logged in. Please login at www.codechef.com to post your questions!

×

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.

asked 10 May '13, 13:49

saj1919's gravatar image

4★saj1919
915511
accept rate: 0%


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(' '))
link

answered 10 May '13, 14:45

bugkiller's gravatar image

3★bugkiller
8.7k194898
accept rate: 9%

@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()]

(10 Nov '14, 09:59) dawny332★

did'nt worked still getting TLE.

link

answered 12 Oct '14, 14:42

vipin14119's gravatar image

2★vipin14119
1
accept rate: 0%

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

link

answered 14 Oct '14, 01:44

dosum99_'s gravatar image

0★dosum99_
1
accept rate: 0%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×717
×518
×6

question asked: 10 May '13, 13:49

question was seen: 11,802 times

last updated: 10 Nov '14, 09:59