Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

A, B = map(int, input().split())

ans = ((B-A/2)+A)
if isinstance(int, ans):
    print(ans)
else:
    print("IMPOSSIBLE")

Fixed submission:
# -*- coding: utf-8 -*-

A, B = map(int, input().split())

ans = (((B-A)/2)+A)
if ans.is_integer():
    print(int(ans))
else:
    print("IMPOSSIBLE")
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

N = int(input())
A = [int(input()) for x in range(N)]
ans = max(A)
for i in range(N):
    if A[i] == ans:
        print(max(A[:i] + A[i+1:]))
    else:
        print(ans)


Fixed submission:
# -*- coding: utf-8 -*-

N = int(input())
A = [int(input()) for x in range(N)]
max1, max2 = sorted(A, reverse=True)[:2]
for i in range(N):
    if A[i] == max1:
        print(max2)
    else:
        print(max1)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

N = int(input())
A = [int(input()) for x in range(N)]
for i in range(N):
    A[i] = A[i] * -1
    print(max(A))
    A[i] = A[i] * -1


Fixed submission:
# -*- coding: utf-8 -*-

N = int(input())
A = [int(input()) for x in range(N)]
max1, max2 = sorted(A, reverse=True)[:2]
for i in range(N):
    if A[i] == max1:
        print(max2)
    else:
        print(max1)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

N = int(input())
A = [int(input()) for x in range(N)]
for i in range(N):
    print(max(A[:i] + A[i+1:]))

Fixed submission:
# -*- coding: utf-8 -*-

N = int(input())
A = [int(input()) for x in range(N)]
max1, max2 = sorted(A, reverse=True)[:2]
for i in range(N):
    if A[i] == max1:
        print(max2)
    else:
        print(max1)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import itertools
import math

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

X = [[0 for x in range(D)] for y in range(N)]

for n in range(N):
    X[n] = list(map(int, input().split()))

ans = 0
for target in itertools.combinations(X, 2):
    res = sum([(y - z) ** 2 for y, z in zip(target[0], target[1])])
    res = math.sqrt(res)
    if res.is_integer():
        ans += 1

print(ans)


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

print(min(N*A, B))
Buggy python submission (verdict: Runtime Error):
A, B, C, D = map(int, input().split())
import math

dc = math.floor(B/C) - math.floor((A-1)/C)
dd = math.floor(B/D) - math.floor((A-1)/D)
lcmCD = (C*D)/math.gcd(C,D)
dcd = math.floor(B/lcmCD) - math.floor((A-1)/lcmCD)

print(B-A+1 - (dc + dd - dcd))

Fixed submission:
a, b, c, d = map(int, input().split())
import fractions
 
def num_divide(p, q, r):
    if p % r == 0:
        rmin = p
    else:
        rmin = p + (r-p%r)
    rmax = q - q%r
    return (rmax-rmin)//r + 1
 
