Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
H, W = map(int, input().split())
S = []
for i in range(H):
    s = list(input())
    for j in range(W):
        if s[j] == '.':
            s[j] = 0
    S.append(s)

dx = [0,1,1,1,0,-1,-1,-1]
dy = [1,1,0,-1,-1,-1,0,1]
for i in range(H):
    for j in range(W):
        for k in range(8):
            nx = j + dx[k]
            ny = i + dy[k]
            if nx >= 0 and ny >= 0 and ny < H and nx < W:
                if S[ny][nx] == "#":
                    S[i][j] += 1
for i in range(H):
    l = map(str,S[i])
    ans = "".join(l)
    print(ans)

Fixed submission:
H, W = map(int, input().split())
S = []
for i in range(H):
    s = list(input())
    for j in range(W):
        if s[j] == '.':
            s[j] = 0
    S.append(s)

dx = [0,1,1,1,0,-1,-1,-1]
dy = [1,1,0,-1,-1,-1,0,1]
for i in range(H):
    for j in range(W):
        if S[i][j] == "#":
            continue
        for k in range(8):
            nx = j + dx[k]
            ny = i + dy[k]
            if nx >= 0 and ny >= 0 and ny < H and nx < W :
                if S[ny][nx] == "#":
                    S[i][j] += 1
for i in range(H):
    l = map(str,S[i])
    ans = "".join(l)
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int, input().split())
ans = 0 
for X in range(K + 1):
    for Y in range(K + 1):
        if X + Y > S:
            continue
        for Z in range(K + 1):
            if X + Y + Z == S:
                ans += 1
print(ans)

Fixed submission:
K, S = map(int, input().split())
ans = 0 
for X in range(K+1):
    for Y in range(K+1):
        Z = S - X - Y
        if 0 <= Z and Z <= K:
            ans += 1
        
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int, input().split())
ans = 0
for X in range(K + 1):
    for Y in range(K + 1):
        for Z in range(K + 1):
            if X + Y + Z == S:
                ans += 1
print(ans)

Fixed submission:
K, S = map(int, input().split())
ans = 0 
for X in range(K+1):
    for Y in range(K+1):
        Z = S - X - Y
        if 0 <= Z and Z <= K:
            ans += 1
        
print(ans)
Buggy python submission (verdict: Runtime Error):
x=input()
if x == 'hi':
	print('Yes')
else if x == 'hihi':
	print('Yes')
else if x == 'hihihi':
	print('Yes')
else if x == 'hihihihi':
	print('Yes')
else if x == 'hihihihihi':
	print('Yes')
else:
	print('NO')

Fixed submission:
x=input()
if x == 'hi':
	print('Yes')
elif x == 'hihi':
	print('Yes')
elif x == 'hihihi':
	print('Yes')
elif x == 'hihihihi':
	print('Yes')
elif x == 'hihihihihi':
	print('Yes')
else:
	print('No')

Buggy python submission (verdict: Runtime Error):
x=input()
if x == 'hi'
	print('Yes')
else if x == 'hihi'
	print('Yes')
else if x == 'hihihi'
	print('Yes')
else if x == 'hihihihi'
	print('Yes')
else if x == 'hihihihihi'
	print('Yes')
else
	print('NO')

  

Fixed submission:
x=input()
if x == 'hi':
	print('Yes')
elif x == 'hihi':
	print('Yes')
elif x == 'hihihi':
	print('Yes')
elif x == 'hihihihi':
	print('Yes')
elif x == 'hihihihihi':
	print('Yes')
else:
	print('No')

Buggy python submission (verdict: Runtime Error):
x=input()
x1=len(x)
x2 = x1 / 2
if x1 %2 == 0
	if "hi"*x2 == s:
		print("Yes")
	else
		print("No")
else:
  print("No")


Fixed submission:
x=input()
if x == 'hi':
	print('Yes')
elif x == 'hihi':
	print('Yes')
elif x == 'hihihi':
	print('Yes')
