Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import numpy as np

#def area--------------------------#
#ryouno syokiti
class ryou:
	def flinit(self):
		room=list()
		for i in range(10):
			room+=[0]
		return room

#def kaijo([a_1,a_2,a_3,a_4,a_5,a_6,a_7,a_8,a_9,a_10]):


#def kaijo(x):
#	y=[]
#	for i in x:
#		y=y+ " "+x[i]
#	return y		
def kaijo(x):
	print "",
	for i in range(len(x)-1):
		print str(x[i]),
	print str(x[len(x)-1])


#----------------------------------#

floor_11=ryou().flinit()
floor_12=ryou().flinit()
floor_13=ryou().flinit()
floor_21=ryou().flinit()
floor_22=ryou().flinit()
floor_23=ryou().flinit()
floor_31=ryou().flinit()
floor_32=ryou().flinit()
floor_33=ryou().flinit()
floor_41=ryou().flinit()
floor_42=ryou().flinit()
floor_43=ryou().flinit()


fldic={"11":floor_11,
       "12":floor_12,
       "13":floor_13,
       "21":floor_21,
       "22":floor_22,
       "23":floor_23,
       "31":floor_31,
       "32":floor_32,
       "33":floor_33,
       "41":floor_41,
       "42":floor_42,
       "43":floor_43
       }

#----------------------------------#


#1kaime yomikomi
n=int(raw_input())

#nkaime syusyori

for l in range(n):
	list_mojiretsu=raw_input().split(" ")
	henka=map(int,list_mojiretsu)
	fldic[str(henka[0])+str(henka[1])][henka[2]-1]+=henka[3]
	
#henka=[3,4,5,6]



kaijo(floor_11)
kaijo(floor_12)
kaijo(floor_13)
print "####################"
kaijo(floor_21)
kaijo(floor_22)
kaijo(floor_23)
print "####################"
kaijo(floor_31)
kaijo(floor_32)
kaijo(floor_33)
print "####################"
kaijo(floor_41)
kaijo(floor_42)
kaijo(floor_43)

print "aiueo"
#print kaijo(floor_11)

Fixed submission:
#import numpy as np

#def area--------------------------#
#ryouno syokiti
class ryou:
	def flinit(self):
		room=list()
		for i in range(10):
			room+=[0]
		return room

#def kaijo([a_1,a_2,a_3,a_4,a_5,a_6,a_7,a_8,a_9,a_10]):


#def kaijo(x):
#	y=[]
#	for i in x:
#		y=y+ " "+x[i]
#	return y		
def kaijo(x):
	print "",
	for i in range(len(x)-1):
		print str(x[i]),
	print str(x[len(x)-1])


#----------------------------------#

floor_11=ryou().flinit()
floor_12=ryou().flinit()
floor_13=ryou().flinit()
floor_21=ryou().flinit()
floor_22=ryou().flinit()
floor_23=ryou().flinit()
floor_31=ryou().flinit()
floor_32=ryou().flinit()
floor_33=ryou().flinit()
floor_41=ryou().flinit()
floor_42=ryou().flinit()
floor_43=ryou().flinit()


fldic={"11":floor_11,
       "12":floor_12,
       "13":floor_13,
       "21":floor_21,
       "22":floor_22,
       "23":floor_23,
       "31":floor_31,
       "32":floor_32,
       "33":floor_33,
       "41":floor_41,
       "42":floor_42,
       "43":floor_43
       }

#----------------------------------#


#1kaime yomikomi
n=int(raw_input())

#nkaime syusyori

for l in range(n):
	list_mojiretsu=raw_input().split(" ")
	henka=map(int,list_mojiretsu)
	fldic[str(henka[0])+str(henka[1])][henka[2]-1]+=henka[3]
	


