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

Fixed submission:
a, b = map(int, input().split())
c = input()
print(c[:b-1]+str.lower(c[b-1])+c[b:])

Buggy submission (verdict: Runtime Error):
a = int(input())
y = a//100
m = a%100
if y <= 12 and y >= 1:
	if m <= 12 and n >= 1:
    	print('AMBIGUOUS')
    else:
     	print('MMYY')
else:
	if m <= 12 and n >= 1:
    	print('YYMM')
    else:
     	print('NA')

Buggy submission (verdict: Runtime Error):
def hantei(y,m):
    if y <= 12 and y >= 1:
        if m <= 12 and n >= 1:
            print('AMBIGUOUS')
        else:
            print('MMYY')
    else:
        if m <= 12 and n >= 1:
            print('YYMM')
        else:
            print('NA')
a = int(input())
b1 = a//100
c2 = a%100
henkan(b1,c2)

Buggy submission (verdict: Runtime Error):
def hantei(y,m):
    if y <= 12 and y >= 1:
        if m <= 12 and n >= 1:
            print('AMBIGUOUS')
        else:
            print('MMYY')
    else:
        if m <= 12 and n >= 1:
            print('YYMM')
        else:
            print('NA')
a = input()
b1 = int(a[0:2])
c2 = int(a[2:4])
henkan(b1,c2)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
c = input()
c[b-1] += 32
print(c)
Problem p03042 (python)

Fixed submission:
a = int(input())
y = a//100
m = a%100
if 1 <= y <= 12 and 1 <= m <= 12:
	print('AMBIGUOUS')
elif 1 <= y <= 12:
	print('MMYY')
elif 1 <= m <= 12:
	print('YYMM')
else:
	print('NA')

Buggy submission (verdict: Runtime Error):
a = int(input())
y = a//100
m = a%100
if y <= 12 and y >= 1:
	if m <= 12 and n >= 1:
    	print('AMBIGUOUS')
    else:
     	print('MMYY')
else:
	if m <= 12 and n >= 1:
    	print('YYMM')
    else:
     	print('NA')

Buggy submission (verdict: Runtime Error):
a = int(input())
y = a//100
m = a%100
if y <= 12 and y >= 1:
        if m <= 12 and n >= 1:
            print('AMBIGUOUS')
        else:
            print('MMYY')
    else:
        if m <= 12 and n >= 1:
            print('YYMM')
        else:
            print('NA')

Buggy submission (verdict: Runtime Error):
def hantei(y,m):
    if y <= 12 and y >= 1:
        if m <= 12 and n >= 1:
            print('AMBIGUOUS')
        else:
            print('MMYY')
    else:
        if m <= 12 and n >= 1:
            print('YYMM')
        else:
            print('NA')
a = input()
b1 = int(a[0:2])
c2 = int(a[2:4])
henkan(b1,c2)

Buggy submission (verdict: Runtime Error):
def hantei(y,m):
    if y <= 12 and y >= 1:
        if m <= 12 and n >= 1:
            print('AMBIGUOUS')
        else:
            print('YYMM')
    else:
        if m <= 12 and n >= 1:
            print('MMYY')
        else:
            print('NA')
a = input()
b1 = int(a[:2])
c2 = int(a[2:])
hantei(b1,c2)

Buggy submission (verdict: Runtime Error):
def hantei(y,m):
    if str(y) == '00' or str(m) == '00':
        print('NA')
        if m > 12:
            print('YYMM')
        else:
            print('MMYY')
    else:
        print('AMBIGUOUS')


a = input()
b = 0
b1 = int(a[:2])
c2 = int(a[2:])
henkan(b1,c2)
Problem p02627 (python)

Fixed submission:
s = input()

if s.islower():
  print('a')
else:
  print('A')

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

if s in ['a-z']:
  print('a')
elif s in ['A-Z']:
  print('A')
else:
Problem p02629 (python)

Fixed submission:
N = int(input())
ans = ''
for i in range(1, 99):
  if N <= 26 ** i:
    N -= 1
    for j in range(i):
      ans += chr(ord('a') + N % 26)
      N //= 26
    break
  else:
    N -= 26 ** i
print(ans[::-1])

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = ''
for i in range(1, 99):
  if N <= 26 ** i:
    N -= 1
    for j in range(i):
      ans += chr(ord('a') + N % 26)
      N //= 26
    break
  else:
    N -= 26 ** i