elif x == 'hihihihi':
	print('Yes')
elif x == 'hihihihihi':
	print('Yes')
else:
	print('No')

Buggy python submission (verdict: Runtime Error):
x=input()
x1=len(x)
if x1 %2 == 0
	if "hi"*x1 == s:
		print("Yes")
	else
		print("No")
else:
  print("No")

Fixed submission:
x=input()
if x == 'hi':
	print('Yes')
elif x == 'hihi':
	print('Yes')
elif x == 'hihihi':
	print('Yes')
elif x == 'hihihihi':
	print('Yes')
elif x == 'hihihihihi':
	print('Yes')
else:
	print('No')

Buggy python submission (verdict: Runtime Error):
x=input()
x1=len(x)
if x1 %2 == 0
	print("yes")
else
	print("no")



Fixed submission:
x=input()
if x == 'hi':
	print('Yes')
elif x == 'hihi':
	print('Yes')
elif x == 'hihihi':
	print('Yes')
elif x == 'hihihihi':
	print('Yes')
elif x == 'hihihihihi':
	print('Yes')
else:
	print('No')
Buggy python submission (verdict: Time Limit Exceeded):
import itertools

K,S = list(map(int,input().split()))
l = set(range(K+1))
ans = 0

for x, y, z in itertools.product(l,l,l):
    if x + y + z == S:
        ans += 1

print(ans)

Fixed submission:
import itertools

K,S = list(map(int,input().split()))
l = set(range(K+1))
ans = 0

for x, y in itertools.product(l,l):
    if x + y + K >= S and x + y <= S:
        ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
A,B,M = map(int, input().split())
a = map(int, input().split())
b = map(int, input().split())
a_min = min(a)
b_min = min(b)
ans = a_min + b_min
for i in range(M):
  x,y,c = map(int, input().split())
  x -= 1
  y -= 1
  ans = min(ans, a[x]+b[y]-c)
print(ans)

Fixed submission:
A,B,M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = min(a) + min(b)
for i in range(M):
  x,y,c = map(int, input().split())
  ans = min(ans, a[x-1]+b[y-1]-c)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
s = list(input())
l = len(s)
count = 0
while "ABC" in "".join(s):
	for i in range(l-2):
		if "".join(s[i:i+3]) == "ABC":
			s[i:i+3] = "BCA"
			count += 1
print(count)

Fixed submission:
s = "Z".join(input().split("BC"))
l = len(s)
count = 0
cue = 0
for i in range(l):
	if s[i] == "A":
		cue += 1
	elif s[i] == "Z":
		count += cue
	else:
		cue = 0
print(count)
Buggy python submission (verdict: Runtime Error):
r, g, b, n = [int(i) for i in input().split()]
total = 0

rm = n//r
for i in range(rm + 1):
	for j in range(gm + 1):
		bd = n - r * i - g * j
		if bd % b == 0:
			total += 1
print(total)


Fixed submission:
r, g, b, n = [int(i) for i in input().split()]
total = 0
rm = n//r
for rn in range(rm + 1):
	gm = (n - rn * r) // g
	for gn in range(gm + 1):
		bd = n - r * rn - g * gn
		if bd % b == 0:
			total += 1
print(total)
Buggy python submission (verdict: Runtime Error):
n = int(input())
t = []
a = 0
b = 0
total = 0
for i in range(n):
	t.append(input())
    total += t[-1].count("AB")
    a += t[-1][-1] == "A"
    b += t[-1][0] == "B"
print(min(a,b) + total)

Fixed submission:
n = int(input())
a = 0
b = 0
ab = 0
total = 0
t = []

for i in range(n):
	t.append(input())

for i in t:
	total += i.count("AB")
	if i[-1] == "A" and i[0] == "B":
		ab += 1
	else:
		a += i[-1] == "A"
		b += i[0] == "B"
if ab == 0:
	print(total + min(a,b))
