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

Fixed submission:
seq = input()
if seq == seq[::-1]:
    if seq[:int((len(seq) - 1) / 2)] == seq[:int((len(seq) - 1) / 2)][::-1]:
        if seq[int((len(seq) + 3) / 2) - 1:] == seq[int((len(seq) + 3) / 2) - 1:][::-1]:
            # print(seq[int((len(seq) + 3) / 2) - 1:])
            print("Yes")
        else:
            print("No")
    else:
        print("No")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
from scipy.special import comb

gusu, kisu = input().split()
gusu = int(gusu) # 個数
kisu = int(kisu) # 個数
gusu_num = comb(gusu, 2, exact=True)
kisu_num = comb(kisu, 2, exact=True)
print(gusu_num + kisu_num)
Problem p02731 (python)

Fixed submission:
L = input()
LL = float(L) / 3
print(LL ** 3)

Buggy submission (verdict: Runtime Error):
L = input()
LL = L / 3
print(LL ** 3)
Problem p03591 (python)

Fixed submission:
s = input()
if s.find("YAKI")==0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N, M, K = map(int, input().split())

flag = False

for i in range(N+1):
    for j in range(M+1):
        if flag:
            break
        if M*i+N*j-i*j*2==K:
            flag = True
    if flag:
        break

if flag:
    print("Yes")
else:
    print("No")
Problem p02713 (python)

Fixed submission:
from math import gcd
from functools import reduce

def func(a,b,c):
  if a == b and b == c:
    return a
  elif a == b and b !=c:
    return gcd(a,c)
  elif a != b and b ==c:
    return gcd(a,b)
  else:
    return reduce(gcd,(a,b,c))

k = int(input())
li = []
for a in range(1,k+1):
  for b in range(1,k+1):
    for c in range(1,k+1):
      li.append(func(a,b,c))

print(sum(li))

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

k = int(input())
li = []
for a in range(1,k+1):
  for b in range(1,k+1):
    for c in range(1,k+1):
      li.append(func(a,b,c))

print(sum(li))

Buggy submission (verdict: Runtime Error):
from  itertools import combinations
def get_unique_list(seq):
    seen = []
    return [x for x in seq if x not in seen and not seen.append(x)]
li = list(combinations(use_li*3,3))
sum_li = []
for i in get_unique_list(li):
  sum_li.append(reduce(gcd,i))
sum(sum_li)

Buggy submission (verdict: Runtime Error):
k = int(input())
li = []
for a in range(1,k+1):
  for b in range(1,k+1):
    for c in range(1,k+1):
      n = (a,b,c)
      li.append(reduce(gcd,n))

print(sum(li))
Problem p03035 (python)

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

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

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
if a>=13:
  print(b)
elif a>=6 and a<=12
  print(int(b/2))
else 
  print(0)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
if a>=13:
  print(b)
elif a>=6 and a<=12
  print(b/2)
else 
  print(0)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
if a>=13:
  print(b)
elif 6<=a and a<=13
  print(b/2)
else 
  print(0)
Problem p03085 (python)

Fixed submission:
x=input()

if x=="A":
  print("T")
elif x=="T":
  print("A")
elif x=="C":
  print("G")
else:
  print("C")

Buggy submission (verdict: Runtime Error):
x=input()
  if x=="A":
    print("T")
  elif x=="T":
    print("A")
  elif x=="C":
    print("G")
  else:
    print("C")

Buggy submission (verdict: Runtime Error):
x=str(input())
  if x=="A":
    print("T")
  elif x=="T":
    print("A")
  elif x=="C":
    print("G")
  elif x=="G":
    print("C")

Buggy submission (verdict: Runtime Error):
x=str(input())
if x=="A":
   print("T")
  else if x=="T":
    print("A")
  else if x=="C":
    print("G")
  else if x=="G":
    print("C")
Problem p03006 (python)

Fixed submission:
from collections import defaultdict

table = defaultdict(lambda: 0)

n = int(input())
if (n==1):
    print(1)
elif n == 2:
    print(1)
else:
    xylist = []
    for _ in range(n):
        x, y = map(int, input().split())
        xylist += [[x, y]]

    xylist.sort()

    for i in range(n):
        for j in range(0, i):
            x = xylist[i][0] - xylist[j][0]
            y = xylist[i][1] - xylist[j][1]
            table[x+y*10**10] += 1

    max_v = max(table.values())
    print(n-max_v)