print(ans[::-1])
Problem p02970 (python)

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

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

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

Fixed submission:
a=[int(input()) for i in range(6)]
print("Yay!" if a[4]-a[0]<=a[5] else ":(")

Buggy submission (verdict: Runtime Error):
for i in range(6):
  a[i]=int(input())
print("Yay!" if a[4]-a[0]==a[5] else ":(")
Problem p03317 (python)

Fixed submission:
n,k=map(int,input().split())
a=list(map(int,input().split()))
n=n-k
print(-(-n//(k-1))+1)

Buggy submission (verdict: Runtime Error):
#include<iostream>
#include<vector>

using namespace std;

int main(){
    int n,k;
    cin >> n >> k;
    std::vector<char> a(n);

    for (int i =0;i<n;i++)
        cin >> a[i];
    int ans =-(-n/(k-1));
    cout << ans<<endl;


}
Problem p02693 (python)

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

res = False
for i in range(1000):
    k = i * K
    if k >= A and k <= B:
        res = True

if res:
    print('OK')
else:
    print('NG')

Buggy submission (verdict: Runtime Error):
import itertools
N, M, Q = map(int, input().split())
m = list()
res = -100
for i in range(Q):
    n = list(map(int, input().split()))
    m.append(n)
l = [x for x in range(1, M + 1)]
p = itertools.combinations_with_replacement(l, N)
for p in p:
    total = 0
    for i in range(Q):
        num = 0
        a = m[i][0]
        b = m[i][1]
        A = p[a - 1]
        B = p[b - 1]
        C = B - A
        if m[i][2] == C:
            num = num + m[i][3]
            total = total + num
    if res < total:
        res = total
print(res)

Buggy submission (verdict: Runtime Error):
import itertools
N, M, Q = map(int, input().split())
m = list()
res = -100
for i in range(Q):
    n = list(map(int, input().split()))
    m.append(n)
l = [x for x in range(1, M + 1)]
p = itertools.combinations_with_replacement(l, N)
for p in p:
    total = 0
    for i in range(Q):
        num = 0
        a = m[i][0]
        b = m[i][1]
        A = p[a - 1]
        B = p[b - 1]
        C = B - A
        if m[i][2] == C:
            num = num + m[i][3]
            total = total + num
    if res < total:
        res = total
print(res)
Problem p02729 (python)

Fixed submission:
import math


N, M = map(int, input().split())

count = N * (N - 1) / 2 + M * (M - 1) / 2
print(math.floor(count))

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

list1 = []
list2 = []

count = 0
C = 0
o = 0
b = 0
G = 0

for i in range(1, N + 1):
    list1.append(i * 2)
    if i >= 2:
        C = sum(list1)
        list1.remove(list1[o])
        o += 1
    if C % 2 == 0:
        count += 1
    C = 0

for q in range(1, M + 1):
    list2.append((q * 2) - 1)
    if q >= 2:
        G = sum(list2)
        list2.remove(list2[b])
        b += 1
    if G % 2 == 0:
        count += 1
    G = 0

for w in list1:
    for e in list2:
        total = w + e
        if total % 2 == 0:
            count += 1

print(count)
Problem p02693 (python)

Fixed submission:
row1 = input()
row2 = input()
k = int(row1)
a = int(row2.split(' ')[0])
b = int(row2.split(' ')[1])
for i in range(a, b + 1):
    if i % k == 0:
        print('OK')
        break
else:
    print('NG')

Buggy submission (verdict: Runtime Error):
text = input()
rows = text.split('\n')
k = int(rows[0])
a = int(rows[1].split(' ')[0])
b = int(row[1].split(' ')[1])
for i in range(a, b + 1):
    if i % k == 0:
        print('OK')
        break
else:
    print('NG')
Problem p02693 (python)

Fixed submission:
K = input()
A,B = input().split()

k = int(K)
a = int(A)
b = int(B)

x = a // k
z = b // k

# print(x,z)
for i in range(z-x + 1):
#   print("fof---", k*(x+i))
  if a <= k*(x+i) and k*(x+i) <= b:
        print("OK")
        exit()
print("NG")

Buggy submission (verdict: Runtime Error):
K = input()
A,B = input().split()5

k = int(K)
a = int(A)
b = int(B)

x = a // k
z = b // k

for i in range(z-x + 1):
  if a <= k*i and k*i <= b:
    print("OK")
    exit()

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

k = int(K)
a = int(A)
b = int(B)

x = a // k
z = b // k

for i in range(z-x + 1):
  if a <= k*i and k*i <= b:
    print("OK")
    exit()
Problem p02725 (python)

Fixed submission:
K,N = input().split()
A = input().split()
 
a_list = list(A)

dist = 0
dist_list = []
max = 0
sum = 0
 
for i in range(len(a_list)):
  if i == len(a_list) - 1:
    dist = int(K) - abs(int(a_list[i]) - int(a_list[0]))
  else:
    dist = abs(int(a_list[i]) - int(a_list[i + 1]))
  if i != 0: 
    if max < dist:
        sum += max
        max = dist
    else:
        sum += dist
  else:
      max = dist
  
    
print(sum)

Buggy submission (verdict: Runtime Error):
K,N = input().split()
A = input().split()

a_list = list(A)

dist = 0
max = 0
sum = 0

for i in range(len(a_list)):
  if i == len(int(a_list)) - 1:
    dist = abs(int(a_list[i]) - int(a_list[0]))
  else:
    dist = abs(int(a_list[i]) - int(a_list[i + 1]))
  
  if max < dist:
    sum += max
    max = dist
  else:
    sum += dist
    
print(sum)
Problem p02623 (python)

Fixed submission:
N,M,K = map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))

