Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

for p in range(1, 4):
 sum = 0
 for i in range(n):
  sum += math.fabs(x[i]-y[i])**p
 print(sum**(1/p))

sum = 0
for i in range(n):
 sum += math.fabs(x[[i]-y[i])**math.inf
print(sum**(1/math.inf))

Fixed submission:
import math
n = int(input())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

for p in range(1, 4):
 sum = 0
 for i in range(n):
  sum += math.fabs(x[i]-y[i])**p
 print(sum**(1/p))

a = []
for i in range(n):
 a.append(math.fabs(x[i]-y[i]))
a.sort()
print(a[n-1])

Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

for p in range(1, 4):
 sum = 0
 for i in range(n):
  sum += math.fabs(x[i]-y[i])**p
 print(sum**(1/p))

a = []
for i in range(n):
 a.append(math.fabs(x[i]-y[i]))
a = a.sort()
print(a[n])

Fixed submission:
import math
n = int(input())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

for p in range(1, 4):
 sum = 0
 for i in range(n):
  sum += math.fabs(x[i]-y[i])**p
 print(sum**(1/p))

a = []
for i in range(n):
 a.append(math.fabs(x[i]-y[i]))
a.sort()
print(a[n-1])

Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

for p in range(1, 4):
 sum = 0
 for i in range(n):
  sum += math.fabs(x[i]-y[i])**p
 print(sum**(1/p))

a = []
for i in range(n):
 a.append(math.fabs(x[i]-y[i]))
a = a.sort()
print(a[n-1])

Fixed submission:
import math
n = int(input())
x = list(map(int, input().split()))
y = list(map(int, input().split()))

for p in range(1, 4):
 sum = 0
 for i in range(n):
  sum += math.fabs(x[i]-y[i])**p
 print(sum**(1/p))

a = []
for i in range(n):
 a.append(math.fabs(x[i]-y[i]))
a.sort()
print(a[n-1])
Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
print(a*b)

Fixed submission:
a, b = input().split(' ')
men = int(a) * int(b)
syu = int(a)*2 + int(b)*2
print(men, syu)
Buggy python submission (verdict: Runtime Error):
S = int(input())
s = S % 60
m = S // 60
h = S // 60 // 60
print(s':'m':'h)

Fixed submission:
S = int(input())
s = str(S % 60)
m = str(S // 60 % 60)
h = str(S // 60 // 60)
print(h + ':' + m + ':' + s)
Buggy python submission (verdict: Runtime Error):
counter = 1
while 1:
  i = int(input())
  if i == 0:
    break
  print("Case", str(count)':', i)
  count++

Fixed submission:
counter = 0
while 1:
  i = int(input())
  if i == 0:
    break
  counter += 1
  print("Case {0}: {1}".format(counter, i))

Buggy python submission (verdict: Runtime Error):
counter = 0
while 1:
  i = int(input())
  if i == 0:
    break
  counter++
  print("Case {0}: {1}".format(counter, i)

Fixed submission:
counter = 0
while 1:
  i = int(input())
  if i == 0:
    break
  counter += 1
  print("Case {0}: {1}".format(counter, i))

Buggy python submission (verdict: Runtime Error):
counter = 0
while 1:
  i = int(input())
  if i == 0:
    break
  counter += 1
  print("Case {0}: {1}".format(counter, i)

Fixed submission:
counter = 0
while 1:
  i = int(input())
  if i == 0:
    break
  counter += 1
  print("Case {0}: {1}".format(counter, i))
Buggy python submission (verdict: Runtime Error):
import math
r = int(input())
S = math.pi * r * r
R = 2 * math.pi * r
print("{0} {1}".format(S, R))

Fixed submission:
from math import pi
r = float(input())
S = pi * r * r
R = 2 * pi * r
print("{0} {1}".format(S, R))

Buggy python submission (verdict: Runtime Error):
import math
r = int(input())
S = math.pi * r * r
R = 2 * math.pi * r
print("{0} {1}".format(S, R))

Fixed submission:
from math import pi
r = float(input())
S = pi * r * r
R = 2 * pi * r
print("{0} {1}".format(S, R))

Buggy python submission (verdict: Runtime Error):
import math
r = int(input())
S = math.pi * r * r
R = 2 * math.pi * r
print("{0} {1}".format(S, R))

Fixed submission:
from math import pi
r = float(input())
S = pi * r * r
R = 2 * pi * r
print("{0} {1}".format(S, R))

Buggy python submission (verdict: Runtime Error):
import math
r = int(input())
S = math.pi * r * r
R = 2 * math.pi * r
print("{0} {1}".format(S, R))

Fixed submission:
from math import pi
r = float(input())
S = pi * r * r
R = 2 * pi * r
print("{0} {1}".format(S, R))

Buggy python submission (verdict: Runtime Error):
from math import math.pi as pi
r = int(input())
S = pi * r * r
R = 2 * pi * r
print("{0} {1}".format(S, R))

Fixed submission:
from math import pi
r = float(input())
S = pi * r * r
R = 2 * pi * r
print("{0} {1}".format(S, R))

Buggy python submission (verdict: Runtime Error):
from math import pi
r = int(input())
S = pi * r * r
R = 2 * pi * r
print("{0} {1}".format(S, R))

Fixed submission:
from math import pi
r = float(input())
S = pi * r * r
R = 2 * pi * r
print("{0} {1}".format(S, R))

Buggy python submission (verdict: Runtime Error):
pi = 3.141592
r = int(input())
S = pi * r * r
R = 2 * pi * r
print("{0} {1}".format(S, R))

Fixed submission:
from math import pi
r = float(input())
S = pi * r * r
R = 2 * pi * r
print("{0} {1}".format(S, R))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
i = 1
while i <= n:
 if i % 3 == 0:
  print(' {}'.format(i))
  continue
 elif i % 10 == 3:
  print(' {}'.format(i))
  continue

Fixed submission:
n = int(input())
i = 1
for i in range(1, n + 1):
 if i % 3 == 0:
  print(' {0}'.format(i), end = '')
 else:
  st = str(i)
  for x in range(0, len(st)):
   if st[x] == '3':
    print(' {0}'.format(i), end = '')
    break
print()

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
i = 1
while i <= n:
 if i % 3 == 0:
  print(' {}'.format(i))
  continue
 elif i % 10 == 3:
  print(' {}'.format(i))
  continue

Fixed submission:
n = int(input())
i = 1
for i in range(1, n + 1):
 if i % 3 == 0:
  print(' {0}'.format(i), end = '')
 else:
  st = str(i)
  for x in range(0, len(st)):
   if st[x] == '3':
    print(' {0}'.format(i), end = '')
    break
print()

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
i = 1
while i <= n:
 if i % 3 == 0:
  print(' {0}'.format(i))
  continue
 elif i % 10 == 3:
  print(' {0}'.format(i))
  continue

Fixed submission:
n = int(input())
i = 1
for i in range(1, n + 1):
 if i % 3 == 0:
  print(' {0}'.format(i), end = '')
 else:
  st = str(i)
  for x in range(0, len(st)):
   if st[x] == '3':
    print(' {0}'.format(i), end = '')
    break
print()

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
i = 1
while i <= n:
 if i % 3 == 0:
  print(' {0}'.format(i))
  continue
 elif i % 10 == 3:
  print(' {0}'.format(i))
  continue
 i += 1

Fixed submission:
n = int(input())
i = 1
for i in range(1, n + 1):
 if i % 3 == 0:
  print(' {0}'.format(i), end = '')
 else:
  st = str(i)
  for x in range(0, len(st)):
   if st[x] == '3':
    print(' {0}'.format(i), end = '')
    break
print()
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = map(int, input().split())
for i in range(0, n):
 print(a[n - i], end = ' ')
print()

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
for i in range(0, n - 1):
 print(a[n - 1 - i], end = ' ')
print(a[0])

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = map(int, input().split())
for i in range(0, n):
 print(a[n - 1 - i], end = ' ')
print()

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
for i in range(0, n - 1):
 print(a[n - 1 - i], end = ' ')
print(a[0])
Buggy python submission (verdict: Runtime Error):
F = [[[0] * 10 for i in range(3)] for i in range(4)]
n = int(input())
for i in range(n):
 b, f, r, v = map(int, input().split())
 F[b+1][f+1][r+1] += v
for x in range(0, 4):
 for y in range(0, 3):
  for z in range(0, 9):
   print(" {0} ".format(F[x][y][z]), end = '')
  print(F[x][y][z+1])
 if x != 3:
  print("#" * 20)

Fixed submission:
F = [[[0] * 10 for i in range(3)] for i in range(4)]
n = int(input())
for i in range(n):
 b, f, r, v = map(int, input().split())
 F[b-1][f-1][r-1] += v
for x in range(0, 4):
 for y in range(0, 3):
  for z in range(0, 10):
   print(" {0}".format(F[x][y][z]), end = '')
  print()
 if x != 3:
  print("#" * 20)
Buggy python submission (verdict: Runtime Error):
while 1:
 n, x = map(int, input().split())
 if n == 0 and x == 0:
  break
 counter = 0
 for a in range(3, n+1):
  for b in range(2, n-1):
   for c in range(1, n-2):
    if a > b > c and a+b+c == x
     counter += 1
 print(counter)
  

Fixed submission:
while 1:
 n, x = map(int, input().split())
 counter = 0
 if n == 0 and x == 0:
  break
 # y + (y-1) + (y-2) = x 
 y = (x+3) // 3
 for a in range(y, n+1):
  for b in range(2, a):
   if (x-a-b) > 0 and (x-a-b) < b:
    counter += 1
 print(counter)

Buggy python submission (verdict: Runtime Error):
while 1:
 n, x = map(int, input().split())
 if n == 0 and x == 0:
  break
 counter = 0
 for a in range(3, n+1):
  for b in range(2, n-1):
   if b > a:
    break
   for c in range(1, n-2):
    if c > b:
     break
    if a+b+c == x
     counter += 1
 print(counter)
  

Fixed submission:
while 1:
 n, x = map(int, input().split())
 counter = 0
 if n == 0 and x == 0:
  break
 # y + (y-1) + (y-2) = x 
 y = (x+3) // 3
 for a in range(y, n+1):
  for b in range(2, a):
   if (x-a-b) > 0 and (x-a-b) < b:
    counter += 1
 print(counter)

Buggy python submission (verdict: Runtime Error):
while 1:
 n, x = map(int, input().split())
 counter = 0
 if n == 0 and x == 0:
  break
 # y + (y-1) + (y-2) = x 
 y = (x+3) // 3
 for a in range(y, n+1):
  for b in range(2, a):
  if (x-a-b) > 0 and (x-a-b) < b:
   counter += 1
 print(counter)
  

Fixed submission:
while 1:
 n, x = map(int, input().split())
 counter = 0
 if n == 0 and x == 0:
  break
 # y + (y-1) + (y-2) = x 
 y = (x+3) // 3
 for a in range(y, n+1):
  for b in range(2, a):
   if (x-a-b) > 0 and (x-a-b) < b:
    counter += 1
 print(counter)
Buggy python submission (verdict: Runtime Error):
while 1:
 n = input()
 if int(n) == 0:
  break
 sum = 0
 for i in range(n):
  sum += int(n[i])
 print(sum)

Fixed submission:
while 1:
 n = input()
 if int(n) == 0:
  break
 sum = 0
 for i in range(len(n)):
  sum += int(n[i])
 print(sum)

Buggy python submission (verdict: Runtime Error):
while 1:
 n = input()
 if int(n) == 0:
  break
 sum = 0
 for i in range(n):
  sum += int(i)
 print(sum)

Fixed submission:
while 1:
 n = input()
 if int(n) == 0:
  break
 sum = 0
 for i in range(len(n)):
  sum += int(n[i])
 print(sum)
Buggy python submission (verdict: Runtime Error):
s = input().split()

for i in range(ord('a'), ord('z')+1):
 print("{0} : {1}".format(chr(i), s.count(chr(i)))

Fixed submission:
import sys 
dataset = sys.stdin.readlines()

for s in range(ord('a'), ord('z') + 1):
 count = 0
 for data in dataset:
  count += data.lower().count(chr(s))
 print("{0} : {1}".format(chr(s), count))

Buggy python submission (verdict: Runtime Error):
s = input()

for i in range(ord('a'), ord('z')+1):
 print("{0} : {1}".format(chr(i), s.count(chr(i)))

Fixed submission:
import sys 
dataset = sys.stdin.readlines()

for s in range(ord('a'), ord('z') + 1):
 count = 0
 for data in dataset:
  count += data.lower().count(chr(s))
 print("{0} : {1}".format(chr(s), count))

Buggy python submission (verdict: Runtime Error):
import sys
s = []
for i in sys.stdin:
 s.append(input().lower())

for i in range(ord('a'), ord('z')+1):
 print("{0} : {1}".format(chr(i), s.count(chr(i))))

Fixed submission:
import sys 
dataset = sys.stdin.readlines()

for s in range(ord('a'), ord('z') + 1):
 count = 0
 for data in dataset:
  count += data.lower().count(chr(s))
 print("{0} : {1}".format(chr(s), count))

Buggy python submission (verdict: Runtime Error):
import sys
s = []
for i in sys.stdin:
 s.append(input().lower())

for i in range(ord('a'), ord('z')+1):
 print("{0} : {1}".format(chr(i), s.count(chr(i))))

Fixed submission:
import sys 
dataset = sys.stdin.readlines()

for s in range(ord('a'), ord('z') + 1):
 count = 0
 for data in dataset:
  count += data.lower().count(chr(s))
 print("{0} : {1}".format(chr(s), count))

Buggy python submission (verdict: Runtime Error):
import sys
s = []
for i in sys.stdin:
 s.append(input().lower())

for i in range(ord('a'), ord('z')+1):
 print("{0} : {1}".format(chr(i), s.count(chr(i))))

Fixed submission:
import sys 
dataset = sys.stdin.readlines()

for s in range(ord('a'), ord('z') + 1):
 count = 0
 for data in dataset:
  count += data.lower().count(chr(s))
 print("{0} : {1}".format(chr(s), count))

Buggy python submission (verdict: Runtime Error):
s = []
while 1:
 inp = input().lower()
 if inp == null:
  break
 s.append(inp)

for i in range(ord('a'), ord('z')+1):
 print("{0} : {1}".format(chr(i), s.count(chr(i))))

Fixed submission:
import sys 
dataset = sys.stdin.readlines()

for s in range(ord('a'), ord('z') + 1):
 count = 0
 for data in dataset:
  count += data.lower().count(chr(s))
 print("{0} : {1}".format(chr(s), count))

Buggy python submission (verdict: Runtime Error):
s = []
while 1:
 inp = input().lower()
 if inp == EOF:
  break
 s.append(inp)
for i in range(ord('a'), ord('z')+1):
 print("{0} : {1}".format(chr(i), s.count(chr(i))))

Fixed submission:
import sys 
dataset = sys.stdin.readlines()

for s in range(ord('a'), ord('z') + 1):
 count = 0
 for data in dataset:
  count += data.lower().count(chr(s))
 print("{0} : {1}".format(chr(s), count))
Buggy python submission (verdict: Runtime Error):
a = []
while 1:
 s = input()
 if s == 'END_OF_TEXT':
  break
 else:
  s = list(s.split('.')
  s = list(s.split())
  a.append(s)

print(a.count(a[0]) - 1)

Fixed submission:
word = input()
counter = 0
while 1:
 s = input()
 if s == 'END_OF_TEXT':
  break
 else:
  s = list(s.lower().split())
  counter += s.count(word)
  counter += s.count(word + '.')

print(counter)

Buggy python submission (verdict: Runtime Error):
a = []
while 1:
 s = input()
 if s == 'END_OF_TEXT':
  break
 else:
  s = list(s.split('.'))
  s.remove('.')
  s.joint(' ')
  s = list(s.split())
  a.append(s)

print(a.count(a[0]) - 1)

Fixed submission:
word = input()
counter = 0
while 1:
 s = input()
 if s == 'END_OF_TEXT':
  break
 else:
  s = list(s.lower().split())
  counter += s.count(word)
  counter += s.count(word + '.')

print(counter)

Buggy python submission (verdict: Runtime Error):
a = []
while 1:
 s = input()
 if s == 'END_OF_TEXT':
  break
 else:
  s = list(s.split('.'))
  s.remove('.')
  s = list(s[0].split())
  a.append(s)

print(a.count(a[0]) - 1)

Fixed submission:
word = input()
counter = 0
while 1:
 s = input()
 if s == 'END_OF_TEXT':
  break
 else:
  s = list(s.lower().split())
  counter += s.count(word)
  counter += s.count(word + '.')

print(counter)

Buggy python submission (verdict: Runtime Error):
a = []
while 1:
 s = input()
 if s == 'END_OF_TEXT':
  break
 else:
  s = list(s.split('.'))
  s.remove('')
  s = list(s[0].split())
  a.append(s)

print(a.count(a[0]) - 1)

Fixed submission:
word = input()
counter = 0
while 1:
 s = input()
 if s == 'END_OF_TEXT':
  break
 else:
  s = list(s.lower().split())
  counter += s.count(word)
  counter += s.count(word + '.')

print(counter)

Buggy python submission (verdict: Runtime Error):
a = []
while 1:
 s = input()
 if s == 'END_OF_TEXT':
  break
 else:
  s = list(s.split(''))
  s.remove('')
  s = list(s[0].split())
  a.append(s)

print(a.count(a[0]) - 1)

Fixed submission:
word = input()
counter = 0
while 1:
 s = input()
 if s == 'END_OF_TEXT':
  break
 else:
  s = list(s.lower().split())
  counter += s.count(word)
  counter += s.count(word + '.')

print(counter)

Buggy python submission (verdict: Runtime Error):
a = []
while 1:
 s = input()
 if s == 'END_OF_TEXT':
  break
 else:
  s = list(s.split(''))
  s = list(s[0].split())
  a.append(s)

print(a.count(a[0]) - 1)

Fixed submission:
word = input()
counter = 0
while 1:
 s = input()
 if s == 'END_OF_TEXT':
  break
 else:
  s = list(s.lower().split())
  counter += s.count(word)
  counter += s.count(word + '.')

print(counter)
Buggy python submission (verdict: Runtime Error):
n = int(input())

t_score = 0
h_score = 0


for i in range(n):
 t, h = input().split()
 if ord(t[0]) > ord(h[0]):
  t_score += 3
 elif ord(t[0]) < ord(h[0]):
  h_score += 3
 elif ord(t[0]) == ord(h[0])
  t_score += 1
  h_score += 1

print("{0} {1}".format(t_score, h_score))

Fixed submission:
n = int(input())

t_score = 0
h_score = 0


for i in range(n):
 t, h = input().split()
 if t == h:
  t_score += 1
  h_score += 1
  continue
 if len(t) >= len(h):
  for j in range(len(h)):
   if ord(t[j]) > ord(h[j]):
    t_score += 3
    break
   elif ord(t[j]) < ord(h[j]):
    h_score += 3
    break
  else:
   t_score += 3
 elif len(t) < len(h):
   for j in range(len(t)):
    if ord(t[j]) > ord(h[j]):
     t_score += 3
     break
    elif ord(t[j]) < ord(h[j]):
     h_score += 3
     break
   else:
    h_score += 3

   
print("{0} {1}".format(t_score, h_score))

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

t_score = 0
h_score = 0


for i in range(n):
 t, h = input().split()
 if len(t) >= len(h):
  for j in range(len(h)):
   if ord(t[j]) > ord(h[j]):
    t_score += 3
    break
   elif ord(t[j]) < ord(h[j]):
    h_score += 3
    break
  else:
   t_score += 1
   h_score += 1
 elif len(t) < len(h):
   for j in range(len(h)):
    if ord(t[j]) > ord(h[j]):
     t_score += 3
     break
    elif ord(t[j]) < ord(h[j]):
     h_score += 3
     break
   else:
    t_score += 1
    h_score += 1
   
print("{0} {1}".format(t_score, h_score))

Fixed submission:
n = int(input())

t_score = 0
h_score = 0


for i in range(n):
 t, h = input().split()
 if t == h:
  t_score += 1
  h_score += 1
  continue
 if len(t) >= len(h):
  for j in range(len(h)):
   if ord(t[j]) > ord(h[j]):
    t_score += 3
    break
   elif ord(t[j]) < ord(h[j]):
    h_score += 3
    break
  else:
   t_score += 3
 elif len(t) < len(h):
   for j in range(len(t)):
    if ord(t[j]) > ord(h[j]):
     t_score += 3
     break
    elif ord(t[j]) < ord(h[j]):
     h_score += 3
     break
   else:
    h_score += 3

   
print("{0} {1}".format(t_score, h_score))
Buggy python submission (verdict: Runtime Error):
s = input()
n = int(input())
for i in range(n):
 a = list(input().split())
 temp = s[int(a[1])+1:int(a[2])+2]
 if a[0] == 'replace':
  s.replace(temp, a[3])
 elif a[0] == 'reverse':
  s.replace(temp, temp[::-1])
 elif a[0] == 'print':
  print(s[int(a[1])+1:int(a[2])+2)
  

Fixed submission:
s = input()
n = int(input())
for i in range(n):
 a = list(input().split())
 temp = s[int(a[1]):int(a[2])+1]
 if a[0] == 'replace':
  temp3 = a[3]
  s = list(s)
  seq = 0
  for i in range(int(a[1]), int(a[2])+1):
   s[i] = temp3[seq]
   seq += 1
  s = ''.join(s)
 elif a[0] == 'reverse':
  temp2 = temp[::-1]
  s = s.replace(temp, temp2, 1)
 elif a[0] == 'print':
  print(temp)

Buggy python submission (verdict: Runtime Error):
s = input()
n = int(input())
for i in range(n):
 a = list(input().split())
 temp = s[int(a[1])-1:int(a[2])]
 if a[0] == 'replace':
  s.replace(temp, a[3])
 elif a[0] == 'reverse':
  temp2 = temp[::-1]
  s.replace(temp, temp2)
 elif a[0] == 'print':
  print(s[int(a[1])-1:int(a[2]))
  

Fixed submission:
s = input()
n = int(input())
for i in range(n):
 a = list(input().split())
 temp = s[int(a[1]):int(a[2])+1]
 if a[0] == 'replace':
  temp3 = a[3]
  s = list(s)
  seq = 0
  for i in range(int(a[1]), int(a[2])+1):
   s[i] = temp3[seq]
   seq += 1
  s = ''.join(s)
 elif a[0] == 'reverse':
  temp2 = temp[::-1]
  s = s.replace(temp, temp2, 1)
 elif a[0] == 'print':
  print(temp)

Buggy python submission (verdict: Runtime Error):
s = input()
n = int(input())
for i in range(n):
 a = list(input().split())
 temp = s[int(a[1]):int(a[2])+1]
 if a[0] == 'replace':
  temp3 = a[3]
  s = list(s)
  seq = 0
  for i in range(int(a[1]), int(a[2])+1):
   s[i] = temp3[seq]
   seq += 1
 elif a[0] == 'reverse':
  temp2 = temp[::-1]
  s = s.replace(temp, temp2, 1)
 elif a[0] == 'print':
  print(temp)
 
  

Fixed submission:
s = input()
n = int(input())
for i in range(n):
 a = list(input().split())
 temp = s[int(a[1]):int(a[2])+1]
 if a[0] == 'replace':
  temp3 = a[3]
  s = list(s)
  seq = 0
  for i in range(int(a[1]), int(a[2])+1):
   s[i] = temp3[seq]
   seq += 1
  s = ''.join(s)
 elif a[0] == 'reverse':
  temp2 = temp[::-1]
  s = s.replace(temp, temp2, 1)
 elif a[0] == 'print':
  print(temp)
Buggy python submission (verdict: Runtime Error):
a = int(raw_input())
b = int(raw_input())
print a*b,a*2+b*2

Fixed submission:
s = raw_input().rstrip().split(" ")
a = int(s[0])
b = int(s[1])
print a*b,a*2+b*2

Buggy python submission (verdict: Runtime Error):
s = raw_input().rstrip.split(" ")
a = int(s[0])
b = int(s[1])
print a*b,a*2+b*2

Fixed submission:
s = raw_input().rstrip().split(" ")
a = int(s[0])
b = int(s[1])
print a*b,a*2+b*2
Buggy python submission (verdict: Time Limit Exceeded):
import sys

def calc():
    while 1:
        n = int(raw_input())
        if n == 0:
            break
        a = 0
        b = 0
        ans = map(int, raw_input().split())
        while n > 0:
            if ans[0] > ans[1]:
                a += ans[0] + ans[1]
            elif ans[1] < ans[0]:
                b += ans [0] + ans[1]
            else:
                a += ans[0]
                b += ans[1]
        print a, b
    
if __name__ == '__main__':
    calc()

Fixed submission:
import sys

def calc():
    while 1:
        n = int(raw_input())
        if n <= 0:
            break
        a = 0
        b = 0
        while n > 0:
            ans = map(int, raw_input().split())
            if ans[0] > ans[1]:
                a += ans[0] + ans[1]
            elif ans[0] < ans[1]:
                b += ans [0] + ans[1]
            else:
                a += ans[0]
                b += ans[1]
            n -= 1
        print a, b
        
    
if __name__ == '__main__':
    calc()
Buggy python submission (verdict: Time Limit Exceeded):
n = int(raw_input())

def fib(N):
    if N in [0, 1]:
        return 1
    else:
        return fib(N-1) + fib(N-2)

print fib(n)

Fixed submission:
n = int(raw_input())
a = 1
b = 1
for i in range(n-1):
    tmp = a
    a = b
    b += tmp
print b
Buggy python submission (verdict: Time Limit Exceeded):
n = int(raw_input())
a = []
for i in range(n):
    a.append(int(raw_input()))

max = a[1] - a[0]
for i in range(n - 1):
    for j in range(i+1, n):
        if a[j] - a[i] > max:
            max = a[j] - a[i]

print max

Fixed submission:
n = int(raw_input())
a = []
for i in range(n):
    a.append(int(raw_input()))

max = a[1] - a[0]
min_num = a[0]
for i in a[1:]:
    if i - min_num > max:
        max = i - min_num
    if min_num > i:
        min_num = i
print max

Buggy python submission (verdict: Runtime Error):
n = int(raw_input())
a = []
for i in range(n):
    a.append(int(raw_input()))

max = a[1] - a[0]
min_num = a[0]
for i in a:
    if a[i] - min_num > max:
        max = a[i] - min_num
    if min_num > i:
        min_num = i
print max

Fixed submission:
n = int(raw_input())
a = []
for i in range(n):
    a.append(int(raw_input()))

max = a[1] - a[0]
min_num = a[0]
for i in a[1:]:
    if i - min_num > max:
        max = i - min_num
    if min_num > i:
        min_num = i
print max