kaijo(floor_11)
kaijo(floor_12)
kaijo(floor_13)
print "####################"
kaijo(floor_21)
kaijo(floor_22)
kaijo(floor_23)
print "####################"
kaijo(floor_31)
kaijo(floor_32)
kaijo(floor_33)
print "####################"
kaijo(floor_41)
kaijo(floor_42)
kaijo(floor_43)
Buggy python submission (verdict: Runtime Error):
while True:
	k=map(int,raw_input().split(" "))
	ct=0
	a=0
	b=0
	c=0	
	max=k[0]
	sum=k[1]
	a=max+1
	
	while True:
		a-=1
		b=a-1
		c=sum-a-b
		if not a>b>c:
			print ct
			break
		while a>b>c:
			if a>b>c>0:
				ct+=1
			b-=1
			c+=1
			

Fixed submission:
while True:
	k=map(int,raw_input().split(" "))
	if k[0]==k[1]==0:
		break
	ct=0
	max=k[0]
	sum=k[1]
	a=max+1

	while True:
		a-=1
		b=a-1
		c=sum-a-b
		if not a>c:
			print ct
			break
		while b>c:
			if c>0:
				ct+=1
			b-=1
			c+=1
Buggy python submission (verdict: Runtime Error):
half_ring=raw_input()
ring=s*2
target=raw_input()
f=0

for i in range(len(s)):
	if ring[i:i+len(target)]==target:
		f=1
		break
if f==1:
	print "Yes"
else:
	print "No"

Fixed submission:
s=raw_input()
target=raw_input()
ring=s*2

ans="No"
for i in range(len(s)):
	if ring[i:i+len(target)]==target:
		ans="Yes"
		break
print ans

Buggy python submission (verdict: Runtime Error):
half_ring=raw_input()
ring=s*2
target=raw_input()
f=0

for i in range(len(s)):
	if ring[i:i+len(target)]==target:
		f=1
		break
if f==1:
	print "Yes"
else:
	print "No"

Fixed submission:
s=raw_input()
target=raw_input()
ring=s*2

ans="No"
for i in range(len(s)):
	if ring[i:i+len(target)]==target:
		ans="Yes"
		break
print ans
Buggy python submission (verdict: Runtime Error):
target=raw_input()
ct=0
flag=0
while True:
	line=raw_input().split(" ")
	for i in line:
		if i.lower()==target.lower:
			ct+=1
		elif i.lower()=="END_OF_TEXT":
			print ct
			flag=1
	if flag==1:
		break

Fixed submission:
target=raw_input().lower()
ct=0
flag=0

while True:
	line=raw_input().split(" ")
	for i in line:
		if i.lower()==target:
			ct+=1
		elif i=="END_OF_TEXT":
			print ct
			flag=1
	if flag==1:
		break
Buggy python submission (verdict: Runtime Error):
round=int(input())
T_pt=0
H_pt=0

for i in range(round):
	pair=raw_input().split(" ")
	T_card=pair[0].lower()
	H_card=pair[1].lower()

	if T_card<H_card:
		H_pt+=3
	elif T_card>H_card:
		T_pt+=3
	else:
		T_pt+=1
		H_pt+=1
print T_pt,H_pt

Fixed submission:
#def area###############################

def pr(s,a,b):
	print s[int(a):int(b)+1]

def rv(s,a,b):
	tmp=s[::-1]
	news=s[:int(a)]+tmp[len(tmp)-int(b)-1:len(tmp)-int(a)]+s[int(b)+1:]
	return news

def rp(s,a,b,p):
	news=s[:int(a)]+p+s[int(b)+1:]
	return news

########################################


I=raw_input()
n=int(input())
for i in range(n):
	k=raw_input().split(" ")
	if k[0]=="replace":
		I=rp(I,k[1],k[2],k[3])
	elif k[0]=="reverse":
		I=rv(I,k[1],k[2])
	elif k[0]=="print":
		pr(I,k[1],k[2])

Buggy python submission (verdict: Runtime Error):
round=int(input())
T_pt=0
H_pt=0

for i in range(round):
	pair=raw_input().split(" ")
	T_card=pair[0].lower()
	H_card=pair[1].lower()

	if T_card<H_card:
		H_pt+=3
	elif T_card>H_card:
		T_pt+=3
	else:
		T_pt+=1
		H_pt+=1