elif a == 0 and b == 0:
	print(total + ab - 1)
elif a > 0 and b > 0:
	print(total + ab + min(a, b))
else:
	print(total + ab)
Buggy python submission (verdict: Runtime Error):
inp=list(map(int,input().split(" ")))
N=inp[0]
T=inp[1]+0.5

a=[0]*N
b=[0]*N
for i in range(N):
    inp=list(map(int,input().split(" ")))
    a[i]=inp[0]
    b[i]=inp[1]


time=0
get =0

while(1):
    time+=1
    if(time>T or len(a)==0):
        break
    need=list(map(lambda x,y:x*time+y,a,b))
    mini=min(need)
    time+=mini
    go=[i for i, x in enumerate(need) if x == mini]#get list to minimum
    gomin=[]
    for i in range(len(go)):#make list a
        gomin.append(a[go[i]])
    go=gomin.index(max(gomin))#find a minimum index
    del a[go]
    del b[go]
    if(time>T):
        break
    get+=1

print(get)



Fixed submission:
a = input()
a=a.replace("hi","")
if(len(a)==0):
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
inp = input().split(" ")
A=int(inp[0])
B=int(inp[1])
M=int(inp[2])

if A!=0:
    a=input().split(" ")
else:
    a=[0]
if B!=0:
    b=input().split(" ")
else:
    b=[0]

s=[0]*(M+(1))
m=[[0]*3]*M
i=0
for x in m:
    x=input().split(" ")
    s[i]=int(a[int(x[0])-1])+int(b[int(x[1])-1])-int(x[2])
    i+=1

s[i]=int(min(a))+int(min(b))

print(min(s))


Fixed submission:
a = input()
a=a.replace("hi","")
if(len(a)==0):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
import sys
from functools import reduce

n, m = map(int, input().split())
ps = [r.split() for r in sys.stdin.read().split('\n') if r != '']
ps.sort(key=lambda t: int(t[0]))
ac = {}
wa = {}
for j in range(0, m):
    i = int(ps[j][0])
    if i in ac:
        continue
    if ps[j][1] == 'AC':
        ac[i] = 1
        continue
    if i not in wa:
        wa[i] = 1
    else:
        wa[i] += 1
wacount = reduce(lambda a, b: a + b, map(lambda t: t[1], filter(lambda t: t[0] in ac, wa.items()))) if len(wa) > 0 else 0
print(len(ac), wacount)

Fixed submission:
import sys
from functools import reduce

n, m = map(int, input().split())
ps = [r.split() for r in sys.stdin.read().split('\n') if r != '']
ps.sort(key=lambda t: int(t[0]))
log = []
for i in range(0, n):
    log.append([])
for j in range(0, m):
    i = int(ps[j][0])
    log[i-1].append(ps[j][1])
wacount = sum(map(lambda l: l.index('AC'), filter(lambda e: e.count('AC') > 0, log)))
print(len(list(filter(lambda e: e.count('AC') > 0, log))),
        wacount)
Buggy python submission (verdict: Runtime Error):
import sys
p = [r for r in sys.stdin.read().split('\n') if r != '']
n = int(p[0])
s = p[1:]
for i, r in enumerate(s):
    t = list(r)
    t.sort()
    s[i] = ''.join(t)
total = 0
while n:
    a = s.pop(-1)
    count = 0
    for i in reversed(range(0, len(s))):
        if s[i] == a:
            count += 1
            s[i] = None
    total += int((count + 1) * count / 2)
    n -= (count + 1)
print(total)

Fixed submission:
import sys
p = [r for r in sys.stdin.read().split('\n') if r != '']
n = int(p[0])
s = p[1:]
for i, r in enumerate(s):
    t = list(r)
    t.sort()
    s[i] = ''.join(t)
d = {}
for i in s:
    if i in d:
        d[i] += 1
    else:
        d[i] = 0
