Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
#!/use/bin/env python3

a = input()

ans = sum(range(1, int(a)))

print(ans)

Fixed submission:
#!/use/bin/env python3

a = input()

b = int(a)

ans = 0

if b != 2:
    if b % 2 == 1:
        ans = b * ((b - 1) // 2)
    else:
        ans = b * ((b - 1) // 2) + (b // 2)
else:
    ans = 1

print(ans)
Buggy python submission (verdict: Runtime Error):
def main():
    n = int(input())
    h_n = [int(s) for s in input().split()]

    for idx in range(1, n):
        diff = [h_n[idx] - h_n[i] for i in range(0, idx-1)]
        diff = filter(lambda x: x >= 0, diff)

    print(len(list(diff)) + 1)
    
main()

Fixed submission:
def main():
    n = int(input())
    h_n = [int(s) for s in input().split()]

    cnt = 0
    for i in range(0, n):
        diff = [h_n[i] - h_n[j] for j in range(0, i)]
        cnt = cnt + 1 if len(list(filter(lambda x: x < 0, diff))) == 0 else cnt

    print(cnt)

    
main()

Buggy python submission (verdict: Runtime Error):
def main():
    n = int(input())
    h_n = [int(s) for s in input().split()]

    for idx in range(1, n):
        diff = [h_n[idx] - h_n[i] for i in range(0, idx-1)]
        print(diff)
        diff = filter(lambda x: x >= 0, diff)

    print(len(list(diff)) + 1)
    
main()

Fixed submission:
def main():
    n = int(input())
    h_n = [int(s) for s in input().split()]

    cnt = 0
    for i in range(0, n):
        diff = [h_n[i] - h_n[j] for j in range(0, i)]
        cnt = cnt + 1 if len(list(filter(lambda x: x < 0, diff))) == 0 else cnt

    print(cnt)

    
main()
Buggy python submission (verdict: Runtime Error):
#!/use/bin/env python3

import math
from collections import defaultdict

(d, n) = [int(s) for s in input().split()]

ans = []

if d == 0:
    ans = range(1, 101)
elif d == 1:
    ans = range(100, 100 * 100 + 100, 100)
else:
    ans = range(10000, 100 * 100 * 100, 100 * 100)

print(ans[n - 1])

Fixed submission:
#!/use/bin/env python3

import math
from collections import defaultdict

(d, n) = [int(s) for s in input().split()]

ans = 0

if d == 0:
    ans = 1
elif d == 1:
    ans = 100
else:
    ans = 10000

ans = 101 * ans if n == 100 else n * ans

print(ans)
Buggy python submission (verdict: Runtime Error):
#!/use/bin/env python3

(n, k) = [int(s) for s in input().split()]
a = [int(s) for s in input().split()]

like = []

ans = n

while (1):

    c = True
    for ii in range(0, 4):
        b = n // pow(10, ii)
        d = b % 10

        if b == 0:
            break

        if d in a:
            c = False
            break

    if (c):
        ans = n
        break
    n += 1

print(ans)


Fixed submission:
#!/use/bin/env python3

a = [int(s) for s in input().split()]

b, c, d = sorted(a)

if b == 5 and c == 5 and d == 7:
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Time Limit Exceeded):
#!/use/bin/env python3

(n, k) = [int(s) for s in input().split()]
a = [int(s) for s in input().split()]

like = []

ans = n
while (1):

    c = True
    b = n
    while (b != 0):
        b = b // 10
        d = b % 10

        if d in a:
            c = False
            break

    if (c):
        ans = n
        break
    n += 1

print(ans)


Fixed submission:
#!/use/bin/env python3

(n, k) = [int(s) for s in input().split()]
a = [int(s) for s in input().split()]

like = []

ans = n
b = n
while (1):

    c = True
    b = n
    while (b != 0):
        d = b % 10
        b = b // 10

        if d in a:
            c = False
            break

    if (c):
        ans = n
        break
    n += 1

print(ans)

Buggy python submission (verdict: Runtime Error):
#!/use/bin/env python3

(n, k) = [int(s) for s in input().split()]
a = [int(s) for s in input().split()]

like = []

ans = n

while (1):

    c = True
    for ii in range(0, 4):
        b = b // 10
        d = b % 10

        if b == 0:
            break

        if d in a:
            c = False
            break

    if (c):
        ans = n
        break
    n += 1

print(ans)


Fixed submission:
#!/use/bin/env python3

(n, k) = [int(s) for s in input().split()]
a = [int(s) for s in input().split()]

like = []

ans = n
b = n
while (1):

    c = True
    b = n
    while (b != 0):
        d = b % 10
        b = b // 10

        if d in a:
            c = False
            break

    if (c):
        ans = n
        break
    n += 1

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
MOD = 998244353
N, S = map(int, input().split())
A = list(map(int, input().split()))

dp = [[0 for i in range(S + 1)] for j in range(N + 1)]

dp[0][0] = 1

for i in range(N):
    for j in range(S + 1):
        dp[i+1][j] += dp[i][j] * 2
        dp[i+1][j] %= MOD
        if j + A[i] <= S:
            dp[i + 1][j + A[i]] += dp[i][j]
            dp[i + 1][j + A[i]] %= MOD
print(dp[N][S])


Fixed submission:
MOD = 998244353
N, S = map(int, input().split())
A = list(map(int, input().split()))

dp = [[0 for i in range(S + 1)] for j in range(N + 1)]

dp[0][0] = 1

for i in range(N):
    for j in range(S + 1):
        dp[i+1][j] += dp[i][j] * 2
        dp[i+1][j] %= MOD
        if j + A[i] <= S:
            dp[i + 1][j + A[i]] += dp[i][j]
            dp[i + 1][j + A[i]] %= MOD
print(dp[N][S])

Buggy python submission (verdict: Time Limit Exceeded):
MOD = 998244353
N, S = map(int, input().split())
A = list(map(int, input().split()))

dp = [[0 for i in range(S + 1)] for j in range(N + 1)]

dp[0][0] = 1

for i in range(1, N + 1):
    for j in range(S + 1):
        dp[i][j] += dp[i - 1][j] * 2
        dp[i][j] %= MOD
        if j + A[i - 1] <= S:
            dp[i][j + A[i - 1]] += dp[i - 1][j]
            dp[i][j + A[i - 1]] %= MOD
print(dp[N][S])


Fixed submission:
MOD = 998244353
N, S = map(int, input().split())
A = list(map(int, input().split()))

dp = [[0 for i in range(S + 1)] for j in range(N + 1)]

dp[0][0] = 1

for i in range(N):
    for j in range(S + 1):
        dp[i+1][j] += dp[i][j] * 2
        dp[i+1][j] %= MOD
        if j + A[i] <= S:
            dp[i + 1][j + A[i]] += dp[i][j]
            dp[i + 1][j + A[i]] %= MOD
print(dp[N][S])

Buggy python submission (verdict: Time Limit Exceeded):
def sub_group(A):
    ret = []
    for i in range(1 << len(A)):
        output = []
        for j in range(len(A)):
            if ((i >> j) & 1) == 1:
                output.append(A[j])
        if output != []:
            ret.append(output)
    return ret

def f(X, validGroup):
    ret = 0
    pattern = sub_group(X)
    for candidate in pattern:
        if candidate in validGroup:
            ret += 1
    return ret

def main():
    MOD = 998244353
    n, s = map(int, input().split())
    a = [i for i in map(int, input().split())]
    
    validGroup = []
    sub_g = sub_group(a)
    for g in sub_g:
        if sum(g) == s:
            validGroup.append(g)

    ans = 0
    for g in sub_g:
        ans += f(g, validGroup)
    
    print(ans % MOD)


main()


Fixed submission:
MOD = 998244353
N, S = map(int, input().split())
A = list(map(int, input().split()))

dp = [[0 for i in range(S + 1)] for j in range(N + 1)]

dp[0][0] = 1

for i in range(N):
    for j in range(S + 1):
        dp[i+1][j] += dp[i][j] * 2
        dp[i+1][j] %= MOD
        if j + A[i] <= S:
            dp[i + 1][j + A[i]] += dp[i][j]
            dp[i + 1][j + A[i]] %= MOD
print(dp[N][S])
Buggy python submission (verdict: Runtime Error):
a, b = list(map(int, input().split()))

min = b - (a - 1)
max = b + (a - 1)

output = ''
for i in range(min, (max+1)):
  output += (i + ' ')

output.rstrip()

print(output)

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

min = b - (a - 1)
max = b + (a - 1)

output = ''
for i in range(min, (max+1)):
  hoge = str(i) + ' '
  output += hoge

output.rstrip()

print(output)

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

min = b - (a - 1)
max = b + (a - 1)

output = ''
for i in range(min, (max+1)):
  output += f'{i} '

output.rstrip()

print(output)

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

min = b - (a - 1)
max = b + (a - 1)

output = ''
for i in range(min, (max+1)):
  hoge = str(i) + ' '
  output += hoge

output.rstrip()

print(output)

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

min = b - (a - 1)
max = b + (a - 1)

output = ''
for i in range(min, max):
  output += f'{i} '

output.rstrip()

print(output)

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

min = b - (a - 1)
max = b + (a - 1)

output = ''
for i in range(min, (max+1)):
  hoge = str(i) + ' '
  output += hoge

output.rstrip()

print(output)
Buggy python submission (verdict: Runtime Error):
input_yen = int(input())
unit_yen = 1000

required_bill = int(float(input_yen)/unit_yen) * unit_yen
return required_bill - input_yen

Fixed submission:
input_yen = int(input())
unit_yen = 1000

required_bill = int(float(input_yen)/unit_yen + (float(input_yen) % unit_yen > 0)) * unit_yen
print(required_bill - input_yen)
Buggy python submission (verdict: Runtime Error):
#ABC 171 C - One Quadrillion and One Dalmatians 10:59

n = int(input())
q = []
while n > 0:
    v = n % 26
    q.append(v)
    n //= 26

res = ''
dic = {1: 'a', 2:'b', 3:'c', 4:'d', 5:'e', 6:'f', 7:'g', 8:'h', 9:'i',
      10:'j', 11:'k', 12:'l', 13:'m', 14:'n', 15:'o', 16:'p', 17:'q',
      18:'r', 19:'s', 20:'t', 21:'u', 22:'v', 23:'w', 24:'x', 25:'y', 26:'z'}

for i in reversed(q):
    res += dic[i]

print(res)

Fixed submission:
#ABC 171 C - One Quadrillion and One Dalmatians 10:59

n = int(input())
res =''
while n > 0:
    n -= 1
    res += chr(ord('a') + n % 26)
    n //= 26
print(res[::-1])
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline


n = int(input())
up = 10**18
l = list(map(int, input().split()))

if 0 in l:
    print(0)
else:
    ans = 1
    for i in l:
        ans *= i
    
    if ans > up:
        print(-1)
    else:
        print(ans)

Fixed submission:
import sys
input = sys.stdin.readline


n = int(input())
up = 10**18
l = list(map(int, input().split()))

if 0 in l:
    print(0)
else:
    ans = 1
    for i in l:
        ans *= i
        if ans > up:
            print(-1)
            break
    else:
        print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline


n = int(input())
up = 10**18
l = list(map(int, input().split()))

ans = 1
for i in l:
    ans *= i
    if i == 0:
        ans = 0
        break
    
if ans > up:
    print(-1)
else:
    print(ans)

Fixed submission:
import sys
input = sys.stdin.readline


n = int(input())
up = 10**18
l = list(map(int, input().split()))

if 0 in l:
    print(0)
else:
    ans = 1
    for i in l:
        ans *= i
        if ans > up:
            print(-1)
            break
    else:
        print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline


n = int(input())
up = 10**18
l = list(map(int, input().split()))

ans = 1
for i in l:
    ans *= i
    if i == 0:
        ans = 0
        break
    
if ans > up:
    print(-1)
else:
    print(ans)

Fixed submission:
import sys
input = sys.stdin.readline


n = int(input())
up = 10**18
l = list(map(int, input().split()))

if 0 in l:
    print(0)
else:
    ans = 1
    for i in l:
        ans *= i
        if ans > up:
            print(-1)
            break
    else:
        print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
up = 10**18
l = list(map(int, input().split()))

ans = 1
for i in l:
    ans *= i
    if i == 0:
        ans = 0
        break
    
if ans > up:
    print(-1)
else:
    print(ans)

Fixed submission:
import sys
input = sys.stdin.readline


n = int(input())
up = 10**18
l = list(map(int, input().split()))

if 0 in l:
    print(0)
else:
    ans = 1
    for i in l:
        ans *= i
        if ans > up:
            print(-1)
            break
    else:
        print(ans)
Buggy python submission (verdict: Runtime Error):
import sys

X = int(input())
a = [i for i in range(-10,101)]
b = [i for i in range(-10, 101)]

for i in a:
    for k in b:
        if i**5 == X + k**5
            print(i,k)
            sys.exit()


Fixed submission:

import sys

X = int(input())
a = [i for i in range(-119, 120)]
b = [i for i in range(-119, 120)]

for i in a:
    for k in b:
        if i**5 == X + k**5:
            print(i,k)
            sys.exit()
Buggy python submission (verdict: Time Limit Exceeded):
# ABC 165 D - Floor Function

a,b,n = map(int, input().split())
l =[(int((a/b)*(i+1)) - a*int((i+1)/b)) - (int((a/b)*(i)) - a*int((i)/b)) for i in range(1, n+1)]

left = 0
right = n-1
mid = (left+right)//2

while right - left > 1:
    if l[mid] <= 0:
        right = mid
        mid = (left+right)//2
    else:
        left = mid
        mid = (left+right)//2

res = right +1
print((int((a/b)*(res)) - a*int((res)/b)))

Fixed submission:
# ABC 165 D - Floor Function

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

def func(i):
    return int(i*a/b) - a*int(i/b)

print(func(min(b-1, n)))
Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

k = int(input())
total = 0
for a in range(1,k+1):
    for b in range(1,k+1):
        for c in range(1,k+1):
            total += gcd(a, b, c)
print(total)

Fixed submission:
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)