SumA=[0 for _ in range(N+1)]
SumB=[0 for _ in range(M+1)]
for i in range(1,N+1):
    SumA[i]=SumA[i-1]+A[i-1]
for i in range(1,M+1):
    SumB[i]=SumB[i-1]+B[i-1]

def binary_search(Time,IndexA):
    if Time>K:
        return 0 
    l=0
    r=M
    c=(l+r)//2
    while r-l>1:
        if Time+SumB[c]>K: r=c
        if Time+SumB[c]<=K: l=c
        c=(l+r)//2
    if Time+SumB[r]>K: IndexB=l
    else: IndexB=r
    NumOfBooks=IndexA+IndexB
    return NumOfBooks

MaxNumOfBooks=0
for IndexA in range(N+1):
    NumOfBooks=binary_search(SumA[IndexA],IndexA)
    if MaxNumOfBooks<NumOfBooks: MaxNumOfBooks=NumOfBooks
print(MaxNumOfBooks)

Buggy submission (verdict: Runtime Error):
 N, M, K = map(int, input().split())
2 A = list(map(int, input().split()))
3 B = list(map(int, input().split()))
4
5 a,b=[0],[0]
 6 for 7
8 for 9
i in range(N): a.append(a[i] + A[i]) i in range(M): b.append(b[i] + B[i])
10
11 ans,j=0,M
12 for 13
14
15
i in range(N + 1): ifa[i]>K:
break
while b[j] > K - a[i]:
j -= 1
ans = max(ans, i + j)
16
17
18 print(ans)
Problem p03107 (python)

Fixed submission:
S=list(input())
ans=0
j=0
while len(S)-1>j:
    if S[j]!=S[j+1]:
        S.pop(j)
        S.pop(j)
        ans+=2
        if j>0:
            j-=1
        continue
    j+=1
print(ans)

Buggy submission (verdict: Runtime Error):
S=list(input())
ans=0
j=0
while len(S)-1>j:
    if S[j]!=S[j+1]:
        S.pop(j)
        S.pop(j)
        ans+=2
        j-=1
        continue
    j+=1
print(ans)
Problem p03137 (python)

Fixed submission:
N,M=map(int,input().split())
X=list(map(int,input().split()))
X.sort()
a=[0 for i in range(M-1)]
for i in range(M-1):
    a[i]=X[i+1]-X[i]
a.sort(reverse=True)
a=a[N-1:]
print(sum(a))

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
X=list(map(int,input().split()))
s=[]
sum=0
if M!=1:
    X.sort()
    for i in range(M-1):
        s.append(X[i+1]-X[i])
    t=[]
    for i in range(M-1):
        t.append(s[i])
    s.sort(reverse=True)
    buf=[[],[]]
    for i in range(N-1):
        buf[0].append(s[i])
        buf[1].append(t.index(s[i]))
    print(buf)
    buf[1].sort()
    for i in range(len(buf[1])):
        if i==0:
            sum+=X[buf[1][i]]-X[0]
        else:
            sum+=X[buf[1][i]]-X[buf[1][i-1]+1]
    sum+=X[M-1]-X[buf[1][-1]+1]