print T_pt,H_pt

Fixed submission:
#def area###############################

def pr(s,a,b):
	print s[int(a):int(b)+1]

def rv(s,a,b):
	tmp=s[::-1]
	news=s[:int(a)]+tmp[len(tmp)-int(b)-1:len(tmp)-int(a)]+s[int(b)+1:]
	return news

def rp(s,a,b,p):
	news=s[:int(a)]+p+s[int(b)+1:]
	return news

########################################


I=raw_input()
n=int(input())
for i in range(n):
	k=raw_input().split(" ")
	if k[0]=="replace":
		I=rp(I,k[1],k[2],k[3])
	elif k[0]=="reverse":
		I=rv(I,k[1],k[2])
	elif k[0]=="print":
		pr(I,k[1],k[2])
Buggy python submission (verdict: Runtime Error):
l = [input()]*10
for i in l.sort(reverse=True)[:3]:
    print(i)

Fixed submission:
l=[int(input()) for _ in range(10)]
[print(x) for x in sorted(l,reverse=True)[:3]]
Buggy python submission (verdict: Runtime Error):
import sys
import itertools

dataset_num = int(input())

class Overflow(Exception):
    pass

for _ in range(dataset_num):
    try:
        k1 = input()
        k2 = input()
        k1_val = [0] * 80
        k2_val = [0] * 80

        if len(k1) > 80 or len(k2) > 80:
            raise Overflow()
        
        for i, x in enumerate(reversed(k1)):
            k1_val[i] = int(x)

        for i, x in enumerate(reversed(k2)):
            k2_val[i] = int(x)
        
        res = [0] * 80
        for i in range(0, 80):
            res[i] += k1_val[i] + k2_val[i]
            if res[i] >= 10:
                res[i+1] += 1
                res[i] -= 10
        sumstr = "".join([str(x) for x in itertools.dropwhile(lambda x: x == 0, reversed(res))])
        if len(sumstr) > 80:
            raise Overflow()

        print(sumstr)
    except Overflow:
        print("overflow")

Fixed submission:
import sys
import itertools

dataset_num = int(input())

class Overflow(Exception):
    pass

for _ in range(dataset_num):
    try:
        k1 = input()
        k2 = input()
        k1_val = [0] * 100
        k2_val = [0] * 100

        if len(k1) > 80 or len(k2) > 80:
            raise Overflow()
        
        for i, x in enumerate(reversed(k1)):
            k1_val[i] = int(x)

        for i, x in enumerate(reversed(k2)):
            k2_val[i] = int(x)
        
        res = [0] * 100 
        for i in range(0, 100):
            res[i] += k1_val[i] + k2_val[i]
            if res[i] >= 10:
                res[i+1] += 1
                res[i] -= 10
        sumstr = "".join([str(x) for x in itertools.dropwhile(lambda x: x == 0, reversed(res))])
        if len(sumstr) > 80:
            raise Overflow()
        if len(sumstr) == 0:
            sumstr = "0"

        print(sumstr)
    except Overflow:
        print("overflow")
Buggy python submission (verdict: Runtime Error):
while True:
    try:
        n = int(input())
    except:
        break

    arr = []
    if n == 0:
        print(arr[-1])
        arr = arr[:-1]
    else:
        arr.append(n)

Fixed submission:
arr = []

while True:
    try:
        n = int(input())
    except:
        break

    if n == 0:
        print(arr[-1])
        arr = arr[:-1]
    else:
        arr.append(n)
Buggy python submission (verdict: Runtime Error):
import math
for i in range(int(input())):
    a = int(input())
    b = int(input())
    if int(math.log10(a+b) + 1) > 80:
        print("overflow")
    else:
        print(a+b)

Fixed submission:
for i in range(int(input())):
    a = int(input())
    b = int(input())
    if a+b >= 10**80:
        print("overflow")
    else:
        print(a+b)