k = int(input())
total = 0
for a in range(1,k+1):
    for b in range(1,k+1):
        for c in range(1,k+1):
            total += gcd(a, b, c)
print(total)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()
count =0
for i in range(n):
    for j in range(i + 1, n):
        for k in range(j + 1, n):
            if s[i] != s[j] and s[j] != s[k] and s[k] != s[i]:
                if j - i != k - j:
                    count +=1
print(count)

Fixed submission:
import sys
input = sys.stdin.readline

n=int(input())
s=input()

r=s.count('R')
g=s.count('G')
b=s.count('B')

ans=r*g*b

for i in range(n):
    for d in range(n):
        j=i+d
        k=j+d
        if k>=n: break
        if s[i]!=s[j] and s[j]!=s[k] and s[k]!=s[i]:
            ans-=1

print(ans)
Buggy python submission (verdict: Runtime Error):
k = str(input())
list = []
def lunlun(k):
    for i in range(len(k) - 1):
        if abs(int(k[i]) - int(k[i+1])) > 1:
            return False
            break
    return True

i = 1
while len(list) == int(k):
    if lunlun(i):
        list.append(i)
    i += 1

print(lunlun(len(k)))

Fixed submission:
import sys
sys.setrecursionlimit(10**7) #再帰関数の呼び出し制限