else:
    sum=0
    print(sum)
Problem p03186 (python)

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

Buggy submission (verdict: Runtime Error):
A,B,C=map(int,input().split())
if B>=C:
  ans=B+C
else C>B:
  ans=2*B
  if A>C:
    ans+=C
  else:
    ans+=A
print(ans)

Buggy submission (verdict: Runtime Error):
A,B,C=map(int,input().split())
if B>=C:
  ans=B+C
else C>B:
  ans+=2*B
  if A>C:
    ans+=C
  else:
    ans+=A
print(ans)
Problem p03221 (python)

Fixed submission:
N,M=map(int,input().split())
P=[[] for i in range(M)]
Y=[1 for i in range(N+1)]
for i in range(M):
    a,b=map(int,input().split())
    P[i].append(i)
    P[i].append(a)
    P[i].append(b)
P.sort(key=lambda x:x[2])
for i in range(M):
    P[i].append(str(P[i][1]*1000000+Y[P[i][1]]))
    Y[P[i][1]]+=1
P.sort(key=lambda x:x[0])
for i in range(M):
    print(P[i][3].zfill(12))

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
P=[[] for i in range(M)]
Y=[1 for i in range(M)]
id=[0 for i in range(M)]
for i in range(M):
    a,b=map(int,input().split())
    P[i].append(i)
    P[i].append(a)
    P[i].append(b)
P.sort(key=lambda x:x[2])
for i in range(M):
    P[i].append(str(P[i][1]*1000000+Y[P[i][1]]))
    Y[P[i][1]]+=1
P.sort(key=lambda x:x[0])
for i in range(M):
    print(P[i][3].zfill(12))

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
P=[[] for i in range(N+1)]
Y=[]
id=[]
for i in range(M):
    a,b=map(int,input().split())
    P[a].append(b)
    Y.append(b)
for i in range(N+1):
    P[i].sort()
for i in range(1,N+1):
    j=1
    for p in P[i]:
        id[Y.index(p)]=str(i*1000000+j)
        j+=1
for i in range(M):
    print(id[i].zfill(12))

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
P=[[] for i in range(N+1)]
Y=[]
id=[[] for i in range(N+1)]
for i in range(M):
    a,b=map(int,input().split())
    P[a].append(b)
    Y.append(b)
for i in range(N+1):
    P[i].sort()
for i in range(1,N+1):
    j=1
    for p in P[i]:
        id[Y.index(p)]=str(i*1000000+j)
        j+=1
for i in range(M):
    print(id[i].zfill(12))
Problem p03272 (python)

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

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
median_len=N*(N+1)//2
median=median_len//2+1
a=1
medin_rank=1
for i in range(1,N):
    a=i*(i+1)//2
    b=(i+2)*(i+1)//2
    if a<=median and b>median:
        medin_rank=i
        break
rank_index=median-a
median_list=[]
l=medin_rank//2
for i in range(N-medin_rank):
    median_list.append(A[l+i])
print(median_list[rank_index])
Problem p03326 (python)

Fixed submission:
import numpy as np
N,M=map(int,input().split())
x=[0 for i in range(N)]
y=[0 for i in range(N)]
z=[0 for i in range(N)]
for i in range(N):
    x[i],y[i],z[i]=map(int,input().split())
x=np.array(x)
y=np.array(y)
z=np.array(z)
xyz=np.array([x,y,z])
d=[]
for i in range(8):
    buf=np.zeros(N)
    for j in range(3):
        if i & (1<<j):
            buf=buf+-1*xyz[j]
            continue
        buf=buf+xyz[j]
    buf.sort()
    d.append(sum(buf[N-M:]))
print(int(max(d)))

Buggy submission (verdict: Runtime Error):
def total(x):
    x=[abs(i) for i in x]
    return sum(x)

N,M=map(int,input().split())
x=[0 for i in range(N)]
y=[0 for i in range(N)]
z=[0 for i in range(N)]
for i in range(N):
    x[i],y[i],z[i]=map(int,input().split())
