Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
l=[[0][0] for _ in range(n+1)]
p=0
for _ in range(m):
  a,b=list(input().split())
  if str(b)=="AC" and l[int(a)][0]==0:
    l[int(a)][0]=1
    p+=l[int(a)][1]
  elif str(b)=="WA" and l[int(a)]==0:
    l[int(a)][1]+=1
print(l.count(1),p)

Fixed submission:
n,m=map(int,input().split())
l=[0]*(n+1)
p=0
for _ in range(m):
  a,b=list(input().split())
  if str(b)=="AC" and l[int(a)]!=-1:
    p+=l[int(a)]
    l[int(a)]=-1
  elif str(b)=="WA" and l[int(a)]!=-1:
    l[int(a)]+=1
print(l.count(-1),p)

Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
l = [input().split() for _ in range(m)]
 
o = [l[i][0] for i in range(m)]
p = list(set(o))

t,f = 0,0
for i in p:
  q = [l[j][1] for j in range(m) if l[j][0] == i ]
  if q.count("AC") == 0:
    pass
  else:
    t = t + 1
    f = f + q.index("AC")
print(t,f)

Fixed submission:
n,m=map(int,input().split())
l=[0]*(n+1)
p=0
for _ in range(m):
  a,b=list(input().split())
  if str(b)=="AC" and l[int(a)]!=-1:
    p+=l[int(a)]
    l[int(a)]=-1
  elif str(b)=="WA" and l[int(a)]!=-1:
    l[int(a)]+=1
print(l.count(-1),p)

Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
l = [input().split() for _ in range(m)]
 
o = [l[i][0] for i in range(m)]
p = list(set(o))

t = 0
f = 0
 
for i in p:
  q = [l[j][1] for j in range(m) if l[j][0] == i ]
  if q.count("AC") == 0:
    pass
  else:
    t = t + 1
    f = f + q.index("AC")
print(t,f)

Fixed submission:
n,m=map(int,input().split())
l=[0]*(n+1)
p=0
for _ in range(m):
  a,b=list(input().split())
  if str(b)=="AC" and l[int(a)]!=-1:
    p+=l[int(a)]
    l[int(a)]=-1
  elif str(b)=="WA" and l[int(a)]!=-1:
    l[int(a)]+=1
print(l.count(-1),p)

Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
l = [input().split() for _ in range(m)]

o = [l[i][0] for i in range(m)]
p = list(set(o))

t = 0
f = 0

for i in p:
  q = [l[j][1] for j in range(m) if l[j][0] == i ]
  tf = q.count("AC")
  if tf != 0:
    t = t + 1
  d = q.index("AC")
  f = f + d
print(t,f)

Fixed submission:
n,m=map(int,input().split())
l=[0]*(n+1)
p=0
for _ in range(m):
  a,b=list(input().split())
  if str(b)=="AC" and l[int(a)]!=-1:
    p+=l[int(a)]
    l[int(a)]=-1
  elif str(b)=="WA" and l[int(a)]!=-1:
    l[int(a)]+=1
print(l.count(-1),p)

Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
l = [input().split() for _ in range(m)]

t = 0
f = 0
for i in range(n):
  q = [l[j][1] for j in range(m) if l[j][0] == str(i+1)]
  if q.count("AC") != 0:
    t = t + 1
  a = q.index("AC")
  f = f + q[0:a].count("WA")
print(t,f)

Fixed submission:
n,m=map(int,input().split())
l=[0]*(n+1)
p=0
for _ in range(m):
  a,b=list(input().split())
  if str(b)=="AC" and l[int(a)]!=-1:
    p+=l[int(a)]
    l[int(a)]=-1
  elif str(b)=="WA" and l[int(a)]!=-1:
    l[int(a)]+=1
print(l.count(-1),p)
Buggy python submission (verdict: Runtime Error):
import numpy as np
n = int(stdin.readline().rstrip())
a = np.array([stdin.readline().rstrip().split() for _ in range(n)])
x = [stdin.readline().rstrip() for _ in range(n)][0]