Buggy submission (verdict: Runtime Error):
from collections import defaultdict

table = defaultdict(lambda: 0)

n = int(input())
xylist = []
for _ in range(n):
    x, y = map(int, input().split())
    xylist += [[x, y]]

xylist.sort()

for i in range(n):
    for j in range(0, i):
        x = xylist[i][0] - xylist[j][0]
        y = xylist[i][1] - xylist[j][1]
        table[x+y*10**10] += 1

max_v = max(table.values())
print(n-max_v)
Problem p03047 (python)

Fixed submission:
n, k = map(int, input().split())

print(n-k+1)

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

s = 0
for r in range(1, int((n-1)**0.5)+5):
    if n % r == 0:
        m = n//r-1
        if n//m == n%m:
            s += m
print(s)
Problem p03818 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
a.sort()
c = 0
e = 0
i = 0
while True:
    c += 1
    cai = 1
    while i != n - 1 and a[i] == a[i + 1]:
        cai += 1
        if i != n - 1:
            i += 1
        else:
            break
    if cai % 2 == 0:
        e += 1
    if i != n - 1:
        i += 1
    else:
        break
ans = c - (e % 2)
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
a.sort()
c = 0
e = 0
i = 0
while i < len(a):
    c += 1
    cai = 1
    while a[i] == a[i + 1]:
        cai += 1
        i += 1
    if cai % 2 == 0:
        e += 1
    i += 1
ans = c - (e % 2)
print(ans)
Problem p03943 (python)

Fixed submission:
a, b, c = list(map(int, input().split()))
if (a + b == c) or (b + c == a) or (c + a == b):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
w, h, n = list(map(int, input().split()))
xya = []
for i in range(n):
    xya.append(list(map(int, input().split())))

min_x_1 = w
max_x_2 = 0
min_y_3 = h
max_y_4 = 0
for i in range(n):
    ai = xya[i][2]
    if ai == 1:
        if xya[i][0] < min_x_1:
            min_x_1 = xya[i][0]
    if ai == 2:
        if xya[i][0] > max_x_2:
            max_x_2 = xya[i][0]
    if ai == 3:
        if xya[i][1] < min_y_3:
            min_y_3 = xya[i][1]
    if ai == 4:
        if xya[i][1] > max_y_4:
            max_y_4 = xya[i][1]

x = min_x_1 - max_x_2
if x <= 0:
    print("0")
else:
    y = min_y_3 - max_y_4
    if y <= 0:
        print("0")
    else:
        print(str(x * y))

Buggy submission (verdict: Runtime Error):
w, h, n = list(map(int, input().split()))
xya = []
for i in range(n):
    xya.append(list(map(int, input().split())))

min_x_1 = w
max_x_2 = 0
min_y_3 = h
max_y_4 = 0
for i in range(n):
    ai = xya[i][2]
    if ai == 1:
        if xya[i][0] < min_x_1:
            min_x_1 = xya[i][0]
    if ai == 2:
        if xya[i][0] > max_x_2:
            max_x_2 = xya[i][0]
    if ai == 3:
        if xya[i][1] < min_y_3:
            min_y_3 = xya[i][1]
    if ai == 4:
        if xya[i][1] > max_y_4:
            max_y_4 = xya[i][1]

x = max_x_2 - min_x_1
if x <= 0:
    print("0")
else:
    y = max_y_4 - min_y_3
    if y <= 0:
        print("0")
    else:
        print(str(x * y))
Problem p03944 (python)

Fixed submission:
w, h, n = list(map(int, input().split()))
xya = []
for i in range(n):
    xya.append(list(map(int, input().split())))

max_x_1 = 0
min_x_2 = w
max_y_3 = 0
min_y_4 = h
for i in range(n):
    ai = xya[i][2]
    if ai == 1:
        if xya[i][0] > max_x_1:
            max_x_1 = xya[i][0]
    if ai == 2:
        if xya[i][0] < min_x_2:
            min_x_2 = xya[i][0]
    if ai == 3:
        if xya[i][1] > max_y_3:
            max_y_3 = xya[i][1]
    if ai == 4:
        if xya[i][1] < min_y_4:
            min_y_4 = xya[i][1]

x = min_x_2 - max_x_1
if x <= 0:
    print("0")
else:
    y = min_y_4 - max_y_3
    if y <= 0:
        print("0")
    else:
        print(x * y)

Buggy submission (verdict: Runtime Error):
w, h, n = list(map(int, input().split()))
xya = []
for i in range(n):
    xya.append(list(map(int, input().split())))