dp=[[[0,0,0] for i in range(M+1)] for j in range(N+1)]
for i in range(N):
    for j in range(M):
        if i>j:
            D=dp[i][j]
            XYZ=[D[0]+x[i],D[1]+y[i],D[2]+z[i]]
            if total(XYZ)>=total(dp[i][j+1]):
                dp[i+1][j+1]=[X,Y,Z]
            else:
                dp[i+1][j+1]=dp[i][j+1]
        elif i==j:
            dp[i+1][j+1]=[a+b for a,b in zip(dp[i][j],[x[i],y[i],z[i]])]
print(total(dp[N][M]))
Problem p02699 (python)

Fixed submission:
S, W = map(int,(input().split()))
if(S>W):
  print("safe")
else:
  print("unsafe")

Buggy submission (verdict: Runtime Error):
N = input()
count=0
for i in range(len(N)+1):
  for j in range(i+1,len(N)+1):
    if(int(N[i:j])%3!=0):
      continue
    if(int(N[i:j])%673==0):
      count+=1

print(count)
Problem p02785 (python)

Fixed submission:
N, K = map(int,(input().split()))
H = list(map(int,(input().split())))
atk=0
H.sort(reverse=True)
del H[0:K]

atk=sum(H)
print(atk)

Buggy submission (verdict: Runtime Error):
N, K = map(int,(input().split()))
H = list(map(int,(input().split())))
atk=0
for i in range(K):
  H.remove(max(H))

atk=SUM(H)
print(atk)

Buggy submission (verdict: Runtime Error):
N, K = map(int,(input().split()))
H = list(map(int,(input().split())))
atk=0
for i in range(K):
  H.remove(max(H))

for j in range(len(H)):
  atk += H[j]
print(atk)
Problem p02831 (python)

Fixed submission:
import fractions

n = (input())
a = int(n.split(" ")[0])
b = int(n.split(" ")[1])
lcm = int((a * b / fractions.gcd(a, b)))
print(lcm)

Buggy submission (verdict: Runtime Error):
n = (input())
a = int(n.split(" ")[0])
b = int(n.split(" ")[1])
lcm = int((a * b / math.gcd(a, b)))
print(lcm)

Buggy submission (verdict: Runtime Error):
import math

n = (input())
a = int(n.split(" ")[0])
b = int(n.split(" ")[1])
lcm = int((a * b / math.gcd(a, b)))
print(lcm)
Problem p02712 (python)

Fixed submission:
n=int(input())
result=0
for i in range(n+1): 
    if i % 3 == 0 and i % 5 == 0:
        result=result    
    elif i % 3 == 0:
        result=result
    elif i % 5 == 0:
        result=result
    else:
        result=result+i
    
print(result)

Buggy submission (verdict: Runtime Error):
n=int(input())
result=0
a
for i in range(n): 
    if i % 3 == 0 and i % 5 == 0:
        a=result    
    elif i % 3 == 0:
        a=result
    elif i % 5 == 0:
        a=result
    else:
        result=result+i
    
print(result)
Problem p02659 (python)

Fixed submission:
AB = list(input().split())
 
A = int(AB[0])
B = float(AB[1])
 
B = round(B * 100)
 