Buggy python submission (verdict: Runtime Error):
n = int(input())
for i in range(n):
    x1,y1,x2,y2,x3,y3,x4,y4 = map(float, input().split())
    if (y1-y2)/(x1-x2) == (y3-y4)/(x3-x4):
        print('YES')
    else:
        print('NO')

Fixed submission:
n = int(input())
for i in range(n):
    x1,y1,x2,y2,x3,y3,x4,y4 = map(float, input().split())
    if abs((y1-y2)*(x4-x3) - (y4-y3)*(x1-x2)) < 1e-10:
        print('YES')
    else:
        print('NO')

Buggy python submission (verdict: Runtime Error):
n = int(input())
for i in range(n):
    x1,y1,x2,y2,x3,y3,x4,y4 = map(float, input().split())
    if x1-x2 == 0 or x3-x4 ==0:
        if x1-x2 == 0 and x3-x4 ==0:
            print('YES')
        else:
            print('NO')
    if (y1-y2)/(x1-x2) == (y3-y4)/(x3-x4):
        print('YES')
    else:
        print('NO')

Fixed submission:
n = int(input())
for i in range(n):
    x1,y1,x2,y2,x3,y3,x4,y4 = map(float, input().split())
    if abs((y1-y2)*(x4-x3) - (y4-y3)*(x1-x2)) < 1e-10:
        print('YES')
    else:
        print('NO')
Buggy python submission (verdict: Runtime Error):
import sys
for i in sys.stdin:
    arrA,arrB = [],[]
    s = i.split()
    for i in s:
        arrA.append(int(i))
    s = input().split()
    for i in s:
        arrB.append(int(i))
    h,b = 0,0
    for i in range(len(arrA)):
        if arrA[i] == arrB[i]:
            h += 1
        else:
            if arrB.count(arrA[i]) > 0:
                b += 1
    print(h,b)

Fixed submission:
import sys
for line in sys.stdin:
    arrA,arrB = [],[]
    s = line.split()
    for i in s:
        arrA.append(int(i))
    s = input().split()
    for i in s:
        arrB.append(int(i))
    h,b = 0,0
    for i in range(len(arrA)):
        if arrA[i] == arrB[i]:
            h += 1
        elif arrB.count(arrA[i]) > 0:
                b += 1
    print(h,b)
Buggy python submission (verdict: Runtime Error):
import numpy


Fixed submission:
while True:
    n = int(input())

    if n == 0:
        break

    matrix = [[] for _ in range(n)]
    col_sum = [0 for _ in range(n + 1)]
    for i in range(n):
        matrix[i] = list(map(int, input().split()))
        matrix[i].append(sum(matrix[i]))
        for j in range(n + 1):
            col_sum[j] += matrix[i][j]

    matrix.append(col_sum)

    for i in range(n + 1):
        for j in range(n + 1):
            print('%5d' % matrix[i][j], end='')
        print()
Buggy python submission (verdict: Time Limit Exceeded):
arr = []
for i in range(int(input())):
    arr.append(int(input()))
m = 0
for i in range(len(arr)-1):
    for j in range(i+1, len(arr)):
        if i == 0 and j == 1:
            m = arr[j] - arr[i]
        else:
            m = max(m, arr[j] - arr[i])
print(m)   

Fixed submission:
n = int(input())
arr = [int(input()) for i in range(n)]

m = 1 - 10**9
minv = arr[0]
for i in range(1,len(arr)):
    if arr[i] - minv > m:
        m = arr[i] - minv
    minv = min(minv, arr[i])
print(m)
Buggy python submission (verdict: Runtime Error):
def bubble_sort(A):
    swap_cnt = 0
    for i in range(len(A)):
        for j in range(len(A), i + 1, -1):
            if A[j] < A[j - 1]:
                A[j], A[j - 1] = A[j - 1], A[j]
                swap_cnt += 1
    return A, swap_cnt


n = int(input())
A = list(map(int, input().split()))
A, swap_cnt = bubble_sort(A)
print(' '.join(A))
print(swap_cnt)



