ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1006. Square Frames

read input in python
Posted by crc 25 Jan 2015 02:56
Hi,
I get runtime error with my program. I am almost sure that it is some problem with reading the input. I have tested my program with many examples and always get the right answer.
This is what I use to read the input:

for y,line in enumerate(stdin.read().split()):
        for x,char in enumerate(line.decode('utf8')):
            c=ord(char)
            .......

I had to use decode('utf8') otherwise I got some strange characters. But now the number I get from ord(char) are not the codes given in the problem.

Thanks.