count = 0
for k, v in d.items():
    count += int((v + 1) * v / 2)
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
p = [r for r in sys.stdin.read().split('\n') if r != '']
n = int(p[0])
s = p[1:]
for i, r in enumerate(s):
    t = list(r)
    t.sort()
    s[i] = ''.join(t)
total = 0
while len(s):
    a = s.pop(-1)
    count = 0
    for i in reversed(range(0, len(s))):
        if s[i] == a:
            count += 1
            s.pop(i)
    total += int((count + 1) * count / 2)
print(total)

Fixed submission:
import sys
p = [r for r in sys.stdin.read().split('\n') if r != '']
n = int(p[0])
s = p[1:]
for i, r in enumerate(s):
    t = list(r)
    t.sort()
    s[i] = ''.join(t)
d = {}
for i in s:
    if i in d:
        d[i] += 1
    else:
        d[i] = 0
count = 0
for k, v in d.items():
    count += int((v + 1) * v / 2)
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
p = [r for r in sys.stdin.read().split('\n') if r != '']
n = int(p[0])
s = p[1:]
for i, r in enumerate(s):
    s[i] = ''.join(sorted((c for c in r)))
total = 0
while len(s):
    a = s.pop(-1)
    count = 0
    for i in reversed(range(0, len(s))):
        if s[i] == a:
            count += 1
            s.pop(i)
    total += int((count + 1) * count / 2)
print(total)

Fixed submission:
import sys
p = [r for r in sys.stdin.read().split('\n') if r != '']
n = int(p[0])
s = p[1:]
for i, r in enumerate(s):
    t = list(r)
    t.sort()
    s[i] = ''.join(t)
d = {}
for i in s:
    if i in d:
        d[i] += 1
    else:
        d[i] = 0
count = 0
for k, v in d.items():
    count += int((v + 1) * v / 2)
print(count)
Buggy python submission (verdict: Runtime Error):
import sys
p = [[int(c) for c in r.split()] for r in sys.stdin.read().split('\n') if r != '']
n = p[0][0]
h = p[1]
h.reverse()
for i, x in enumerate(h[:-1]):
    if x + 1 < h[i+1]:
        print('No')
        quit()
    if x < h[i+1]:
        h[i+1] -= 1
if h[i] < h[i+1]:
    print('No')
else:
    print('Yes')

Fixed submission:
import sys
p = [[int(c) for c in r.split()] for r in sys.stdin.read().split('\n') if r != '']
n = p[0][0]
if n == 1:
    print('Yes')
    quit()
h = p[1]
h.reverse()
for i in range(len(h)-1):
    if h[i] + 1 < h[i+1]:
        print('No')
        quit()
    if h[i] < h[i+1]:
        h[i+1] -= 1
if h[i] < h[i+1]:
    print('No')
else:
    print('Yes')
Buggy python submission (verdict: Time Limit Exceeded):
L, R = list(map(int, input().split()))
a = (L * (L + 1)) % 2019
for i in range(L, R + 1):
    for j in range(i + 1, min(i + 2019, R + 1)):
        if (i * j) % 2019 < a:
            a = (i * j) % 2019
print(a)

Fixed submission:
L, R = list(map(int, input().split()))
a = (L * (L + 1)) % 2019
for i in range(L, min(R + 1, L + 2019)):
    for j in range(i + 1, min(i + 2020, R + 1)):
        if (i * j) % 2019 < a:
            a = (i * j) % 2019
print(a)

Buggy python submission (verdict: Time Limit Exceeded):
L, R = list(map(int, input().split()))
a = (L * (L + 1)) % 2019
for i in range(L, R + 1):
    for j in range(i + 1, min(i + 2019, R + 1)):
        if (i * j) % 2019 < a:
            a = (i * j) % 2019
print(a)

Fixed submission:
L, R = list(map(int, input().split()))
a = (L * (L + 1)) % 2019
for i in range(L, min(R + 1, L + 2019)):
    for j in range(i + 1, min(i + 2020, R + 1)):
        if (i * j) % 2019 < a:
            a = (i * j) % 2019