min_x_1 = w
max_x_2 = 0
min_y_3 = h
max_y_4 = 0
for i in range(n):
    ai = xya[i][2]
    if ai == 1:
        if xya[i][0] < min_x_1:
            min_x_1 = xya[i][0]
    if ai == 2:
        if xya[i][0] > max_x_2:
            max_x_2 = xya[i][0]
    if ai == 3:
        if xya[i][1] < min_y_3:
            min_y_3 = xya[i][1]
    if ai == 4:
        if xya[i][1] > max_y_4:
            max_y_4 = xya[i][1]

x = min_x_1 - max_x_2
if x <= 0:
    print("0")
else:
    y = min_y_3 - max_y_4
    if y <= 0:
        print("0")
    else:
        print(str(x * y))
return 0
Problem p03946 (python)

Fixed submission:
n, t = list(map(int, input().split()))
a = list(map(int, input().split()))
min_a = 1000000000
max_dif = 0
max_dif_c = 0
for i in range(n):
    if a[i] < min_a:
        min_a = a[i]
    elif a[i] - min_a > max_dif:
        max_dif = a[i] - min_a
        max_dif_c = 1
    elif a[i] - min_a == max_dif:
        max_dif_c += 1
print(str(max_dif_c))

Buggy submission (verdict: Runtime Error):
n, t = list(map(int, input().split()))
a = list(map(int, input().split()))
min = 1000000000
min_c = 0
max_dif = 0
max_dif_c = 0
for i in range(n):
    if a[i] < min:
        min = a[i]
        min_c = 1
        continue
    elif a[i] == min:
        min_c += 1
        continue
    if a[i] - min > max_dif:
        max_dif = a[i] - min
        max_dif_c = 1
    elif a[i] - min == max_dif:
        max_dif_c += 1
c = min([min_c, max_dif_c])
print(str(c))

Buggy submission (verdict: Runtime Error):
n, t = list(map(int, input().split()))
a = list(map(int, input().split()))
min = 1000000000
min_c = 0
max_dif = 0
max_dif_c = 0
for i in range(n):
    if a[i] < min:
        min = a[i]
        min_c = 1
    elif a[i] == min:
        min_c += 1
    if a[i] - min > max_dif:
        max_dif = a[i] - min
        max_dif_c = 1
    elif: a[i] - min == max_dif:
        max_dif_c += 1
c = min([min_c, max_dif_c])
print(str(c))

Buggy submission (verdict: Runtime Error):
n, t = list(map(int, input().split()))
a = list(map(int, input().split()))
c = 0
max_dif = 0
for i in range(n):
    for j in range(i + 1, n):
        if a[j] - a[i] > max_dif:
            c = 1
            max_dif = a[j] - a[i]
        elif: a[j] - a[i] == max_dif:
            c += 1
print(str(c))

Buggy submission (verdict: Runtime Error):
n, t = list(map(int, input().split()))
a = list(map(int, input().split()))
c = 0
max_dif = 0
for i in range(n):
    for j in range(i + 1, n):
        if a[j] - a[i] > max_dif:
            c = 1
            max_dif = a[j] - a[i]
        elif: a[j] - a[i] == max_dif:
            c += 1
print(c)

Buggy submission (verdict: Runtime Error):
n, t = list(map(int, input().split()))
a = list(map(int, input().split()))
c = 0
max_dif = 0
for i in range(n):
    for j in range(i, n):
        if a[j] - a[i] > max_dif:
            c = 1
            max_dif = a[j] - a[i]
        elif: a[j] - a[i] == max_dif:
            c += 1
print(c)
Problem p04001 (python)

Fixed submission:
def __main__():
    s = input()
    result = cal(s)
    print(result[0])

# return (下階層の和の合計, 下階層の和のパターン数)
def cal(s):
    if len(s) == 0:
        return(0, 1)
    elif len(s) == 1:
        return (int(s), 1)
    else:
        sum, times = 0, 0
        for i in range(len(s)):
            num = int(s[0:(i + 1)])
            result = cal(s[(i + 1):len(s)])
            sum += num * result[1] + result[0]
            times += result[1]
        return (sum, times)
            
__main__()

