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

Fixed submission:
A,B,C = map(int,input().split())

answer = C-A+B

if answer >= 0:
	print(answer)

else :
	print(0)

Buggy submission (verdict: Runtime Error):
A,B,C = map(int,input().split())

answer = C-A+B

if answer >= 0:
print(answer)

else :
print(0)

Buggy submission (verdict: Runtime Error):
A,B,C = map(int,input().split())

answer = C-A+B

if answer > 0:
print(answer)

else :
print(0)

Buggy submission (verdict: Runtime Error):
A,B,C = map(int,input().split())

if B+C <= A:
print(0)

else :
print(C-A+B)

Buggy submission (verdict: Runtime Error):
A,B,C = map(int,input().split())

if B+C <= A:
print(0)

else B+C > A:
print(C-A+B)

Buggy submission (verdict: Runtime Error):
A,B,C=map(int,input().split())

if B+C <= A:
print(0)

else B+C > A:
print(C-A+B)

Buggy submission (verdict: Runtime Error):
A,B,C=map(int,input().split())


if B+C <= A
print(0)

else B+C > A
print(C-A+B)

Buggy submission (verdict: Runtime Error):
A,B,C=map(int,input().split())


if B+C <= 20
print(0)

else B+C > 20
print(C-A+B)

Buggy submission (verdict: Runtime Error):
A, B, C = int(input()).split()

if B+C <= 20
print(0)

else B+C > 20
print(C-A+B)

Buggy submission (verdict: Runtime Error):
A, B, C = input()

if B+C <= 20
print(0)

else B+C > 20
print(C-A+B)

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

if B+C <= 20
print(0)

else B+C > 20
print(C-A+B)
Problem p02959 (python)

Fixed submission:
n = int(input())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
c = 0
 
for i in range(n):
  if a[i] >= b[i]:
    c += b[i]
  else:
    c += a[i]
    c += min(a[i+1],b[i]-a[i])
    if a[i+1] >= b[i]-a[i]:
      a[i+1] = a[i+1] - (b[i] - a[i])
    else:
      a[i+1] = 0
     
print(c)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int, for i in input().split()]
b = [int, for i in input().split()]
c = 0

for i in range(n):
	if a[i] >= b[i]:
		c += b[i]
	else:
		c += a[i]
		c += min(a[i+1],b[i]-a[i])
		if a[i+1] >= b[i]-a[i]:
			a[i+1] = a[i+1] - (b[i] - a[i])
		else:
			a[i+1] = 0
print(c)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
c = 0

for i in range(n):
	if a[i] >= b[i]:
		c += b[i]
	else:
		c += a[i]
		c += min(a[i+1],b[i]-a[i])
		if a[i+1] >= b[i]-a[i]
			a[i+1] = a[i+1] - (b[i] - a[i])
		else:
			a[i+1] = 0
print(c)
Problem p02970 (python)

Fixed submission:
N,D = map(int,input().split())


if N%(2*D+1) == 0 :
	ans = 0
	ans = N//(2*D+1)
	print(ans)
