Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import sys
import math
Q = sys.stdin.readline()
for _ in range(int(Q)):
    cnt = 0
    N = int(sys.stdin.readline())
    digLeng = int(math.log10(N)) + 1
    while digLeng > 1:
        Nmax = 0
        for dig in range(digLeng):
            lNum = N // int(math.pow(10,dig))
            rNum = N % int(math.pow(10,dig))
            Nmax = max(Nmax,lNum * rNum)
        N = Nmax
        cnt += 1
        if N != 0:
            digLeng = int(math.log10(N)) + 1
        else:
            digLeng = 1
    print(cnt)

Fixed submission:
import sys
import math
Q = sys.stdin.readline()
for _ in range(int(Q)):
    cnt = 0
    N = int(sys.stdin.readline())
    if N != 0:
        digLeng = int(math.log10(N)) + 1
    else:
        digLeng = 1
    while digLeng > 1:
        Nmax = 0
        for dig in range(digLeng):
            lNum = N // int(math.pow(10,dig))
            rNum = N % int(math.pow(10,dig))
            Nmax = max(Nmax,lNum * rNum)
        N = Nmax
        cnt += 1
        if N != 0:
            digLeng = int(math.log10(N)) + 1
        else:
            digLeng = 1
    print(cnt)
Buggy python submission (verdict: Runtime Error):
#-*- coding:utf-8 -*-

while 1:
    n = int(raw_input())
    if not n:
        break
    length = n*n
    columns = []
    for i in range(n):
        columns.append([])
    rows = [0]*(length) #列の最小値となっている数
    for i in range(n):
        row = [int(r) for r in raw_input().split(" ")]
        rows[min(row)] = 1
        for i in range(n):
            columns[i].append(row[i])

    result = 0
    for c in columns:
        if rows[max(c)]:
            result = max(c)
            break

    print result

Fixed submission:
#-*- coding:utf-8 -*-

while 1:
    n = int(raw_input())
    if not n:
        break
    columns = []
    for i in range(n):
        columns.append([])
    rows = []
    for i in range(n):
        row = [int(r) for r in raw_input().split(" ")]
        rows.append(min(row))
        for i in range(n):
            columns[i].append(row[i])

    result = 0
    for c in columns:
        if max(c) in rows:
            result = max(c)
            break

    print result

Buggy python submission (verdict: Runtime Error):
#-*- coding:utf-8 -*-

while 1:
    n = int(raw_input())
    if not n:
        break
    length = n*n+1
    columns = []
    for i in range(n):
        columns.append([])
    rows = [0]*(length) #列の最小値となっている数
    for i in range(n):
        row = [int(r) for r in raw_input().split(" ")]
        rows[min(row)] = 1
        for i in range(n):
            columns[i].append(row[i])

    result = 0
    for c in columns:
        if rows[max(c)]:
            result = max(c)
            break

    print result

Fixed submission:
#-*- coding:utf-8 -*-

while 1:
    n = int(raw_input())
    if not n:
        break
    columns = []
    for i in range(n):
        columns.append([])
    rows = []
    for i in range(n):
        row = [int(r) for r in raw_input().split(" ")]
        rows.append(min(row))
        for i in range(n):
            columns[i].append(row[i])

    result = 0
    for c in columns:
        if max(c) in rows:
            result = max(c)
            break

    print result

Buggy python submission (verdict: Runtime Error):
#-*- coding:utf-8 -*-

while 1:
    n = int(raw_input())
    if not n:
        break
    length = n*n+1
    columns = []
    for i in range(n):
        columns.append([])
    rows = [0]*(length) #列の最小値となっている数
    for i in range(n):
        row = [int(r) for r in raw_input().split(" ")]
        rows[min(row)] = 1
        for i in range(n):
            columns[i].append(row[i])

    result = 0
    for c in columns:
        if rows[max(c)]:
            result = max(c)
            break

    print result

Fixed submission:
#-*- coding:utf-8 -*-

while 1:
    n = int(raw_input())
    if not n:
        break
    columns = []
    for i in range(n):
        columns.append([])
    rows = []
    for i in range(n):
        row = [int(r) for r in raw_input().split(" ")]
        rows.append(min(row))
        for i in range(n):
            columns[i].append(row[i])

    result = 0
    for c in columns:
        if max(c) in rows:
            result = max(c)
            break

    print result