print(b - a + 1 - (num_divide(a, b, c) + num_divide(a, b, d) - num_divide(a, b, c * d // fractions.gcd(c, d))))

Buggy python submission (verdict: Runtime Error):
import math
A, B, C, D = map(int, input().split())

dc = math.floor(B/C) - math.floor((A-1)/C)
dd = math.floor(B/D) - math.floor((A-1)/D)
lcmCD = (C*D)/math.gcd(C,D)
dcd = math.floor(B/lcmCD) - math.floor((A-1)/lcmCD)

print(B-A+1 - (dc + dd - dcd))

Fixed submission:
a, b, c, d = map(int, input().split())
import fractions
 
def num_divide(p, q, r):
    if p % r == 0:
        rmin = p
    else:
        rmin = p + (r-p%r)
    rmax = q - q%r
    return (rmax-rmin)//r + 1
 
print(b - a + 1 - (num_divide(a, b, c) + num_divide(a, b, d) - num_divide(a, b, c * d // fractions.gcd(c, d))))
Buggy python submission (verdict: Runtime Error):
X, A = map(int, input().spilt())

if X < A:
    print(0)
else:
    print(10)

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

if X < A:
    print(0)
else:
    print(10)
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]

dp = [-1]*(N+1)
dp[0] = 1
ans = 0

for i in range(1, N+1):
    if i in a:
        dp[i] = 0
        if dp[i-1] == 0:
            ans = 0
            break
    else:
        if i > 1:
            dp[i] = dp[i-1] + dp[i-2]
        else:
            dp[i] = dp[i-1]

else:
    ans = dp[-1] % 1000000007

print(ans)


Fixed submission:
N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]

dp = [-1]*(N+1)
for i in a:
    dp[i] = 0

dp[0] = 1
mod = 1000000007

for i in range(1, N+1):
    if dp[i] == 0:
        continue
    else:
        if i > 1:
            dp[i] = (dp[i-1] + dp[i-2]) % mod
        else:
            dp[i] = dp[i-1] % mod

print(dp[-1])

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

dp = [0]*(N+1)
dp[0] = 1
ans = 0

for i in range(1, N+1):
    if i in a:
        dp[i] = 0
        if dp[i-1] == 0:
            ans = 0
            break
    else:
        if i > 1:
            dp[i] = dp[i-1] + dp[i-2]
        else:
            dp[i] = dp[i-1]

else:
    ans = dp[-1] % 1000000007

print(ans)


Fixed submission:
N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]

dp = [-1]*(N+1)
for i in a:
    dp[i] = 0

dp[0] = 1
mod = 1000000007

for i in range(1, N+1):
    if dp[i] == 0:
        continue
    else:
        if i > 1:
            dp[i] = (dp[i-1] + dp[i-2]) % mod
        else:
            dp[i] = dp[i-1] % mod

print(dp[-1])

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

dp = [0]*(N+1)
dp[0] = 1
ans = 0

for i in range(1, N+1):
    if i in a:
        dp[i] = 0
        if dp[i-1] == 0:
            ans = 0
            break
    else:
        try:
            dp[i] = dp[i-1] + dp[i-2]
        except:
            dp[i] = dp[i-1]
else:
    ans = dp[-1] % 1000000007

print(ans)


Fixed submission:
N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]

dp = [-1]*(N+1)
for i in a:
    dp[i] = 0

dp[0] = 1
mod = 1000000007

for i in range(1, N+1):
    if dp[i] == 0:
        continue
    else:
        if i > 1:
            dp[i] = (dp[i-1] + dp[i-2]) % mod
        else:
            dp[i] = dp[i-1] % mod

print(dp[-1])
Buggy python submission (verdict: Runtime Error):
A, P = map(int, input())

print(round((P+3*A)/2))

Fixed submission:
import math
A, P = map(int, input().split())

print(math.floor((P+3*A)/2))
Buggy python submission (verdict: Runtime Error):
b = str(input())
atcg = [["A", "T"],["C", "G"]]

for i in atcg:
  if b in i:
    print(i.remove(b)[0])
    break

Fixed submission:
print("ATACGC"["ATACGC".find(str(input()))+1])

Buggy python submission (verdict: Runtime Error):
b = str(input())
atcg = [["A","T"]["C","G"]]

for i in atcg:
  if b in i:
    print(i.pop(b)[0])
    break

Fixed submission:
print("ATACGC"["ATACGC".find(str(input()))+1])
Buggy python submission (verdict: Runtime Error):
print(["TBD","Heisei"][int(20190430>=int(str(input()).replace("/","")))]

Fixed submission:
print(["TBD","Heisei"][int(20190430>=int(str(input()).replace("/","")))])
Buggy python submission (verdict: Runtime Error):
A,B = map(int,input().split())

if B%A == 0
	print(A+B)
else:
  	print(A-B)

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

if B%A == 0:
	print(A+B)
else:
  	print(B-A)

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

if B%A == 0
	print(A+B)
else:
  	print(A=B)

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

if B%A == 0:
	print(A+B)
else:
  	print(B-A)
Buggy python submission (verdict: Runtime Error):
# -*- coding:utf-8 -*-
# https://atcoder.jp/contests/dp/tasks/dp_a
import math

N = int(input())
h = list(map(int, input().split()))

dp = [math.inf]*N
dp[0] = 0
for i in range(1, N):
    cost1 = abs(h[i] - h[i-1])
    dp[i] = min(dp[i], dp[i-1] + cost1)
    if i > 1:
        cost2 = abs(h[i] - h[i - 2])
        dp[i] = min(dp[i], dp[i-2] + cost2)

print(dp[-1])






Fixed submission:
# -*- coding:utf-8 -*-

N = int(input())
h = list(map(int, input().split()))

dp = [float("inf")]*N
dp[0] = 0
for i in range(1, N):
    cost1 = abs(h[i] - h[i-1])
    dp[i] = min(dp[i], dp[i-1] + cost1)
    if i > 1:
        cost2 = abs(h[i] - h[i - 2])
        dp[i] = min(dp[i], dp[i-2] + cost2)

print(dp[-1])
Buggy python submission (verdict: Runtime Error):
if int(input())==1:
    print("Hello World")
else:
  	a = int(input())
    b = int(input())
    print(a+b)

Fixed submission:
if int(input())==1:
    print("Hello World")
else:
    a = int(input())
    b = int(input())
    print(a+b)

Buggy python submission (verdict: Runtime Error):
if int(input())==1:
	print("Hello World")
else:
  	a = int(input())
    B = int(input())
    print(a+b)

Fixed submission:
if int(input())==1:
    print("Hello World")
else:
    a = int(input())
    b = int(input())
    print(a+b)
Buggy python submission (verdict: Runtime Error):
N = str(input())

for n in N:
    n = str(eval(10 - n))
    
print(int(n))

Fixed submission:
N = str(input())

ans = ""
for n in N:
    formura = "10-{}".format(n)
    ans += str(eval(formura))

print(int(ans))
Buggy python submission (verdict: Runtime Error):
#C - Build Stairs
N=int(input())
H=list(map(int, input().split()))
t=True
for i in range(1,N+1):
    M=max(H[:i])
    if M>min(H[i:])+1:
        print("No")
        t=False
        break
if t:
    print("Yes")

Fixed submission:
#C - Build Stairs
N=int(input())
H=list(map(int, input().split()))
t=True
M=H[0]
for i in range(1,N):
    if M<H[i]:
        M=H[i]
    if M>H[i]+1:
        print("No")
        t=False
        break
if t:
    print("Yes")

Buggy python submission (verdict: Runtime Error):
#C - Build Stairs
N=int(input())
H=list(map(int, input().split()))
t=True
for i in range(1,N+1):
    M=max(H[:i])
    if M>min(H[i:])+1:
        print("No")
        t=False
        break
if t:
    print("Yes")

Fixed submission:
#C - Build Stairs
N=int(input())
H=list(map(int, input().split()))
t=True
M=H[0]
for i in range(1,N):
    if M<H[i]:
        M=H[i]
    if M>H[i]+1:
        print("No")
        t=False
        break
if t:
    print("Yes")

Buggy python submission (verdict: Time Limit Exceeded):
#C - Build Stairs
N=int(input())
H=list(map(int, input().split()))
t=True
for i in range(1,N+1):
    M=max(H[:i])
    M_i=H.index(M)
    if M>min(H[M_i:])+1:
        print("No")
        t=False
        break
if t:
    print("Yes")

Fixed submission:
#C - Build Stairs
N=int(input())
H=list(map(int, input().split()))
t=True
M=H[0]
for i in range(1,N):
    if M<H[i]:
        M=H[i]
    if M>H[i]+1:
        print("No")
        t=False
        break
if t:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
#A-Harmony
X=map(int, input().split())
K=(X[0]+X[1])/2
if (X[0]+X[1])%2==0:
    print(K)
else:
    print("IMPOSSIBLE")

Fixed submission:
#A-Harmony
X=list(map(int, input().split()))
K=(X[0]+X[1])/2
if (X[0]+X[1])%2==0:
    print(int(K))
else:
    print("IMPOSSIBLE")
Buggy python submission (verdict: Runtime Error):
#B - Bounding(ABC130)
A=list(map(int, input().split()))
L=list(map(int, input().split()))
D=0
C=1
for i in L:
    D+=i
    if D<=A[1]:
        C+=1
    else:
        print(C)
        break
else:
    print(N)

Fixed submission:
#B - Bounding(ABC130)
A=list(map(int, input().split()))
L=list(map(int, input().split()))
D=0
C=1
for i in L:
    D+=i
    if D<=A[1]:
        C+=1
    else:
        print(C)
        break
else:
    print(A[0]+1)
Buggy python submission (verdict: Runtime Error):
#B - Five Dishes(ABC123)
B=[]
C=[]
for i in range(5):
    S=int(input())
    if S%10==0:
        C.append(S)
    else:
        C.append(S+(10-S%10))
    if S%10!=0:
        B.append(S%10)
print(sum(C)-(10-min(B)))

Fixed submission:
# B - Five Dishes(ABC123)
B=[]
C=[]
for i in range(5):
    S=int(input())
    if S%10==0:
        C.append(S)
    else:
        C.append(S+(10-S%10))
    if S%10!=0:
        B.append(S%10)
if B==[]:
    print(sum(C))
else:
    print(sum(C)-(10-min(B)))
Buggy python submission (verdict: Runtime Error):
#C - Energy Drink Collector(ABC121)
N,M=map(int, input().split())
L={}
for i in range(N):
    A,B=map(int, input().split())
    L[A]=B
X=sorted(L.keys())
i=0
ans=0
while True:
    if M>=L[X[i]]:
        M-=L[X[i]]
        ans+=X[i]*L[X[i]]
        i+=1
        if M==0:
            break
    else:
        ans+=X[i]*M
        break
print(ans)

Fixed submission:
#C - Energy Drink Collector(ABC121)
N,M=map(int, input().split())
X=[]
for i in range(N):
    a,b=map(int, input().split())
    X.append([a,b])
X.sort()
ans=0
i=0
while M>0:
    if M>=X[i][1]:
        ans+=X[i][1]*X[i][0]
        M-=X[i][1]
        i+=1
    else:
        ans+=X[i][0]*M
        break
print(ans)
Buggy python submission (verdict: Runtime Error):
#best
N=int(input())
a=list(map(int, input().split()))
import fractions
a = list(map(int, input().split()))
ans = a[0]
for i in range(1, N):
    ans = fractions.gcd(ans, a[i])
    if ans==1:
        break
print(ans)

Fixed submission:
#C - Monsters Battle Royale(ABC118)
N=int(input())
A=list(map(int, input().split()))
B=min(A)
i=0
n=1
while i<N:
    a=A[i]%B
    i+=1
    if 0<a<B:
        B=a
        i=0
    elif 0<a:
        i-=1
        A[i]=a
    elif B==1:
        break
print(B)

Buggy python submission (verdict: Runtime Error):
#best
import fractions
a = list(map(int, input().split()))
ans = a[0]
for i in range(1, N):
    ans = fractions.gcd(ans, a[i])
    if ans==1:
        break
print(ans)

Fixed submission:
#C - Monsters Battle Royale(ABC118)
N=int(input())
A=list(map(int, input().split()))
B=min(A)
i=0
n=1
while i<N:
    a=A[i]%B
    i+=1
    if 0<a<B:
        B=a
        i=0
    elif 0<a:
        i-=1
        A[i]=a
    elif B==1:
        break
print(B)
Buggy python submission (verdict: Runtime Error):
#C - Streamline(ABC117)
N,M=map(int, input().split())
X=list(map(int, input().split()))
X.sort(reverse=True)
ans=X[0]-X[-1]
A=[0]*(N-1)
if N<M:
    for i in range(M-1):
        a=X[i]-X[i+1]
        if min(A)<a:
            A[A.index(min(A))]=a
    ans-=sum(A)
else:
    ans=0
print(ans)

Fixed submission:
#C - Streamline(ABC117)
N,M=map(int, input().split())
X=list(map(int, input().split()))
X.sort(reverse=True)
ans=X[0]-X[-1]
A=[]
if N<M:
    for i in range(M-1):
        A.append(X[i]-X[i+1])
    A.sort(reverse=True)
    ans-=sum(A[0:N-1])
else:
    ans=0
print(ans)
Buggy python submission (verdict: Runtime Error):
#B - Shiritori(ABC109)
N=int(input())
W=[]
for i in range(N):
    W.append(input())

if len(set(W))==N:
    for i in range(N-1):
        if W[i][-1]==W[i+1][0]:
            s=True
        
        else:
            print("No")
            s=False
            break   
else:
    print("No")
if s:
    print("Yes")

Fixed submission:
#B - Shiritori(ABC109)
N=int(input())
W=[]
s=True
for i in range(N):
    W.append(input())
if len(set(W))==N:
    for i in range(N-1):
        if W[i][-1]!=W[i+1][0]:
            print("No")
            s=False
            break   
else:
    print("No")
    s=False
if s:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
#A-Good Integer(ABC079)
N=input()
if N[1]==N[2]and set(N)<3:
    print("Yes")
else:
    print("No")

Fixed submission:
#A-Good Integer(ABC079)
N=str(input())
if len(set(N[0:3]))==1 or len(set(N[1:4]))==1:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
import fractions


n, m = map(int, input().split())
s = input()
t = input()

# よい文字列が存在する場合、答えは最小公倍数となる
l = (n * m) // fractions.gcd(n, m)

# 連結するとSになるXの位置リストを生成
ss = [l // n * i for i in range(n)]
# 連結するとTになるXの位置リストを生成
tt = [l // m * i for i in range(m)]

# 条件を満たすか判定
# for s_num in ss:
#     if s_num in tt:
#         s_idx = ss.index(s_num)
#         t_idx = tt.index(s_num)
#         if s[s_idx] != t[t_idx]:
#             l = -1
#             break

# 共通部分を取得
same = set(ss) & set(tt)
for item in same:
    if s[ss.index(item)] != t[tt.index(item)]:
        l = -1
        break
print(l)


Fixed submission:
import fractions


n, m = map(int, input().split())
s = input()
t = input()

# 先頭文字が一致しない場合はよい文字列は存在しないので終了
if s[0] != t[0]:
    print(-1)
    exit()

# よい文字列が存在する場合、答えは最小公倍数となる
l = (n * m) // fractions.gcd(n, m)

# 連結するとSになるXの位置リストを生成
ss = set(l // n * i for i in range(1, n))
# 連結するとTになるXの位置リストを生成
tt = set(l // m * i for i in range(1, m))

# 共通部分を取得
same = list(ss & tt)

# メモリ開放
del ss
del tt

a = [s[item // (l // n)] for item in same]
b = [t[item // (l // m)] for item in same]

print(l) if a == b else print(-1)

Buggy python submission (verdict: Time Limit Exceeded):
import fractions


def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)


n, m = map(int, input().split())
s = input()
t = input()

# よい文字列が存在する場合、答えは最小公倍数となる
l = lcm(n, m)

# 連結するとSになるXの位置リストを生成
ss = [l // n * i for i in range(n)]
# 連結するとTになるXの位置リストを生成
tt = [l // m * i for i in range(m)]

# 条件を満たすか判定
for s_num in ss:
    if s_num in tt:
        s_idx = ss.index(s_num)
        t_idx = tt.index(s_num)
        if s[s_idx] != t[t_idx]:
            l = -1
            break
print(l)


Fixed submission:
import fractions


n, m = map(int, input().split())
s = input()
t = input()

# 先頭文字が一致しない場合はよい文字列は存在しないので終了
if s[0] != t[0]:
    print(-1)
    exit()

# よい文字列が存在する場合、答えは最小公倍数となる
l = (n * m) // fractions.gcd(n, m)

# 連結するとSになるXの位置リストを生成
ss = set(l // n * i for i in range(1, n))
# 連結するとTになるXの位置リストを生成
tt = set(l // m * i for i in range(1, m))

# 共通部分を取得
same = list(ss & tt)

# メモリ開放
del ss
del tt

a = [s[item // (l // n)] for item in same]
b = [t[item // (l // m)] for item in same]

print(l) if a == b else print(-1)
Buggy python submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
v = list(map(int, input().split()))
if v.count(v[0]) == n:
    print(n // 2)
    exit()
e = []
o = []
for i in range(n):
    if i % 2 == 0:
        e.append(v[i])
    else:
        o.append(v[i])
e_counter = Counter(e)
o_counter = Counter(o)
E1 = list(e_counter.keys())[0]
if len(list(e_counter.keys())) > 1:
    E2 = list(e_counter.keys())[1]
else:
    E2 = E1
O1 = list(o_counter.keys())[0]
if len(list(o_counter.keys())) > 1:
    O2 = list(o_counter.keys())[1]
else:
    O2 = O1
e_cnt = n // 2 - max(e.count(E1))
o_cnt = n // 2 - max(o.count(O1))
if e_cnt == 0 and o_cnt == 0:
    print(0)
else:
    print(e_cnt + o_cnt)


Fixed submission:
from collections import Counter
n = int(input())
v = list(map(int, input().split()))
e = []
o = []
for i in range(n):
    if i % 2 == 0:
        e.append(v[i])
    else:
        o.append(v[i])
e_counter = Counter(e)
o_counter = Counter(o)
e_most = e_counter.most_common()
o_most = o_counter.most_common()
E1 = e_most[0][0]
E2 = E1
if len(e_most) > 1:
    E2 = e_most[1][0]
O1 = o_most[0][0]
O2 = O1
if len(o_most) > 1:
    O2 = o_most[1][0]
e_cnt = n // 2 - e.count(E1)
o_cnt = n // 2 - o.count(O1)
if e_cnt == 0 and o_cnt == 0:
    if e[0] == o[0]:
        print(n // 2)
    else:
        print(0)
else:
    if E1 != O1:
        print(e_cnt + o_cnt)
    else:
        if E1 == O2:
            e_cnt = n // 2 - e.count(E2)
            print(e_cnt + o_cnt)
        elif E2 == O1:
            o_cnt = n // 2 - o.count(O2)
            print(e_cnt + o_cnt)
        else:
            cnt1 = n // 2 - e.count(E2) + o_cnt
            cnt2 = e_cnt + n // 2 - o.count(O2)
            print(min(cnt1, cnt2))
Buggy python submission (verdict: Time Limit Exceeded):
a, b, k = map(int, input().split())
for i in range(a, b + 1):
    if i <= a + (k - 1):
        print(i)
    elif i >= b - (k - 1):
        print(i)


Fixed submission:
a, b, k = map(int, input().split())
for i in range(a, min(b, a+k-1)+1):
    print(i)
for i in range(max(b-k+1, a+k), b+1):
    print(i)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input())

res = 0
for i in range(a, b + 1):
    i_str = str(i)
    if i_str == i_str[::-1]:
        res += 1
print(res)


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

res = 0
for i in range(a, b + 1):
    i_str = str(i)
    if i_str == i_str[::-1]:
        res += 1
print(res)
Buggy python submission (verdict: Runtime Error):
n = int(input())
l0 = 2
l1 = 1
if n == 0:
    print(l0)
    return
if n == 1:
    print(l1)
    return

l_prev = l0
l_next = l1

i = 2
while True:
    l_new = l_prev + l_next
    if n == i:
        print(l_new)
        break
    l_prev = l_next
    l_next = l_new
    i += 1


Fixed submission:
n = int(input())

l = [2, 1]
for i in range(2, n+1):
    l.append(l[i - 2] + l[i - 1])
print(l[n])

Buggy python submission (verdict: Runtime Error):
n = int(input())

l_prev = l0
l_next = l1

l_new = 0
for i in range(2, n+1):
    l_new = l_prev + l_next
    l_prev = l_next
    l_next = l_new
print(l_new)


Fixed submission:
n = int(input())

l = [2, 1]
for i in range(2, n+1):
    l.append(l[i - 2] + l[i - 1])
print(l[n])

Buggy python submission (verdict: Runtime Error):
n = long(input())
l0 = 2L
l1 = 1L
if n == 0:
    print(l0)
if n == 1:
    print(l1)

l_prev = l0
l_next = l1

l_new = 0L
for i in range(2, n+1):
    l_new = l_prev + l_next
    l_prev = l_next
    l_next = l_new
print(l_new)


Fixed submission:
n = int(input())

l = [2, 1]
for i in range(2, n+1):
    l.append(l[i - 2] + l[i - 1])
print(l[n])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l0 = 2
l1 = 1
if n == 0:
    print(l0)
if n == 1:
    print(l1)

l_prev = l0
l_next = l1

i = 2
while True:
    l_new = l_prev + l_next
    if n == i:
        print(l_new)
        break
    l_prev = l_next
    l_next = l_new
    i += 1


Fixed submission:
n = int(input())

l = [2, 1]
for i in range(2, n+1):
    l.append(l[i - 2] + l[i - 1])
print(l[n])
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
h = list(map(int, input().split()))
temp = 0
for i in range(n-1):
    a = 0
    while i+a+1 < n and h[i+a]>=h[i+a+1]:
        a += 1
        temp = max(temp, a)
print(temp)

Fixed submission:
n = int(input())
h = list(map(int, input().split()))
temp = 0
i = 0
while i<n:
    a = 0
    while i+a+1 < n and h[i+a]>=h[i+a+1]:
        a += 1
        temp = max(temp, a)
    if a == 0: i+=1
    else: i+=a
print(temp)
Buggy python submission (verdict: Runtime Error):
n = int(input())
print(sum(list(range(n))))

Fixed submission:
n = int(input())-1
print(int(n*(n+1)//2))