Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int, input().split())

A_B = (a+b)
A_C = (a+c)
B_C = (b+c)

if (A_B == c) or (A_C == b) or (B_C = a):
    print("Yes")
else:
    print("No")

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

A_B = (a+b)
A_C = (a+c)
B_C = (b+c)

if (A_B == c):
    print("Yes")
elif (A_C == b):
    print("Yes")
elif (B_C == a ):
    print("Yes")
else:
    print("No")

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

A_B = (A+B)
A_C = (A+C)
B_C = (B+C)

if A_B == C or A_C == B or B_C = A:
    print("Yes")
else:
    print("No")

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

A_B = (a+b)
A_C = (a+c)
B_C = (b+c)

if (A_B == c):
    print("Yes")
elif (A_C == b):
    print("Yes")
elif (B_C == a ):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
 
print(k * (k-1)**(n-1))

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

if a == b and a == c:
    print(1)
elif a == b and a != c:
    print(2)
elif a == c and a != b:
    print(2)
elif b == c and b != a:
    print(2)
else:
    print(3)
Buggy python submission (verdict: Runtime Error):
a

Fixed submission:
a=list(input())
b=list(input())
c=list(input())
s=a.pop(0)
w=''
while True:
    if(s=='a'):
        if(len(a)==0):
            w='A'
            break
        s=a.pop(0)
    elif(s=='b'):
        if(len(b)==0):
            w='B'
            break
        s=b.pop(0)
    else:
        if(len(c)==0):
            w='C'
            break
        s=c.pop(0)
print(w)
Buggy python submission (verdict: Runtime Error):
N = int(input())
K = int(input())
X = int(input())
Y = int(input())

# N泊連続で行う。最初の K 泊まで X 円.　K+1泊以降はY円

if  N <= K:
    print(X*N)
else:
    print(((N-K)*Y) + (X*Y)

Fixed submission:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())
if N <= K :
    ans = X * N
else :
    ans = X * K + Y * (N - K)
print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
K = int(input())
X = int(input())
Y = int(input())

D = (N-K)*X + (N-(K+1))*Y 

# N泊連続で行う。最初の K 泊まで X 円.　K+1泊以降はY円

if  N <= (K+1):
    print(X*X)
elif  N >= (K+1):
    print(((N-K)*X) + ((N-(K+1))*Y)


#　10泊する　5泊目までX円　6泊目からY円　(((N-K)*X) + ()

Fixed submission:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())
if N <= K :
    ans = X * N
else :
    ans = X * K + Y * (N - K)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
a, b = map(int, input().split())
ans = 1
for i in range(a,(b+1)):
    ans = ans*i

if ans > 0:
    print("Positive")
elif ans < 0:
    print("Negative")
else:
    print("Zero")

Fixed submission:
a, b = [int(x) for x in input().split()]

if a > 0:
    print('Positive')
elif a <= 0 and 0 <= b:
    print('Zero')
elif (b - a) % 2 == 0:
    print('Negative')
else:
    print('Positive')
Buggy python submission (verdict: Runtime Error):
N, L = map(int, input().split())
S = []
for _ in range(H):
    S.append(input())

S1 = sorted(S)

S2 ="".join(S1)

print(S2)

Fixed submission:
N, L = map(int, input().split())
S = []
for _ in range(N):
    S.append(input())

S1 = sorted(S)

S2 ="".join(S1)

print(S2)

Buggy python submission (verdict: Runtime Error):
a

Fixed submission:
N, L = map(int, input().split())
S = []
for _ in range(N):
    S.append(input())

S1 = sorted(S)

S2 ="".join(S1)

print(S2)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
a=1
if 0 in A:
    print(0)
else:
    for i in range(N):
        a*=A[i]
    if a>1000000000000000000:
        print(-1)
    else:
        print(int(a))

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
a=1
if 0 in A:
    print(0)
else:
    for i in range(N):
        a*=A[i]
        if a>1000000000000000000:
          print(-1)
          break
    else:
        print(int(a))

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
a=1
if 0 in A:
    print(0)
else:
    for i in range(N):
        a*=A[i]
    if a>(int(10**18)):
        print(-1)
    else:
        print(a)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
a=1
if 0 in A:
    print(0)
else:
    for i in range(N):
        a*=A[i]
        if a>1000000000000000000:
          print(-1)
          break
    else:
        print(int(a))

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
a=1
if 0 in A:
    print(0)