Buggy python submission (verdict: Runtime Error):
a,b = map(int,list(input().split(" ")))
n = int(input())
c = [0 for i in range(1002)]
ans = 0
c[a]+=1
c[b]-=1
for i in range(n):
      s,f = map(int,list(input().split(" ")))
      c[s]+=1
      c[f]-=1
for i in range(1002):
      c[i+1] += c[i]
      if(c[i]>1):
            ans = 1
print(ans)


Fixed submission:
a,b = map(int,list(input().split(" ")))
n = int(input())
c = [0 for i in range(1002)]
ans = 0
c[a]+=1
c[b]-=1
for i in range(n):
      s,f = map(int,list(input().split(" ")))
      c[s]+=1
      c[f]-=1
for i in range(1001):
      c[i+1] += c[i]
      if(c[i]>1):
            ans = 1
print(ans)
Buggy python submission (verdict: Runtime Error):
a, b= map(int, input().split())


c = (a*b)
d = (a+b)*2

print( c, d)


Fixed submission:
x = int(input())
print(x**3)
Buggy python submission (verdict: Runtime Error):
a, b, c= map(int, input().split())
if a<=b<=c:print(a, b, c)
if b<a<=c:print(b, a, c)
if a<=c<=b:print(a, c, b)
if b<c<=a:print(b, c, a)
if c<a<=b:print(c, a, b)
if c<=b<=a:print(c, b, a


Fixed submission:
a, b, c= map(int, input().split())
if a<=b<=c:print(a, b, c)
if b<a<=c:print(b, a, c)
if a<=c<b:print(a, c, b)
if b<c<a:print(b, c, a)
if c<a<b:print(c, a, b)
if c<=b<=a:print(c, b, a)

Buggy python submission (verdict: Runtime Error):
a, b, c= map(int, input().split())
if a<=b<=c:print(a, b, c)
if b<a<=c:print(b, a, c)
if a<=c<=b:print(a, c, b)
if b<c<=a:print(b, c, a)
if c<a<=b:print(c, a, b)
if c<=b<=a:print(c, b, a


Fixed submission:
a, b, c= map(int, input().split())
if a<=b<=c:print(a, b, c)
if b<a<=c:print(b, a, c)
if a<=c<b:print(a, c, b)
if b<c<a:print(b, c, a)
if c<a<b:print(c, a, b)
if c<=b<=a:print(c, b, a)
Buggy python submission (verdict: Runtime Error):
print(imput()[::-1])


Fixed submission:
print(input()[::-1])
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input.split())
print(a * b, a * 2 + b * 2)




Fixed submission:
a, b = map(int, input().split())
print(a * b, a * 2 + b * 2)
Buggy python submission (verdict: Runtime Error):
l = []
for i in range(10):
    l.append(int(input))
l.sort()
for i in range(3):
    print(l[i])


Fixed submission:
l = []
for i in range(10):
    l.append(int(input()))
l.sort()
for i in range(3):
    print(l[9-i])
Buggy python submission (verdict: Runtime Error):
f = True
cnt = 0
l = [0,0,0]
while f:
    t = []
    t.append(int(input()))
    t.append(int(input()))
    t.append(int(input()))
    t.sort()
    if t[0]+t[1] <= t[2]:
        f = False
        continue
    if t[0]**2+t[1]**2 > t[2]**2:
        l[0]+=1
    elif t[0]**2+t[1]**2 == t[2]**2:
        l[1]+=1
    else:
        l[2]+=1
print(sum(l),s for s in l)
    


Fixed submission:
f = True
cnt = 0
l = [0,0,0]
while f:
    t = [int(s) for s in input().split()]
    t.sort()
    if t[0]+t[1] <= t[2]:
        f = False
        break
    if t[0]**2+t[1]**2 > t[2]**2:
        l[0]+=1
    elif t[0]**2+t[1]**2 == t[2]**2:
        l[1]+=1
    else:
        l[2]+=1
print(sum(l),l[1],l[0],l[2])

Buggy python submission (verdict: Runtime Error):
f = True
cnt = 0
l = [0,0,0]
while f:
    t = []
    t.append(int(input()))
    t.append(int(input()))
    t.append(int(input()))
    t.sort()
    if t[0]+t[1] <= t[2]:
        f = False
        continue
    if t[0]**2+t[1]**2 > t[2]**2:
        l[0]+=1
    elif t[0]**2+t[1]**2 == t[2]**2:
        l[1]+=1
    else:
        l[2]+=1
print(sum(l),[s for s in l])
    


Fixed submission:
f = True
cnt = 0
l = [0,0,0]
while f:
    t = [int(s) for s in input().split()]
    t.sort()
    if t[0]+t[1] <= t[2]:
        f = False
        break
    if t[0]**2+t[1]**2 > t[2]**2:
        l[0]+=1
    elif t[0]**2+t[1]**2 == t[2]**2:
        l[1]+=1
    else:
        l[2]+=1
print(sum(l),l[1],l[0],l[2])
Buggy python submission (verdict: Runtime Error):
print((int(input())+int(input()))*2)


Fixed submission:
s = input().split()
print(int(s[0])*int(s[1]),(int(s[0])+int(s[1]))*2)
Buggy python submission (verdict: Runtime Error):
import datetime as d
a = d.timedelta(seconds=int(input()))
print((a+d).hour, (a+d).minute, (a+d).second, sep=':')


Fixed submission:
import datetime as d
a,b = d.timedelta(seconds=int(input())),d.datetime(1,1,1)
print((a+b).hour, (a+b).minute, (a+b).second, sep=':')

Buggy python submission (verdict: Runtime Error):
import datetime as d
a,b = d.timedelta(seconds=int(input())).d.datetime(1,1,1)
print(((a+b).hour, (a+b).minute, (a+b).second, sep=':')


Fixed submission:
import datetime as d
a,b = d.timedelta(seconds=int(input())),d.datetime(1,1,1)
print((a+b).hour, (a+b).minute, (a+b).second, sep=':')

Buggy python submission (verdict: Runtime Error):
import datetime as d
a,b = d.timedelta(seconds=int(input())).d.datetime(1,1,1)
print((a+b).hour, (a+b).minute, (a+b).second, sep=':')


Fixed submission:
import datetime as d
a,b = d.timedelta(seconds=int(input())),d.datetime(1,1,1)
print((a+b).hour, (a+b).minute, (a+b).second, sep=':')
Buggy python submission (verdict: Runtime Error):
cnt = 10
top3 = [0,0,0]

for x in xrange(cnt):
    n = int( raw_input() )

    if top3[2] > n: continue
    top3[2] = n

    if top3[1] > top3[2]: continue
    top3[1], top3[2] = top3[2], top3[1]

    if top3[0] > top3[1]: continue
    top3[0], top3[1] = top3[1], top3[0]

print top[0], top[1], top[2]



Fixed submission:

cnt = 10
top3 = [0,0,0]

for x in xrange(cnt):
    n = int( raw_input() )

    if top3[2] > n: continue
    top3[2] = n

    if top3[1] > top3[2]: continue
    top3[1], top3[2] = top3[2], top3[1]

    if top3[0] > top3[1]: continue
    top3[0], top3[1] = top3[1], top3[0]

print top3[0]
print top3[1]
print top3[2]
Buggy python submission (verdict: Runtime Error):
#
# coding: utf-8

def bubbleSort(arr, n):

    flag = True
    swap_num = 0

    while flag:
        flag = False
        for j in xrange(n-1, 0, -1):
            if arr[j] < arr[j-1]:
                arr[j], arr[j-1] = arr[j-1], arr[j]
                swap_num += 1
                flag = True
        pass
    return swap_num


n = int(raw_input())
arr = map(int, raw_input().split())

num = bubbleSort(arr, n)
print " ".join(map(str, test_arr)),"\n",num

Fixed submission:
#
# coding: utf-8
 
def bubbleSort(arr, n):
 
    flag = True
    swap_num = 0
 
    while flag:
        flag = False
        for j in xrange(n-1, 0, -1):
            if arr[j] < arr[j-1]:
                arr[j], arr[j-1] = arr[j-1], arr[j]
                swap_num += 1
                flag = True
        pass
    return swap_num
 
 
n = int(raw_input())
arr = map(int, raw_input().split())
 
num = bubbleSort(arr, n)
print " ".join(map(str, arr))
print num

Buggy python submission (verdict: Runtime Error):
#
# coding: utf-8
 
def bubbleSort(arr, n):
 
    flag = True
    swap_num = 0
 
    while flag:
        flag = False
        for j in xrange(n-1, 0, -1):
            if arr[j] < arr[j-1]:
                arr[j], arr[j-1] = arr[j-1], arr[j]
                swap_num += 1
                flag = True
        pass
    return swap_num
 
 
n = int(raw_input())
arr = map(int, raw_input().split())
 
num = bubbleSort(arr, n)
print " ".join(map(str, test_arr))
print num

Fixed submission:
#
# coding: utf-8
 
def bubbleSort(arr, n):
 
    flag = True
    swap_num = 0
 
    while flag:
        flag = False
        for j in xrange(n-1, 0, -1):
            if arr[j] < arr[j-1]:
                arr[j], arr[j-1] = arr[j-1], arr[j]
                swap_num += 1
                flag = True
        pass
    return swap_num
 
 
n = int(raw_input())
arr = map(int, raw_input().split())
 
num = bubbleSort(arr, n)
print " ".join(map(str, arr))
print num
Buggy python submission (verdict: Runtime Error):
# Python 3+
import sys
import math

#file = open("test.txt")
file = sys.stdin

r = int(file.readline())
l = 2*math.pi*r
s = math.pi*r*r

print("%.6f %.6f"%(s, l))

Fixed submission:
# Python 3+
import sys
import math

#file = open("test.txt")
file = sys.stdin

r = float(file.readline())
l = 2*math.pi*r
s = math.pi*r*r

print("{0:.6f} {1:.6f}".format(s, l))

Buggy python submission (verdict: Runtime Error):
import sys
import math
 
#file = open("test.txt")
file = sys.stdin
 
r = int(file.readline())
l = 2*math.pi*r
s = math.pi*r*r
 
print("%.6f %.6f"%(s, l))

sys.exit(0)

Fixed submission:
# Python 3+
import sys
import math

#file = open("test.txt")
file = sys.stdin

r = float(file.readline())
l = 2*math.pi*r
s = math.pi*r*r

print("{0:.6f} {1:.6f}".format(s, l))
Buggy python submission (verdict: Runtime Error):
#-------------------------------------------------------------------------------
# coding: utf-8
# Created:  
import sys

op = { "+" : lambda x, y:  x + y,
        "-": lambda x,y: x - y,
        "/": lambda x,y: x/y,
        "*": lambda x,y: x*y }

while True:
    a, op_, b = sys.readline().split()
    if op_ == "?" : break
    a1, b1 = int(a), int(b)

    print op[op_](a1, b1)

Fixed submission:
#-------------------------------------------------------------------------------
# coding: utf-8
# Created:     16/12/2015
import sys

io = sys.stdin

op = { "+" : lambda x, y:  x + y,
        "-": lambda x,y: x - y,
        "/": lambda x,y: x/y,
        "*": lambda x,y: x*y }


while True:
    a, op_, b = io.readline().split()
    if op_ == "?" : break
    a1, b1 = int(a), int(b)

    print op[op_](a1, b1)

Buggy python submission (verdict: Runtime Error):
#-------------------------------------------------------------------------------
# coding: utf-8
# Created:  
import sys

op = { "+" : lambda x, y:  x + y,
        "-": lambda x,y: x - y,
        "/": lambda x,y: x/y,
        "*": lambda x,y: x*y }

while True:
    a, op_, b = sys.readline().split()
    if op_ == "?" : break
    a1, b1 = int(a), int(b)

    print op[op_](a1, b1)

Fixed submission:
#-------------------------------------------------------------------------------
# coding: utf-8
# Created:     16/12/2015
import sys

io = sys.stdin

op = { "+" : lambda x, y:  x + y,
        "-": lambda x,y: x - y,
        "/": lambda x,y: x/y,
        "*": lambda x,y: x*y }


while True:
    a, op_, b = io.readline().split()
    if op_ == "?" : break
    a1, b1 = int(a), int(b)

    print op[op_](a1, b1)
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

n = []
a = []

i = 0
while True:
    n.append(int(input()))
    if n[i] == 0:
        break
    for j in range(0,n[i]):
        a.append(int(input()))
    i += 1

for i in range(0,len(n)):
    sumMax = 0
    for j in range(sum(n[0:i-1 if i != 0 else 0]),sum(n[0:i])):
        for k in range(j,sum(n[0:i])+1):
            if j==k:
                continue
            sumMax = max(sumMax,sum(a[j:k]))
    print(sumMax)

Fixed submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

while True:
    n = int(input())
    if n == 0:
        break
    a = []
    for i in range(0,n):
        a.append(int(input()))
    sumMax = -100000
    for i in range(0,n):
        tmp = 0
        for j in range(i,n):
            tmp += a[j]
            sumMax = max(sumMax,tmp)
    print(sumMax)
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import itertools

S = []
N = []
while True:
    n,s = map(int,input().split(" "))
    if s == 0 and n == 0:
        break
    else:
        N.append(n)
        S.append(s)

for i in range(0,len(S)):
    sumMap = list(map(sum,list(itertools.combinations(range(0,S[i]+1),N[i]))))
    print(sum([1 for j in range(0,len(sumMap)) if sumMap[j] == S[i]]))

Fixed submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import itertools

S = []
N = []
while True:
    n,s = map(int,input().split(" "))
    if s == 0 and n == 0:
        break
    else:
        N.append(n)
        S.append(s)

for i in range(0,len(S)):
    sumMap = list(map(sum,list(itertools.combinations(range(0,10),N[i]))))
    print(sum([1 for j in range(0,len(sumMap)) if sumMap[j] == S[i]]))
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

while True:
    n = int(raw_input())
    island = []
    if n == 0:
        break
    for i in range(n):
        g,b = map(int,input().split())
        island.append((g,b,b-g))
    sorted(island,key = lambda x:(x[2],[0],[1]))
    
    gem = 0
    for g,b,c in island:
        gem += g
        if b < gem:
            break
    else:
        print 'Yes'
        continue
    print 'No'
        

Fixed submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

while True:
    n = int(raw_input())
    island = []
    if n == 0:
        break
    for i in range(n):
        g,b = map(int,raw_input().split())
        island.append((g,b))
    island = sorted(island,key = lambda x:(x[1],x[0]))
    
    gem = 0
    for g,b in island:
        gem += g
        if b < gem:
            break
    else:
        print 'Yes'
        continue
    print 'No'
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**6)

def dfs(string,bracket):
    i = 0
    while i < len(string):
        if bracket == '[' and string[i] == ']':
            return i
        elif bracket == '(' and string[i] == ')':
            return i
        elif string[i] == '(' or string[i] == '[':
            ret = dfs(string[i+1:],string[i])
            ret += 1
            if ret  == False:
                return False
            i += ret
        i += 1
    return True if bracket == '' else False


while True:
    string = list(input())
    if len(string) == 1 and string[0] == '.':
        break
    ans = 'yes' if dfs(string,'') else 'no'
    print(ans)

Fixed submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**6)

