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

Fixed submission:
N = int(input())
Q = 0
for i in range(1,N+1):
  if(i%3 != 0 and i%5 != 0):
      Q += i
print(Q)

Buggy submission (verdict: Runtime Error):
N = int(input())
Q = 0
for i in range(1,N+1):
  if(i%3 !== 0 and i%5 !== 0):
      Q += i
print(Q)

Buggy submission (verdict: Runtime Error):
N = int(input())
Q = 0
for i in range(N+1):
  if(N%3 !== 0 and N%5 !== 0):
      Q += i
print(Q)

Buggy submission (verdict: Runtime Error):
N = int(input())
Q = 0
for i in range(N+1):
  if(N%3 !== 0 or N%5 !== 0):
      Q += i
print(Q)

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

for i in range(N+1):
  if(N%3 !> 0 !< N%5):
    M += i
print(M)

Buggy submission (verdict: Runtime Error):
 = input()
Q = 0
for i in range(int(N)):
  P = []
  for j in range(len(str(i))):
    k= str(i)
    P.append(int(k[j]))
  if(sum(P)%3 == 0 and P[-1]/5 == 0):
      Q += 0
  elif(sum(P)%3 == 0):
      Q += 0
  elif(P[-1] == 0 or P[-1] == 5):
      Q += 0
  else:
      Q += i
print(Q)

Buggy submission (verdict: Runtime Error):
N = input()
Q = 0
for i in range(int(N)):
  P = []
  for j in range(len(str(i))):
    k= str(j)
    P.append(int(k[j]))
  if(sum(P)%3 == 0 and P[-1] == 0 or P[-1] == 5):
    Q += 0
  elif(sum(P)%3 == 0):
    Q += 0
  elif(P[-1] == 0 or L[-1] == 5):
    Q += 0
  else:
    Q += i
print(Q)
Problem p02723 (python)

Fixed submission:
S = input()
 
if (S[2] == S[3] and S[4] == S[5]):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
S = input()
 
if (S[2] = S[3] and S[4] = S[5]):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
S = input()
 
if (S[2] = S[3] and S[4] = S[5]):
  print(Yes)
else:
  print(No)

Buggy submission (verdict: Runtime Error):
a = input()

if (a[2] = a[3] and a[4] = a[5]):
  print(Yes)
else:
  print(No)
Problem p02753 (python)

Fixed submission:
X = input()
Y = X.count("A")
Z = X.count("B")
if (Y == 3 or Z == 3):
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
X = input()
Y = X.count("A")
Z = X.count("B")
if (Y == 3 or Z ==3):
  print("Yes")
else
  print("No")

Buggy submission (verdict: Runtime Error):
X = input()
Y = X.count("A")
Z = X.count("B")
if (Y == 3 or X ==3):
  print("Yes")
else
  print("No")

Buggy submission (verdict: Runtime Error):
X = input()
Y = len(X)
if (Y == 3):
  print("Yes")
else
  print("No")

Buggy submission (verdict: Runtime Error):
X = input()
Y = len(X)
if (Y = 3):
  print("Yes")
else
  print("No")
Problem p02766 (python)

Fixed submission:
N, K = map(int, input().split())
cnt = 0
while True:
  cnt += 1
  N = N//K
  if N == 0:
    break
print(cnt)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
cnt = 0
while True:
  cnt += 1
  N = N//K
  if N != 0:
print(cnt)
Problem p02777 (python)

Fixed submission:
S, T = input().split()
A, B = map(int, input().split())
U = input()
if U == S:
  print(A-1, B)
else:
  print(A, B-1)

Buggy submission (verdict: Runtime Error):
S, T = input().split()
A, B = map(int, input().split())
U = input()
if U == S:
  print(A-1, B):
else:
  print(A, B-1)
Problem p02835 (python)

Fixed submission:
a = list(map(int, input().split()))
print('bust' if sum(a) >= 22 else 'win')

Buggy submission (verdict: Runtime Error):
A = list(map(int, input().split()))
print('bust' if sum(a) >= 22 else 'win')
Problem p02847 (python)

Fixed submission:
S = input()
A =['SAT', 'FRI', 'THU', 'WED', 'TUE', 'MON','SUN']
for i in range(7):
  if A[i] == S:
    print(i+1)
    break

Buggy submission (verdict: Runtime Error):
s = input()
A =['SAT', 'FRI', 'THU', 'WED', 'TUE', 'MON','SUN']
for i in range(7):
  if A[i] == S:
    print(i+1)
    break

