Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p03998 (python)

Fixed submission:
s_a = input()
s_b = input()
s_c = input()
x = s_a[0]
while( len(s_a) >= 0 and len(s_b) >=0 and len(s_c) >= 0):

    if x == 'a':
        x = s_a[0]
        s_a = s_a[1:]


    elif x == 'b':
        x = s_b[0]
        s_b = s_b[1:]

    elif x == 'c':
        x = s_c[0]
        s_c = s_c[1:]


    if x == 'a' and len(s_a) == 0:
        print('A')
        break
    if x == 'b' and len(s_b) == 0:
        print('B')
        break
    if x == 'c' and len(s_c) == 0:
        print('C')
        break

Buggy submission (verdict: Runtime Error):
s_a = input()
s_b = input()
s_c = input()
x = s_a[0]
while( len(s_a) >= 0 and len(s_b) >=0 and len(s_c) >= 0):

    if x == 'a':
        x = s_a[0]
        s_a = s_a[1:]

    if x == 'b':
        x = s_b[0]
        s_b = s_b[1:]

    if x == 'c':
        x = s_c[0]
        s_c = s_c[1:]

    if x == 'a' and len(s_a) == 0:
        print('A')
        break
    if x == 'b' and len(s_b) == 0:
        print('B')
        break
    if x == 'c' and len(s_c) == 0:
        print('C')
        break

Buggy submission (verdict: Runtime Error):
s_a = input()
s_b = input()
s_c = input()
x = s_a[0]
while( len(s_a) >= 0 and len(s_b) >=0 and len(s_c) >= 0):

    print(s_a,s_b,s_c,1)
    if x == 'a':
        x = s_a[0]
        s_a = s_a[1:]
        print(s_a,s_b,s_c,2)
    if x == 'b':
        x = s_b[0]
        s_b = s_b[1:]
        print(s_a,s_b,s_c,3)
    if x == 'c':
        x = s_c[0]
        s_c = s_c[1:]
        print(s_a,s_b,s_c,4)
    if x == 'a' and len(s_a) == 0:
        print('A')
        break
    if x == 'b' and len(s_b) == 0:
        print('B')
        break
    if x == 'c' and len(s_c) == 0:
        print('C')
        break
Problem p02945 (python)

Fixed submission:
n,s= map(int,input().split())
print(max(n+s,n-s,n*s))

