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

Fixed submission:

xs = [int(input()) for _ in range(5)]
k = int(input())

ok = True
for x in xs:
    for y in xs:
        if abs(x-y) > k:
            ok = False

print("Yay!" if ok else ":(")

Buggy submission (verdict: Runtime Error):

xs = [int(input()) for _ in range(5)]
k = int(input())

ok = True
for x in xs:
    for y in ys:
        if abs(x-y) > k:
            ok = False

print("Yay!" if ok else ":(")
Problem p03250 (python)

Fixed submission:

x =map(int,input().split())
x = sorted(x, reverse=True)

print(x[0] * 10 + x[1] + x[2])

Buggy submission (verdict: Runtime Error):

x =map(int,input())
x = sorted(x, reverse=True)

print(x[0] * 10 + x[1] + x[2])
Problem p03307 (python)

Fixed submission:

import math
n = int(input())

if n % 2 == 0:
    n = n // 2

print(2 * n)

Buggy submission (verdict: Runtime Error):

import math
n = int(input())

print(2 * n // math.gcd(2, n))
Problem p02933 (python)

Fixed submission:
a = int(input())
s = input()

if a >= 3200:
    print(s)
else:
    print("red")

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(200005)
n, q = map(int, input().split())

to = [[] for i in range(n+1)]


for i in range(n-1):
    a, b = map(int, input().split())
    to[a].append(b)
    to[b].append(a)

score = [0]*(n+1)
h = [0] * (n+1)
for i in range(q):
    p, x = map(int, input().split())
    h[p] += x


def down_tree(index, parent):
    global score
    score[index] += score[parent] + h[index]
    for i in to[index]:
        if i == parent:
            continue
        down_tree(i, index)
    return


down_tree(1, 1)

print(' '.join(map(str, score[1:])))

Buggy submission (verdict: Runtime Error):

n, q = map(int, input().split())

to = [[] for i in range(n)]


for i in range(n-1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    to[a].append(b)
    to[b].append(a)

score = [0]*n

for i in range(q):
    p, x = map(int, input().split())
    score[p-1] += x


def down_tree(index, parent=-1):
    global score
    for i in to[index]:
        if i == parent:
            continue
        score[i] += score[index]
        down_tree(i, index)
    return


down_tree(0)

print(*score)
Problem p03038 (python)

Fixed submission:
n,m=map(int,input().split())
*q, = map(int,input().split())
#print(q)
l = [list(map(int,input().split())) for _ in range(m)]
l.sort(key=lambda x:x[1], reverse=True)
#print(l)
for b,c in l:
  q.extend([c]*b)
  if len(q) > n*2:
    break

print(sum(sorted(q,reverse=True)[:n]))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
*q, = sorted(map(int,input().split()))
#print(q)
l = []
for _ in range(m):
  b,c = map(int,input().split())
  for i in range(b):
    l.append(c)
l = sorted(l,reverse=True)
#print(l)

ans = 0
for j in range(len(l)):
  if q[j] > l[j]:
    ans += q[j]
    #print('ans',ans)
  else:
    ans += l[j]
    #print('ans',ans)
print(ans+sum(q[len(l):]) if len(l)<len(q) else ans)
Problem p03127 (python)

Fixed submission:
n = input()
a = list(map(int, input().split()))
import functools, fractions
print(functools.reduce(fractions.gcd, a))

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

def gcd(mn, xn):
  if xn == 0:
    return mn
  else:
    return gcd(xn, mn%xn)

ans = 0  
for i in range(N):
  if i < N-1:
    ans = gcd(num_li[i], num_li[i+1])
    if ans == 1:
      print(1)
      exit()
    else:
      ans += gcd(num_li[i], num_li[i+1] 
  
print(ans/N)
Problem p03135 (python)

Fixed submission:
T, X = map(int, input().split())

print(T/X)

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

max_num = max(num_li)
other_num = 0

for n in num_li:
  if n == max_num:
    continue
  other_num += n

if max_num < other_num:
  print('Yes')
else:
  print('No')
Problem p02933 (python)

Fixed submission:
a = int(input())
s = raw_input().strip()

if a >= 3200:
    print s
else:
    print "red"

Buggy submission (verdict: Runtime Error):
package main

import "fmt"

func main() {
    var a, b int
    fmt.Scan(&a, &b)
    if a*b%2 == 0 {
        fmt.Printf("Even\n")
    } else {
        fmt.Printf("Odd\n")
    }
}
Problem p03072 (python)

Fixed submission:
a = int(input())
k = list(map(int,input().split()))
kijun = k[0]
l = 1
for i in range(1,a):
    if k[i] >= kijun:
        l += 1
        kijun = k[i]
print(l)

Buggy submission (verdict: Runtime Error):
a=int(input())
for i in range(a):
  k = list(map(int,input().split()))
l =1
for i in range(1,a):
  for j in range(i):
    if k[i] >= k[j]:
      l += 1
print(l)

Buggy submission (verdict: Runtime Error):
a=int(input())
k=[]
for i in range(a):
  k.append(int(input()))
l =1
for i in range(1,a):
  for j in range(i):
    if k[i] >= k[j]:
      l += 1
print(l)
Problem p02933 (python)

Fixed submission:
a = input()
s = input()

print(s if int(a) >= 3200 else 'red')

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

print( s if a >3200 else: 'red')

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

print s if a > 3200 else 'red'
Problem p02935 (python)

Fixed submission:
n = input()
ints = list(map(int, input().split()))
ints = sorted(ints)
a = (ints[1] + ints[0])/2
for i in range(2, len(ints)):
    a = (a + ints[i]) / 2
    
print(a)

Buggy submission (verdict: Runtime Error):
n = input()
ints = list(map(int, input().split()))
ints = sorted(ints)
a = (ints[1] + ints[0])/2
for i in range(2, len(ints)):
    a = (a + int[i]) / 2
    
print(a)
Problem p02933 (python)

Fixed submission:
a = int(input())
s= input()

if (a<3200):
    print('red')
else:
    print(s)

Buggy submission (verdict: Runtime Error):
N=int(input())
a =list(map(int,input().split()))
def myFunction(int i):
    if (i == N-2):
        print((a[i-1]+a[i])/2)
    a[i] = (a[i-1]+a[i])/2
    myFunction(i+1)    
a.sort()
myFunction(1)
Problem p02933 (python)

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

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

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

Buggy submission (verdict: Runtime Error):
N = int(input())
A = input()
A = A.split()
s = 0
for i in range(0,len(A)):
  s = s + 1/int(A[i])

print(1/s)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = input()
A = A.split()
s = 0
for i in range(0,len(A)):
  s = s + 1/int(A[i])

print(1/s)
Problem p02954 (python)

Fixed submission:
s = input()
ans = [0] * len(s)
c = 0
for i in range(len(s)):
    if s[i] == 'R':
        c += 1
    if s[i] == 'L' and s[i-1] == 'R':
        if c % 2 == 0:
            ans[i] += c // 2
            ans[i-1] += c // 2
        else:
            ans[i] += c//2
            ans[i-1] += c//2 + 1
        c = 0
c = 0
for i in reversed(range(len(s))):
    if s[i] == 'L':
        c += 1
    if s[i] == 'R' and s[i+1] == 'L':
        if c % 2 == 0:
            ans[i+1] += c // 2
            ans[i] += c // 2
        else:
            ans[i+1] += c//2 + 1
            ans[i] += c // 2
        c = 0
print(' '.join(list(map(str, ans))))

Buggy submission (verdict: Runtime Error):
s = stdin.readline().rstrip()
ans = [0] * len(s)
c = 0
for i in range(len(s)):
    if s[i] == 'R':
        c += 1
    if s[i] == 'L' and s[i-1] == 'R':
        if c % 2 == 0:
            ans[i] += c // 2
            ans[i-1] += c // 2
        else:
            ans[i] += c//2
            ans[i-1] += c//2 + 1
        c = 0

for i in reversed(range(len(s))):
    if s[i] == 'L':
        c += 1
    if s[i] == 'R' and s[i+1] == 'L':
        if c % 2 == 0:
            ans[i+1] += c // 2
            ans[i] += c // 2
        else:
            ans[i+1] += c//2 + 1
            ans[i] += c // 2
        c = 0
print(' '.join(list(map(str, ans))))

Buggy submission (verdict: Runtime Error):
s = stdin.readline().rstrip()
ans = [0] * len(s)
c = 0
for i in range(len(s)):
    if s[i] == 'R':
        c += 1
    if s[i] == 'L' and s[i-1] == 'R':
        if c % 2 == 0:
            ans[i] += c // 2
            ans[i-1] += c // 2
        else:
            ans[i] += c//2
            ans[i-1] += c//2 + 1
        c = 0

for i in reversed(range(len(s))):
    if s[i] == 'L':
        c += 1
    if s[i] == 'R' and s[i+1] == 'L':
        if c % 2 == 0:
            ans[i+1] += c // 2
            ans[i] += c // 2
        else:
            ans[i+1] += c//2 + 1
            ans[i] += c // 2
        c = 0
print(' '.join(ans))
Problem p02933 (python)

Fixed submission:
a = int(input())
s = input()

if a >= 3200:
    print(s)
else:
    print("red")

Buggy submission (verdict: Runtime Error):
n = int(input())
v = list(map(int,input().split()))
i = len(v)-1

for i in range(n-1):
    v.sort()
    print(v)
    new_num = (v[0] + v[1]) / 2
    v[0] = new_num
    v.sort
    v.remove(v[1])
    print(v)

print(new_num)

'''
    for j in range((n-1)-i):
        if j == 0:
            v[j] = new_num
        else:
            v.remove(v[len(v)-1])

'''
Problem p02933 (python)

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

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

Fixed submission:
s = input()
lst = list(s)
for c in s:
    k = s.count(c)
    if k != 2:
        print('No')
        exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
s = input()
lis = list(s)
count = 0
if s.count(lis[0]) == 2:
   count+=1
else:
    if s.count(lis[1]) == 2:
        count+=1
    else:
        if s.count(lis[2]) == 2:
            count+=1
        else if count == 3:
            print("YES")
        else:
            print("NO")

Buggy submission (verdict: Runtime Error):
s = input()
lis = list(s)
count_str = 0
if s.count(lis[0]) == 2:
   count+=1
else:
    if s.count(lis[1]) == 2:
        count+=1
    else:
        if s.count(lis[2]) == 2:
            count+=1
        else if count == 3:
            print("YES")
        else:
            print("NO")
Problem p03307 (python)

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

Buggy submission (verdict: Runtime Error):
N = int(input())
A = input() .split()
a = list(A)
if len(a) == N:
    b = int(max(a))
    s = int(min(a))
    print(b-s)
else:
    N, A, a, b, s = FUCK
Problem p03186 (python)

Fixed submission:
a,b,c = map(int, input().split())
if a+b >= c-1:
  print(b+c)
else:
  print(a+2*b+1)

Buggy submission (verdict: Runtime Error):
a,b,c = map(int, input().split())
if a+b >= c-1:
  print(b+c)
else:
  print(a+2b+1)
Problem p03038 (python)

Fixed submission:
import heapq


n, m = map(int, input().split())
al = map(int, input().split())
h = []
ad = {}
for a in al:
    if a not in ad:
        ad[a] = 1
    else:
        ad[a] += 1
    

for i in range(m):
    b, c = map(int, input().split())
    
    if c not in ad:
        ad[c] = b
    else:
        ad[c] += b


keys = list( ad.keys() )
keys.sort(reverse=True)



for k in keys:
    for i in range(ad[k]):
        heapq.heappush(h, k)

        if len(h) >= n:
            break


ans = sum( heapq.nlargest(n, h) )
print(ans)

Buggy submission (verdict: Runtime Error):
import heapq

n, m = map(int, input().split())
al = map(int, input().split())
h = []

for a in al:
    heapq.heappush(h, a)

for i in range(m):
    b, c = map(int, input().split())
    for j in range(b):
        heapq.heappush(h, c)


[heapq.heappop(h) for i in range(n)]

sum = 0
for i in range(n):
    sum += heapq.heappop(h)

print(sum)
Problem p02984 (python)

Fixed submission:
N = int(raw_input())
A = map(int, raw_input().split())
ans = []
sum_all = sum(A) / 2

ic = sum_all
for i in range(1, N, 2):
    ic -= A[i]
ans.append(ic*2)

for i in range(0, N-1):
    ans.append((A[i] - ans[i]/2)*2)

print(' '.join(map(str, ans)))

Buggy submission (verdict: Runtime Error):
N = int(raw_input())
A = map(int, raw_input().split())
ans = []
sum_all = sum(A) / 2

ic = sum_all
for i in range(1, N, 2):
    ic -= A[i]
ans.append(ic*2)

for i in range(1, N):
    ans.append(A[i-1] - ans[i])

print(' '.join(map(str, ans)))
Problem p03104 (python)

Fixed submission:
def xor(_x) :
    if _x % 4 == 0:
        return _x
    elif _x % 4 == 1:
        return 1
    elif _x % 4 == 2:
        return 1 ^ _x
    else:
        return 0


A, B = map(long, raw_input().split())
print(xor(A - 1) ^ xor(B))

Buggy submission (verdict: Runtime Error):
A, B = map(long, raw_input().split())
ans = B
for i in range(A, B):
    ans = ans ^ i

print(ans)

Buggy submission (verdict: Runtime Error):
A, B = map(long, raw_input().split())
ans = A
for i in range(A + 1, B + 1):
    ans = ans ^ i

print(ans)
Problem p02990 (python)

Fixed submission:
n,k = map(int,input().split())
mod = 10**9+7

def kai(a):
    ans = 1
    for i in range(1,a+1):
        ans *= i
    return ans
    
for i in range(1,k+1):
    if(n-k+1<i):
        print(0)
        continue
    kusan=(kai(n-k+1))//kai(i)//kai(n-k-i+1)%mod
    haibun=(kai(k-1)//kai(k-i)//kai(i-1))%mod
    print((kusan*haibun)%mod)

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
mod = 10**9+7

def kai(a):
    ans = 1
    for i in range(1,a+1):
        ans *= i
    return ans
    
for i in range(1,k+1):
    if(n-k+1<i):
        print(0)
        continue
    kusan=(kai(n-k+1))//kai(i)//kwai(n-k-i+1)%mod
    haibun=(kai(k-1)//kai(k-i)//kai(i-1))%mod
    print((kusan*haibun)%mod)
Problem p03041 (python)

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

for i in c:
    print(i,end='')

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
s = input()
c = list(s)
c[k] = c[k].lower()

for i in c:
    print(i,end='')
Problem p02933 (python)

Fixed submission:
import numpy as np

A = input()
A = int(A)
S = input()
S = str(S)

if(A>=3200):
    print(S)
else:
    print("red")

Buggy submission (verdict: Runtime Error):
import numpy as np

A,S= map(str,input().split())
A = int(A)

if(A>=3200):
    print(S)
else:
    print("red")
Problem p03011 (python)

Fixed submission:
p = (int(i) for i in input().split())
p = sorted(p)
print(p[0] + p[1])

Buggy submission (verdict: Runtime Error):
import math
n, m = [int(i) for i in input().split()]
p = [0 for i in range(n + 1)]
for _ in range(m):
    p[int(input())] = 1
    
a = []
a.append(1)
if p[1] == 1:
    a.append(0)
else:
    a.append(1)
for i in range(2, n + 1):
    if p[i] == 1:
        a.append(0)
    else:
        a.append((a[i - 2] + a[i - 1]) % 1000000007)
    
print(a[n])

Buggy submission (verdict: Runtime Error):
import math
n, m = [int(i) for i in input().split()]
p = [int(input()) for i in range(m)]

a = []
a.append(1)
if 1 in p:
    a.append(0)
else:
    a.append(1)
for i in range(2, n + 1):
    if i in p:
        a.append(0)
    else:
        a.append((a[i - 2] + a[i - 1]) % 1000000007)
    
print(a[n])
Problem p03042 (python)

Fixed submission:
s = input()
left = int(s[:2])
right = int(s[2:])
 
if 1 <= left and left <=12 and 1 <= right and right <= 12:
  print("AMBIGUOUS")
elif 1 <= left and left <= 12:
  print("MMYY")
elif 1 <= right and right <= 12:
  print("YYMM")
else:
  print("NA")

Buggy submission (verdict: Runtime Error):
s = input()
left = int(s[:2])
right = int(s[2:])
 
if 1 <= left and left <=12 and 1 <= right and right <= 12:
	print("AMBIGUOUS")
elif 1 <= left and left <= 12:
	print("MMYY")
elif 1 <= rihgt and right <= 12:
	print("YYMM")
else:
	print("NA")

Buggy submission (verdict: Runtime Error):
s = input()
left = int(s[:2])
right = int(s[2:])

if 1 <= left and left <=12 and 1 <= right and right <= 12:
    print("AMBIGUOUS")
elif 1 <= left and left <= 12:
  	print("MMYY")
elif 1 <= rihgt and right <= 12:
  	print("YYMM")
else:
  	print("NA")
Problem p02987 (python)

Fixed submission:
s = input()
listS = list(s)
sortS = listS.sort()
if listS[0] == listS[1] and listS[2] == listS[3]:
  if listS[0] != listS[3]:
    print('Yes')
  else:
    print('No')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s = input()
listS = list(s)
sortS = listS.sort()

if listS[0] == listS[1] and listS[2] == listS[3]:
  if listS[0] != listS[2]
  	print('Yes')
else:
  print('No')
Problem p03803 (python)

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

if a == b:
    print("Draw")
elif a > b:
    if b == 1:
        print("Bob")
    else:
        print("Alice")
else:
    if a == 1:
        print("Alice")
    else:
        print("Bob")

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

if a == b:
    print("Draw")
elif a > b:
    if b == 1:
        print("Bob")
        break
    print("Alice")
else:
    print("Bob")
Problem p02987 (python)

Fixed submission:
S = [x for x in input().rstrip()]

if S[0]==S[1] and S[1]!=S[2] and S[2]==S[3]:
    print("Yes")
elif S[0]==S[2] and S[1]!=S[2] and S[1]==S[3]:
    print("Yes")
elif S[0]==S[3] and S[2]!=S[3] and S[1]==S[2]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
 S = [x for x in input().rstrip()]

if S[0]==S[1] and S[1]!=S[2] and S[2]==S[3]:
    print("Yes")
elif S[0]==S[2] and S[1]!=S[2] and S[1]==S[3]:
    print("Yes")
elif S[0]==S[3] and S[2]!=S[3] and S[1]==S[2]:
    print("Yes")
else:
    print("No")
Problem p03631 (python)

Fixed submission:
#70

N = list(input())

if N[0] == N[2]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
#70

N = list(int(input()))

if N[0] == N[2]:
    print("Yes")
else:
    print("No")
Problem p02948 (python)

Fixed submission:
import heapq
import sys
input = sys.stdin.readline
'''
allinputs = iter(input().splitlines())
input = lambda : next(allinputs)
#'''
N, M = map(int, input().split())
jobs = [[] for _ in range(M + 1)]

for _ in range(N):
	a, b = map(int, input().split())
	
	if a > M:
		continue
		
	jobs[a].append(b)
	
ans = 0
myheap = []

for i in range(M + 1):
	for j in jobs[i]:
		heapq.heappush(myheap, -j)
			
	if myheap:
		ans -= heapq.heappop(myheap)
		
print(ans)

Buggy submission (verdict: Runtime Error):
import heapq
import sys
input = sys.stdin.readline
'''
allinputs = iter(input().splitlines())
input = lambda : next(allinputs)
#'''
N, M = map(int, input().split())
jobs = []

for i in range(N):
	a, b = map(int, input().split())
	if a <= M:
		jobs.append((a, b))
	
jobs.sort()
index = 0
ans = 0
myheap = []

for day in range(M - 1, -1, -1):
	for i in range(index, N):
		if (day + jobs[i][0]) < (M + 1):
			heapq.heappush(myheap, -jobs[i][1])
		else:
			index = i
			break
			
	if len(myheap) > 0:
		ans -= heapq.heappop(myheap)
		
print(ans)
Problem p02990 (python)

Fixed submission:
N, K = map(int, input().split())
r = N - K
mod = 10 ** 9 + 7
dp1 = [[0] * (K) for _ in range(K)]
dp2 = [[0] * (r + 2) for _ in range(K + 1)]

for i in range(K):
	for j in range(K):
		if i == 0:
			dp1[i][j] = 1
		elif j == 0:
			dp1[i][j] = 0
		else:
			dp1[i][j] = (dp1[i - 1][j - 1] + dp1[i][j - 1]) % mod

for i in range(K + 1):
	for j in range(r + 2):
		if i == 0:
			dp2[i][j] = 1
		elif j == 0:
			dp2[i][j] = 0
		else:
			dp2[i][j] = (dp2[i - 1][j - 1] + dp2[i][j - 1]) % mod
			
for i in range(K):
	print((dp1[i][-1] * dp2[i + 1][-1]) % mod)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
r = N - K
mod = 10 ** 9 + 7
dp1 = [[0] * (K) for _ in range(K)]
dp2 = [[0] * (r + 2) for _ in range(r + 2)]

for i in range(K):
	for j in range(K):
		if i == 0:
			dp1[i][j] = 1
		elif j == 0:
			dp1[i][j] = 0
		else:
			dp1[i][j] = (dp1[i - 1][j - 1] + dp1[i][j - 1]) % mod

for i in range(r + 2):
	for j in range(r + 2):
		if i == 0:
			dp2[i][j] = 1
		elif j == 0:
			dp2[i][j] = 0
		else:
			dp2[i][j] = (dp2[i - 1][j - 1] + dp2[i][j - 1]) % mod
			
for i in range(K):
	print((dp1[i][-1] * dp2[i + 1][-1]) % mod)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
r = N - K
mod = 10 ** 9 + 7
dp1 = [[0] * (K) for _ in range(K)]
dp2 = [[0] * (r + 2) for _ in range(r + 2)]

for i in range(K):
	for j in range(K):
		if i == 0:
			dp1[i][j] = 1
		elif j == 0:
			dp1[i][j] = 0
		else:
			dp1[i][j] = (dp1[i - 1][j - 1] + dp1[i][j - 1]) % mod

for i in range(r + 2):
	for j in range(r + 2):
		if i == 0:
			dp2[i][j] = 1
		elif j == 0:
			dp2[i][j] = 0
		else:
			dp2[i][j] = (dp2[i - 1][j - 1] + dp2[i][j - 1]) % mod
			
for i in range(K):
	print(dp1[i][-1] * dp2[i + 1][-1])
Problem p03013 (python)

Fixed submission:
import sys
input = sys.stdin.readline
'''
allinputs = iter(input().splitlines())
input = lambda : next(allinputs)
#'''

N, M = map(int, input().split())
mod = 10 ** 9 + 7
a = [0] * M
dp = [0] * (N + 2)
dp[0] = 1
dp[1] = 1

for i in range(M):
	a[i] = int(input())
	
now = 0
next = 0

for i in a:
	next = i
	for j in range(now + 1, next + 1):
		if j == i:
			dp[i] = 0
		else:
			dp[j] = (dp[j - 1] + dp[j - 2]) % mod
	
	now = next

next = N
for j in range(now + 1, next + 1):
		dp[j] = (dp[j - 1] + dp[j - 2]) % mod
print(dp[N])

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(2000)

input = sys.stdin.readline
'''
allinputs = iter(input().splitlines())
input = lambda : next(allinputs)
#'''
N, M = map(int, input().split())
mod = 10 ** 9 + 7
a = [0] * M
memo = [-1] * (N + 1)

for i in range(M):
	a[i] = int(input())

def step(n):
	if memo[n] >= 0:
		return memo[n]
	elif n < 2:
		memo[n] = 1
		return 1
	else:
		memo[n] = (step(n - 1) + step(n - 2)) % mod
		return memo[n]
			
for i in a:
	memo[i] = 0
	
print(step(N))

Buggy submission (verdict: Runtime Error):
import sys
#sys.setrecursionlimit(2000)

input = sys.stdin.readline
'''
allinputs = iter(input().splitlines())
input = lambda : next(allinputs)
#'''
N, M = map(int, input().split())
mod = 10 ** 9 + 7
a = [0] * M
memo = [-1] * (N + 1)

for i in range(M):
	a[i] = int(input())

def step(n):
	if memo[n] >= 0:
		return memo[n]
	elif n < 2:
		memo[n] = 1
		return 1
	else:
		memo[n] = (step(n - 1) + step(n - 2)) % mod
		return memo[n]
			
for i in a:
	memo[i] = 0
	
print(step(N))
Problem p03073 (python)

Fixed submission:
S = list(input())

count_0 = 0
count_1 = 0

for i in range(len(S)):
	if (i % 2 == 1) ^ (S[i] == '1'):
		count_0 += 1
	else:
		count_1 += 1
		
print(min(count_0, count_1))

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

S = list(input())
S = [int(i) for i in S]

count_0 = 0
count_1 = 0

for i in range(len(S)):
	if (i % 2 == 1) ^ S[i]:
		count_0 += 1
	else:
		count_1 += 1
		
print(min(count_0, count_1))

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

S = list(input())
S = [int(i) for i in S]

count_0 = 0
count_1 = 0

for i in range(len(S)):
	if (i % 2 == 1) ^ S[i]:
		count_0 += 1
	else:
		count_1 += 1
		
print(min(count_0, count_1))

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

S = list(input())
S = [int(i) for i in S]

count_0 = 0
count_1 = 0

for i in range(len(S)):
	if (i % 2 == 1) ^ S[i]:
		count_0 += 1
	else:
		count_1 += 1
		
print(min(count_0, count_1))
Problem p03135 (python)

Fixed submission:
a,b = map(lambda x: int(x), input().split())
print(a/b)

Buggy submission (verdict: Runtime Error):
_ = input()
nums = [int(x) for x in input().split()]
max_ = max(nums)
pop(nums.index(max_))
rest = sum(nums)
if rest > max_:
    print('Yes')
else:
    print('No')
Problem p03835 (python)

Fixed submission:
K, S = map(int,input().split())

cnt = 0
for i in range(K+1):
    for j in range(K+1):
        if 0 <= S - i - j <= K:
            cnt +=1
print(cnt)

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

cnt = 0
for i in range(K+1):
    for j in range(K+1):
        if 0 <= S - i - j <= k:
            cnt +=1
print(cnt)