Buggy submission (verdict: Runtime Error):
s = input()
A =['SAT', 'FRI', 'THU', 'WED', 'TUE', 'MON','SUN']
for i in range(1, 8):
  if A[i] == S:
    print(i)
    break
Problem p02897 (python)

Fixed submission:
N = int(input())
print(N/2/N if N%2==0 else (N+1)/2/N)

Buggy submission (verdict: Runtime Error):
N = int(input)
print(N/2 if N%2==0 else (N+1)/2)
Problem p02970 (python)

Fixed submission:
N,D = map(int, input().split())
print(N//(2*D+1) if N%(2*D+1)==0 else N//(2*D+1)+1)

Buggy submission (verdict: Runtime Error):
N,D = map(input().split())
print(N//(2*D+1))
Problem p02989 (python)

Fixed submission:
N = int(input())
d = list(map(int, input().split()))
d.sort()
S = sum(d)
print(d[N//2]-d[N//2 - 1])

Buggy submission (verdict: Runtime Error):
N = int(input())
d = list(map(int, input().split()))
d.sort()
S = sum(d)
if not d[N/2 - 1] < S/N <= d[N/2 + 1]:
  print(0)
elif:
  A = 0
  for i in range(d[N/2 + 1]-d[N/2 - 1]):
    d[N/2 - 1] + i+1 <= d[N/2 + 1]
    A += 1
  print(A)
Problem p03041 (python)

Fixed submission:
N,K = map(int, input().split())
S = input()
print(S[:K-1]+S[K-1].lower()+S[K:])

Buggy submission (verdict: Runtime Error):
N,K = map(int, input().split())
S = input()
print(S[:,K+1]+S[K+1].lower()+S[K+2,:])
Problem p02711 (python)

Fixed submission:
print('Yes' if any([i == '7' for i in input()]) else 'No')

Buggy submission (verdict: Runtime Error):
print('Yes' if all([i = '7' for i in input()]) else 'No')
Problem p02773 (python)

Fixed submission:
n = int(input())
dic = {}
for i in range(n):
    a = input()
    if a in dic:
        dic[a] += 1
    else:
        dic[a] = 0

l = sorted(dic.items(), key=lambda x: x[1], reverse=True)
num = l[0][1]
ok = []
for i in range(len(l)):
    if l[i][1] == num:
        ok.append(l[i][0])
    else:
        break
ok.sort()
for i in ok:
    print(i)

Buggy submission (verdict: Runtime Error):
n = int(input())
dic = {}
for i in range(n):
    a = input()
    if a in dic:
        dic[a] += 1
    else:
        dic[a] = 0

l = sorted(dic.items(), key=lambda x: x[1], reverse=True)
i = 0
while(i<n):
    print(l[i][0])
    if i<n-1:
        if l[i][1] != l[i+1][1]:
            break
    i += 1
Problem p02831 (python)

Fixed submission:
def gcd(m, n):
    x = max(m, n)
    y = min(m, n)
    if x%y==0:
        return y
    else:
        return gcd(y, x%y)
        
a, b = map(int, input().split())
print(a*b//gcd(a, b))

Buggy submission (verdict: Runtime Error):
from math import gcd
a, b = map(int, input().split())
print(a*b//gcd(a, b))

Buggy submission (verdict: Runtime Error):
import math
a, b = map(int, input().split())
print(a*b//math.gcd(a, b))
Problem p03013 (python)

Fixed submission:
n, m = map(int, input().split())
ok = [1] * n
for i in range(m):
    x = int(input())
    ok[x-1] = 0
mod = 1000000007
dp = [0] * (n+2)
dp[1] = 1
for i in range(n):
    dp[i+2] = (dp[i+1] + dp[i])%mod if ok[i] else 0

print(dp[n+1])

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
broken = [0] * n
dp = [0] * (n+1)
in_memo = [0] * (n+1)
for i in range(m):
    broken[int(input())] = 1

def solve(i):
    if(not in_memo[i]):
        if i == n:
            dp[i] = 1
        elif i == n-1:
            dp[i] = 0 if broken[i] else 1
        else:
            dp[i] = 0 if broken[i] else (solve(i+1)+solve(i+2)) % 1000000007
        in_memo[i] = 1
    return dp[i]

print(solve(0))
Problem p03107 (python)

Fixed submission:
s = input()
l0, l1 = 0, 0
for i in s:
    if i == '0':
        l0 += 1
    else:
        l1 += 1
        
print(len(s)-abs(l0-l1))

Buggy submission (verdict: Runtime Error):
s = input()
ans = 0

def solve(s):
    if all((s[i]==s[i+1] for i in range(len(s)-1))):
        return 0
    for i in range(len(s)-1):
        if s[i:i+2] == '01' or s[i:i+2] == '10':
            return solve(s[:i]+s[i+2:])+2

print(solve(s))
Problem p02659 (python)

Fixed submission:
l = input().split()
 
a = l[0]
b = l[1]
 
a = int(a)
b = float(b) * 1000
b = int(b)
ks = a * b 
print(int(ks // 1000))

Buggy submission (verdict: Runtime Error):
a = input().split()[0]
b = input().split()[1]
a = int(a)
b = float(b)

print(int(a*b))

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

print(int(a*b))
Problem p02693 (python)

Fixed submission:
k = int(input())
 
a, b = map(int, input().split())
ngcounter = 0
for i in range(a, b+1):
  if i % k == 0:
    break
  else:
    ngcounter += 1
    
if ngcounter == b - a + 1:
  print("NG")
else :
  print("OK")

Buggy submission (verdict: Runtime Error):
import math
 
a,b,n = map(int,input().split())
 
ans = 0
pre = 0
for i in range(1, n+1):
  now = math.floor(a*i / b) - a * math.floor(i / b)
  if now > pre:
    ans = i
    pre = now
  elif not now == 0:
    break
    
print(pre)

Buggy submission (verdict: Runtime Error):
import math
 
a,b,n = map(int,input().split())
 
ans = 0
pre = 0
for i in range(1, n+1):
  now = math.floor(a*i / b) - a * math.floor(i / b)
  if now > pre:
    ans = i
    pre = now
  else:
    break
    
print(pre)

Buggy submission (verdict: Runtime Error):
k = int(input())
 
a, b = map(int, input().split())
necounter = 0
for i in range(a, b+1):
  if i % k == 0:
    break
  else:
    ngcounter += 1
    
if ngcounter == b - a + 1:
  print("NG")
else :
  print("OK")
Problem p02712 (python)

Fixed submission:
n = int(input())
sum = 0
for i in range(1, n+1):
  if i % 3 != 0 and i % 5 != 0:
    sum += i
    
print(sum)

Buggy submission (verdict: Runtime Error):
n = input()
sum = 0
for i in range(n):
  if i % 3 != 0 and i % 5 != 0:
    sum += i
    
print(sum)

Buggy submission (verdict: Runtime Error):
n = input()
sum = 9
for i in range(n):
  if i % 3 != 0 and i % 5 != 0:
    sum += i
    
print(sum)
Problem p02777 (python)

Fixed submission:
str = input().split()
s = str[0]
t = str[1]
a, b = map(int, input().split())
u = input()
 
if u == t :
  num = b - 1
  print(a, num)
else:
  num = a - 1
  print(num, b)

Buggy submission (verdict: Runtime Error):
s, t = intput().split("")
a, b = map(int, input().split(""))
u = input()

if u == t :
  num = b - 1
  print(a, num)
else:
  num = a - 1
  print(num, b)
Problem p02785 (python)

Fixed submission:
n, k = map(int, input().split())
 
h = list(map(int, input().split()))
sum = 0
h.sort()

if n <= k:
  print(0)
else:
   for i in range(0, k):
    h[n-i-1] = 0
  
   for i in range(0, n):
    sum += h[i]
   
   print(sum)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
 
h = list(map(int, inoput().split))
sum = 0
h.sort()

if n < k:
  print(0)
else:
   for i in range(0, k):
    h[n-i-1] = 0
  
   for i in range(0, n):
    sum += h[i]
  print(sum)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())

h = list(map(int, inoput().split))
sum = 0
h.sort()

for i in range(0, k):
  h[n-i-1] = 0
  
for i in range(0, n):
  sum += h[i]
  
print(sum)
Problem p02860 (python)

Fixed submission:
n = int(input()) # length of string
str = input()
mid = n // 2 # the first char in later str
counter = 0
if n % 2 != 0:
  print("No")
else:
  for i in range(mid):
    if str[i] == str[mid + i]:
      counter += 1   
  if counter == mid :
    print("Yes")
  else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = int(input()) # length of string
str = input()
mid = n / 2 # the first char in later str
counter = 0
for i in range(mid):
  if n % 2 != 0:
    print("No")
    break
  elif str[i] == str[mid + i]:
    counter += 1
    
if counter == mid :
  print("Yes")
Problem p02879 (python)

Fixed submission:
a, b = map(int, input().split())
 
if a <= 9 and a >= 1 and b <= 9 and b >= 1:
  print(a * b)
else :
  print(-1)

Buggy submission (verdict: Runtime Error):
import math
a, b, x = map(int, input().split())
 
h = x / (a * a) #height 
if h > b / 2:
  shahen = 4 * (b - x/(a * a) * (b - x/(a * a))) + a * a
  sin = a / (math.sqrt(shahen))
  print(90 - math.degrees(math.asin(sin)))
elif h == b / 2:
  print(45.0000000000)
else:
  shahen = 4 * x * x + (a * a * a * a) * b * b
  sin = 2 * x / (math.sqrt(shahen))
  print(90 - math.degrees(math.asin(sin)))
Problem p02880 (python)

Fixed submission:
n = int(input())
counter  = 0
for i in range(1, 10):
  if n % i == 0:
    if(n / i <= 9):
      print("Yes")
      counter += 1
      break
  
if counter == 0:
  print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
counter  = 0
for i in range(10):
  if n mod i == 0:
    if(n / i <= 9):
      print("Yes")
      counter += 1
      break
  
if counter == 0:
  print("No")
Problem p02881 (python)

Fixed submission:
def prime_factorize(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors
  
n = int(input())
ls = prime_factorize(n)
for i in range(len(ls)):
  ans = []
  pair = n // ls[i]
  ans.append(ls[i] + n // ls[i] - 2)
 
ans.sort()
print(ans[0])

Buggy submission (verdict: Runtime Error):
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
  
n = int(input())
ls = prime_factorize(n)

for i in range(len(ls) //2 + 1):
  ans = []
  ans.append(i + n / i - 2)

ans.sort()
print(ans[0])
Problem p02916 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split())) # taberu order
b = list(map(int, input().split())) # get
c = list(map(int, input().split())) # renzoku
 
ans = 0
for i in range(n):
  po = a[i]
  ans += b[po-1]
 
for i in range(n-1):
  if(a[i] + 1 == a[i+1] ):
    ans += c[a[i]-1]
    
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split())) # taberu order
b = list(map(int, input().split())) # get
c = list(map(int, input().split())) # renzoku

ans = 0
for i in range(n):
  po = a[i]
  ans += b[po]

for i in range(n-1):
  if(a[i] + 1 = a[i+1] ):
    ans += c[i]
    
print(ans)
Problem p03073 (python)

Fixed submission:
s = list(map(int,input()))

n = len(s)
 
ans_l = 0
for i in range(n-1):
  if s[i] == s[i+1]:
    ans_l += 1
    if s[i] == 0:
      s[i+1] = 1
    else:
      s[i+1] = 0
print(ans_l)

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

n = len(s)

for i in range(n-1):
  if s[i] == s[i+1]:
    if s[i] == 0:
      s[i+1] = 1
    else:
      [i] = 0

print(s)
Problem p03107 (python)

Fixed submission:
str = input()

count1 = str.count('1')
count0 = str.count('0')
print(2 * min(count1, count0))

Buggy submission (verdict: Runtime Error):
str = input()
n = len(str)

ls = []

for i in range(n):
  ls.append(str[i])


for i in range(len(ls)):
  if (ls[i] == ls[i+1]) or (len(ls) == 1):
    break
  if (ls[i] == 0 and ls[i + 1] == 1) or (ls[i] == 1 and ls[i + 1] == 0):
    del ls[i]
    del ls[i]

nokori = len(ls)
print(n - nokori)
Problem p03127 (python)

Fixed submission:
n = int(input()) # the num of monster
 
ls = list(map(int, input().split()))
n = len(ls)

def gcd(a,b):
  while b != 0:
    a,b = b, a % b
  return a

ans = gcd(ls[0], ls[1])
 
for i in range(n):
    ans = gcd(ans, ls[i])
    
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input()) # the num of monster
 
ls = list(map(int, input().split()))
n = len(ls)
ans = math.gcd(ls[0], ls[1])

for i in range(n):
    ans = math.gcd(ans, ls[i])
    
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input()) # the num of monster

ls = list(map(int, input().split()))

ls.sort()

for i in range(len(ls)-1):
  if(len(ls)==1):
    print(len[0])
  for j in range(1, len(ls)):
    if(ls[j] % ls[i] == 0):
      ls.remove(ls[j])
Problem p02629 (python)

Fixed submission:
n = int(input())
ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
s = ''
while n>0:
    n -= 1
    i = n % 26
    s += ascii_lowercase[i]
    n = n // 26
out = s[::-1]
print(out)

Buggy submission (verdict: Runtime Error):

# Python 3 program to implement 
# the above approach 
from math import pow
  
# Function to calculate number of characters 
# in corresponding string of 'A' and 'B' 
def no_of_characters(M): 
      
    # Since the minimum number 
    # of characters will be 1 
    k = 1
  
    # Calculating number of characters 
    while (True): 
          
        # Since k length string can 
        # represent at most pow(2, k+1)-2 
        # that is if k = 4, it can 
        # represent at most pow(2, 4+1)-2 = 30 
        # so we have to calculate the 
        # length of the corresponding string 
        if (pow(2, k + 1) - 2 < M): 
            k += 1
        else: 
            break
  
    # return the length of 
    # the corresponding string 
    return k 
  
# Function to print corresponding 
# string of 'A' and 'B' 
def print_string(M): 
      
    # Find length of string 
    k = no_of_characters(M) 
  
    # Since the first number that can be  
    # represented by k length string will  
    # be (pow(2, k)-2)+1 and it will be  
    # AAA...A, k times, therefore, N will  
    # store that how much we have to print 
    N = M - (pow(2, k) - 2) 
  
    # At a particular time, 
    # we have to decide whether 
    # we have to print 'A' or 'B', 
    # this can be check by calculating 
    # the value of pow(2, k - 1) 
    while (k > 0): 
        num = pow(2, k - 1) 
  
        if (num >= N): 
            print("A", end = "") 
        else: 
            print("B", end = "") 
            N -= num 
        k -= 1
          
    print("\n", end = "") 
  

M=input()
print_string(M)
Problem p02897 (python)

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

n = int(input())

print((n - (n // 2)) / n)

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

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

if a > (b * 2):
    print(a - (b * 2))
else:
    print(0)
Problem p03327 (python)

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

n = int(input())

if (n // 1000) == 0:
    print('ABC')
else:
    print('ABD')

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

n = int(input())

if (n / 1000) == 0:
    print('ABC' + n % 1000)
else:
    print('ABD' + (n % 1000) + 1)
Problem p02707 (python)

Fixed submission:
import collections
 
N = int(input())
A = list(map(int,input().split()))
a = collections.Counter(A)
 
for i in range(N):
  print(a[i+1])

Buggy submission (verdict: Runtime Error):
import collections

N = int(input())
A = list(map(int,input().split()))
a = Collections.Counter(A)

for i in range(N):
  print(a[i])
Problem p02777 (python)

Fixed submission:
S, T = input().split()
A, B = list(map(int,input().split()))
U = input()
 
if U == S:
  print("{} {}".format(A-1,B))
else:
  print("{} {}".format(A,B-1))

Buggy submission (verdict: Runtime Error):
S, T = input().split()
A, B = input().split()
U = input()

if U == S:
  print(A-1)
else:
  print(B-1)
Problem p02831 (python)

Fixed submission:
import sys
from fractions import gcd

def main():
    A, B = map(int, input().split())

    print(int(A * B / gcd(A, B)))

main()

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

def main():
    A, B = map(int, input().split())

    print(int(A * B / math.gcd(A, B)))

main()
Problem p02836 (python)

Fixed submission:
import sys
 
def main():
  S = list(input())
  
  sum = 0
  for i in range(0,int(len(S)//2)):
    if S[i]!=S[len(S)-i-1]:
    	sum+=1
               
  print(sum)
               
main()

Buggy submission (verdict: Runtime Error):
import sys

def main():
  S = list(input())
  
  sum = 0
  for i in range(0,int(len(S)//2)):
    if S[i]!=S[len(S)-i-1):
    	sum+=1
               
  print(sum)
               
main()
Problem p03013 (python)

Fixed submission:
import sys
from collections import deque

def main():
    N, M = map(int, input().split())
    a = deque([int(sys.stdin.readline().strip()) for _ in range(M)])

    atmp = -1
    if len(a) != 0:
        atmp = a.popleft()

    dp=[0] * (N+1)
    for i in range(0, N+1):
        if i == atmp:
            if len(a) != 0:
                atmp = a.popleft()
            continue

        if i == 0 or i == 1:
            dp[i] = 1
            continue

        if dp[i-1] == 0 and dp[i-2] == 0:
            break


        dp[i] = dp[i-1] + dp[i-2]

    print(dp[N] % 1000000007)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
from collections import deque

def main():
    N, M = map(int, input().split())
    a = deque([int(sys.stdin.readline().strip()) for _ in range(M)])
    atmp = a.popleft()

    dp=[0] * (N+1)
    for i in range(0, N+1):
        if i == atmp:
            if len(a) != 0:
                atmp = a.popleft()
            continue

        if i == 0 or i == 1:
            dp[i] = 1
            continue

        if dp[i-1] == 0 and dp[i-2] == 0:
            break


        dp[i] = dp[i-1] + dp[i-2]

    print(dp[N] % 1000000007)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
from collections import deque

def main():
    N, M = map(int, input().split())
    a = deque([int(sys.stdin.readline().strip()) for _ in range(M)])

    if len(a) != 0:
        atmp = a.popleft()

    dp=[0] * (N+1)
    for i in range(0, N+1):
        if i == atmp:
            if len(a) != 0:
                atmp = a.popleft()
            continue

        if i == 0 or i == 1:
            dp[i] = 1
            continue

        if dp[i-1] == 0 and dp[i-2] == 0:
            break


        dp[i] = dp[i-1] + dp[i-2]

    print(dp[N] % 1000000007)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
from collections import deque

def main():
    N, M = map(int, input().split())
    a = deque([int(sys.stdin.readline().strip()) for _ in range(M)])
    atmp = a.popleft()

    dp=[0] * (N+1)
    for i in range(0, N+1):
        if i == atmp:
            if len(a) != 0:
                atmp = a.popleft()
            continue

        if i == 0 or i == 1:
            dp[i] = 1
            continue

        if dp[i-1] == 0 and dp[i-2] == 0:
            break


        dp[i] = dp[i-1] + dp[i-2]

    print(dp[N] % 1000000007)

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

Fixed submission:
n,k=map(int,input().split())
s=list(input())
s[k-1]=chr(ord(s[k-1])+32)

print(*s,sep='')

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
s=list(input())
s[k]=chr(ord(s[k])+32)

print(*s,sep='')
Problem p03127 (python)

Fixed submission:
import fractions 

N = int(input())
A = list(map(int,input().split()))
 
ans = 0
for i in range(N):
  if i == 0:
    ans = A[0]
    continue
 
  ans = fractions.gcd(ans,A[i])
  
print(ans)

Buggy submission (verdict: Runtime Error):
import fractions 

N = int(input())
A = list(map(int,input().split()))

ans = 0
for i in range(N):
  if i == 0:
    ans = A[0]
    continue

  ans = gcd(ans,A[i])
  
print(ans)
Problem p03137 (python)

Fixed submission:
import sys

def main():
    N, M = list(map(int, input().split()))
    X = list(map(int, input().split()))

    if N >= M:
        print('0')
        exit()

    X = sorted(X)

    kukan = []
    for i in range(1, M):
        kukan.append(X[i]-X[i-1])

    kukan = sorted(kukan, reverse=True)

    jogai = 0
    for j in range(N-1):
        jogai += kukan[j]

    print(X[M-1] - X[0] - jogai)

main()

Buggy submission (verdict: Runtime Error):
import sys

def main():
    N, M = list(map(int, input().split()))
    X = list(map(int, input().split()))

    if M == 1:
        print('0')
        exit()

    if N == 1:
        print(X[M] - X[0])
        exit()

    X = sorted(X)

    kukan = []
    for i in range(1, M):
        kukan.append(X[i]-X[i-1])

    kukan = sorted(kukan, reverse=True)

    jogai = 0
    for j in range(N-1):
        jogai += kukan[j]

    print(X[M-1] - X[0] - jogai)

main()

Buggy submission (verdict: Runtime Error):
import sys

def main():
    N, M = list(map(int, input().split()))
    X = list(map(int, input().split()))

    if M == 1:
        print('0')
        exit()

    X = sorted(X)

    kukan = []
    for i in range(1, M):
        kukan.append(X[i]-X[i-1])

    kukan = sorted(kukan, reverse=True)

    jogai = 0
    for j in range(N-1):
        jogai += kukan[j]

    print(X[M-1] - X[0] - jogai)

main()