else:
    for i in range(N):
        a=a*A[i]
    if a>(10**18):
        print('-1')
    else:
        print(a)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
a=1
if 0 in A:
    print(0)
else:
    for i in range(N):
        a*=A[i]
        if a>1000000000000000000:
          print(-1)
          break
    else:
        print(int(a))

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
a=1
for i in range(N):
    a=a*A[i]
if a>(10**18):
    print('-1')
else:
    print(a)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
a=1
if 0 in A:
    print(0)
else:
    for i in range(N):
        a*=A[i]
        if a>1000000000000000000:
          print(-1)
          break
    else:
        print(int(a))
Buggy python submission (verdict: Time Limit Exceeded):
H,W=map(int,input().split())
n=0
for i in range(1,H+1):
    for j in range(1,W+1):
        if (i+j)%2==0:
            n+=1
print(n)

Fixed submission:
H,W=map(int,input().split())
if H==1 or W==1:
    print(1)
elif (H*W)%2==0:
    print((H*W)//2)
else:
    print((H*W+1)//2)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
A=[str(a)*b]
B=[str(b)*a]
if a>b:
    print(int(B))
if a<b:
    print(int(A))
if a==b:
    print(int(A))

Fixed submission:
a,b=map(int,input().split())
A=[str(a)*b]
B=[str(b)*a]
if a>b:
    print(int(''.join(B)))
if a<b:
    print(int(''.join(A)))
if a==b:
    print(int(''.join(A)))
Buggy python submission (verdict: Runtime Error):
S=list(input())
T=list('keyence')
A=[]
B=[]
C=[]
a=0
for i in range(len(S)):
    if S[i]==T[a]:
        A.append(i)
        a+=1
if len(A)!=7:
    print('NO')
elif A==[0,1,2,3,4,5,6]:
    print('YES')
else:
    for i in range(0,A[len(A)-1]+1):
        B.append(i)
    for i in range(len(B)):
        if B[i] not in A:
            C.append(B[i])
    if C[len(C)-1]-C[0]==len(C)-1:
        print('YES')
    else:
        print('NO')

Fixed submission:
u=str(input())
S=u.replace(' ','z')
A=[]
for i in range(len(S)+1):
    for j in range(len(S)+1):
        if i<=j:
            A.append(S.replace(S[i-1:j],'',1))
if 'keyence' in A:
    print('YES')
else:
    print('NO')

Buggy python submission (verdict: Runtime Error):
S=list(input())
T=list('keyence')
A=[]
B=[]
C=[]
a=0
for i in range(len(S)):
    if S[i]==T[a]:
        A.append(i)
        a+=1
if len(A)!=7:
    print('NO')
elif len(A)==7:
    print('YES')
else:
    for i in range(0,A[len(A)-1]+1):
        B.append(i)
    for i in range(len(B)):
        if B[i] not in A:
            C.append(B[i])
    if C[len(C)-1]-C[0]==len(C)-1:
        print('YES')
    else:
        print('NO')

Fixed submission:
u=str(input())
S=u.replace(' ','z')
A=[]
for i in range(len(S)+1):
    for j in range(len(S)+1):
        if i<=j:
            A.append(S.replace(S[i-1:j],'',1))
if 'keyence' in A:
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Runtime Error):
D,N=map(int,input().split())
a=100**(D)
A=[]
for i in range(1,101):
    A.append(i*a)
if D==0:
    A.remove(100)
elif D==1:
    A.remove(10000)
elif D==2:
    A.remove(1000000)
print(A[N-1])

Fixed submission:
D,N=map(int,input().split())
a=100**(D)
A=[]
for i in range(1,101):
    A.append(i*a)
if D==0:
    A.remove(100)
    A.append(101)
elif D==1:
    A.remove(10000)
    A.append(10100)
elif D==2:
    A.remove(1000000)
    A.append(1010000)
print(A[N-1])
Buggy python submission (verdict: Runtime Error):
import numpy as np
a,b=map(str,input().split())
c=int(a+b)
if np.sqrt(c)%1==0:
    print('Yes')
else:
    print('No')

Fixed submission:
a,b=map(str,input().split())
c=int(a+b)
if (c**(1/2))%1==0:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
N=int(input())
AB=[]
for i in range(N):
    AB.append(list(map(int,input().split())))
a=AB[0][1]
for i in range(N-1):
    if AB[i+1][1]<AB[i][1]:
        a=AB[i+1][1]
        b=i+1
print(a+AB[b][0])

Fixed submission:
N=int(input())
AB=[]
for i in range(N):
    AB.append(list(map(int,input().split())))
a=AB[0][1]
b=0
for i in range(1,N):
    if AB[i][1]<a:
        a=AB[i][1]
        b=i
print(a+AB[b][0])

Buggy python submission (verdict: Runtime Error):
N=int(input())
AB=[]
for i in range(N):
    AB.append(list(map(int,input().split())))
a=AB[0][1]
for i in range(N-1):
    if AB[i+1][1]<AB[i][1]:
        a=AB[i+1][1]
        b=i+1
print(a+AB[b][0])

Fixed submission:
N=int(input())
AB=[]
for i in range(N):
    AB.append(list(map(int,input().split())))
a=AB[0][1]
b=0
for i in range(1,N):
    if AB[i][1]<a:
        a=AB[i][1]
        b=i
print(a+AB[b][0])

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
AB=[]
for i in range(N):
    AB.append(list(map(int,input().split())))
A=[]
B=[]
for i in range(N):
    A.append(AB[i][0])
    B.append(AB[i][1])
for i in range(N):
    if B[i]==min(B):
        bmin=i
print(A[bmin]+B[bmin])

Fixed submission:
N=int(input())
AB=[]
for i in range(N):
    AB.append(list(map(int,input().split())))
a=AB[0][1]
b=0
for i in range(1,N):
    if AB[i][1]<a:
        a=AB[i][1]
        b=i
print(a+AB[b][0])

Buggy python submission (verdict: Runtime Error):
N=int(input())
AB=[]
for i in range(N):
    AB.append(list(map(int,input().split())))
A=[]
B=[]
for i in range(N):
    A.append(AB[i][0])
    B.append(AB[i][1])
for i in range(N):
    if B[i]==max(B):
        bmax=i
    elif B[i]==min(B):
        bmin=i
print(A[bmin]+B[bmin])

Fixed submission:
N=int(input())
AB=[]
for i in range(N):
    AB.append(list(map(int,input().split())))
a=AB[0][1]
b=0
for i in range(1,N):
    if AB[i][1]<a:
        a=AB[i][1]
        b=i
print(a+AB[b][0])

Buggy python submission (verdict: Runtime Error):
N=int(input())
AB=[]
for i in range(N):
    AB.append(list(map(int,input().split())))
A=[]
B=[]
for i in range(N):
    A.append(AB[i][0])
    B.append(AB[i][1])
for i in range(N):
    if B[i]==max(B):
        bmax=i
    elif B[i]==min(B):
        bmin=i
print(A[bmin]+B[bmin])

Fixed submission:
N=int(input())
AB=[]
for i in range(N):
    AB.append(list(map(int,input().split())))
a=AB[0][1]
b=0
for i in range(1,N):
    if AB[i][1]<a:
        a=AB[i][1]
        b=i
print(a+AB[b][0])
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
for i in range(1,N):
    N*=i
print(N%((10**9)+7))

Fixed submission:
N=int(input())
a=1
for i in range(1,N+1):
    a=(a*i)%((10**9)+7)
print(a)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
for i in range(1,N):
    N*=i
print(N%((10**9)+7))

Fixed submission:
N=int(input())
a=1
for i in range(1,N+1):
    a=(a*i)%((10**9)+7)
print(a)
Buggy python submission (verdict: Time Limit Exceeded):
s=input()
A=[]
B=[]
for i in range(len(s)):
    for j in range(len(s)):
        if i<j and s[i]=='A' and s[j]=='Z':
            A.append(j+1-i)
print(max(A))

Fixed submission:
s=input()
A=[]
B=[]
for i in range(0,len(s)):
    if s[i]=='A':
        a=i
        break
S=list(reversed(s))
for j in range(0,len(S)):
    if S[j]=='Z':
        b=j
        break
print(len(s)-a-b)

Buggy python submission (verdict: Time Limit Exceeded):
s=input()
A=[]
B=[]
for i in range(len(s)):
    for j in range(len(s)):
        if i<j and s[i]=='A' and s[j]=='Z':
            A.append(s[i:j+1])
for i in range(len(A)):
    B.append(len(A[i]))
print(max(B))

Fixed submission:
s=input()
A=[]
B=[]
for i in range(0,len(s)):
    if s[i]=='A':
        a=i
        break
S=list(reversed(s))
for j in range(0,len(S)):
    if S[j]=='Z':
        b=j
        break
print(len(s)-a-b)

Buggy python submission (verdict: Time Limit Exceeded):
s=input()
A=[]
B=[]
for i in range(len(s)):
    for j in range(len(s)):
        if i<j and s[i]=='A' and s[j]=='Z':
            A.append(s[i:j+1])
for i in range(len(A)):
    B.append(len(A[i]))
print(max(B))

Fixed submission:
s=input()
A=[]
B=[]
for i in range(0,len(s)):
    if s[i]=='A':
        a=i
        break
S=list(reversed(s))
for j in range(0,len(S)):
    if S[j]=='Z':
        b=j
        break
print(len(s)-a-b)
Buggy python submission (verdict: Runtime Error):
A,B=map(str,input().split())
B=int(float(B)*100)
ans=A*B
print(int(ans//100))

Fixed submission:
A,B=map(str,input().split())
B_100=B.replace('.','')
print(int(A)*int(B_100)//100)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
ans=[]
for i in range(N):
    S=input()
    if S not in ans:
        ans.append(S)
print(len(ans))

Fixed submission:
N=int(input())
ans=set()
for i in range(N):
    S=input()
    ans.add(S)
print(len(ans))

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
ans=[]
for i in range(N):
    S=input()
    if S not in ans:
        ans.append(S)
print(len(ans))

Fixed submission:
N=int(input())
ans=set()
for i in range(N):
    S=input()
    ans.add(S)
print(len(ans))
Buggy python submission (verdict: Time Limit Exceeded):
import math
K=int(input())
ans=0
for i in range(1,K+1):
    for j in range(1,K+1):
        for k in range(1,K+1):
            ans+=math.gcd(i,math.gcd(j,k))
print(ans)

Fixed submission:
def gcd(a,b):
    if a<b:
        a,b=b,a
    if b==0:
        return a
    else:
        return gcd(b,a%b)

K=int(input())
ans=0
for i in range(1,K+1):
    for j in range(1,K+1):
        for k in range(1,K+1):
            ans+=gcd(i,gcd(j,k))
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
def gcd(a,b):
    if a<b:
        a,b=b,a
    if b==0:
        return a
    else:
        return gcd(b,a%b)

K=int(input())
ans=0
for i in range(1,K+1):
    for j in range(1,K+1):
        for k in range(1,K+1):
            ans+=gcd(i,gcd(j,k))
print(ans)

Fixed submission:
def gcd(a,b):
    if a<b:
        a,b=b,a
    if b==0:
        return a
    else:
        return gcd(b,a%b)

K=int(input())
ans=0
for i in range(1,K+1):
    for j in range(1,K+1):
        for k in range(1,K+1):
            ans+=gcd(i,gcd(j,k))
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
S=list(input())
Q=int(input())
re=True
cnt=0
for i in range(Q):
    q=list(map(str,input().split()))
    if q[0]=='1':
        cnt+=1
        if re==True:
            re=False
        else:
            re=True
    else:
        if re==True:
            if q[1]=='1':
                S.insert(0,q[2])
            else:
                S.append(q[2])
        else:
            if q[1]=='2':
                S.insert(0,q[2])
            else:
                S.append(q[2])
if cnt%2==1:
    S.reverse()
print(*S,sep='')

Fixed submission:
from collections import deque
S=deque(input())
Q=int(input())
re=True
cnt=0
for i in range(Q):
    q=list(map(str,input().split()))
    if q[0]=='1':
        cnt+=1
        if re==True:
            re=False
        else:
            re=True
    else:
        if re==True:
            if q[1]=='1':
                S.appendleft(q[2])
            else:
                S.append(q[2])
        else:
            if q[1]=='2':
                S.appendleft(q[2])
            else:
                S.append(q[2])
if cnt%2==1:
    S.reverse()
print(*S,sep='')

Buggy python submission (verdict: Time Limit Exceeded):
S=list(input())
Q=int(input())
re=True
cnt=0
for i in range(Q):
    q=list(map(str,input().split()))
    if q[0]=='1':
        cnt+=1
        if re==True:
            re=False
        else:
            re=True
    else:
        if re==True:
            if q[1]=='1':
                S.insert(0,q[2])
            else:
                S.append(q[2])
        else:
            if q[1]=='2':
                S.insert(0,q[2])
            else:
                S.append(q[2])
if cnt%2==1:
    S.reverse()
print(*S,sep='')

Fixed submission:
from collections import deque
S=deque(input())
Q=int(input())
re=True
cnt=0
for i in range(Q):
    q=list(map(str,input().split()))
    if q[0]=='1':
        cnt+=1
        if re==True:
            re=False
        else:
            re=True
    else:
        if re==True:
            if q[1]=='1':
                S.appendleft(q[2])
            else:
                S.append(q[2])
        else:
            if q[1]=='2':
                S.appendleft(q[2])
            else:
                S.append(q[2])
if cnt%2==1:
    S.reverse()
print(*S,sep='')
Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
ans=10**(N-1)
if M==0:
    print(ans)
else:
    S=[]
    C=[]
    for i in range(M):
        s,c=map(int,input().split())
        S.append(s)
        C.append(c)
    for i in range(1000):
        flag=True
        I=str(i)
        for j in range(M):
            if N<S[j]:
                flag=False
            else:
                if I[S[j]-1]!=str(C[j]):
                    flag=False
        if flag==True:
            print(i)
            exit()
    print(-1)

Fixed submission:
N,M=map(int,input().split())
if M==0:
    if N==1:
        print(0)
    else:
        print(10**(N-1))
else:
    S=[]
    C=[]
    for i in range(M):
        s,c=map(int,input().split())
        S.append(s)
        C.append(c)
    if N==1:
        o=0
    else:
        o=10**(N-1)
    for i in range(o,10**N):
        flag=True
        I=str(i)
        for j in range(M):
            if N<S[j]:
                flag=False
            else:
                if I[S[j]-1]!=str(C[j]):
                    flag=False
        if flag==True:
            print(i)
            exit()
    print(-1)
Buggy python submission (verdict: Runtime Error):
t,s=map(input().split())
print(s+t)


Fixed submission:
t,s=map(str,input().split())
print(s+t)
Buggy python submission (verdict: Runtime Error):
import math
A,B=map(int,input().split())
print(int(A*B/math.gcd(A,B)))

Fixed submission:
A,B=map(int,input().split())
def gcd(a,b):
    if a<b:
        a,b=b,a
    if b==0:
        return a
    else:
        return gcd(b,a%b)
print(int(A*B/gcd(A,B)))
Buggy python submission (verdict: Runtime Error):
import math

N=int(input())
S=[]
for i in range(N):
    s=input()
    ss=list(s)
    ss.sort()
    S.append(ss)
S.sort()
ans=0
cnt=0
for i in range(N-1):
    if S[i]==S[i+1]:
        cnt+=1
    else:
        ans+=math.factorial(cnt-1)
        cnt=0
print(ans)

Fixed submission:
N=int(input())
S_list=[]
for i in range(N):
    s=input()
    ss=list(s)
    ss.sort()
    S_list.append(ss)
S_list.sort()
ans=0
cnt=0
for i in range(1,N):
    if S_list[i]==S_list[i-1]:
        cnt+=1
        ans+=cnt
    else:
        cnt=0
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
A,B,C,D=map(int,input().split())
CD=(C*D)//(math.gcd(C,D))
A=A-1
num_B=B-B//C-B//D+B//CD
num_A=A-A//C-A//D+A//CD
print(int(num_B-num_A))

Fixed submission:
import fractions
A,B,C,D=map(int,input().split())
CD=(C*D)//(fractions.gcd(C,D))
A=A-1
num_B=B-B//C-B//D+B//CD
num_A=A-A//C-A//D+A//CD
print(int(num_B-num_A))

Buggy python submission (verdict: Runtime Error):
import math
A,B,C,D=map(int,input().split())
CD=(C*D)//(math.gcd(C,D))
A=A-1
num_B=B-B//C-B//D+B//CD
num_A=A-A//C-A//D+A//CD
print(int(num_B-num_A))
print(CD)

Fixed submission:
import fractions
A,B,C,D=map(int,input().split())
CD=(C*D)//(fractions.gcd(C,D))
A=A-1
num_B=B-B//C-B//D+B//CD
num_A=A-A//C-A//D+A//CD
print(int(num_B-num_A))
Buggy python submission (verdict: Runtime Error):
N,X=map(int,input().split())
L=list(map(int,input().split()))
D=0
cnt=0
i=0
while(D<=X):
    cnt+=1
    D=D+L[i]
    i+=1
print(cnt)

Fixed submission:
N,X=map(int,input().split())
L=list(map(int,input().split()))
D=0
cnt=1
for i in range(N):
    D=D+L[i]
    if D<=X:
        cnt+=1
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
R,G,B,N=map(int,input().split())
cnt=0
for i in range(N+1):
    for j in range(N+1):
        if i*R+j*G<=N and (N-(i*R+j*G))%B==0:
            cnt+=1
print(cnt)

Fixed submission:
R,G,B,N=map(int,input().split())
cnt=0
for i in range(N+1):
    for j in range(N+1):
        if i*R+j*G<=N and (N-(i*R+j*G))%B==0:
            cnt+=1
print(cnt)
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input(),split())
if n%2==0:
    if n/2>=k:
        print('YES')
    else:
        print('NO')
else:
    if (n//2)+1>=k:
        print('YES')
    else:
        print('NO')

Fixed submission:
n,k=map(int,input().split())
if n%2==0:
    if n/2>=k:
        print('YES')
    else:
        print('NO')
else:
    if (n//2)+1>=k:
        print('YES')
    else:
        print('NO')
Buggy python submission (verdict: Runtime Error):
n=int(input()
h=list(map(int,input().split()))
ans=0
for i in range(max(h)):
      cnt=0
      for j in range(n):
            if h［j］>=i+1:
                  cnt+=1
            elif j==n-1:
                  ans+=cnt
            else:
                  ans+=cnt
                  cnt=0
print(ans)

Fixed submission:
n=int(input())
h=list(map(int,input().split()))
h.append(0)
ans=0
for i in range(max(h)):
    cnt=0
    for j in range(n+1):
        if h[j]>=i+1:
            cnt+=1
        else:
            if cnt>=1:
                ans+=1
            cnt=0
print(ans)
Buggy python submission (verdict: Runtime Error):
4 54

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

print(int(A+B/2))
Buggy python submission (verdict: Runtime Error):
S=input()
T=input()
s=0
flag1=False
for i in range(len(S)-len(T)+1):
    flag2=True
    for j in range(len(T)):
        if S[i+j]!=T[j] and S[i+j]!='?':
            flag2=False
    if flag2==True:
        flag1=True
        s=i
if flag1==False:
    print('UNRESTORABLE')
else:
    for i in range(len(S)):
        if i>=s:
            print(T[i-s],end='')
        elif S[i]=='?':
            print('a',end='')
        else:
            print(S[i],end='')

Fixed submission:
S=input()
T=input()
s=0
flag1=False
for i in range(len(S)-len(T)+1):
    flag2=True
    for j in range(len(T)):
        if S[i+j]!=T[j] and S[i+j]!='?':
            flag2=False
    if flag2==True:
        flag1=True
        s=i
if flag1==False:
    print('UNRESTORABLE')
else:
    for i in range(len(S)):
        if i>=s and i-s<len(T):
            print(T[i-s],end='')
        elif S[i]=='?':
            print('a',end='')
        else:
            print(S[i],end='')
Buggy python submission (verdict: Runtime Error):
N=int(input())
A={}
for _ in range(N):
    a=int(input())
    if a not in A:
        A.append(a)
    else:
        A.remove(a)
print(len(A))

Fixed submission:
N=int(input())
A=set()
for _ in range(N):
    a=int(input())
    if a not in A:
        A.add(a)
    else:
        A.remove(a)
print(len(A))

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=[]
for _ in range(N):
    a=int(input())
    if a not in A:
        A.append(a)
    else:
        A.remove(a)
print(len(A))

Fixed submission:
N=int(input())
A=set()
for _ in range(N):
    a=int(input())
    if a not in A:
        A.add(a)
    else:
        A.remove(a)
print(len(A))

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=[]
for _ in range(N):
    a=int(input())
    if a not in A:
        A.append(a)
    else:
        A.remove(a)
print(len(A))

Fixed submission:
N=int(input())
A=set()
for _ in range(N):
    a=int(input())
    if a not in A:
        A.add(a)
    else:
        A.remove(a)
print(len(A))