One thing I'm struggling with is taking data from stdin...I don't know of a way more efficient than this:
import sys x=sys.stdin.next()
But that means that I've already spent 30 characters to get the line into x, which seems awfully inefficient. If there's a better way to load x from stdin, could somebody give me a hint as to what function or class to look at?
(By the way, I'm just amazed at some of the scores on these problems...I can't wait until there's some policy under which we get to see old code.)
import sys
x=sys.stdin.next()
But that means that I've already spent 30 characters to get the line into x, which seems awfully inefficient. If there's a better way to load x from stdin, could somebody give me a hint as to what function or class to look at?
(By the way, I'm just amazed at some of the scores on these problems...I can't wait until there's some policy under which we get to see old code.)