Buggy submission (verdict: Runtime Error):
def __main__():
    h, w, n = list(map(int, input().split()))
    grid = []
    for i in range(h):
        row = []
        for j in range(w):
            row.append(0)
        grid.append(row)
    for i in range(n):
        ai, bi = list(map(int, input().split()))
        grid[ai - 1][bi - 1] = 1
    
    result = [0] * 10
    for i in range(h - 2):
        for j in range(w - 2):
            black = 0
            for i2 in range(3):
                for j2 in range(3):
                    if grid[i + i2][j + j2] == 1: black += 1 
            result[black] += 1
            
    for i in range(9):
        print(result[i])

__main__()
Problem p03214 (python)

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

sum = 0


for i in range(n):
  sum += framelist[i]

avg = sum /n

min = avg
value = 0

for i in range(n):
  difference = abs(framelist[i]-avg)
  if min>difference:
    min = difference
    value = framelist[i]
    
print(framelist.index(value))

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

sum = 0


for i in range(n):
  sum += framelist[i]

avg = sum /n

min = avg

for i in range(n):
  difference = abs(framelist[i]-avg)
  if min>difference:
    min = difference
    
print(framelist.index(difference))
Problem p03243 (python)

Fixed submission:
n = int(input())
 
if n>888:
  print(999)
elif n>777:
  print(888)
elif n>666:
  print(777)
elif n>555:
  print(666)
elif n>444:
  print(555)
elif n>333:
  print(444)
elif n>222:
  print(333)
elif n>111:
  print(222)
else:
  print(111)

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

if n>888:
  print(999)
elif n>777:
  print(888)
elif n>666:
  print(777)
elif n>555:
  print(666)
elif n>444:
  print(555)
elif n>333:
  print(444)
elif n>222:
  print(333)
elif n>111:
  print(222)
else:
  print(111)
Problem p03316 (python)

Fixed submission:
n = int(input())
keep = n
 
sn = 0
for i in range(10):
  sn += n%10
  n = n//10
  
if keep%sn == 0:
  print("Yes")
else:
  print("No")

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

sn = 0
for i in range(9):
  sn += n%10
  n = n//10
  
if keep%sn == 0:
  print("Yes")
else:
  print("No")
Problem p03337 (python)

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

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

print(max[a+b,a-b,a*b])
Problem p03386 (python)

Fixed submission:
a,b,k = [int(i) for i in input().split()]
jougen = a+k-1
kagen = b-k+1

if jougen>=kagen:
  for i in range(a,b+1):
    print(i)
    
else:
  for i in range(a,jougen+1):
    print(i)
  for i in range(kagen,b+1):
    print(i)

Buggy submission (verdict: Runtime Error):
a,b,k = [int(i) for i in input().split()]
jougen = a+k-1
kagen = b-k+1

if jougen>=kagen:
  for i in range(a,b+1):
    print(i)
    
else:
  for i in range(a,jougen+1):
    print(i)
  for i in range(kagen,b+1)
Problem p03403 (python)

Fixed submission:
n = int(input())
sortedlist = [int(i) for i in input().split()]
anslist = []

longest = 0
ans = 0

for i in range(n+1):
  if i==0:
    longest += abs(sortedlist[0]-0)
  elif i==n:
    longest += abs(0-sortedlist[n-1])
  else:
    longest += abs(sortedlist[i]-sortedlist[i-1])

    
for i in range(n):
  if i==0:
    ans = longest - abs(sortedlist[0]) - abs(sortedlist[1]-sortedlist[0]) + abs(sortedlist[1])
  elif i==n-1:
    ans = longest - abs(sortedlist[n-1]) - abs(sortedlist[n-1]-sortedlist[n-2]) + abs(sortedlist[n-2])
  else:
    ans = longest - abs(sortedlist[i]-sortedlist[i-1])-abs(sortedlist[i+1]-sortedlist[i]) + abs(sortedlist[i+1]-sortedlist[i-1])
  print(ans)

Buggy submission (verdict: Runtime Error):
import copy

n = int(input())
natural = [int(i) for i in input().split()]
sortedlist = natural.sorted()

sum = 0

for i in range(n):
  removed = copy.deepcopy(sortedlist).remove(natural[i])
  for j in range(n-1):
    if j == 0:
      sum += abs(removed[j])
    else:
      sum += abs(removed[j]-removed[j-1])
  print(sum)
Problem p04030 (python)

Fixed submission:
s=input()
length = len(s)
ary = []

for i in range(length):
  if s[i] != "B":
    ary.append(s[i])
  elif len(ary) != 0:
    ary.pop(-1)
    
print("".join(ary))