K = int(input())

l = [1,2,3,4,5,6,7,8,9] #１桁のルンルン数
ln = [1,2,3,4,5,6,7,8,9] #既にわかっている分をセット。重複がいやなのでset

def dfs(i):
    n = int(str(i)[-1]) #1桁目を取る
    a,b,c = n-1, n, n+1 #差の絶対値が１未満、-1/+0/+1
    if a != -1:
        ln.append(i*10+a)
    ln.append(i*10+b)
    if c != 10:
        ln.append(i*10+c)
    
    if len(str(i)) <= 10:
        if a != -1:
            dfs(i*10 + a)
        dfs(i*10 + b)
        
        if c != 10:
            dfs(i*10 + c)

for i in l: #１桁のルンルン数を順番に再帰
    dfs(i)

print(sorted(ln)[K-1]) #0-indexを意識してリストのK-1番目を出す
Buggy python submission (verdict: Runtime Error):
n = input()
s, t = input().split()
w = ''

for i in range(n):
    w += s[i] + t[i]

print(w)

Fixed submission:
n = int(input())
s, t = input().split()
w = ''
 
for i in range(n):
    w += s[i] + t[i]
 
print(w)

Buggy python submission (verdict: Runtime Error):
n = input()
s, t = input().split()

for i in range(n):
  w += s[i] + t[i]