def dfs(string,bracket):
    i = 0
    while i < len(string):
        if bracket == '[' and string[i] == ']':
            return i
        elif bracket == '(' and string[i] == ')':
            return i
        elif string[i] == ')' or string[i] == ']':
            return False
        elif string[i] == '(' or string[i] == '[':
            ret = dfs(string[i+1:],string[i])
            if ret is False:
                return False
            i += ret + 1
        i += 1
    return True if bracket == '' else False


while True:
    string = list(input())
    if len(string) == 1 and string[0] == '.':
        break
    ans = 'yes' if dfs(string,'') else 'no'
    print(ans)
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

while True:
    x,y,s = map(int,input().split())
    if (x,y,s) == (0,0,0):
        break
    ans = 0
    for i in range(1,s-1):
        for j in range(1,s-1):
            if i*(100+x)//100 + j*(100+x)//100== s:
                ans = max(ans,i*(100+y)//100 + j*(100+y)//100)
    print(ans)

Fixed submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

while True:
    x,y,s = map(int,input().split())
    if (x,y,s) == (0,0,0):
        break
    ans = 0
    for i in range(1,s//2 + 1):
        for j in range(1,s-i + 1):
            if i*(100+x)//100 + j*(100+x)//100== s:
                ans = max(ans,i*(100+y)//100 + j*(100+y)//100)
    print(ans)
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from itertools import product
coins = [10,50,100,500]

def coin_count(num):
    count = 0
    for coin in sorted(coins,reverse = True):
        count += num // coin
        num -= (num // coin)*coin
    return count

while True:
    price = int(input())
    if price == 0:
        break
    dp = [-1 for i in range(20*660)]
    dp[0] = 0
    has = map(lambda x:list(range(int(x)+1)),input().split(" "))
    ans = (10**8,())
    for t in product(*has):
        tmp = price - sum([coins[i] * t[i] for i in range(4)])
        if tmp <= 0:
            ans = min(ans,(coin_count(-1 * tmp),t))
    for i in range(4):
        if ans[1][i] != 0:
            print(coins[i],ans[1][i])
    print()

Fixed submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from itertools import product
coins = [10,50,100,500]

def coin_count(num):
    count = 0
    for coin in sorted(coins,reverse = True):
        count += num // coin
        num -= (num // coin)*coin
    return count

flag = True
while True:
    price = int(input())
    if price == 0:
        break

    if flag:
        flag = False
    else:
        print()

    has = list(map(int,input().split()))
    sum_coins = list(map(lambda x: x[0]*x[1], zip(has,coins)))


    change = (sum(sum_coins) - price)
    surplus = [change % 50 // 10, change % 100 // 50, change % 500 // 100, change // 500]

    for i in range(4):
        if has[i] > surplus[i]:
            print(coins[i],has[i] - surplus[i])
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from math import sqrt

while True:
    e = int(input())
    if e == 0:
        break
    ans = 10**9
    for z in range(e):
        if z > e:
            break
        y = int(sqrt(e-z**3))
        x = e - y ** 2 - z ** 3
        ans = min(ans,x+y+i)
    print(ans)

Fixed submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from math import sqrt

while True:
    e = int(input())
    if e == 0:
        break
    ans = 10**9
    for z in range(e):
        if z**3 > e:
            break
        y = int(sqrt(e-z**3))
        x = e - y ** 2 - z ** 3
        ans = min(ans,x+y+z)
    print(ans)
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

while True:
    N,M = map(int,input().split())
    if N == 0 and M == 0:
        break
    square_count_w = [0 for i in range(1000*1500+1)]
    square_count_h = [0 for i in range(1000*1500+1)]
    heights = []
    widths = []

    for i in range(N):
        height = int(input())
        square_count_h[height] += 1
        for h in heights[::-1]:
            square_count_h[height+h] += 1
        heights.append(height)

    for i in range(M):
        width = int(input())
        square_count_w[width] += 1
        for w in widths[::-1]:
            square_count_w[width+w] += 1
        widths.append(width)

    ans = 0
    for i in range(1000*1500+1):
        ans += square_count_w[i] * square_count_h[i]

    print(ans)

Fixed submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import collections

while True:
    N,M = map(int,raw_input().split())
    if N == 0 and M == 0:
        break
    square_count_w = collections.defaultdict(int)
    square_count_h = collections.defaultdict(int)
    heights = []
    widths = []

    for i in range(N):
        height = int(raw_input())
        square_count_h[height] += 1
        sum_h = 0
        for h in heights[::-1]:
            sum_h += h
            square_count_h[height+sum_h] += 1
        heights.append(height)

    for i in range(M):
        width = int(raw_input())
        square_count_w[width] += 1
        sum_w = 0
        for w in widths[::-1]:
            sum_w += w
            square_count_w[width+sum_w] += 1
        widths.append(width)

    ans = 0
    for key,value in square_count_w.items():
        ans += square_count_w[key] * square_count_h[key]

    print(ans)
Buggy python submission (verdict: Runtime Error):
# coding:utf-8

x=map(int,(raw_input().split()))

if int(x[0]) < x[1]) < x[2]:
    print("Yes")
else:
    print("No")

Fixed submission:
# coding:utf-8

x=map(int,(raw_input().split()))

if x[0] < x[1] < x[2]:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
# coding:utf-8

x=map(int,(raw_input().split()))

if x[0] < x[1]) < x[2]:
    print("Yes")
else:
    print("No")

Fixed submission:
# coding:utf-8

x=map(int,(raw_input().split()))

if x[0] < x[1] < x[2]:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):

r=int(input())
p=3.14159265359
a=r*r*p
b=p*r*2
print('{:.6f}'.format(a),'{:.6f}'.format(b)) 


Fixed submission:
from math import pi
r = float(input())
s = "{:.6f}".format(r ** 2 * pi) 
l = "{:.6f}".format(r * 2 * pi)
print(s, l)