Fixed submission:
def bubble_sort(A):
    swap_cnt = 0
    for i in range(len(A)):
        for j in range(len(A) - 1, i, -1):
            if A[j] < A[j - 1]:
                A[j], A[j - 1] = A[j - 1], A[j]
                swap_cnt += 1
    return A, swap_cnt


n = int(input())
A = list(map(int, input().split()))
A, swap_cnt = bubble_sort(A)
print(' '.join(map(str, A)))
print(swap_cnt)

Buggy python submission (verdict: Runtime Error):
def bubble_sort(A):
    swap_cnt = 0
    for i in range(len(A)):
        for j in range(len(A), i + 1, -1):
            if A[j] < A[j - 1]:
                A[j], A[j - 1] = A[j - 1], A[j]
                swap_cnt += 1
    return A, swap_cnt


n = int(input())
A = list(map(int, input().split()))
A, swap_cnt = bubble_sort(A)
print(' '.join(map(str, A)))
print(swap_cnt)



Fixed submission:
def bubble_sort(A):
    swap_cnt = 0
    for i in range(len(A)):
        for j in range(len(A) - 1, i, -1):
            if A[j] < A[j - 1]:
                A[j], A[j - 1] = A[j - 1], A[j]
                swap_cnt += 1
    return A, swap_cnt


n = int(input())
A = list(map(int, input().split()))
A, swap_cnt = bubble_sort(A)
print(' '.join(map(str, A)))
print(swap_cnt)
Buggy python submission (verdict: Time Limit Exceeded):
n, q = map(int, input().split())
queue = []
for _ in range(n):
    name, time = input().split()
    queue.append((name, int(time)))

finish_time = 0
while len(queue) > 0:
    name, time = queue[0]
    if q >= time:
        finish_time += time
        print('{} {}'.format(name, finish_time))
        queue = queue[1:]
    else:
        finish_time += q
        queue = queue[1:] + [(name, time - q)]



Fixed submission:
import queue

n, quantum = map(int, input().split())
q = queue.Queue()
for _ in range(n):
    name, time = input().split()
    q.put([name, int(time)])

spend_time = 0
while q.qsize() > 0:
    name, time = q.get()
    tmp = min(quantum, time)
    spend_time += tmp
    time -= tmp
    if time == 0:
        print('{} {}'.format(name, spend_time))
    else:
        q.put([name, time])

Buggy python submission (verdict: Time Limit Exceeded):
n, q = map(int, input().split())
queue = []
for _ in range(n):
    name, time = input().split()
    queue.append((name, int(time)))

spend_time = 0
while len(queue) > 0:
    name, time = queue[0]
    tmp = min(q, time)
    spend_time += tmp
    time -= tmp
    if time == 0:
        print('{} {}'.format(name, spend_time))
        queue = queue[1:]
    else:
        queue = queue[1:] + [(name, time)]



Fixed submission:
import queue

n, quantum = map(int, input().split())
q = queue.Queue()
for _ in range(n):
    name, time = input().split()
    q.put([name, int(time)])

spend_time = 0
while q.qsize() > 0:
    name, time = q.get()
    tmp = min(quantum, time)
    spend_time += tmp
    time -= tmp
    if time == 0:
        print('{} {}'.format(name, spend_time))
    else:
        q.put([name, time])
Buggy python submission (verdict: Runtime Error):
import math
x1,y1,x2,y2 = map(int, input().split())
print(math.sqrt((x1-x2)**2+(y1-y2)**2))

Fixed submission:
import math
x1,y1,x2,y2 = map(float, input().split())
print(math.sqrt((x1-x2)**2+(y1-y2)**2))
Buggy python submission (verdict: Runtime Error):
import random