else:
	ans = 0
	ans = int(N//(2*D+1))+1
	print(ans)

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


if N%(2D+1) == 0 :
	ans = 0
	ans = int(N//(2D+1))
	print(ans)
else:
	ans = 0
	ans = int(N//(2D+1))+1
	print(ans)
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:])

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

if S[K] = A :
	S[K] = a
elif S[K] = B :
	S[K] = b
elif S[K] = C :
	S[K] = c

print(S)
Problem p03075 (python)

Fixed submission:
I =[int(input())for i in range(6)]

if I[4] - I[0] > I[5] :
	print(":(")
else :
	print("Yay!")

Buggy submission (verdict: Runtime Error):
a,b,c,d,e,k = [int(input) for i in range(6)]
print('Yay!' if e-a<=k else ':(')

Buggy submission (verdict: Runtime Error):
a,b,c,d,e,k = [int(input) for i in range(6)]
print('Yay!' if e-a <= k else ':(')

Buggy submission (verdict: Runtime Error):
a,b,c,d,e = [int(input) for i in range(6)]
print('Yay!' if e-a <= k else ':(')

Buggy submission (verdict: Runtime Error):
I =[int(input())for i in range(5)]

if I[4] - I[0] > I[5] :
	print(":(")
else :
	print("Yay!")

Buggy submission (verdict: Runtime Error):
I =[int(input())for i in range(5)]

if I[4] - I[0] > I[5] :
	print(":(")
else :
	print(("Yay!"))

Buggy submission (verdict: Runtime Error):
I = [int(input()) for _ in range(6)]

I[0] = a
I[4] = e
I[5] = k

if e-a <= k:
	print(":(")
else :
	print("Yay!")

Buggy submission (verdict: Runtime Error):
I = [int(input()) for _ in range(6)]

I[0] = a
I[4] = e
I[5] = k

if e-a > k:
	print(":(")
else :
	print("Yay!")

Buggy submission (verdict: Runtime Error):
I = [int(input()) for _ in range(6)]

I[0] = a
I[4] = e
I[5] = k

if e-a > k:
	print(':(')
else :
	print('Yay!')

Buggy submission (verdict: Runtime Error):
I = [int(input()) for i in range(6)]

I[0] = a
I[4] = e
I[5] = k

if e-a > k:
	print(':(')
else :
	print('Yay!')

Buggy submission (verdict: Runtime Error):
I = [int(input()) for i in range(6)]

I[0] = a
I[5] = e
I[6] = k

if e-a > k:
	print(':(')
else :
	print('Yay!')

Buggy submission (verdict: Runtime Error):
I = int(input()) for i in range(6):

I[0] = a
I[5] = e
I[6] = k

if e-a > k:
	print(':(')
else :
	print('Yay!')
Problem p02897 (python)

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

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

Fixed submission:
a = int(input())
s = input()
if a>=3200:
  print(s)
elif a<3200:
  print('red')

Buggy submission (verdict: Runtime Error):
a = int(input())
s = input()
if a=>3200:
  print(s)
elif a<3200:
  print('red')
Problem p02987 (python)

Fixed submission:
S = input()
if len(set(S)) == 2:
	ans = 'Yes'  
else:
	ans = 'No'
print(ans)

Buggy submission (verdict: Runtime Error):
S = input()
if len(set(S)) == 2:
  ans = 'Yes'  
else ans = 'No'
print(ans)

Buggy submission (verdict: Runtime Error):
S = input()
if len(set(S)) == 2:
	ans = 'Yes'  
else ans = 'No'
print(ans)
Problem p03041 (python)

Fixed submission:
N,K = list(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()
new_S= S.lower(K)
print(new_S)
Problem p03075 (python)

Fixed submission:
a=int(input())
b=input()
c=input()
d=input()
e=int(input())
k=int(input())
print('Yay!' if (e-a)<=k else ':(')

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
a.b=b-a
a.c=c-a
a.d=d-a
a.e=e-a
b.c=c-b
b.d=d-b
b.e=e-b
c.d=d-c
c.e=e-c
d.e=e-d
if a.b<=k and a.c<=k and a.d<=k and a.e<=k and b.c<=k and b.d<=k and b.e<=k and c.d<=k and c.e<=k and d.e<=k:
  print('Yay!')
else:
  print(':(')
Problem p03242 (python)

Fixed submission:
S = input()

ans = ""

for i in S:
  if i == "1":
    ans += "9"
  else:
    ans += "1"

print(ans)

Buggy submission (verdict: Runtime Error):
n = input()
ans = ""
	for c in n:
		if c == "1":
            ans += "9"
        elif c == "9":
            ans += "1"
        else:
            ans += c
print(ans)

Buggy submission (verdict: Runtime Error):
    n = input()
    ans = ""
    for c in n:
        if c == "1":
            ans += "9"
        elif c == "9":
            ans += "1"
        else:
            ans += c
    print(ans)
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())
print(input().replace(s[k-1], s[k-1].lower()))
Problem p03221 (python)

Fixed submission:
n,m = map(int, input().split())
py = []
for i in range(m):
    p,y = map(int, input().split())
    py.append((p,y,i))
py.sort()
li = [[0]*2 for i in range(m)]
s = 0
t = 0
for p,y,i in py:
    #もしs!=pならその県は初めてなので1番目、違うならそこから+1
    if s != p:
        s = p
        t = 1
    else:
        t += 1
    li[i][0] = s
    li[i][1] = t
for i in range(m):
    print(str(li[i][0]).zfill(6) + str(li[i][1]).zfill(6))

Buggy submission (verdict: Runtime Error):
import numpy as np
n,m = map(int, input().split())
count = [0]*n
py = []

for i in range(m):
    p,y = map(int, input().split())
    count[p-1] += 1
    py.append([p,y])

li = sorted(py)
count = np.cumsum(count)

for i in range(m):
    num = li.index(py[i]) + 1
    pref = str(py[i][0])
    if py[i][0] == 1:
        print(pref.zfill(6) + str(num).zfill(6))
    else:
        print(pref.zfill(6) + str(num - count[i]).zfill(6))

Buggy submission (verdict: Runtime Error):
n,m = map(int, input().split())
count = [0]*m
py = []

for i in range(m):
    p,y = map(int, input().split())
    count[p-1] += 1
    py.append([p,y])

li = sorted(py)

for i in range(m):
    num = li.index(py[i]) + 1
    pref = str(py[i][0])
    print("0"*(6-len(pref)) + pref + "0"*(6-len(str(num))) + str(num - sum(count[:py[i][0]-1])))
Problem p03272 (python)

Fixed submission:
n,i = map(int, input().split())
print(n-i+1)

Buggy submission (verdict: Runtime Error):
n,i = map(int, input())
print(n-i+1)
Problem p03307 (python)

Fixed submission:
n = int(input())
if n % 2:
    print(2*n)
else:
    print(n)

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
print(2*n // math.gcd(2,n))

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
print(2*n // math.gcd(2,n))
Problem p03327 (python)

Fixed submission:
if 1<= int(input()) <= 999:
    print("ABC")
else:
    print("ABD")

Buggy submission (verdict: Runtime Error):
if 1<= int(input()) <= 999:
    print("ABC")
if 1000 <= int(input()) <= 1998:
    print("ABD")
Problem p03803 (python)

Fixed submission:
a, b = map(int, input().split())
if a == 1 and a != b:
    print("Alice")
    exit()
if b == 1 and a != b:
    print("Bob")
    exit()
if a < b:
    print("Bob")
    exit()
if a > b:
    print("Alice")
    exit()
if a == b:
    print("Draw")

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
if a < b:
    print("Bob")
if a > b:
    print("Alice")
if a = b:
    print("Draw")
Problem p03042 (python)

Fixed submission:
S=input()
S1=int(S[:2])
S2=int(S[2:])

if (S1 == 0 and S2 == 0) or (S1 >12 and S2 > 12):
    print('NA')
elif S1 == 0 or S1 > 12:
  if S2 >=1 and S2 <=12:
    print('YYMM')
  else:
    print('NA')
elif S2 == 0 or S2 > 12:
  if S1 >=1 and S1 <=12:
    print('MMYY')
  else:
    print('NA')
else:
    print('AMBIGUOUS')

Buggy submission (verdict: Runtime Error):
S=input()
S1=int(S[:2])
S2=int(S[2:])

if S1 == 0 AND S2 == 0:
    print('NA')
if S1 == 0 AND S2 >12:
    print('NA')
if S1 > 12 AND S2 == 0:
    print('NA')
elif S1 > 12 and S2 > 12:
    print('NA')
elif S1 > 12 and S2 <= 12:
    print('YYMM')
elif S1 <= 12 and S2 > 12:
    print('MMYY')
else:
    print('AMBIGUOUS')
Problem p03013 (python)

Fixed submission:
n,m=map(int,input().split())
a=[]
for i in range(m):
    a.append(int(input()))
flag=0
c=[0 for i in range(n+1)]
b=0
a.append(-2)
c[0]=1
if(a[b]==1):
    c[1]=0
    b+=1
else:
    c[1]=1
for i in range(2,n+1):
    if (i==a[b]):
        c[i]=0
        b+=1
    else:
        c[i]=c[i-1]+c[i-2]
        c[i]=c[i] %1000000007
print('{0}'.format(c[n]))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=[]
b=0
c=0
d=1
e=0
for i in range(m):
    a.append(int(input()))
for j in range(m-1):
    if(a[j]+1==a[j+1]):
        print('0')
        break    
z=list(set(a))
z=sorted(z)
z.append(0)     
for i in range(n):
    if(z[b]==i+1):
        b+=1    
        continue    
    else:
        c=d+e
        e=d
        d=c
print({0}.format(c%100000007)
Problem p03017 (python)

Fixed submission:
n,a,b,c,d=map(int,input().split())
s=str(input())
s=s.replace('.','0')
s=s.replace('#','1')
x=0
y=0
f=0
g=0
for i in range(c-a-1):
    x=int(s[i+a])
    y=int(s[i+a+1])
    if(x*y==1):
        f=-1
for j in range(d-b-1):
    x=int(s[j+b])
    y=int(s[j+b+1])
    if(x*y==1):
        g=-1
if(d<c):
    if(s[b-2:d+1].find('000')==-1):
        f=-1
if(f==0 and g==0):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
n,a,b,c,d=map(int,input().split())
s=str(input())
s=s.replace('.','0')
s=s.replace('#','1')
x=0
y=0
f=0
g=0
for i in range(c-a-2):
    x=int(s[i+a+1])
    y=int(s[i+a+2])
    if(x*y==1):
        f=-1
for j in range(d-b-2):
    x=int(s[j+b+1])
    y=int(s[j+b+2])
    if(x*y==1):
        g=-1
if(d<c):
    if(s[b+1:d].find('000')==-1 and ):
        f=-1
if(f==0 and g==0):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
n,a,b,c,d=map(int,input().split())
s=str(input())
s=s.replace('.','0')
s=s.replace('#','1')
x=0
y=0
f=0
g=0
for i in range(c-a-2):
    x=int(s[i+a+1])
    y=int(s[i+a+2])
    if(x*y==1):
        f=-1
for j in range(d-b-2):
    x=int(s[j+b+1])
    y=int(s[j+b+2])
    if(x*y==1):
        g=-1
x=s.replace('11','7')
x=x.replace('000','8')
x=x.replace('0','')
x=x.replace('1','')
if(d<c):
    if(s[b+1:d].find('000')==-1 and ):
        f=-1
if(f==0 and g==0):
    print('Yes')
else:
    print('No')
Problem p03038 (python)

Fixed submission:
n,m=map(int,input().split())
a=list(map(int,input().split()))
a=[(1,z)for z in a]
b=[tuple(map(int,input().split()))for i in range(m)]
b+=a
b.sort(key=lambda x:x[1])
cnt=0
ans=0
while True:
    c=b.pop()
    if cnt+c[0]<=n:
        ans+=c[0]*c[1]
        cnt+=c[0]
    else:
        ans+=c[1]*(n-cnt)
        break
print('{0}'.format(ans))

Buggy submission (verdict: Runtime Error):
n,m=map(input().split())
a=list(map(int,input().split()))
a=[(1,z)for z in A]
b=[tuple(map(int,input().split()))for i in range(m)]
b+=a
b.sort(key=lambda x:x[1])
cnt=0
ans=0
while True:
    c=b.pop()
    if cut+c[0]<=n:
        ans+=c[0]*c[1]
        cnt+=c[0]
    else:
        ans+=c[1]*(n-cnt)
        break
print('{0}'.format(ans))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=list(map(int,input().split()))
b=[0 for i in range(m)]
c=0
d=0
for i in range(m):
    c,d=map(int,input().split())
    e=[d,c]
    b[i]=e
a.sort()
b.sort(reverse=True)
f=[]
g=n
for i in range(m):
    if(b[i][1]>=g):
        for j in range(g):
            f.append(b[i][0])
            break
    else:
        for k in range(b[i][1]):
            f.append(b[i][0])
        g=g-b[i][1]
if(len(f)<n):
    for i in range(n-len(f)):
        f.append(0)
f.sort(reverse=True)
for i in range(len(f)):
    if(f[i]>=a[i]):
        a[i]=f[i]
    else:
        break
print('{0}'.format(sum(a)))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=list(map(int,input().split()))
b=[0 for i in range(m)]
c=0
d=0
for i in range(m):
    c,d=map(int,input().split())
    e=[d,c]
    b[i]=e
a.sort()
b.sort(reverse=True)
f=[]
g=n
for i in range(m):
    if(b[i][1]>=g):
        for j in range(g):
            f.append(b[i][0])
            break
    else:
        for k in range(b[i][1]):
            f.append(b[i][0])
        g=g-b[i][1]
f.sort(reverse=True)
for i in range(len(f)):
    if(f[i]>=a[i]):
        a[i]=f[i]
    else:
        break
print('{0}'.format(sum(a)))

Buggy submission (verdict: Runtime Error):
for i in range(m):
    if(b[i][1]>=g):
        for j in range(g):
            f.append(b[i][0])
            break
    else:
        for j in range(b[i][1]):
            f.append(b[i][0])
        g=g-b[i][1]
if(len(f)<n):
    for i in range(n-len(f)):
        f.append(-1)
f.sort(reverse=True)
for i in range(n):
    if(f[i]>a[i]):
        a[i]=f[i]
    else:
        break
print('{0}'.format(sum(a)))
Problem p03075 (python)

Fixed submission:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
max=a
min=a
if (max<b):
    max=b
if (max<c):
    max=c
if (max<d):
    max=d
if (max<e):
    max=e
if (min>b):
    min=b
if (min>c):
    min=c
if (min>d):
    min=d
if (min>e):
    min=e
z= max-min
if (z>k):
    print(':(')
else :
    print('Yay!')

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
frag = 0
max=a
min=a
if (max<b):
    max=b
if (max<c):
    max=c
if (max<d):
    max=d
if (max<e):
    max=e
if (min>b):
    min=b
if (min>c):
    min=c
if (min>d):
    min=d
if (min>e):
    min=e
z= max-min
if (z>k):
    print(':(')
    else :
        print('Yay!')
Problem p03104 (python)

Fixed submission:
import math

# f(x) = 0からxまでのxor
def f(x):
    div = (x // 2) % 2
    if x % 2 == 0:
        return div ^ x
    else:
        return div ^ 1

A, B = map(int, input().split())
print(f(A - 1) ^ f(B))

Buggy submission (verdict: Runtime Error):
# O(log(B))で求める場合

import math

# f(x) = 0からxまでのxor
def f(x):
    x += 1
    digit = math.ceil(math.log2(x)) + 1

    ret = 0
    for d in range(digit):
        loop = 1 << (d + 1)
        count = (x // loop) * (loop // 2)
        count += max(0, x % loop - loop // 2)

        if count % 2 == 1:
            ret += 1 << d
    return ret



A, B = map(int, input().split())
print(f(A - 1) ^ f(B))

Buggy submission (verdict: Runtime Error):
import math
A, B = map(int, input().split())
bi_list = [n for n in range(math.ceil(math.log2(B)) + 1)]

if A == B:
    print(A)
    exit()

odd_num = 0
count_list = [0] * (len(bi_list) + 1)
for i in range(A, B + 1):
    if i % 2 != 0:
        odd_num +=1
    for b in bi_list:
        if i >= b and i % (2 ** b) == 0:
            count_list[b] += 1

result_list = [0] * (len(bi_list) + 1)
for i, elem in enumerate(reversed(count_list)):
    if elem % 2 == 0:
        result_list[i] = "0"
    else:
        result_list[i] = "1"

if odd_num % 2 != 0:
    result_list[-1] = "1"
print(int("".join(result_list), 2))
Problem p02897 (python)

Fixed submission:
n = int(input())

print((n // 2 + n % 2) / n)

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

print((n // 2 + n % 2) / n)
Problem p02959 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
ans, x = 0, 0
ans += x
for i in range(N):
    x = min(A[i]-x,B[i])
    ans += x
    x = min(A[i+1],B[i]-x)
    ans += x
print(ans)

Buggy submission (verdict: Runtime Error):

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

ans = 0
x = min(A[0],B[0])
ans += x
for j in range(N-1):
    i = j+1
    x = min(A[i],B[i-1]-x)
    ans += x
    x = min(A[i]-x,B[i])
    ans += x
i = i+1
x = min(A[i],B[i-1]-x)
ans += x
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

ans = 0
x = min(A[0],B[0])
ans += x
for j in range(N-1):
    i = j+1
    x = min(A[i],B[i-1]-x)
    ans += x
    x = min(A[i]-x,B[i])
    ans += x
i = i+1
x = min(A[i],B[i-1]-x)
ans += x

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

ans = 0
x = 0
ans += min(A[0],B[0])

for j in range(N-1):
    i = j+1
    x = min(A[i],B[i-1]-x)
    ans += x
    x = min(A[i]-x,B[i])
    ans += x
i = i+1
x = min(A[i],B[i-1]-x)
ans += x
print(ans)
Problem p02970 (python)

Fixed submission:
n,d = map(int, input().split())
print(int((n+(d*2+1)-1)/(d*2+1)))

Buggy submission (verdict: Runtime Error):
n,d = map(int, input().split())
print int((n+(d*2+1)-1)/(d*2+1))
Problem p02989 (python)

Fixed submission:
N = int(input())
d = list(map(int,input().split()))

d.sort()
i = len(d)//2
print(d[i]-d[i-1])

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

    d.sort()
    i = len(d)//2
    print(d[i]-d[i-1])
Problem p03013 (python)

Fixed submission:
# DP
mod = 1000000007
 
n, m = map(int, input().split())
b_list = [True] * (n+1)
dp = [0 for _ in range(n+1)]
for i in range(m):
    b_list[int(input())] = False
 
dp[0] = 1
for i in range(n):
    for j in range(i+1, min(n, i+2)+1):
        if b_list[j] == True:
            dp[j] += dp[i]
            dp[j] %= mod
# print(b_list)
# print(dp)
print(dp[n])

Buggy submission (verdict: Runtime Error):
n,m= map(int,input().split())
c = [True]*(n+1)
for _ in range(m):
    c[int(input())] = False
d = [0]*(n)
if c[1] : d[1] = 1
if c[2] : d[2] = d[1] + 1
for i in range(3,n+1):
    if c[i] : d[i] = ( d[i-1] + d[i-2] ) % 1000000007
print(d[n])

Buggy submission (verdict: Runtime Error):
n,m= map(int,input().split())
c = [True]*(n+1)
for _ in range(m):
    c[int(input())] = False
d = [0]*(n+1)
if c[1] : d[1] = 1
if c[2] : d[2] = d[1] + 1
for i in range(3,n+1):
    if c[i] :
        d[i] = ( d[i-1] + d[i-2] ) % 1000000007
print(d[n])

Buggy submission (verdict: Runtime Error):
n,m= map(int,input().split())
a = [int(input()) for _ in range(m)]
d = [0]*(n+1)
if not 1 in a : d[1] = 1
if not 2 in a : d[2] = d[1] + 1
for i in range(3,n+1):
    if i not in a :
        d[i] = ( d[i-1] + d[i-2] ) % 1000000007
print(d[n])

Buggy submission (verdict: Runtime Error):
def resolve():
    n,m= map(int,input().split())
    a = [int(input()) for _ in range(m)]
    d = [0]*(n+1)
    if not 1 in a : d[1] = 1
    if not 2 in a : d[2] = d[1] + 1
    for i in range(3,n+1):
        if not i in a :
            d[i] += ( d[i-1] + d[i-2] ) % 1000000007
    print(d[i])

resolve()

Buggy submission (verdict: Runtime Error):
n,m= map(int,input().split())
a = [int(input()) for _ in range(m)]
d = [0]*(n+1)
if not 1 in a : d[1] = 1
if not 2 in a : d[2] = d[1] + 1
for i in range(3,n+1):
    if not i in a :
        d[i] += d[i-1] + d[i-2]
print(d[i]%1000000007)

Buggy submission (verdict: Runtime Error):
def resolve():
    n,m= map(int,input().split())
    a = [int(input()) for _ in range(m)]
    d = [0]*(n+1)
    if not 1 in a : d[1] = 1
    if not 2 in a : d[2] = d[1] + 1
    for i in range(3,n+1):
        if not i in a :
            d[i] += d[i-1] + d[i-2]
    print(d[i]%1000000007)

resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    n,m= map(int,input().split())
    a = [int(input()) for _ in range(m)]
    d = [0]*(n+1)
    d[0] = 0
    d[1] = 1
    d[2] = 2
    for i in range(3,n+1):
        if not i in a :
            d[i] += d[i-1] + d[i-2]
    print(d[i]%1000000007)
resolve()
Problem p03041 (python)

Fixed submission:
n,k = map(int,input().split())
s = list(input())
s[k-1] = s[k-1].lower()
print("".join(s))

Buggy submission (verdict: Runtime Error):
s = list(input())
a = int(s[0]+s[1])
b = int(s[2]+s[3])
if 0<a<13 and 0<b<13:
    print('AMBIGUOUS')
elif 0<a<13:
    print('MMYY')
elif 0<b<13:
    print('YYMM')
else:
    print('NA')
Problem p03077 (python)

Fixed submission:
import math
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
print(math.ceil(N/min(A,B,C,D,E))+4)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
print(math.ceil(N/min(A,B,C,D,E))+4)
Problem p03242 (python)

Fixed submission:
print(str(input()).replace('1','0').replace('9','1').replace('0','9'))

Buggy submission (verdict: Runtime Error):
print(input().replace(1,0).replace(9,1).replace(0,9))
Problem p03329 (python)

Fixed submission:
def resolve():
    N=int(input())
    mini=10**10
    for i in range(N+1):
        j=N-i
        mini=min(mini,f(i,6)+f(j,9))
    print(mini)


def f(n,m):#nをm進数にしたときの桁和
    i=0
    while n>0:
        i=i+n%m
        n=n//m
    return(i)
resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    N=int(input())
    print(f(N))

memo = [-1]*110000

def f(n):
    if n==0: return 0
    
    global memo
    if memo[n]!=-1:
        return memo[n]
    
    minc=n
    minc=min(minc,f(n-1)+1)
    i=1
    while 6**i<=n:
        j=6**i
        minc=min(minc,f(n-j)+1)
        i+=1
    
    i=1
    while 9**i<=n:
        j=9**i
        minc=min(minc,f(n-j)+1)
        i+=1

    memo[n]=minc
    return minc

resolve()
Problem p02951 (python)

Fixed submission:
A, B, C = map(int, input().split())
if C-A+B >= 0:
    print(C-A+B)
else:
    print(int(0))

Buggy submission (verdict: Runtime Error):
a = int(input())
l = len(str(a))

ans = 0
if l % 2 == 0:
    while l >= 1:
        ans += 10 ** (l - 1) - 1
        l -= 2
else:
    ans += a - (10 ** (l - 1) - 1)
    l -= 1
    while l >= 1:
        ans += 10 ** (l - 1) - 1
        l -= 2

print(ans)

Buggy submission (verdict: Runtime Error):
a = int(input())
l = len(str(a))

ans = 0
if l % 2 == 0:
    while l >= 1:
        ans += 10 ** (l - 1) - 1
        l -= 2
else:
    ans += a - (10 ** (l - 1) - 1)
    l -= 1
    while l >= 1:
        ans += 10 ** (l - 1) - 1
        l -= 2

print(ans)