Buggy submission (verdict: Runtime Error):
n,s= map(int,input().split())
print(max(n+s,n-s,n*s)
Problem p02660 (python)

Fixed submission:

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append(cnt)
    if temp!=1:
        arr.append(1)
    if arr==[]:
        arr.append(1)
    return arr

def calc(n):
    val = 1
    count = 0
    for i in range(2,100000):
        count += 1
        val = val + i
        if val > n:
            return count

N = int(input())
if N == 1:
    print(0)
    exit(0)

arr = factorization(N)

ans = 0 
for val in arr:
    ans += calc(val)
 
print(ans)

Buggy submission (verdict: Runtime Error):
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append(cnt)
    if temp!=1:
        arr.append(1)
    if arr==[]:
        arr.append(1)
    return arr

def calc(n):
    val = 1
    count = 0
    for i in range(2,100000):
        count += 1
        val = val + i
        if val > n:
            return count

N = int(input())
if N == 1:
    print(0)
    exit(0)

print(arr)

ans = 0 
for val in arr:
    ans += calc(val)
 
print(ans)
Problem p02789 (python)

Fixed submission:
n,m = map(int, input().split())
if n==m:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n,m = map(int, input().split())
if n==m:
    print "Yes"
else:
    print "No"
Problem p04045 (python)

Fixed submission:
N, K = map(int, input().split())
D = list(map(int, input().split()))
ans = N
while True:
    for i in D:
        if str(i) in str(ans):
            break
    else:
        break

    ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
D = list(map(int, input().split()))
OK = list({1, 2, 3, 4, 5, 6, 7, 8, 9} - set(D))

S = str(N)
ans = []


def find_next(x):
    while True:
        x += 1
        if x in OK:
            return str(x)


for i in range(len(S)):
    if int(S[i]) in OK:
        ans += S[i]
    elif max(OK) > int(S[0]):
        ans += find_next(int(S[0]))
        for _ in range(len(S) - len(ans)):
            ans += "0"
        break
    else:
        if i == 0:
            ans += str(min(OK))
        else:
            ans[-1] = find_next(ans[-1])

        for _ in range(len(S) - len(ans) + 1):
            ans += "0"
        break

print("".join(ans))
Problem p02789 (python)

Fixed submission:
a = list(map(int,input().split()))
if a[0] == a[1]:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
a = list(map(int,input().split()))
if a[0] == a[1]:
    print('Yes')
elif:
    print('No')
Problem p02801 (python)

Fixed submission:
z = input()
a = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
for b in range(26):
    if a[b]==z:
        c=b+1
print(a[c])

Buggy submission (verdict: Runtime Error):
i1 = list(map(int,input().split()))
i2 = list(map(int,input().split()))

x = sum(i2)

for i in range(i1[1]):
    if (x+i)/(i1[0]) >= i1[2]:
        print(i)
        break
    else if i == i1[1]-1:
        print(-1)
Problem p02681 (python)

Fixed submission:
s = input()
t = input()
bool = 0
list = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
for i in list:
  if s+i==t:
    print("Yes")
    bool+=1
    break
if bool==0:
  print("No")

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
bool = 0
list = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
for i in list:
  if s+i==t:
    print("Yes")
    bool+=1
    break
if bool=0:
  print("No")
Problem p02818 (python)

Fixed submission:
a,b,k=map(int,input().split())
if(k<=a):
  print(a-k,b)
elif(k>a and k<=a+b):
  print(0,b-k+a)
else:
  print(0,0)

Buggy submission (verdict: Runtime Error):
a,b,k=input().split()
if(k<=a):
  print(a-k,b)
elif(k>a and k<=a+b):
  print(0,b-k+a)
else:
  print(0,0)
Problem p02642 (python)

Fixed submission:
from collections import Counter

def main():
    n = int(input())
    a = sorted([int(i) for i in input().split()])
    table = [True for i in range(max(a))]
    res = 0
    amax = max(a)

    for i in a:
        if (amax/2) + 1 < i:
            break
        if table[i-1] is False:
            continue
        for j in range(i*2, amax+1, i):
            table[j-1] = False

    c = Counter(a)
    for i in set(a):
        if table[i-1]:
            if c[i] == 1:
                res += 1
    print(res)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    n = int(input())
    a = sorted([int(i) for i in input().split()])
    table = [True for i in range(max(a))]
    res = 0
    amax = max(a)
    dup = 0

    for i in a:
        if table[i-1]:
            if i not in res:
                res.append(i)
            else:
                dup += 1  
                continue
        else:
            continue
        for j in range(i *2, amax, i):
            table[j-1] = False
    print(len(res) - dup)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    n = int(input())
    a = sorted([int(i) for i in input().split()])
    table = [True for i in range(max(a))]
    res = 0
    amax = max(a)
    dup = 0

    for i in a:
        if table[i-1]:
            if i not in res:
                res.append(i)
            else:
                dup += 1  
                continue
        else:
            continue
        for j in range(i *2, amax, i):
            table[j-1] = False
    print(len(res) - dup)

if __name__ == '__main__':
    main()
Problem p02714 (python)

Fixed submission:
from itertools import permutations

def main():
    n = int(input())
    s = input()
    res = 0
    r = 0
    g = 0
    b = 0
    for i, c in enumerate(s):
        if c == 'R':
            r += 1
        elif c == 'G':
            g += 1
        else:
            b += 1
    
    rgb = []
    for t in permutations('RGB'):
        rgb.append(''.join(t))

    cnt = 0
    for i in range(n-2):
        for j in range(i+1, n-1):
            k = 2*j - i 
            if k >= n:
                break
            if (s[i] + s[j] + s[k]) in rgb:
                cnt += 1
    print(r*g*b - cnt)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import math
from itertools import combinations

def main():
    k = int(input())
    res = 0
    memo = [[0 for _ in range(k+1)] for _ in range(k+1)]
    for i ian range(1, k+1):
        for j in range(i, k+1):
            tmp = math.gcd(i,j)
            memo[i][j] = tmp
            memo[j][i] = tmp

    for i in range(1, k+1):
        res += i 

    for c in combinations(range(1,k+1),2):
        ab = memo[c[0], c[1]]
        res += ab * 6

    for c in combinations(range(1,k+1), 3):
        ab = memo[c[0], c[1]]
        abc = memo[ab, c[2]]
        res += abc * 6
    print(res)


if __name__ == '__main__':
    main()
Problem p02727 (python)

Fixed submission:
def main():
    X, Y, A, B, C = [int(i) for i in input().split()]
    red = [int(i) for i in input().split()]
    blue = [int(i) for i in input().split()]
    noc = [int(i) for i in input().split()]
    red = sorted(red)[-X:]
    blue = sorted(blue)[-Y:]
    rb = sorted(red + blue)
    score = sum(rb)
    noc = sorted(noc)[::-1]

    s_noc = 0
    s_rb = 0
    for i in range(min(len(rb), len(noc))):
        if rb[i] > noc[i]:
            break
        s_noc += noc[i]
        s_rb += rb[i]

    print(score + s_noc - s_rb)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    X, Y, A, B, C = [int(i) for i in input().split()]
    red = [int(i) for i in input().split()]
    blue = [int(i) for i in input().split()]
    noc = [int(i) for i in input().split()]
    red = sorted(red)[-X:]
    blue = sorted(blue)[-Y:]
    rb = sorted(red + blue)
    score = sum(rb)
    noc = sorted(noc)[::-1]

    s_noc = 0
    s_rb = 0
    for i in range(min(A+B, C)):
        if rb[i] > noc[i]:
            break
        s_noc += noc[i]
        s_rb += rb[i]

    print(score + s_noc - s_rb)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    X, Y, A, B, C = [int(i) for i in input().split()]
    red = [int(i) for i in input().split()]
    blue = [int(i) for i in input().split()]
    noc = [int(i) for i in input().split()]
    red = sorted(red)[-X:]
    blue = sorted(blue)[-Y:]
    rb = sorted(red + blue)
    score = sum(rb)
    noc = sorted(noc)[::-1]

    s_noc = 0
    s_rb = 0
    for i in range(min(A+B, C)):
        if rb[i] > noc[i]:
            break
        s_noc += noc[i]
        s_rb += rb[i]

    print(score + s_noc - s_rb)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    X, Y, A, B, C = [int(i) for i in input().split()]
    red = [int(i) for i in input().split()]
    blue = [int(i) for i in input().split()]
    noc = [int(i) for i in input().split()]
    red = sorted(red)[-X:]
    blue = sorted(blue)[-Y:]
    rb = sorted(red + blue)
    score = sum(rb)
    noc = sorted(noc)[::-1]
    print(rb)
    print(noc)

    s_noc = 0
    s_rb = 0
    for i in range(min(A+B, C)):
        if rb[i] > noc[i]:
            break
        s_noc += noc[i]
        s_rb += rb[i]

    print(score + s_noc - s_rb)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    X, Y, A, B, C = [int(i) for i in input().split()]
    red = [int(i) for i in input().split()]
    blue = [int(i) for i in input().split()]
    noc = [int(i) for i in input().split()]
    red = sorted(red)[-X:]
    blue = sorted(blue)[-Y:]
    rb = sorted(red + blue)
    score = sum(rb)
    noc = sorted(noc)[::-1]

    s_noc = 0
    s_rb = 0
    for i in range(max(A+B, C)):
        if rb[i] > noc[i]:
            break
        s_noc += noc[i]
        s_rb += rb[i]

    print(score + s_noc - s_rb)


if __name__ == '__main__':
    main()
Problem p02756 (python)

Fixed submission:
from collections import deque as dq
s = input()
nq = int(input())

s = dq(s)

jun = True
for i in range(nq):
  query = input().split()
  if query[0] == '1':
    jun = not jun
    continue
  if jun:
    if query[1] == '1':
      s.appendleft(query[2])
    else:
      s.append(query[2])
  else:
    if query[1] == '1':
      s.append(query[2])
    else:
      s.appendleft(query[2])
if jun:
  print(''.join(s))
else:
  print(''.join(list(s)[::-1]))

Buggy submission (verdict: Runtime Error):
from collections import deque as dq
s = input()
nq = int(input())

s = dq(s)

jun = True
for i in range(nq):
  query = input().split()
  if query[0] == '1':
    jun = not jun
    continue
  if jun:
    if query[1] == '1':
      s.appendleft(query[2])
    else:
      s.append(query[2])
  else:
    if query[1] == '1':
      s.append(query[2])
    else:
      s.appendleft(query[2])
if jun:
  print(''.join(s))
else:
  print(''.join(s[::-1]))

Buggy submission (verdict: Runtime Error):
from collections import deque as dq
s = input()
nq = int(input())

s = dq(s)

jun = True
for i in range(nq):
  query = input().split()
  if query[0] == '1':
    jun = not jun
    continue
  if jun:
    if query[1] == '1':
      s.appendleft(query[2])
    else:
      s.qppend(query[2])
  else:
    if query[1] == '1':
      s.append(query[2])
    else:
      s.appendleft(query[2])
if jun:
  print(''.join(s))
else:
  print(''.join(s[::-1]))
Problem p02901 (python)

Fixed submission:
N, M = map(int, input().split())
price = []
keys = []
dp = [float('inf') for i in range(1<<N)]
dp[0] = 0
for k in range(M):
    price.append(int(input().split()[0]))
    keys.append(list(map(int,input().split())))
for p,key in zip(price,keys):
    key_open = 0
    for k in key:
        key_open |= 1 << (k-1)
        for j in range(1 << N):
            dp[j|key_open] = min(dp[j|key_open], dp[j] + p)

if dp[(1<<N)-1] == float('inf'):
    dp[(1<<N)-1] = - 1
print(dp[(1 << N) - 1])

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
price = []
kagi = []
for i in range(M):
  price.append(int(input().split()[0]))
  key = 0
  kagikagi = list(map(int,input().split()))
  for k in kagikagi:
    key += 2 ** (k-1)
  kagi.append(key)

res = -1
for i in range(2**M):
  combi = 0
  tmp_res = 0
  keys = []
  for j in range(M):
    if((i >> j) & 1):
      combi = combi|kagi[j]
      tmp_res += price[j]
      keys.append(j)
  if combi == 2**N-1:
	if tmp_res < res or res == -1:
      res = tmp_res
      
print(res)
Problem p03037 (python)

Fixed submission:
N, M = [int(i) for i in input().split()]
left = 1
right = N
for _ in range(M):
  L, R = [int(i) for i in input().split()]
  if left < L:
    left = L
  if right > R:
    right = R
if left <= right:
  print(right-left+1)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
N, M = [int(i) for i in input().split()]
left = 0
right = M
for _ in range(N):
  L, R = [int(i) for i in input().split()]
  if left < L:
    left = L
  if right > R:
    right = R
print(R-L+1)
Problem p03161 (python)

Fixed submission:
def main():
    n, k = [int(i) for i in input().split()]
    h = [int(i) for i in input().split()]
    memo = [10e9 for _ in range(n)]
    memo[0] = 0
    for i in range(n):
        for j in range(1, min(n-i,k+1)):
            memo[i+j] = min(memo[i+j], memo[i] + abs(h[i] - h[i+j]))
    print(memo[-1])


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import math
def main():
    n, k = [int(i) for i in input().split()]
    h = [int(i) for i in input().split()]
    memo = [0 for _ in range(n)]
    memo[1] = abs(h[0] - h[1])
    for i in range(2,n):
        k_max = max(k, i-1)
        memo[i] = min([memo[i-j] + abs(h[i]-h[i-j])for j in range(1, k_max)])
    print(memo[-1])


if __name__ == '__main__':
    main()
Problem p02995 (python)

Fixed submission:
from fractions import gcd

a, b, c, d = map(int, input().split())

cnt = int(0)

for i in [c, d]:
    t4 = a // i
    if a % i == 0:
        t1 = t4
    else:
        t1 = t4+1
    t2 = b // i

    cnt += int(t2 - t1 + 1)

lcm = c * d // int(gcd(c, d))

i = lcm
t4 = a // i
if a % i == 0:
    t1 = t4
else:
    t1 = t4 + 1
t2 = b // i

cnt -= int(t2 - t1 + 1)

print(b - a + 1 - cnt)

Buggy submission (verdict: Runtime Error):
from math import gcd

a, b, c, d = map(int, input().split())

cnt = int(0)

for i in [c, d]:
    t4 = a // i
    if a % i == 0:
        t1 = t4
    else:
        t1 = t4+1
    t2 = b // i

    cnt += int(t2 - t1 + 1)

lcm = c * d // int(gcd(c, d))

i = lcm
t4 = a // i
if a % i == 0:
    t1 = t4
else:
    t1 = t4 + 1
t2 = b // i

cnt -= int(t2 - t1 + 1)

print(b - a + 1 - cnt)
Problem p03000 (python)

Fixed submission:
n, x = [int(i) for i in input().split()]
l = [int(i) for i in input().split()]

cnt = 0
di = 0

if sum(l) < x or sum(l) is x:
  print(n + 1)
else:
  for i, li in enumerate(l, 1):
    di += li
    if di > x:
      i -= 1
      break
    if di is x:
      break
    
  print(i+1)

Buggy submission (verdict: Runtime Error):
n, x = [int(i) for i in input().split()]
l = [int(i) for i in input().split()]

cnt = 0
di = 0
while di <= x:
  cnt += 1
  di += l[cnt-1]

print(cnt)
Problem p03001 (python)

Fixed submission:
w, h, x, y = [int(i) for i in input().split()]

o1 = (w * h) / 2

l = [(x, h / w * x), (x, - h / w * x + h)]
l2 = [(0, 0), (w, 0), (0, h), (w, h)]
if (x, y) in l2:
  o2 = 0
elif (x, y) in l:
  o2 = 1
else:
  o2 = 0
  
print(o1, o2)

Buggy submission (verdict: Runtime Error):
o1 = (w * h) / 2

l = []
a = h / w

for i in range(h+1):
  l.append((i, w / h * i))
  l.append((i, - h / w * i + h))

if (x, y) in l:
  o2 = 1
else:
  o2 = 0
  
print(o1, o2)
Problem p03007 (python)

Fixed submission:
n = int(input())
ai = [int(x) for x in input().split()]

ai.sort()

temp = [abs(x) for x in ai[1:-1]]

o1 = -ai[0] + sum(temp) + ai[-1]

print(o1)

temp1 = ai.pop(-1)
num_p = sum(x >= 0 for x in ai)
if num_p == len(ai):
  num_p -= 1
for i in range(num_p):
  temp2 = ai.pop(-1)
  print(ai[0], temp2)
  ai[0] -= temp2

for i in range(len(ai)):
  temp2 = ai.pop(0)
  print(temp1, temp2)
  temp1 -= temp2

Buggy submission (verdict: Runtime Error):
n = int(input())
ai = [int(x) for x in input().split()]

ai.sort()

temp = [abs(x) for x in ai[1:-1]]

o1 = -ai[0] + sum(temp) + ai[-1]

print(o1)

temp1 = ai.pop(-1)
num_p = sum(x >= 0 for x in ai)
if num_p is len(ai):
  num_p = len(ai) - 1
for i in range(num_p):
  temp2 = ai.pop(-1)
  print(ai[0], temp2)
  ai[0] -= temp2

for i in range(len(ai)):
  temp2 = ai.pop(0)
  print(temp1, temp2)
  temp1 -= temp2

Buggy submission (verdict: Runtime Error):
n = int(input())
ai = [int(x) for x in input().split()]

ai.sort()

temp = [abs(x) for x in ai[1:-1]]

o1 = -ai[0] + sum(temp) + ai[-1]

print(o1)

temp1 = ai.pop(-1)
num_p = sum(x >= 0 for x in ai)
if num_p is len(ai):
  num_p = len(ai) - 1
for i in range(num_p):
  temp2 = ai.pop(-1)
  temp3 = ai[0]
  print(temp3, temp2)
  ai[0] = temp3 -temp2

for i in range(len(ai)):
  temp2 = ai.pop(0)
  print(temp1, temp2)
  temp1 = temp1 - temp2

Buggy submission (verdict: Runtime Error):
n = int(input())
ai = [int(x) for x in input().split()]

ai.sort()

temp = [abs(x) for x in ai[1:-1]]

o1 = -ai[0] + sum(temp) + ai[-1]

print(o1)

temp1 = ai.pop(-1)
num_p = sum(x >= 0 for x in ai)
for i in range(num_p):
  temp2 = ai.pop(-1)
  temp3 = ai[0]
  print(temp3, temp2)
  ai[0] = temp3 -temp2

for i in range(len(ai)):
  temp2 = ai.pop(0)
  print(temp1, temp2)
  temp1 = temp1 - temp2
Problem p03035 (python)

Fixed submission:
a, b = map(int,input().split())

if a >= 13:
  out = b
elif a >= 6:
  out = int(b/2)
else:
  out = 0
print(out)

Buggy submission (verdict: Runtime Error):
a, b = map(int,input())

if a >= 13:
  out = b
elif a >= 6:
  out = b/2
else:
  out = 0
print(out)
Problem p03043 (python)

Fixed submission:
import math

[n, k] = [int(x) for x in input().split()]

prob = 0

for i in range(n):
    
    num = math.ceil(math.log2(k/(i+ 1)))
    
    if num < 0:
        num = 0
    prob += 1 / n * ((1 / 2) ** num)
    
print(prob)

Buggy submission (verdict: Runtime Error):
[n, k] = [int(x) for x in input().split()]

prob = 0

for i in range(n):
    
    num = math.ceil(math.log2(k/(i+ 1)))
    
    if num < 0:
        num = 0
    prob += 1 / n * ((1 / 2) ** num)
    
print(prob)

Buggy submission (verdict: Runtime Error):
[n, k] = [int(x) for x in input().split()]

prob = 0

for i in range(n):
    
    num = math.ceil(math.log2(k/(i+ 1)))
    
    if num < 0:
        num = 0
    prob = prob + 1 / n * ((1 / 2) ** num)
    
print(prob)

Buggy submission (verdict: Runtime Error):
[n, k] = [int(x) for x in input().split()]

prob = 0

for i in range(n):
    
    num = math.ceil(math.log2(k/(i+ 1)))
    
    if num < 1:
        num = 1
    prob = prob + 1 / n * ((1 / 2) ** num)
    
print(prob)

Buggy submission (verdict: Runtime Error):
[n, k] = [int(x) for x in input().split()]

prob = 0

for i in range(n):
    
    num = math.ceil(math.log2(k/(i+ 1)))
    
    if num < 0:
        num = 0
    prob = prob + 1 / n * ((1 / 2) ** num)
    
print(prob)
Problem p03145 (python)

Fixed submission:
ab, bc, ca = map(int, input().split())
area = int(ab * bc / 2)
print(area)

Buggy submission (verdict: Runtime Error):
ab, bc, ca = map(int, raw_input().split())
area = ab * bc / 2
print(area)
Problem p03219 (python)

Fixed submission:
x,y = map(int,input().split())

print(x+y//2)

Buggy submission (verdict: Runtime Error):
x,y = map(int,input())

print(x+y//2)
Problem p02660 (python)

Fixed submission:
from collections import defaultdict

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

def Fib(n):
    a, b = 0, 1
    if n == 1:
        return a
    elif n == 2:
        return b
    else:
        for i in range(n-2):
            a, b = b, a + b
        return b

N = int(input())
if(N == 1):
    print(0)
else:
    fact = factorization(N)
    l = [i for i in range(1,1000)]
    count = 0
    d = {}
    for n in fact:
        num = n[1]
        for f in l:
            num -= f
            if(num < 0):
                break
            count += 1
    print(count)

Buggy submission (verdict: Runtime Error):
from decimal import *
import math
A,B = input().split()
A = Decimal(float(A))
B = Decimal(float(B))
print(math.floor(A*B))
Problem p02677 (python)

Fixed submission:
import math
A,B,H,M = map(int,input().split())
H_pos = H/12 + M/720
M_pos = M/60
deg = 360*(H_pos-M_pos)
if deg > 180: deg = 360-deg
rad = math.radians(deg)
co = math.cos(rad)
print("{:.9f}".format(math.sqrt(A**2+B**2-2*A*B*co)))

Buggy submission (verdict: Runtime Error):
import math
A,B,H,M = map(int,input().split())
H_pos = H/12 + M/720
M_pos = M/60
print("{:.9f}".format((A**2+B**2-2*A*B*math.cos(math.radians(360*(H_pos-M_pos)))))**0.5)

Buggy submission (verdict: Runtime Error):
import math
A,B,H,M = map(int,input().split())
H_pos = H/12 + M/720
M_pos = M/60
print("{:.9f}".format((A**2+B**2-2*A*B*math.cos(math.radians(360*(H_pos-M_pos)))))**0.5)
Problem p02887 (python)

Fixed submission:
_ = input()
s = input()
place_holder = s[0]
count = 1
for letter in s[1:]:
    if place_holder == letter:
        continue
    else:
        place_holder = letter
        count +=1
print(count)

Buggy submission (verdict: Runtime Error):
_ = input()
 s = input()
place_holder = s[0]
count = 1
for letter in s[1:]:
  if place_holder == letter:
    continue
  else:
    place_holder = letter
    count += 1

Buggy submission (verdict: Runtime Error):
_ = input()
 s = input()
 place_holder = s[0]
 count = 1
 for letter in s[1:]:
     if place_holder == letter:
         continue
     else:
         place_holder = letter
         count += 1