class Dice(object):
    def __init__(self):
        self.t = 1
        self.s = 2
        self.e = 3
        self.w = 4
        self.n = 5
        self.b = 6

    def __init__(self, faces):
        self.t = faces[0]
        self.s = faces[1]
        self.e = faces[2]
        self.w = faces[3]
        self.n = faces[4]
        self.b = faces[5]

    def roll(self, direct):
        if direct == 0:
            self.t, self.s, self.b, self.n = self.n, self.t, self.s, self.b
        elif direct == 1:
            self.t, self.w, self.b, self.e = self.e, self.t, self.w, self.b
        elif direct == 2:
            self.n, self.w, self.s, self.e = self.w, self.s, self.e, self.n

    def is_equal(dice):
        if self.t == dice.t and self.s == dice.s and self.e == dice.e and self.w == dice.w and self.n == dice.n and self.b == dice.b:
            return True
        else:
            return False

faces1 = list(map(int, input().split()))
dice1 = Dice(faces1)
faces2 = list(map(int, input().split()))
dice2 = Dice(faces2)

flag = False

for i in range(10000):
    dice2.roll(random.randint(0, 3))
    if dice1.is_equal(dice2):
        flag = True
        break

if flag:
    print('Yes')
else:
    print('No')



Fixed submission:
import random


class Dice(object):
    def __init__(self):
        self.t = 1
        self.s = 2
        self.e = 3
        self.w = 4
        self.n = 5
        self.b = 6

    def __init__(self, faces):
        self.t = faces[0]
        self.s = faces[1]
        self.e = faces[2]
        self.w = faces[3]
        self.n = faces[4]
        self.b = faces[5]

    def roll(self, direct):
        if direct == 0:
            self.t, self.s, self.b, self.n = self.n, self.t, self.s, self.b
        elif direct == 1:
            self.t, self.w, self.b, self.e = self.e, self.t, self.w, self.b
        elif direct == 2:
            self.n, self.w, self.s, self.e = self.w, self.s, self.e, self.n

    def is_equal(self, dice):
        if self.t == dice.t and self.s == dice.s and self.e == dice.e and self.w == dice.w and self.n == dice.n and self.b == dice.b:
            return True
        else:
            return False

faces1 = list(map(int, input().split()))
dice1 = Dice(faces1)
faces2 = list(map(int, input().split()))
dice2 = Dice(faces2)

flag = False

for i in range(10000):
    dice2.roll(random.randint(0, 3))
    if dice1.is_equal(dice2):
        flag = True
        break

if flag:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
import math
r = int(input())
print(r**2*math.pi, 2*r*math.pi)

Fixed submission:
import math
r = float(input())
print(r**2*math.pi, r*2*math.pi)

Buggy python submission (verdict: Runtime Error):
import math
r = int(input())
print(r*r*math.pi, 2*r*math.pi)

Fixed submission:
import math
r = float(input())
print(r**2*math.pi, r*2*math.pi)
Buggy python submission (verdict: Runtime Error):
charas = 'abcdefghijklmnopqrstuvwxyz'


for line in sys.stdin:
    data.appen(line)
for chara in chara:
    for row in data:
        cnt = row.count(chara)
        cnt += row.count(chara.upper())
    print('{} : {}'.format(chara, cnt))

Fixed submission:
# coding: utf-8
alphabet = 'abcdefghijklmnopqrstuvwxyz'
S = ''
while True:
    try:
        n = input()
        S += n
    except EOFError:
        break
ans_dict = {}
for char in alphabet:
    ans_dict[char] = S.count(char)
    ans_dict[char] += S.count(char.upper())
for k, v in sorted(ans_dict.items(), key=lambda x: x[0]):
    print('{} : {}'.format(k, v))

Buggy python submission (verdict: Runtime Error):
import sys

charas = 'abcdefghijklmnopqrstuvwxyz'

for line in sys.stdin:
    data.appen(line)
for chara in chara:
    for row in data:
        cnt = row.count(chara)
        cnt += row.count(chara.upper())
    print('{} : {}'.format(chara, cnt))

Fixed submission:
# coding: utf-8
alphabet = 'abcdefghijklmnopqrstuvwxyz'
S = ''
while True:
    try:
        n = input()
        S += n
    except EOFError:
        break
ans_dict = {}
for char in alphabet:
    ans_dict[char] = S.count(char)
    ans_dict[char] += S.count(char.upper())