print(w)

Fixed submission:
n = int(input())
s, t = input().split()
w = ''
 
for i in range(n):
    w += s[i] + t[i]
 
print(w)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

#Sから暗証番号Vを作るのではなく、VからSを作れるかを判定する
n = int(input())
s = input()
ans = 0
for i in range(1000):
    t = str(i).zfill(3)
    ti = 0
    for si in range(n):
        if s[si] == t[ti]:
            ti += 1
            if ti == 3:
                break
    if ti == 3:
        ans += 1
print(ans)

Fixed submission:
import sys
input = sys.stdin.readline

#Sから暗証番号Vを作るのではなく、VからSを作れるかを判定する
n = int(input())
s = input()
ans = 0
for i in range(1000):
    t = str(i).zfill(3)
    ti = 0
    for si in range(n):
        if s[si] == t[ti]:
            ti += 1
            if ti == 3:
                break
    if ti == 3:
        ans += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
#Sから暗証番号Vを作るのではなく、VからSを作れるかを判定する
n = int(input())
s = input()
ans = 0
for i in range(1000):
    t = str(i).zfill(3)
    ti = 0
    for si in range(n):
        if s[si] == t[ti]:
            ti += 1
            if ti == 3:
                break
    if ti == 3:
        ans += 1
print(ans)