print(a)

Buggy python submission (verdict: Time Limit Exceeded):
L, R = list(map(int, input().split()))
a = (L * (L + 1)) % 2019
for i in range(L, R + 1):
    for j in range(i + 1, R + 1):
        if (i * j) % 2019 < a:
            a = (i * j) % 2019
print(a)

Fixed submission:
L, R = list(map(int, input().split()))
a = (L * (L + 1)) % 2019
for i in range(L, min(R + 1, L + 2019)):
    for j in range(i + 1, min(i + 2020, R + 1)):
        if (i * j) % 2019 < a:
            a = (i * j) % 2019
print(a)
Buggy python submission (verdict: Runtime Error):
import sys
def a():
    p = [[int(t) for t in r.split(' ')] for r in sys.stdin.read().split('\n') if r != '']
    A, P = p[0]
    print(int((A*3+P)/2)
a()


Fixed submission:
import sys
def a():
    p = [[int(t) for t in r.split(' ')] for r in sys.stdin.read().split('\n') if r != '']
    A, P = p[0]
    print(int((A*3+P)/2))
a()

Buggy python submission (verdict: Runtime Error):
import sys
from functools import reduce
def a():
    p = [[int(t) for t in r.split(' ')] for r in sys.stdin.read().split('\n') if r != '']
    A, P = p[0]
    print(int((A*3+P)/2)
a()
import sys
def a():
    p = [[int(t) for t in r.split(' ')] for r in sys.stdin.read().split('\n') if r != '']
    A, P = p[0]
    print(int((A*3+P)/2)
a()


Fixed submission:
import sys
def a():
    p = [[int(t) for t in r.split(' ')] for r in sys.stdin.read().split('\n') if r != '']
    A, P = p[0]
    print(int((A*3+P)/2))
a()

Buggy python submission (verdict: Runtime Error):
import sys
from functools import reduce
def a():
    p = [[int(t) for t in r.split(' ')] for r in sys.stdin.read().split('\n') if r != '']
    A, P = p[0]
    print(int((A*3+P)/2)
a()


Fixed submission:
import sys
def a():
    p = [[int(t) for t in r.split(' ')] for r in sys.stdin.read().split('\n') if r != '']
    A, P = p[0]
    print(int((A*3+P)/2))
a()
Buggy python submission (verdict: Runtime Error):
def abc127d():
    N, M = (int(s) for s in input().split(" "))
    A = sorted(list(int(s) for s in input().split(" ")))
    for i in range(0, M):
        B, C = (int(s) for s in input().split(" "))
        r = len(list(filter(lambda x: x < C, A[:B])))
        A = sorted([C for n in range(0, r)] + A[r:])
    print(sum(A))
abc127d()


Fixed submission:
def abc127a():
    A, B = (int(s) for s in input().split(" "))
    answer = int(0 if A <= 5 else B / 2 if A <= 12 else B)
    print(answer)

def main():
    abc127a()

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

if (500 * K - X） >= 0  :
  print('Yes') 
else:
  print('No') 


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

if 500 * K - X >= 0  :
  print('Yes') 
else:
  print('No')

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

if (500 * K） < X  :
  print('No') 
else:
  print('Yes') 

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

if 500 * K - X >= 0  :
  print('Yes') 
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
N, A, B = input().split()
q, mod = divmod(N, A+B)

if mod > A:
  print((q+1)*A)
else :
  print(q*A+mod)

Fixed submission:
N, A, B = map(int, input().split())
q, mod = divmod(N, A+B)
if mod >= A:
	print(q*A+A)
else: 
	print(q*A+mod)
Buggy python submission (verdict: Runtime Error):
S = input()

counter = 1
yorn = 1
for foot in S:
    if foot == 'R':
        if counter % 2 == 0:
            yorn=0
            break
    elif foot == 'L':
        if counter % 2 == 1:
            yorn = 0
            break
    counter++

if yorn == 1:
    print("Yes")
else:
    print("No")



Fixed submission:
S = input()

counter = 1
yorn = 1
for foot in S:
    if foot == 'R':
        if counter % 2 == 0:
            yorn=0
            break
    elif foot == 'L':
        if counter % 2 == 1:
            yorn = 0
            break
    counter+=1

if yorn == 1:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N,M = map(int, input().split())
A = list(map(int, input().split()))
for i in range(M):
    max_A = max(A)
    num_A= A.index(max_A)
    A[num_A] = max_A // 2

print(sum(A))



Fixed submission:
import heapq as hq
N,M = map(int, input().split())
A =[-x for x in map(int, input().split())]

hq.heapify(A)
for i in range(M):
    m = A[0]
    hq.heappushpop(A, -((-m)//2))
print(-sum(A))

Buggy python submission (verdict: Time Limit Exceeded):
N,M = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)
for i in range(M):
    fir = A[0] // 2
    if N != 1:
        for i in range(1, N):
            if fir < A[i]:
                A[i-1]=A[i]
                if i == N-1:
                    A[i] = fir
            else:
                A[i-1]=fir
                break
    else:
        A[0] = fir

print(sum(A))



Fixed submission:
import heapq as hq
N,M = map(int, input().split())
A =[-x for x in map(int, input().split())]

hq.heapify(A)
for i in range(M):
    m = A[0]
    hq.heappushpop(A, -((-m)//2))
print(-sum(A))

Buggy python submission (verdict: Time Limit Exceeded):
N,M = map(int, input().split())
A = list(map(int, input().split()))
for i in range(M):
    A.sort(reverse=True)
    A[0] = A[0] // 2
print(sum(A))



Fixed submission:
import heapq as hq
N,M = map(int, input().split())
A =[-x for x in map(int, input().split())]

hq.heapify(A)
for i in range(M):
    m = A[0]
    hq.heappushpop(A, -((-m)//2))
print(-sum(A))
Buggy python submission (verdict: Runtime Error):
N = int(input())
l = [list(map(int, input().split())) for i in range(n)]
l.sort(key= x:x[1])
t=0
for i in l:
    a,b=i
    t+=a
    if(t>b):
        print("No")
        break
    else:
        print("Yes")


Fixed submission:
S = input()
n=0
b=0
while n<3 :
    if S[n]==S[n+1]:
        b=1
    n+=1
if b==1:
    print("Bad")
else:
    print("Good")
Buggy python submission (verdict: Runtime Error):
N = int(input())
l = [list(map(int, input().split())) for i in range(n)]
l.sort(key= lambda x:x[1])
t=0
for i in l:
    a,b=i
    t+=a
    if(t>b):
        print("No")
        break
    else:
        print("Yes");


Fixed submission:
N = int(input())
l = [list(map(int, input().split())) for i in range(N)]
l.sort(key= lambda x:x[1])
t=0
cnt=0
for i in l:
    cnt+=1
    a,b=i
    t+=a
    if(t>b):
        print("No")
        break
    elif cnt==N:
        print("Yes");

Buggy python submission (verdict: Runtime Error):
N = int(input())
l = [list(map(int, input().split())) for i in range(n)]
l.sort(key= x:x[1])
t=0
for i in l:
    a,b=i
    t+=a
    if(t>b):
        print("No")
        break
    else:
        print("Yes")


Fixed submission:
N = int(input())
l = [list(map(int, input().split())) for i in range(N)]
l.sort(key= lambda x:x[1])
t=0
cnt=0
for i in l:
    cnt+=1
    a,b=i
    t+=a
    if(t>b):
        print("No")
        break
    elif cnt==N:
        print("Yes");
Buggy python submission (verdict: Runtime Error):
N, X = map(int, input().split())

L = [int(i) for i in input().split()]

d=0
for i in range(N+1):
    if d>X :
        print(i)
        break
    if i == N :
        print(i+1)
    d += L[i]


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

L = [int(i) for i in input().split()]

d=0
for i in range(N):
    d += L[i]
    if d>X :
        print(i+1)
        break
    if i == N-1 :
        print(N+1)
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
def fib(n) :
    if n==1 :
        return 1
    elif n==0 :
        return 1
    else :
        return fib(n-1) + fib(n-2)
a=[]
b=1

for i in range(M):
    a.append(int(input()))
    if a[i]-a[i-1] == 1 :
        b=0

def rest(num) :
    return num % 1000000007
c=0
if b==0 :
    print(c)
else :
    for i in range(M+1):
        if i == 0 == M :
            c += rest(fib(N))
        elif i == 0:
            c += rest(fib(a[i]-1))
        elif i == M:
            c = rest(c * fib(N-a[i-1]-1))
        else :
            c = rest(c * fib(a[i]-a[i-1]-2))
    print(c)


Fixed submission:
N, M = map(int, input().split())
def fib(n) :
    a, b = 1, 1
    if n==0 :
        return a
    elif n==1 :
        return b
    else :
        for i in range(n-1):
            a, b = b, a+b
        return b
a=[]
b=1

for i in range(M):
    a.append(int(input()))
    if a[i]-a[i-1] == 1 :
        b=0

def rest(num) :
    return num % 1000000007
c=0
if b==0 :
    print(c)
else :
    for i in range(M+1):
        if i == 0 == M :
            c += rest(fib(N))
        elif i == 0:
            c += rest(fib(a[i]-1))
        elif i == M:
            c = rest(c * fib(N-a[i-1]-1))
        else :
            c = rest(c * fib(a[i]-a[i-1]-2))
    print(c)

Buggy python submission (verdict: Runtime Error):
nm = [int(s) for s in input().split()]


def fib(n) :
    if n==1 :
        return 1
    elif n==0 :
        return 1
    else :
        return fib(n-1) + fib(n-2)
a=[]
b=1
for i in range(nm[1]):
    a.append(int(input()))
    if a[i]-a[i-1] == 1 :
        b=0

def rest(num) :
    return num % 1000000007
c=0
if b==0 :
    print(c)
else :
    for i in range(nm[1]+1):
        if i == 0:
            c += rest(fib(a[i]-1))
        elif i == nm[1]:
            c = rest(c * fib(nm[0]-a[i-1]-1))
        else :
            c = rest(c * fib(a[i]-a[i-1]-2))
    print(c)


Fixed submission:
N, M = map(int, input().split())
def fib(n) :
    a, b = 1, 1
    if n==0 :
        return a
    elif n==1 :
        return b
    else :
        for i in range(n-1):
            a, b = b, a+b
        return b
a=[]
b=1

for i in range(M):
    a.append(int(input()))
    if a[i]-a[i-1] == 1 :
        b=0

def rest(num) :
    return num % 1000000007
c=0
if b==0 :
    print(c)
else :
    for i in range(M+1):
        if i == 0 == M :
            c += rest(fib(N))
        elif i == 0:
            c += rest(fib(a[i]-1))
        elif i == M:
            c = rest(c * fib(N-a[i-1]-1))
        else :
            c = rest(c * fib(a[i]-a[i-1]-2))
    print(c)
Buggy python submission (verdict: Runtime Error):
    s = input()[8]
    print('A' + s + 'C')

Fixed submission:
s = input()[8]
print('A' + s + 'C')
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
import sys


def main(argv=sys.argv):
  N, K = map(int, input().split())
  print(K * ((K - 1) ** (N - 1)))

  
  
  return 0
  
  
if __name__ == '__main__':
  sys.exit(main())
  

Fixed submission:
# coding: utf-8
 
 
def main():
 
    penki_list = input().split(' ')

    # setは重複する要素を持たない→複数のデータをまとめる
    # lenは要素の数
    print(len(set(penki_list)))
 
    return 0
 
 
if __name__ == '__main__':
    main()