python run time error

I am new in code shef. In my system code is running fine but in codeshef showing run time error:

i=raw_input()
withdraw=int(i.split()[0])
balance=float(i.split()[1])
if withdraw > (balance+0.5):
	print ("%.2f"%balance)
	exit(1)
if not(withdraw % 5 == 0):
	print ("%.2f"%balance)
	exit(1)
balance=(balance-withdraw-0.5)
print ("%.2f"%balance)

Which question are you tackling? Provide the link to your question and solution.

Iam also gettting runtime error but cant figure it out
plz help

for i2 in xrange(input()):
    r=input()
    a=[]
    for i1 in xrange(r):
        a.append([])
        x=raw_input()
        x=x.split(' ')
        for i3 in x:
            a[i1].append(int(i3))
        #a.append([int(i) for i in raw_input().split(' ')])
    for i in xrange(r-2,-1,-1):
        for j in xrange(i+1):
            a[i][j]+=max(a[i+1][j],a[i+1][j+1])
    #print a
    print a[0][0]

Which question are you tackling ?

Hello @naveen4509,

I believe the question you tried to solve was ATM, right?

Well, regarding the runtime error, I’ll say I am totally clueless about what it can be… Maybe it’s some error in the output formatting, or some argument passed to the print function that it’s not being recognized by the judge… (The RTE is by far the most upsetting one can get, imo… almost all my Go submissions here are being judged as RTE, and I believe it’s also I/O format related…)

Nevertheless, using parts of your code, plus my accepted solution in C++ and seeing how an accepted python solution was designed, I managed to get accepted with this Python code:

inp=raw_input().split()
withdraw=float(inp[0])
balance=float(inp[1])
if (withdraw%5 != 0) or (balance < withdraw+0.5):
print (balance)
else:
print (balance-float(withdraw)-0.5)

What’s more weird to me is the lack of formatting passed to the print function, that, I recall, is mandatory to get accepted… My only explanation to this fact, is that by passing the current balance as a float value with 2 decimal places to input, all further calculations will be performed with 2 dp as well… But it seems quite weird I must say…

I hope I could help though,

Bruno