python runtime error

I have written a python code for this problem .Its the easiest sum in this competition and runs on my local machine perfectly .This is the first time i am posting the code in python and the FAQ is not helping me.Here’s the code.
Since the competition is on i dont think the users wold be able to access the solution but if any admins can help me.

thanks

2 Likes

Same with me RE M-3.9M T-0.0

Hello! I am new to codechef competition and I posted today code in python too, but for other task:

It tells me wrong answer but on my local PC it works perfect too. I have red some FAQ pages and there is nothing about python.
I have tested it on local with: python code.py < in.txt > out.txt and I get good output. Is there any other hint to check for?

The suggestion of LushIsTheLanguage has partly solved one problem I was facing for long time. I have embedded python interpreter in one multithreaded C code with GTK. I could run my *.py script (with pyHook imported in it) from the GTK based GUI only for first time. Next time when I used to run it the full code used to crash. Without pyHook imported scripts I could run any number of times from my GUI.

Now after calling hm.UnhookMouse() and hm.UnhookKeyboard() at the end of the python script I can run it more that one time from my GUI. However still it is crashing after four or five times.

In my *.py script I am not using “pythoncom.PumpMessages()”, rather I am using while loop with “pythoncom.PumpWaitingMessages()”, so that I can break it once any key is pressed.