i = np.where(a[:,0] == x)[0][0]
b = a[i+1:,1]
b = [int(i) for i in b]
print(sum(b))

Fixed submission:
from sys import stdin
n = int(stdin.readline().rstrip())
a = [stdin.readline().rstrip().split() for _ in range(n)]
x = [stdin.readline().rstrip() for _ in range(n)][0]

k = 0
for i in range(len(a)):
  name = a[i][0]
  time = a[i][1]
  if name == x:
    k = i
  else:
    pass
s = 0 
for i in range(len(a)):
  if i <= k:
    pass
  else:
    s = s + int(a[i][1])
print(s)
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=str(input())
for _ in range(n-1):
  s = s + str(input())
n=s.count("ABC")
print(n)

Fixed submission:
n=int(input())
s=str(input())
print(s.count("ABC"))
Buggy python submission (verdict: Runtime Error):
def main():
    from math import gcd, ceil

    n, m, *a = map(int, open(0).read().split())
    b = [0 for _ in range(n)]
    a.sort()

    for i, j in enumerate(a):
        c = 0
        while j % 2 == 0:
            c += 1
            j = j // 2
        a[i] = j
        b[i] = c

    if len(set(b)) > 1:
        print(0)
        exit()

    lcm = 1
    for i in a:
        lcm = (lcm * i) // gcd(lcm, i)

    k = b[0] - 1
    ans = ceil(m // 2 ** k // lcm / 2)
    print(ans)


if __name__ == "__main__":
    main()


Fixed submission:
def main():
    from fractions import gcd
    from math import ceil

    n, m, *a = map(int, open(0).read().split())
    b = [0 for _ in range(n)]
    a.sort()

    for i, j in enumerate(a):
        c = 0
        while j % 2 == 0:
            c += 1
            j = j // 2
        a[i] = j
        b[i] = c

    if len(set(b)) > 1:
        print(0)
        exit()

    lcm = 1
    for i in a:
        lcm = (lcm * i) // gcd(lcm, i)

    k = b[0] - 1
    ans = ceil(m // 2 ** k // lcm / 2)
    print(ans)


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
a, b = map(input())
print(a+b)

Fixed submission:
a,b = map(str,input().split())
print(b+a)
Buggy python submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
if a+b-k =< 0;
	print(0)
else ;
	print(a+b-k)

Fixed submission:
a,b,k = map(int,input().split())
if a+b-k <= 0:
  print(0,0)
elif a-k <= 0:
  print(0,b+a-k)
else:
  print(a-k,b)

Buggy python submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
if a-k >= 0;
	print(a)
elif  a+b-k=< 0;
	print(0)
else;
	print(0)

Fixed submission:
a,b,k = map(int,input().split())
if a+b-k <= 0:
  print(0,0)
elif a-k <= 0:
  print(0,b+a-k)
else:
  print(a-k,b)

Buggy python submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
if a-k >= 0;
  print(a)
elif  a+b-k=< 0;
	print(0)
else;
	print(0)

Fixed submission:
a,b,k = map(int,input().split())
if a+b-k <= 0:
  print(0,0)
elif a-k <= 0:
  print(0,b+a-k)
else:
  print(a-k,b)
Buggy python submission (verdict: Runtime Error):
x = int(input())
a = False
while a = True:
  b = range(x) + 1
  c = x/b
  d = [d.is_integer() for d in c[1:-1]]
  if not any(d):
    a = True
    break    
  else:
    x = x + 1
print(x)

Fixed submission:
x = int(input())
a = False
while a == False:
  b = list(range(1,x) ) 
  c = [x/c for c in b]
  d = [d.is_integer() for d in c[1:-1]]
  if not any(d):
    a = True
    break    
  else:
    x = x + 1
print(x)

Buggy python submission (verdict: Runtime Error):
x = int(input())
a = False
while a = True:
  b = range(x) + 1
  c = x/b
  d = [d.is_integer() for d in c[1:-1]]
  if any(d):
    x = x + 1
  else:
    a = True
    break
print(x)

Fixed submission:
x = int(input())
a = False
while a == False:
  b = list(range(1,x) ) 
  c = [x/c for c in b]
  d = [d.is_integer() for d in c[1:-1]]
  if not any(d):
    a = True
    break    
  else:
    x = x + 1
print(x)

Buggy python submission (verdict: Runtime Error):
x = int(input())
a = False
while a = True:
  b = range(x) + 1
  c = x/b
  d = [d.is_integer() for d in c[1:-1]]
  if any(d):
    a = True
    break
  x = x + 1
print(x)

Fixed submission:
x = int(input())
a = False
while a == False:
  b = list(range(1,x) ) 
  c = [x/c for c in b]
  d = [d.is_integer() for d in c[1:-1]]
  if not any(d):
    a = True
    break    
  else:
    x = x + 1
print(x)
Buggy python submission (verdict: Runtime Error):
import math
a,b=map(int,input().split())
gcd=math.gcd(a,b)
print(a*b//gcd)

Fixed submission:
import fractions
a,b=map(int,input().split())
gcd=fractions.gcd(a,b)
print(a*b//gcd)

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

Fixed submission:
import fractions
a,b=map(int,input().split())
gcd=fractions.gcd(a,b)
print(a*b//gcd)
Buggy python submission (verdict: Runtime Error):
s = sum(list(map(int,input().split())))
print("bust" if s s>21 else "win")

Fixed submission:
s = sum(list(map(int,input().split())))
print("bust" if s>21 else "win")
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n, *a = map(int, open(0).read().split())
    m = max(a)
    l = len(bin(m)) - 2
    y = [list(bin(i)[2:].zfill(l)) for i in a]

    mod = 10 ** 9 + 7
    ans = 0
    for i, j in enumerate(zip(*y)):
        o = j.count('1')
        z = n - o
        ans += z * o * pow(2, l - i - 1, mod)
        ans %= mod

    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    from itertools import zip_longest
    n, *a = map(lambda x: bin(int(x))[2:][::-1], open(0).read().split())
    n = int('0b' + n[::-1], 2)

    mod = 10 ** 9 + 7
    ans = 0
    
    for i, j in enumerate(zip_longest(*a)):
        o = j.count('1')
        z = n - o
        ans += z * o * pow(2, i, mod)
        ans %= mod

    print(ans)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split()),map(int,input().split())
print("0" if a==c else "1")

Fixed submission:
a,b=map(int,input().split())
c,d=map(int,input().split())
print("0" if a==c else "1")
Buggy python submission (verdict: Runtime Error):
x=int(input())
if x<100:
  print(0)
  exit()
DP=[False]*(x+1)
for i in range(x+1):
  coin=list(range(100,106,1))
  if i in coin:
    DP[i]=True
    continue
  DP[i]=True if any(DP[i-m] for m in coin) else False
print(1 if DP[x]==True else 0)

Fixed submission:
x=int(input())
if x<100:
  print(0)
  exit()
elif 100<=x<=105:
  print(1)
  exit()
else:
  DP=[False]*(x+1)
  for i in range(x+1):
    coin=list(range(100,106,1))
    if i in coin:
      DP[i]=True
      continue
    DP[i]=True if any(DP[i-m] for m in coin) else False
  print(1 if DP[x]==True else 0)

Buggy python submission (verdict: Runtime Error):
x=int(input())
DP=[False]*(x+1)
for i in range(x+1):
  coin=list(range(100,106,1))
  if i in coin:
    DP[i]=True
    continue
  DP[i]=True if any(DP[i-m] for m in coin) else False
print(1 if DP[x]==True else 0)

Fixed submission:
x=int(input())
if x<100:
  print(0)
  exit()
elif 100<=x<=105:
  print(1)
  exit()
else:
  DP=[False]*(x+1)
  for i in range(x+1):
    coin=list(range(100,106,1))
    if i in coin:
      DP[i]=True
      continue
    DP[i]=True if any(DP[i-m] for m in coin) else False
  print(1 if DP[x]==True else 0)
Buggy python submission (verdict: Runtime Error):
def main():
    import sys
    import bisect


    n = int(input())
    a = list(map(int, sys.stdin.readline().split()))

    b = list(accumulate(a))
    l = b[-1]
    i = bisect.bisect(b, l // 2)
    ans = min(abs(l - 2 * b[i - 1]), abs(l - 2 * b[i]))
    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    import sys
    from itertools import accumulate

    n = int(input())
    a = list(map(int, sys.stdin.readline().split()))

    b = list(accumulate(a))
    diff = b[-1]
    total = b[-1]
    for x in b:
        diff = min(diff, abs(total - 2 * x))
    print(diff)

if __name__ == '__main__':
     main()

Buggy python submission (verdict: Runtime Error):
def main():
    import sys
    import bisect
    from itertools import accumulate

    n = int(input())
    a = list(map(int, sys.stdin.readline().split()))

    b = list(accumulate(a))
    l = b[-1]
    i = bisect.bisect_left(b, l // 2)
    ans = min(abs(l - 2 * b[i]), abs(l - 2 * b[i + 1]))
    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    import sys
    from itertools import accumulate

    n = int(input())
    a = list(map(int, sys.stdin.readline().split()))

    b = list(accumulate(a))
    diff = b[-1]
    total = b[-1]
    for x in b:
        diff = min(diff, abs(total - 2 * x))
    print(diff)

if __name__ == '__main__':
     main()
Buggy python submission (verdict: Runtime Error):
def main():
  import sys
  n,*d=map(int,sys.stdin.buffer.read().split())
  e=[0]*n
  
  for i in d
  e[i]+=1
  
  a=e[0]
  
  for i in d[1:]:
    a=a*e[i-1]%998244353
    
  print(a)

if __name__=="__main__":
  main()

Fixed submission:
def main():
  import sys
  n,*d=map(int,sys.stdin.buffer.read().split())
  e=[0]*n
  
  for i in d:
    e[i]+=1
  
  a=e[0]
  
  for i in d[1:]:
    a=a*e[i-1]%998244353
    
  print(a)
  
if __name__=="__main__":
  main()
Buggy python submission (verdict: Time Limit Exceeded):
from itertools import groupby
s=list(input())
ans=[0]
for k,v in groupby(s):
  d=len(list(v))
  x= -1 if k==">" else 1 
  ad=list(range(d+1))[::x]
  ans=ans[:-1]+[max(ans[-1],ad[0])]+ad[1:]
print(sum(ans))  

Fixed submission:
from itertools import groupby

s = list(input())
f = 0
ans = 0
for k,v in groupby(s):
  d = len(list(v))
  left = d if k==">" else 0
  right = d if k=="<" else 0
  if f>left:
    ans += d*(d+1)//2 - left
  else:
    ans += -1*f + d*(d+1)//2  
  f = right 
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import groupby
s=list(input())
ans=[0]
for k,v in groupby(s):
  d=len(list(v))
  x= -1 if k==">" else 1 
  ad=list(range(d+1))[::x]
  ans=ans[:-1]+[max(ans[-1],ad[0])]+ad[1:]
print(sum(ans))  

Fixed submission:
from itertools import groupby

s = list(input())
f = 0
ans = 0
for k,v in groupby(s):
  d = len(list(v))
  left = d if k==">" else 0
  right = d if k=="<" else 0
  if f>left:
    ans += d*(d+1)//2 - left
  else:
    ans += -1*f + d*(d+1)//2  
  f = right 
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
print("1" if 1<=a,b<=9 else "-1")

Fixed submission:
a,b=map(int,input().split())
f= 0<a<10 and 0<b<10
print(a*b if f is True else "-1")
Buggy python submission (verdict: Runtime Error):
def p(n):
    i = 2
    t = []
    while i * i <= n:
        while n % i == 0:
            n //= i
            t.append(i)
        i += 1
    if n > 1:
        t.append(n)
    return t


def main():
    from math import gcd
    a, b = map(int, input().split())
    g = gcd(a, b)
    print(len(set(p(g))) + 1)


if __name__ == '__main__':
    main()


Fixed submission:
def p(n):
    i = 2
    t = []
    while i * i <= n:
        while n % i == 0:
            n //= i
            t.append(i)
        i += 1
    if n > 1:
        t.append(n)
    return t


def main():
    from fractions import gcd
    a, b = map(int, input().split())
    g = gcd(a, b)
    print(len(set(p(g))) + 1)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
s,t=list(input()),list(input())
print(sum(s==t))

Fixed submission:
s,t=list(input()),list(input())
print(sum(x==y for x,y in zip(s,t)))
Buggy python submission (verdict: Runtime Error):
def main():
  
  n,k=map(int,input().split())
  a=list(map(int,input().split()))
  
  count=lambda arr,now:sum(element<now for element in arr)
  b=[[count(a[:i],a[i]),count(a[i+1:],a[i])] for i in range(n)]

  ans=0
  prime=10**9+7
  
  for x in b:
    left=x[0]
    right=x[1]
    res=(k-1)*k//2*(right+left)+right*k
    ans+=res%prime
    
  print(ans%prime)

  if __name__=="__main__":
  main()

Fixed submission:
def main():
  
  n,k=map(int,input().split())
  a=list(map(int,input().split()))
  
  count=lambda arr,now:sum(element<now for element in arr)
  b=[[count(a[:i],a[i]),count(a[i+1:],a[i])] for i in range(n)]

  ans=0
  prime=10**9+7
  
  for x in b:
    left=x[0]
    right=x[1]
    res=(k-1)*k//2*(right+left)+right*k
    ans+=res%prime
    
  print(ans%prime)

if __name__=="__main__":
  main()
Buggy python submission (verdict: Runtime Error):
n=int(input())
b=0
for _ in range(n):
  b+=1/int(input())
print(1/b)

Fixed submission:
n=int(input())
l = list(map(int,input().split()))
b = sum([1/x for x in l])
print(1/b)
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    from collections import deque
    n, m, *ab = map(int, open(0).read().split())
    job = [[] for _ in range(1 + max(ab))]
    for i, j in zip(*[iter(ab)] * 2):
        job[i].append(j)

    ans = 0
    t = []
    for i in range(1, m + 1):
        t += job[i]
        if len(t) == 0:
            continue
        else:
            m = max(t)
            t.remove(m)
            ans += m

    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    import heapq
    n, m, *ab = map(int, open(0).read().split())
    l = [[] for _ in range(m + 1)]
    for i, j in zip(*[iter(ab)] * 2):
        if i <= m:
            l[i].append(-j)

    ans = 0
    h = []
    for i in range(1, m + 1):
        g = l[i]
        for j in g:
            heapq.heappush(h, j)
        if len(h) > 0:
            x = heapq.heappop(h)
            ans += x

    print(-ans)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
n=str(input())
l=len(n)
ans=0
while(l>0):
  if l%2==1 and l==len(n):
    ans+=n-10**(l-1)+1
  elif l%2==1:
    ans+=9*10**(l-1)
  l-=1
print(ans)

Fixed submission:
n=str(input())
l=len(n)
ans=0
while(l>0):
  if l%2==1 and l==len(n):
    ans+=int(n)-10**(l-1)+1
  elif l%2==1:
    ans+=9*10**(l-1)
  l-=1
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
print((a+b)//2 if (a+b)%2=0 else "IMPOSSIBLE")

Fixed submission:
a,b=map(int,input().split())
print((a+b)//2 if (a+b)%2==0 else "IMPOSSIBLE")
Buggy python submission (verdict: Runtime Error):
n=int(input())
l=list(map(int,input().split()))
m=sum([i!=l[i] for i in range(1,n+1)])
print("YES" if m==0 or m==2 else "NO")

Fixed submission:
n=int(input())
l=list(map(int,input().split()))
m=sum([(i+1)!=l[i] for i in range(n)])
print("YES" if m==0 or m==2 else "NO")
Buggy python submission (verdict: Runtime Error):
def main():
  import sys
  n = int(input())
  a = list(map(int.sys.stdin.readline().split()))
  b = list(map(int.sys.stdin.readline().split()))
  
  count=0
  
  for i in range(n):
    c1 = a[i] 
    c2 = a[i+1]
    h = b[i]
    ans+=min(c1,h)  
    if h>c1:
        ans+=min(h-c1,c2)
        a[i+1]=max(0,c2-(h-c1))

  print(ans)
  
if __name__=="__main__":
  main()

Fixed submission:
def main():
  import sys
  n = int(input())
  a = list(map(int,sys.stdin.readline().split()))
  b = list(map(int,sys.stdin.readline().split()))
  
  count=0
  
  for i in range(n):
    c1 = a[i] 
    c2 = a[i+1]
    h = b[i]
    count+=min(c1,h)  
    if h>c1:
        count+=min(h-c1,c2)
        a[i+1]=max(0,c2-(h-c1))
 
  print(count)
  
if __name__=="__main__":
  main()
Buggy python submission (verdict: Runtime Error):
def main():
    n, *a = map(int, open(0).read().split())
    m = [0] * (n + 1)
    res = []
    for i in range(n, 0, -1):
        x = a[i - 1] % 2
        y = m[i] % 2
        if x != y:
            res.append(i)
            c = i // 2
            j = 1
            while j < c:
                if i % j == 0:
                    res[j] += 1
                j += 1

    m = len(res)
    print(m)
    if m == 1:
        print(res[0])
    elif m > 1:
        l = ' '.join(map(str, res))
        print(l[::-1])


if __name__ == '__main__':
    main()


Fixed submission:
def solve():
    N, *a_l = map(int, open(0).read().split())
    a_l = [0] + a_l

    for i in range(N//2, 0, -1):
        a_l[i] = sum(a_l[i::i]) % 2

    b_l = [i for i, x in enumerate(a_l) if x]

    print(len(b_l))
    if len(b_l) != 0:
        print(' '.join(map(str, b_l)))


if __name__ == '__main__':
    solve()
Buggy python submission (verdict: Runtime Error):
def main():
  import itertools
  
  L,R=map(int,input().split())
  if R<45:
    print(L*(L+1))
    exit()
  elif L<=2019 and 2019<=R:
    print(0)
    exit()
  else:
    z=range(L,R+1)
    ans=float("inf")
    for i,j in itertools.combinations(z,2):
      if (i*j)%2019==0:
        print(0)
        break
      else:
        ans=min(ans,(i*j)%2019)
    else:
      print(ans)
  
if __name__=="__main__":
  main()

Fixed submission:
def main():
  
  L,R=map(int,input().split())
  x,y=L//2019,R//2019
  
  if y-x>=1:
    print(0)
    
  else:
    i=R
    k=1
    ans=float("inf")
    while(L<i):
      ans=min(ans,i*(i-k)%2019)
      if ans==0:
        print(0)
        break        
      k+=1
      if i-k<L:
        k=1
        i-=1
        
    else:
      print(ans)
      
if __name__=="__main__":
  main()
Buggy python submission (verdict: Runtime Error):
n,x=map(int,input().split())
l=list(map(int,input().split()))
i,d=0,0
while(x>d and i<=n+1):
  d+=l[i]
  i+=1
print(i)

Fixed submission:
n,x=map(int,input().split())
l=list(map(int,input().split()))
if sum(l)<=x:
  print(n+1)
  exit()
i,d=1,0
while(i<n):
  d+=l[i-1]
  if d<=x:
    i+=1
  else:
    break
print(i)
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
x=set(int(input()) for _ in range(m)
f=[0]*(n+1)
f[0]=1
for i in range(1,n+1):
  f[i]=(f[i-1]+f[i-2])%(10**9+7)
  if i in x:
    f[i]=0
print(f[n]%(10**9+7))

Fixed submission:
n,m=map(int,input().split())
x=set([int(input()) for _ in range(m)])
f=[0]*(n+1)
f[0]=1
for i in range(1,n+1):
  f[i]=f[i-1]+f[i-2]
  if i in x:
    f[i]=0
print(f[n]%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
x=[int(input()) for _ in range(m)]
f=[0]*(n+1)
f[0]=1
for i in range(1,n+1):
  f[i]=(f[i-1]+f[i-2])%(10**9+7)
  if i in x:
    f[i]=0
print(f[n]%(10**9+7))

Fixed submission:
n,m=map(int,input().split())
x=set([int(input()) for _ in range(m)])
f=[0]*(n+1)
f[0]=1
for i in range(1,n+1):
  f[i]=f[i-1]+f[i-2]
  if i in x:
    f[i]=0
print(f[n]%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
x=[int(input()) for _ in range(m)]
f=[0]*(n+1)
f[0]=1
for i in range(1,n+1):
  f[i]=f[i-1]+f[i-2]
  if i in x:
    f[i]=0
print(f[n]%(10**9+7))

Fixed submission:
n,m=map(int,input().split())
x=set([int(input()) for _ in range(m)])
f=[0]*(n+1)
f[0]=1
for i in range(1,n+1):
  f[i]=f[i-1]+f[i-2]
  if i in x:
    f[i]=0
print(f[n]%(10**9+7))
Buggy python submission (verdict: Runtime Error):
c=str(int(input())).count("x")
print("YES" if c<=7 else "NO")

Fixed submission:
c=str(input()).count("x")
print("YES" if c<=7 else "NO")
Buggy python submission (verdict: Runtime Error):
a,b=map(it,input().split())
p=0
if a>=13:
  p=b
elif a<=5:
  p=0
else:
  p=b//2
print(p)

Fixed submission:
a,b=map(int,input().split())
p=0
if a>=13:
  p=b
elif a<=5:
  p=0
else:
  p=b//2
print(p)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
s=str(input())
s[b-1]=s[b-1].lower()
print(s)

Fixed submission:
a,b=map(int,input().split())
s=list(input())
s[b-1]=(s[b-1]).lower()
print("".join(s))
Buggy python submission (verdict: Runtime Error):
import itertools
r,g,b,n=map(int,input().split())
x,y=n//r,n//g
x,y=list(range(0,r*x+1,r)),list(range(0,g*y+1,g))
l=[i+j for i,j in ()itertools.product(x,y) if i+j<n]
print(l)

Fixed submission:
import collections
import itertools
r,g,b,n=map(int,input().split())
x,y=n//r,n//g
x,y=list(range(0,r*x+1,r)),list(range(0,g*y+1,g))
l=[i+j for i,j in itertools.product(x,y) if i+j<=n]
z=collections.Counter(l)
count=0
for key,value in zip(z.keys(),z.values()):
  v=n-key
  if v==0:
    count+=value
  elif v%b==0:
    count+=value
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
r,g,b,n=map(int,input().split())
x,y=n//r,n//g
x,y=list(range(0,r*x+1,r)),list(range(0,g*y+1,g))
count=0
for i,j in list(itertools.product(x,y)):
  d=n-i-j
  if d<0:
    pass
  elif d==0:
    count+=1
  elif d%b==0:
    count+=1
print(count)

Fixed submission:
import collections
import itertools
r,g,b,n=map(int,input().split())
x,y=n//r,n//g
x,y=list(range(0,r*x+1,r)),list(range(0,g*y+1,g))
l=[i+j for i,j in itertools.product(x,y) if i+j<=n]
z=collections.Counter(l)
count=0
for key,value in zip(z.keys(),z.values()):
  v=n-key
  if v==0:
    count+=value
  elif v%b==0:
    count+=value
print(count)