Buggy submission (verdict: Runtime Error):
s=input()
length = len(s)
ary = []

for i in length:
  if s[i] != "B":
    ary.append(s[i])
  elif len(ary) != 0:
    ary.pop(-1)
    
print("".join(ary))
Problem p04043 (python)

Fixed submission:
array = [int(i) for i in input().split()]

if sorted(array) == [5,5,7]:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
array = [int(i) for i in input().split()]

if sort(array) == [5,5,7]:
  print("YES")
else:
  print("NO")
Problem p02706 (python)

Fixed submission:
n, m = input().split()
days = list(map(int, input().split()))
if int(n) < sum(days):
  print("-1")
else:
  print(int(n) - sum(days))

Buggy submission (verdict: Runtime Error):
n, m = input().split()
days = list(map(int, input().split()))
if n < sum(days):
  print("-1")
else:
  print(int(n) - sum(days))

Buggy submission (verdict: Runtime Error):
n, m = input().split()
days = list(map(int, input().split()))
print(n - sum(days))
Problem p02747 (python)

Fixed submission:
import re
s = input()
isHitachi = re.search("^(hi)+$", s)
if isHitachi:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
import re
s = input()
isHitachi = re.search("^(hi)+$")
if isHitachi:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
import re
isHitachi = re.search("(hi)+")
if isHitachi:
  print("Yes")
else:
  print("No")
Problem p02861 (python)

Fixed submission:
from itertools import permutations
import math
n = int(input())
l1 = []
l = []
ans = 0
for i in range(n):
    x,y = map(int,input().split())
    l.append(i)
    l1.append((x,y))
per = permutations(l)
for elm in per:
    for i in range(1,len(elm)):
        x=(((l1[elm[i]][0]-l1[elm[i-1]][0])**2)+((l1[elm[i]][1]-l1[elm[i-1]][1])**2))
        ans+=math.sqrt(x)
ans = ans/(math.factorial(n))
print(ans)

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
l1 = []
l = []
ans = 0
for i in range(n):
    x,y = map(int,input().split())
    l.append(i)
    l1.append((x,y))
per = permutations(l)
for elm in per:
    for i in range(1,len(elm)):
        x=(((l1[elm[i]][0]-l1[elm[i-1]][0])**2)+((l1[elm[i]][1]-l1[elm[i-1]][1])**2))
        ans+=math.sqrt(x)
ans = ans/(math.factorial(n))
print(ans)
Problem p02900 (python)

Fixed submission:
def gcd(a,b):
    if(b==0):
        return a
    return gcd(b,a%b)
import math
a,b = map(int,input().split())
x = gcd(a,b)
c= x
ans = 1
for i in range(2,int(math.sqrt(x))+1):
    if(c%i==0):
        ans+=1
    while(c%i==0):
        c=c//i
        
if(c>1):
    ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
import math
a,b = map(int,input().split())
x = math.gcd(a,b)
c= x
ans = 1
for i in range(2,min(int(math.sqrt(x))+1,x)):
    if(c%i==0):
        ans+=1
    while(c%i==0):
        c=c//i
if(c>1):
    ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
import math
a,b = map(int,input().split())
x = math.gcd(a,b)
c= x
ans = 1
for i in range(2,min(int(math.sqrt(x))+1,x)):
    if(c%i==0):
        ans+=1
    while(c%i==0):
        c=c//i
        
if(c>1):
    ans+=1
print(ans)
Problem p02741 (python)

Fixed submission:
num = int(input())
l = ['1', '1', '1', '2', '1', '2', '1', '5', '2', '2', '1', '5', '1', '2', '1', '14', '1', '5', '1', '5', '2', '2', '1', '15', '2', '2', '5', '4', '1', '4', '1', '51']
print(l[num - 1])

Buggy submission (verdict: Runtime Error):
num = int(input())
l = ['1', '1', '1', '2', '1', '2', '1', '5', '2', '2', '1', '5', '1', '2', '1', '14', '1', '5', '1', '5', '2', '2', '1', '15', '2', '2', '5', '4', '1', '4', '1', '51']
print(l[num])
Problem p02818 (python)

Fixed submission:
taka, aoki, times= map(int,input().split())
if taka + aoki > times:
    if taka < times:
        print(0,aoki - (times - taka))
    elif taka > times:
        print(taka - times, aoki)
    else:
        print(0,aoki)
else:
    print(0,0)