Fixed submission:
import sys
input = sys.stdin.readline

#Sから暗証番号Vを作るのではなく、VからSを作れるかを判定する
n = int(input())
s = input()
ans = 0
for i in range(1000):
    t = str(i).zfill(3)
    ti = 0
    for si in range(n):
        if s[si] == t[ti]:
            ti += 1
            if ti == 3:
                break
    if ti == 3:
        ans += 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations

n = int(input())
l = list(map(int, input().split()))
cnt = 0
for i in combinations(range(n), 3):
    a,b,c = i
    if (l[a] < l[b] + l[c]) and (l[b] < l[c] + l[a]) and (l[c] < l[b] + l[a]):
        cnt += 1
print(cnt)

Fixed submission:
from bisect import bisect_left

n = int(input())
l = sorted(list(map(int, input().split())))

#aを1番短い辺、bを2番めに短い辺とする
cnt = 0
for i in range(n-2):
    for j in range(i+1, n-1):
        c_i = bisect_left(l, l[i] + l[j])
        cnt += c_i - (j+1)

print(cnt)
Buggy python submission (verdict: Runtime Error):
import math

a, b, c, d = map(int, input().split())
e = c*d//math.gcd(c,d)


i = (a-1) // c #aのcの約数の数
j = b // c #bのcの約数の数
k = (a-1) // d #aのdの約数の数
l = b // d #bのdの約数の数
m = (a-1) // (e) #aのc*dの約数の数
n = b // (e) #bのc*dの約数の数

x = (j-i) + (l-k) - (n-m)
y = b - a + 1
print(y-x)

Fixed submission:
import fractions

a, b, c, d = map(int, input().split())
e = c*d//fractions.gcd(c,d)


i = (a-1) // c #aのcの約数の数
j = b // c #bのcの約数の数
k = (a-1) // d #aのdの約数の数
l = b // d #bのdの約数の数
m = (a-1) // (e) #aのc*dの約数の数
n = b // (e) #bのc*dの約数の数

x = (j-i) + (l-k) - (n-m)
y = b - a + 1
print(y-x)

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

a, b, c, d = map(int, input().split())
e = c*d//math.gcd(c,d)


i = (a-1) // c #aのcの約数の数
j = b // c #bのcの約数の数
k = (a-1) // d #aのdの約数の数
l = b // d #bのdの約数の数
m = (a-1) // (e) #aのc*dの約数の数
n = b // (e) #bのc*dの約数の数

x = (j-i) + (l-k) - (n-m)
y = b - a + 1
print(y-x)

Fixed submission:
import fractions

a, b, c, d = map(int, input().split())
e = c*d//fractions.gcd(c,d)


i = (a-1) // c #aのcの約数の数
j = b // c #bのcの約数の数
k = (a-1) // d #aのdの約数の数
l = b // d #bのdの約数の数
m = (a-1) // (e) #aのc*dの約数の数
n = b // (e) #bのc*dの約数の数

x = (j-i) + (l-k) - (n-m)
y = b - a + 1
print(y-x)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

n, m = map(int, input().split())
mod = 1000000007
a = list(int(input()) for _ in range(m))

dp = [0]*(n+1)
dp[0] = 1
if 1 not in a:
    dp[1] = 1

for i in range(2, n+1):
    if i not in a: dp[i] = dp[i-1] + dp[i-2]

print(dp[n]%mod)

Fixed submission:
import sys
input = sys.stdin.readline

n, m = map(int, input().split())
mod = 1000000007
a = set(int(input()) for _ in range(m))

dp = [0]*(n+1)
dp[0] = 1
if 1 not in a:
    dp[1] = 1

for i in range(2, n+1):
    if i not in a: dp[i] = dp[i-1] + dp[i-2]

print(dp[n]%mod)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

n, m = map(int, input().split())
mod = 1000000007
a = tuple(int(input()) for _ in range(m))