ans = int(A * B // 100)
 
print(ans)

Buggy submission (verdict: Runtime Error):
AB = list(input().split())
 
A = int(AB[0])
B = float(AB[1])
 
B = round(B * 100)
 
ans = int(A * B / /100)
 
print(ans)
Problem p03767 (python)

Fixed submission:
n=int(input())
a=list(map(lambda x: int(x), input().split()))
a.sort(reverse=True)
print(sum(a[1:2*n:2]))

Buggy submission (verdict: Runtime Error):
N = int(input())
a = sorted(list(map(int, input().split())), reverse=True)


print(sum(a[1:2*n:2]))

Buggy submission (verdict: Runtime Error):
N = int(input())
a = sorted(list(map(int, input().split())), reverse=True)

print(sum(a[1:2*n:2]))
Problem p02693 (python)

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

if b - a >= k - 1:
  print("OK")
elif  k == 1:
  print("OK")
elif b == k or a == k:
  print("OK")
elif b % k == 0 or a % k == 0:
  print("OK")
elif a < k and k < b:
  print("OK")
elif a != b and k == 2:
  print("OK")
elif b < k:
  print("NG")
elif a % k > b % k:
  print("OK")
else:
  print("NG")

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

if k >= 2 and b - a >= k - 1:
  print("OK")
elif k == a or k == b:
  print("OK")
elif a < k  and k < b:
  print("OK")
print k == 1:
  print("OK")
else:
  print("NO")

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

if k < a:
  if k >= 2:
    if b - a >= k - 1:
      print("OK")
elif k == a or k == b:
  print("OK")
elif a < k  and k < b:
  print("OK")
print k == 1:
  print("OK")
else:
  print("NO")

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

if k < a:
  if k >= 2:
    if b - a >= k - 1:
    print("OK")
elif k == a or k == b:
  print("OK")
elif a < k  and k < b:
  print("OK")
print k == 1:
  print("OK")
else:
  print("NO")

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

if k < a:
  if k >= 2:
    if b - a >= k - 2:
    print("OK")
elif k == a or k == b:
  print("OK")
elif a < k  and k < b:
  print("OK")
print k == 1:
  print("OK")
else:
  print("NO")

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

if k < a:
  if k >= 2 and (b - a) >= k - 2:
    print("OK")
elif k == a or k == b:
  print("OK")
elif a < k  and k < b:
  print("OK")
print k == 1:
  print("OK")
else:
  print("NO")

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

if k < a:
  if k >= 2 and b - a >= k - 2:
    print("OK")
elif k == a or k == b:
  print("OK")
elif a < k < b:
  print("OK")
print k == 1:
  print("OK")
else:
  print("NO")
Problem p02859 (python)

Fixed submission:
x = int(input())
print(x**2)

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

print(x*x)
Problem p03011 (python)

Fixed submission:
P, Q, R = map(int, input().split())
lst = [P, Q, R]
lst = sorted(lst)
print(lst[0]+lst[1])

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
lack = []
for _ in range(M):
    lack.append(int(input()))

mod = 1000000007

def fib(n):
    memo=["EMPTY"]*(n+1)
    def inner(n):
        if n in lack:
            return 0
        elif n == 0:
            return 1
        elif n == 1:
            return 1
        elif memo[n] != "EMPTY":
            return memo[n]
        else:
            memo[n] = inner(n-1)+inner(n-2)
            return memo[n] % mod
    return inner(n)

print(fib(N)% mod)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
lack = []
for _ in range(M):
    lack.append(int(input()))

def fib(n):
    memo=["EMPTY"]*(n+1)
    def inner(n):
        if n in lack:
            return 0
        elif n == 0:
            return 1
        elif n == 1:
            return 1
        elif memo[n] != "EMPTY":
            return memo[n]
        else:
            memo[n] = inner(n-1)+inner(n-2)
            return memo[n]
    return inner(n) %1000000007

print(fib(N)%1000000007)
Problem p03072 (python)

Fixed submission:
N = int(input())
H = [i for i in map(int, input().split())]
cnt = 0
for i in range(N):
    if max(H[0:i+1]) == H[i]:
        cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
N = int(input())
H = [i for i in map(int, input().split())]

cnt = 0
for i in range(i):
    if H[i] == max(H):
        cnt += 1
print(cnt)
Problem p02688 (python)

Fixed submission:
N, K = map(int, input().split())
d = []
A = []

for k in range(K):
    d.append(int(input()))
    A.append(list(map(int, input().split())))

Alist = [e for row in A for e in row]
        
L = len(list(set(Alist)))
print(N-L)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
d = []
A = []
safe = []
ubsafe = []
for k in range(K):
    d.append(int(input()))
    A.append(list(map(int, input().split())))

for _ in range(K-1):
    for p in range(d[K-1]-1):
        safe.append(A[_][p])
        
L = len(list(set(safe)))
print(N-L)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
d = []
A = []
safe = []
ubsafe = []
for k in range(K):
    d.append(int(input()))
    A.append(list(map(int, input().split())))

for _ in range(K-1):
    for p in range(d[K-1]):
        safe.append(A[_][p])
        
L = len(list(set(safe)))
print(N-L)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
d = []
A = []
safe = []
ubsafe = []
for k in range(K):
    d.append(int(input()))
    A.append(list(map(int, input().split())))

for _ in range(K):
    for p in range(d[K-1]):
        safe.append(A[_][p])
        
L = len(list(set(safe)))
print(N-L)