Buggy submission (verdict: Runtime Error):
taka, aoki, times= map(int,input().split())
if taka + aoki > times:
    if taka < times:
        print(0,aoki - (times - taka))
    elif taka > times:
        print(taka - times, aoki)
    else:
        print(0,0)
elif taka = times:
    print(0,aoki)
else:
    print(0,0)
Problem p03624 (python)

Fixed submission:
str = input()
abc = ['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','aa']
i = 0
while abc[i] in str:
    if i < 26:
        i += 1
    else:
        break

if i < 26:
    print(abc[i])

else:
    print("None")

Buggy submission (verdict: Runtime Error):
str = input()
abc = ['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','aa']
i = 0
while abc[i] in str:
    if i <= 26:
        i += 1
    else:
        break

if i < 26:
    print(abc[i])
    
else:
    print("None")

Buggy submission (verdict: Runtime Error):
str = input()
list = list(str)
abc = ['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']
i = 0
while abc[i] in str:
    i += 1

if i > 26:
    print(abc[i])
else:
    print("None")

Buggy submission (verdict: Runtime Error):
str = input()
list = list(str)
abc = ['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']
i = 0
while abc[i] in str:
    i += 1

print(abc[i])
Problem p03679 (python)

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

if buy >= eat:
    print("delicious")
elif eat-buy <= x:
    print("safe")
elif eat - buy > x:
    print("dangerous")

Buggy submission (verdict: Runtime Error):
x, buy, eat = int(input().split())

if buy > eat:
    print("delicious")
elif eat-buy < x:
    print("safe")
elif eat - buy > x:
    print("dangerous")
Problem p02782 (python)

Fixed submission:
r1,c1,r2,c2=map(int,input().split())
a=r2-r1+1
b=c2-c1+1
m=max(a,b)
n=min(a,b)
mod=10**9+7
def framod(n, mod, a=1):
    for i in range(1,n+1):
        a=a * i % mod
    return a
def comb(n, k, mod):
    a=framod(n, mod)
    b=framod(k, mod)
    c=framod(n-k, mod)
    return (a * pow(b, mod-2, mod) * pow(c, mod-2, mod)) % mod
def f(x,y):
  return comb(x+y+2,y+1,mod)-1
 
print((f(r2,c2)-f(r2,c1-1)-f(r1-1,c2)+f(r1-1,c1-1))%mod)

Buggy submission (verdict: Runtime Error):
r1,c1,r2,c2=map(int,input().split())
a=r2-r1+1
b=c2-c1+1
m=max(a,b)
n=min(a,b)
mod=10**9+7
def framod(n, mod, a=1):
    for i in range(1,n+1):
        a=a * i % mod
    return a
def comb(n, k, mod):
    a=framod(n, mod)
    b=framod(k, mod)
    c=framod(n-k, mod)
    return (a * pow(b, mod-2, mod) * pow(c, mod-2, mod)) % mod
def f(x,y):
  return comb(x+y+2,y+1)-1
 
print((f(r2,c2)-f(r2,c1-1)-f(r1-1,c2)+f(r1-1,c1-1))%mod)
Problem p02783 (python)

Fixed submission:
h,a=map(int,input().split())
if h%a==0:
    print(h//a)
else:
    print((h//a)+1)

Buggy submission (verdict: Runtime Error):
h=int(input())
n=len(list(bin(h)))-2
print(2**n-1)
Problem p02795 (python)

Fixed submission:
h=int(input())
w=int(input())
n=int(input())
t=0
if h>=w:
    if n%h==0:
        print(n//h)
    else:
        print((n//h)+1)
else:
    if n%w==0:
        print(n//w)
    else:
        print((n//w)+1)

Buggy submission (verdict: Runtime Error):
n=int(input())
l=[list(map(int,input().split())) for _ in range(n)]
l.sort()
t=0
for i in range(0,n-1):
    if l[i+1][0]-l[i][0]<l[i+1][1]+l[i][1]:
        del l[i+1]
        l=[[0,0]]+l
        t+=1
print(max(t,n-t))
Problem p02801 (python)

Fixed submission:
print(chr(ord(input())+1))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
l=list(input().split() for _ in range(m))
l=sorted(l,key=lambda x:x[0])
import itertools
lll=[]
for (k,g) in itertools.groupby(l,key=lambda x:x[0]):
    lll.append(list(g))
a=0
w=0
for i in range(len(lll)):
    for j in lll[i]:
        if j[1]=="AC":
            a+=1
            w+=lll[i].index(j)
            break
print(a,w)