for k, v in sorted(ans_dict.items(), key=lambda x: x[0]):
    print('{} : {}'.format(k, v))

Buggy python submission (verdict: Runtime Error):
import sys

charas = 'abcdefghijklmnopqrstuvwxyz'

data = []
for line in sys.stdin:
    data.append(line)
for chara in chara:
    for row in data:
        cnt = row.count(chara)
        cnt += row.count(chara.upper())
    print('{} : {}'.format(chara, cnt))

Fixed submission:
# coding: utf-8
alphabet = 'abcdefghijklmnopqrstuvwxyz'
S = ''
while True:
    try:
        n = input()
        S += n
    except EOFError:
        break
ans_dict = {}
for char in alphabet:
    ans_dict[char] = S.count(char)
    ans_dict[char] += S.count(char.upper())
for k, v in sorted(ans_dict.items(), key=lambda x: x[0]):
    print('{} : {}'.format(k, v))
Buggy python submission (verdict: Runtime Error):
ring_str = input()
str = input()

for i in range(len(s)):
    if i == 0 and ring_str.find(s) != -1:
        print('Yes')
        break
    if i != 0 and ring_str.find(s[:i]) == len(ring_str) - len(s[:i]):
        if s[i:] == ring_str[:len(s[i:])]:
            print('Yes')
            break
    if i == len(s) - 1:
        print('No')

Fixed submission:
# coding: utf-8
ring = input()
pattern = input()

ring *= 2

if pattern in ring:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
n,m = map(int, input().split())
a = n**m%1,000000007
print(a)

Fixed submission:
def power(n,m):
    if m == 0:
        return 1
    if m % 2 == 0:
        return power(n*n%1000000007,m//2)
    else:
        return n * power(n,m-1) % 1000000007
        
n,m = map(int, input().split())
print(power(n,m))

Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int, input().split())
a = n**m%1000000007
print(a)

Fixed submission:
def power(n,m):
    if m == 0:
        return 1
    if m % 2 == 0:
        return power(n*n%1000000007,m//2)
    else:
        return n * power(n,m-1) % 1000000007
        
n,m = map(int, input().split())
print(power(n,m))

Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int, input().split())
a = 1
for i in range(m):
    a *= n
    if a > 1000000007:
        a %= 1000000007
print(a)

Fixed submission:
def power(n,m):
    if m == 0:
        return 1
    if m % 2 == 0:
        return power(n*n%1000000007,m//2)
    else:
        return n * power(n,m-1) % 1000000007
        
n,m = map(int, input().split())
print(power(n,m))
Buggy python submission (verdict: Runtime Error):
N = input()
a = [input() for i in range(N)]
a.sort()
print a[0],a[1],a[3]

Fixed submission:
a = [input() for i in range(10)]
a.sort(reverse=True)
print a[0]
print a[1]
print a[2]
Buggy python submission (verdict: Runtime Error):
n = raw_input()

print n*n*n

Fixed submission:
n = int(raw_input())
print n**3

Buggy python submission (verdict: Runtime Error):
n = int(raw_input)

print n**3

Fixed submission:
n = int(raw_input())
print n**3
Buggy python submission (verdict: Runtime Error):
sec = int(raw_input())
H = 3600
M = 60

h = sec / H
sec = sec % H
m = sec / M
s = sec % M

print h+":"+m+":"+s

Fixed submission:
sec = int(raw_input())
H = 3600
M = 60

h = sec / H
sec = sec % H
m = sec / M
s = sec % M

print str(h)+":"+str(m)+":"+str(s)

Buggy python submission (verdict: Runtime Error):
sec = int(raw_input())
H = 3600
M = 60

h = sec / H
sec = sec % H
m = sec / M
s = sec % M

print h+":"+m+":"+s

Fixed submission:
sec = int(raw_input())
H = 3600
M = 60

h = sec / H
sec = sec % H
m = sec / M
s = sec % M

print str(h)+":"+str(m)+":"+str(s)