dp = [0]*(n+1)
dp[0] = 1
if 1 not in a:
    dp[1] = 1

for i in range(2, n+1):
    if i in a: continue
    dp[i] = dp[i-1] + dp[i-2]

print(dp[n]%mod)

Fixed submission:
import sys
input = sys.stdin.readline

n, m = map(int, input().split())
mod = 1000000007
a = set(int(input()) for _ in range(m))

dp = [0]*(n+1)
dp[0] = 1
if 1 not in a:
    dp[1] = 1

for i in range(2, n+1):
    if i not in a: dp[i] = dp[i-1] + dp[i-2]

print(dp[n]%mod)

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
mod = 1000000007
a = tuple(int(input()) for _ in range(m))

dp = [0]*(n+1)
dp[0] = 1
if 1 not in a:
    dp[1] = 1

for i in range(2, n+1):
    if i in a: continue
    dp[i] = dp[i-1] + dp[i-2]

print(dp[n]%mod)

Fixed submission:
import sys
input = sys.stdin.readline

n, m = map(int, input().split())
mod = 1000000007
a = set(int(input()) for _ in range(m))

dp = [0]*(n+1)
dp[0] = 1
if 1 not in a:
    dp[1] = 1

for i in range(2, n+1):
    if i not in a: dp[i] = dp[i-1] + dp[i-2]

print(dp[n]%mod)

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
mod = 1000000007
a = [int(input()) for _ in range(m)]

dp = [0]*(n+1)
dp[0] = 1
if 1 not in a:
    dp[1] = 1

for i in range(2, n+1):
    if i in a: continue
    dp[i] = dp[i-1] + dp[i-2]

print(dp[n]%mod)

Fixed submission:
import sys
input = sys.stdin.readline

n, m = map(int, input().split())
mod = 1000000007
a = set(int(input()) for _ in range(m))

dp = [0]*(n+1)
dp[0] = 1
if 1 not in a:
    dp[1] = 1

for i in range(2, n+1):
    if i not in a: dp[i] = dp[i-1] + dp[i-2]

print(dp[n]%mod)

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
mod = 1000000007
a = [int(input()) for _ in range(m)]

dp = [0]*(n+1)
dp[0] = 1
if 1 not in a:
    dp[1] = 1

for i in range(2, n+1):
    if i in a: continue
    dp[i] = dp[i-1] + dp[i-2]

print(dp[n]%mod)

Fixed submission:
import sys
input = sys.stdin.readline

n, m = map(int, input().split())
mod = 1000000007
a = set(int(input()) for _ in range(m))

dp = [0]*(n+1)
dp[0] = 1
if 1 not in a:
    dp[1] = 1

for i in range(2, n+1):
    if i not in a: dp[i] = dp[i-1] + dp[i-2]

print(dp[n]%mod)
Buggy python submission (verdict: Runtime Error):
n, M = map(int, input().split())
s = [list(map(int, input().split()))[1:] for m in range(m)]
p = list(map(int, input().split()))

for i in range(2 ** n):
    for m in range(M):
        switch = 0
        for j in range(n):
            if (i >> j) & 1:
                if j + 1 in s[m]:
                    switch += 1
        if switch % 2 != p[m]:
            break
    else:
        count += 1
print(count)

Fixed submission:
N,M=map(int,input().split())
s=[list(map(int,input().split()))[1:] for m in range(M)]
p=list(map(int,input().split()))
count=0
for i in range(1<<N):
    for m in range(M):
        switch=0
        for j in range(N):
            if (i>>j)&1 and j+1 in s[m]:
                switch+=1
        if switch%2!=p[m]:
            break
    else:
        count+=1
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
#ABC 122 C - GeT AC 18:47

n, q = map(int, input().split())
s = input()
memo = [0]*(n) #与えられた文字列の何文字目にACが現れるかメモ
for i in range(n-1):
    if s[i:i+2] == 'AC':
        memo[i] = 1

for i in range(q):
    l, r = map(int, input().split())
    l -= 1
    r -= 1
    temp = memo[l:r+1]
    res = sum(temp)
    if temp[-1] == 1:
        res -= 1
    print(res)

Fixed submission:
#ABC 122 C - GeT AC 18:47
n, q = map(int, input().split())
s = input()
t = [0]*(n+1)
for i in range(n):
    t[i+1] = t[i] + (1 if s[i:i+2] == 'AC' else 0)
for i in range(q):
    l,r = map(int, input().split())
    print(t[r-1] - t[l-1])