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

Fixed submission:
from fractions import gcd
N, K = map(int, input().split())
A = list(map(int, input().split()))
if max(A) < K:
    print("IMPOSSIBLE")
else:
    temp = A[0]
    for a in A[1:]:
        temp = gcd(a, temp)
    if K % temp == 0:
        print("POSSIBLE")
    else:
        print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
from math import gcd
N, K = map(int, input().split())
A = list(map(int, input().split()))
if max(A) < K:
    print("IMPOSSIBLE")
else:
    temp = A[0]
    for a in A[1:]:
        temp = gcd(a, temp)
    if K % temp == 0:
        print("POSSIBLE")
    else:
        print("IMPOSSIBLE")
Problem p04031 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
work = sum(a)/n
work = int(work) if work-int(work)<0.5 else int(work)+1
result = 0
for el in a:
    result += (work-el)**2
print(result)

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
a = list(map(int, input().split()))
work = math.round(sum(a)/n, 0) 
result = 0
for el in a:
    result += (work-el)**2
print(result)
Problem p02657 (python)

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

c = a * b
print(c)

Buggy submission (verdict: Runtime Error):
a, b = int(input.split())
print(a * b)
Problem p03455 (python)

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

if a * b % 2 == 0:
    print("Even")
else:
    print("Odd")

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())

if a * b % 2 == 0:
    print("Even")
else:
    print("Odd")
Problem p02639 (python)

Fixed submission:
x1, x2, x3, x4, x5 = input().split()
x = list()
x.append(x1)
x.append(x2)
x.append(x3)
x.append(x4)
x.append(x5)
ans = 0
for i, j in enumerate(x):
  if int(j) == 0:
  	ans = i+1
print(int(ans))

Buggy submission (verdict: Runtime Error):
x1, x2, x3, x4, x5 = int(input().split( ))
x = []
x.append(x1)
x.append(x2)
x.append(x3)
x.append(x4)
x.append(x5)
ans = 0
for i, j in enumerate(x):
  if i+1 != j:
  	ans = j
print(type(0 2 3 4 5),j)

Buggy submission (verdict: Runtime Error):
x1, x2, x3, x4, x5 = int(input().split())
x = list()
x.append(x1)
x.append(x2)
x.append(x3)
x.append(x4)
x.append(x5)
ans = 0
for i, j in enumerate(x):
  if i+1 != j:
  	ans = j
print(type(0 2 3 4 5),j)

Buggy submission (verdict: Runtime Error):
x1, x2, x3, x4, x5 = int(input().split())
x = list()
x.append(x1)
x.append(x2)
x.append(x3)
x.append(x4)
x.append(x5)
ans = 0
for i, j in enumerate(x):
  if i+1 != j:
  	ans = j
print(j)

Buggy submission (verdict: Runtime Error):
x1, x2, x3, x4, x5 = int(input().split())
x = list()
x.append(x1)
x.append(x2)
x.append(x3)
x.append(x4)
x.append(x5)
ans = 0
for i, j in enumerate(x):
  if i+1 != j
  ans = j
print(j)
Problem p02664 (python)

Fixed submission:
T_list = input()
T = list(T_list)
nT = [0]*len(T)
if T[len(T)-1] == '?':
    T[len(T)-1] = 'D'
for i in range(len(T)):
    if T[i] != '?':
        nT[i] = T[i]
    else:
        if 0<i and i<len(T)-1:
            if T[i-1] == 'P':
                nT[i] = 'D'
                T[i] = 'D'
            elif T[i+1] == 'D':
                nT[i] = 'P'
                T[i] = 'P'
            elif T[i+1] == '?':
                nT[i] = 'P'
                T[i] = 'P'
            else:
                nT[i] = 'D'
                T[i] = 'D'
        else:
            if i<len(T)-1:
                if T[i+1] == 'D':
                    nT[i] = 'P'
                    T[i] = 'P'
                elif T[i+1] == '?':
                    nT[i] = 'P'
                    T[i] = 'P'
                else:
                    nT[i] = 'D'
                    T[i] = 'D'
nT=''.join(nT)              
print(nT)

Buggy submission (verdict: Runtime Error):
T_list = input()
T = list(T_list)
nT = [0]*len(T)
for i in range(len(T)):
    if T[i] != '?':
        nT[i] = T[i]
    else:
        if 0<i:
            if T[i-1] == 'P':
                nT[i] = 'D'
                T[i] = 'D'
            elif T[i+1] == 'D':
                nT[i] = 'P'
                T[i] = 'P'
            elif T[i+1] == '?':
                nT[i] = 'P'
                T[i] = 'P'
            else:
                nT[i] = 'D'
                T[i] = 'D'
nT=''.join(nT)              
print(nT)

Buggy submission (verdict: Runtime Error):
T_list = input()
T = list(T_list)
nT = [0]*len(T)
for i in range(len(T)):
    if T[i] != '?':
        nT[i] = T[i]
    else:
        if 0<i:
            if T[i-1] == 'P':
                nT[i] = 'D'
                T[i] = 'D'
            elif T[i+1] == 'D':
                nT[i] = 'P'
                T[i] = 'P'
            elif T[i+1] == '?':
                nT[i] = 'P'
                T[i] = 'P'
nT=''.join(nT)              
print(nT)
Problem p02706 (python)

Fixed submission:
N,M = map(int, input().split())
A = [list(map(int,input().split()))]
SUM = sum(A[0])
if SUM>N:
    print(-1)
else:
    print(N-SUM)

Buggy submission (verdict: Runtime Error):
N,M = map(int, input().split())
A = [0]*M
for i in range(M):
    A[i] = int(input())
SUM = sum(A)
if SUM>N:
    print(-1)
else:
    print(N-SUM)
Problem p02713 (python)

Fixed submission:
import math
 
 
N = int(input())
 
s = 0
 
for i in range(N):
    for j in range(N):
        ss = math.gcd(i+1,j+1)
        for k in range(N):
            s +=math.gcd(ss,k+1)
 
print(s)

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce
from math import gcd
K = int(input())
A=[]
B=[]
for a in range(1,K+1):
    for b in range(1,K+1):
        A.append(gcd(a,b))
for x in range(len(A)):
    for c in range(1,K+1):
        B.append(gcd(A[x],c))
for i in range(len(B)):
    sum +=B[i]
print(sum)

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce
from math import gcd
K = int(input())
A=[]
B=[]
sum=0
for a in range(1,K+1):
    for b in range(1,K+1):
        A.append(gcd(a,b))
for c in range(1,K+1):
    for d in range(1,K+1):
        B.append(gcd(A[c],d))
        sum+=B[c]
print(sum)

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce
from math import gcd
K = int(input())
A=[]
B=[]
sum=0
for a in range(1,K+1):
    for b in range(1,K+1):
        A.append(gcd(a,b))
for c in range(1,K+1):
    for d in range(1,K+1):
        B.append(gcd(A[c],d)
        sum+=B[c]
print(sum)
Problem p02718 (python)

Fixed submission:
N,M = map(int, input().split())
A = [int(N) for N in input().split()]
X=0
F=sum(A)/(4*M)
for i in range(N):
    if A[i] >= F:
        X+=1
if X>=M:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
M = map(int, input().split())
A = [int(N) for N in input().split()]
X=0
F=int(sum(A)/(4*M))
for i in range(N):
    if A[i] >= F:
        X+=1
if X>=M:
    print('Yes')
else:
    print('No')
Problem p02719 (python)

Fixed submission:
N,K =  map(int, input().split())
i=1
X=N%K
A=[]
A.append(X)
if K!=1:
    while True:
        A.append(abs(A[i-1]-K))
        if A[i] in (A):
            break
        i+=1
    print(min(A))
else:
    print(0)

Buggy submission (verdict: Runtime Error):
N,K =  map(int, input().split())
i=1
A[0]=N
if K!=1:
    while True:
        A[i]=abs(A[i]-K)
        if A[i] in A:
            break
        i+=1
    print(min(A))
else:
    print(0)
Problem p02780 (python)

Fixed submission:
N,K = map(int, input().split())
P = list(map(int,input().split()))
Px  =[]
for i in range(N):
    Px.append((1+P[i])/2)
temp_num = sum(Px[0:K])
temp_max = sum(Px[0:K])
#print(Px)
for j in range(N-K):
    #print(temp_num)
    temp_num = temp_num-Px[j]+Px[j+K]
    if temp_max <temp_num:
        temp_max=temp_num
print(temp_max)

Buggy submission (verdict: Runtime Error):
N,K = map(int, input().split())
P = list(map(int,input().split()))
Px  =[]
for i in range(N):
    Px.append((1+P[i])/2)
temp_num = sum(Px[0:K])
temp_max = sum(Px[0:K])
for j in range(N-K+1):
    temp_num = temp_num-Px[j]+Px[j+K]
    if temp_max <temp_num:
        temp_max=temp_num
    if j==(N-K-1):
        break
print(temp_max)

Buggy submission (verdict: Runtime Error):
N,K = map(int, input().split())
P = list(map(int,input().split()))
Px  =[0]*N
Pxx = []
for i in range(N):
    Px[i] = (1+P[i])/2
for j in range(N-K+1):
    temp_num = sum(Px[j:j+K])
    Pxx.append(temp_num)
print(Pxx)
print(f'{max(Pxx):.12f}')

Buggy submission (verdict: Runtime Error):
N,K = map(int, input().split())
P = list(map(int,input().split()))
Px  =[0]*N
Pxx = []
sumx = 0
for i in range(N):
    Px[i] = (1+P[i])/2
for j in range(N-K+1):
    for k in range(K):
        sumx += Px[j+k]
        Pxx.append(sumx)
    sumx = 0
print(f'{max(Pxx):.12f}')

Buggy submission (verdict: Runtime Error):
N,K = map(int, input().split())
sump=0
P = list(map(int,input().split()))
P.sort(reverse=True)
for i in range(K):
    p = P[i]*(P[i]+1)/(2*P[i])
    sump += p
print(f'{sump:.12f}')

Buggy submission (verdict: Runtime Error):
N,K = map(int, input().split())
sump=0
P = list(map(int,input().split()))
P.sort(reverse=True)
for i in range(K):
    p = P[i]*(P[i]+1)/(2*P[i])
    sump += p
print(f'{sump:.12f}')
Problem p02802 (python)

Fixed submission:
N,M = map(int,input().split())
PS = [list(map(str,input().split())) for i in range(M)]
A_num = [0]*N
W_num = [0]*N
w=0
#print(PS)
for j in range(M):
    #print(A_num)
    if PS[j][1] == 'WA'and A_num[int(PS[j][0])-1]==0:
        W_num[int(PS[j][0])-1]+=1 
    if PS[j][1]== 'AC' and A_num[int(PS[j][0])-1]==0:
        A_num[int(PS[j][0])-1]=1
s = sum(A_num)
for k in range(N):
    if A_num[k] == 0:
        W_num[k]=0
w = sum(W_num)
print(s,w)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
PS = [list(map(str,input().split())) for i in range(M)]
A_num = [0]*N
W_num = [0]*N
w=0
#print(PS)
for j in range(M):
    #print(A_num)
    if PS[j][1] == 'WA'and A_num[int(PS[j][0])-1]==0:
        W_num[int(PS[j][0]-1)]=1 
    if PS[j][1]== 'AC' and A_num[int(PS[j][0])-1]==0:
        A_num[int(PS[j][0])-1]=1
s = sum(A_num)
for k in range(N):
    if A_num[k] == 0:
        W_num[k]=0
w = sum(W_num)
print(s,w)
Problem p02675 (python)

Fixed submission:
input = input()[-1]
if input == '3':
    print('bon')
elif input in ['0', '1', '6', '8']:
    print('pon')
else:
    print('hon')

Buggy submission (verdict: Runtime Error):
n = int(stdin.readline().rstrip()[-1])

if n == '3':
    print('bon')
elif n in ['0', '1', '6', '8']:
    print('pon')
else:
    print('hon')

Buggy submission (verdict: Runtime Error):
input = input()[-1]
if input == '3':
  print('bon')
elif intpu in ['0', '1', '6', '8']:
  print('hon')
else:
  print('hon')

Buggy submission (verdict: Runtime Error):
input = input()[-1]
if input == '3':
    print('bon')
elif intpu in ['0', '1', '6', '8']:
    print('hon')
else:
    print('hon')
Problem p02639 (python)

Fixed submission:
a=input().split()
for i in range(5):
    if a[i]=='0':
        print(i+1)

Buggy submission (verdict: Runtime Error):
x,n=map(int,input().split())
import sys
if n==0:
    _=input()
    print(x)
    sys.exit()
    
p_list=list(map(int,input().split()))
r=list(range(100))
a=list(set(r)-set(p_list))

ans=100000
kkk=100000
for i in a:
    tem=abs(i-x)
    if ans>tem:
        ans=tem
        kkk=i
    
print(kkk)
Problem p02791 (python)

Fixed submission:
n = int(input())
x = list(map(int, input().split()))
curr = 10 ** 9
ans = 0
for p in x:
    if p < curr:
        ans += 1
        curr = p
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
x = list(map(int, input().split()))
curr = 10 ** 9
ans = 0
for p in ppp:
    if p < curr:
        ans += 1
        curr = p
print(ans)
Problem p02971 (python)

Fixed submission:
n=int(input())
a=[int(input()) for _ in range(n)]
b=sorted(a)
mx=b[-1]
mx2=b[-2]
for i in a:
    if i==mx:
        print(mx2)
    else:
        print(mx)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[]
b=sorted(a)
mx=b[-1]
mx2=b[-2]
for i in a:
    if i==mx:
        print(mx2)
    else:
        print(mx)
Problem p03037 (python)

Fixed submission:
n,m=map(int,input().split())
mn=0
mx=10**6
for i in range(m):
    a,b=map(int,input().split())
    mn=max(mn,a)
    mx=min(mx,b)
if mn>mx:
    print(0)
else:
    print(mx-mn+1)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
ans=list(range(1,n+1))
for i in range(m):
    a,b=map(int,input().split())
    if a-1 in ans:
        ans=ans[ans.index(a-1):]
    if b+1 in ans:
        ans=ans[:ans.index(b)]
print(len(ans))
Problem p03103 (python)

Fixed submission:
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10**9)
n,m=map(int,input().split())
AB=[list(map(int,input().split())) for _ in range(n)]
AB=sorted(AB,key=lambda x:x[0])
cnt=0
ans=0
for a,b in AB:
    tmp=cnt
    cnt=min(m,cnt+b)
    ans+=a*(cnt-tmp)
    if cnt==m:
        break
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10**9)
n,m=map(int,input().split())
shop=[]
for i in range(n):
    shop.append(map(int,input().split()))
shop_sorted=sorted(shop,key=lambda x :x[0])
ans=0
cnt=0
for a,b in shop_sorted:
    tmp=cnt
    cnt=min(m,cnt+b)
    ans+=a*(cnt-tmp)
    if cnt==m:
        break
print(ans)
Problem p02658 (python)

Fixed submission:
import sys
n = int(input())
A = list(map(int,input().split()))
if A.count(0)>0:
    print(0)
else:
    ANS = 1
    for i in range(n):
        ANS *= A[i]
        if ANS > 10**18:
            print(-1)
            sys.exit()
    print(ANS)

Buggy submission (verdict: Runtime Error):
import sys
n = int(input())
A = list(map(int,input().split()))
ANS = 1
for i in range(n):
    ANS *= A[i]
    if ANS > 10**18:
        print(-1)
        sys.exit(1)
print(ANS)
Problem p02677 (python)

Fixed submission:
import numpy as np
a,b,h,m=map(int,input().split())
pi = np.pi
x = 2*pi*(h*60+m)/720
y = 2*pi*m/60
theta=abs(x-y)
cos = np.cos(theta)
ans = (a**2+b**2-2*a*b*cos)**0.5
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
a,b,h,m=map(int,input().split())
pi = np.py
x = 2*pi*(h*60+m)/720
y = 2*pi*m/60
theta=abs(x-y)
cos = np.cos(theta)
ans = (a**2+b**2-2*a*b*cos)**0.5
print(ans)
Problem p02681 (python)

Fixed submission:
import sys
s = input()
t = input()
n = len(s)
for i in range(n):
  if s[i] != t[i]:
    print("No")
    sys.exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
n = len(s)
for i in range(n):
  if s[i] != t[i]:
    print("No")
    return 0
print("Yes")

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
n = len(s)
for i in range(n):
  if s[i] != t[i]:
    print("No")
    return
print("Yes")
Problem p02886 (python)

Fixed submission:
n = int(input())
d = [int(i) for i in input().split()]
s = []
for i in range(n):
	for j in range(i):
		s.append(d[i]*d[j])
print(sum(s))

Buggy submission (verdict: Runtime Error):
n = int(input())
d = [int(i) for input().split()]
s = []
for i in range(n):
	for j in range(i):
		s.append(d[i]*d[j])
l = s.size()
for i in range(l):
	print(s[i])

Buggy submission (verdict: Runtime Error):
n = int(input())
d = [int(i) for input().split()]
s = []
for i in range(n):
	for j in range(i):
		s.append(d[i]*d[j])
n = s.size()
for i in range(n):
	print(s[i])
Problem p02909 (python)

Fixed submission:
s = input()
if s == 'Sunny':
  print('Cloudy')
elif s == 'Cloudy':
  print("Rainy")
else:
  print('Sunny')

Buggy submission (verdict: Runtime Error):
n, k, q = map(int, input().split())
A = [0]*n
for i in range(n):
  a = int(input())
  A[a-1]+=1
for j in range(n):
  if A[j] > q-k :
    print("Yes")
  else:
    print("No")
Problem p02910 (python)

Fixed submission:
s = list(input())
a = s[::2]
b = s[1::2]
if a.count('L') == 0 and b.count('R') == 0:
  print('Yes')
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s = list(input())
a = s[::2]
b = s[1::2]
if a.count(L) == 0 and b.count(R) == 0:
  print('Yes')
else:
  print("No")
Problem p02911 (python)

Fixed submission:
N, K, Q = map(int, input().split())
A = [0]*N
for i in range(Q):
  a = int(input())
  A[a-1]+=1
for j in range(N):
  if A[j] > Q-K :
    print("Yes")
  else:
    print("No")

Buggy submission (verdict: Runtime Error):
n, k, q = map(int, input().split())
A = [0]*n
for i in range(n):
  a = int(input())
  A[a-1]+=1
for j in range(n):
  if A[j] > q-k :
    print("Yes")
  else:
    print("No")

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = [int(i) for i in input().split()]
for i in range(m):
  b = max(a)
  c = a.index(b)
  a[c] = b//2
  if sum(a) == 0:
    print(0)
    exit()
print(sum(a))
Problem p02921 (python)

Fixed submission:
s = list(input())
t = list(input())
u = 0
for i in range(3):
  if s[i] == t[i]:
    u += 1
print(u)

Buggy submission (verdict: Runtime Error):
S = list(input())
T = list(input())
s = 0
for i in range(3):
  if S[i] = T[i]:
    s += 1
print(s)

Buggy submission (verdict: Runtime Error):
s = list(input())
t = list(input())
s = 0
for i in range(3):
  if s[i] = t[i]:
    s += 1
print(s)

Buggy submission (verdict: Runtime Error):
s = list(input())
t = list(input())
s = 0
for i in range(3):
  s[i] = t[i]
  s += 1
print(s)
Problem p02923 (python)

Fixed submission:
n = int(input())
h = [int(i) for i in input().split()]
ans = []
a = 0
for i in range(n-1):
  if h[i] >= h[i+1]:
    a += 1
  else:
    ans.append(a)
    a = 0
ans.append(a)
print(max(ans))

Buggy submission (verdict: Runtime Error):
n = int(input())
h = [int(i) for i in range(n)]
ans = []
a = 0
for i in range(n-1):
  if h[i] >= h[i+1]:
    a += 1
  else:
    ans.append(a)
    a = 0
print(max(ans))

Buggy submission (verdict: Runtime Error):
n = int(input())
h = [int(i) for i in input().split()]
m = [0]
for i in range(1,n-1):
  if h[i-1] =< h[i] and h[i] >= h[i+1]:
    m.append(h.index(h[i]))
m.append(n-1)
l = [m[i] - m[i-1] for i in range(1,len(m))]
if m == [0,n-1] and h[0] < h[1]:
  print("0")
else:
  print(max(l))

Buggy submission (verdict: Runtime Error):
n = int(input())
h = [int(i) for i in input().split()]
m = [0]
for i in range(1,n-1):
  if h[i-1] < h[i] and h[i] >= h[i+1]:
    m.append(h.index(h[i]))
m.append(n-1)
l = [m[i] - m[i-1] for i in range(1,len(m))]
if m == [0,n-1] and h[0] < h[1]:
  print("0")
else:
  print(max(l))
Problem p02934 (python)

Fixed submission:
n = int(input())
a = [int(i) for i in input().split()]
s = 0
for j in a:
  s += 1/j
print(1/s)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(i) for i in input().split()]
s == 0
for i in a:
  s += 1/i
print(1/s)
Problem p02952 (python)

Fixed submission:
n = int(input())
s = 0
for i in range(1,n+1):
  l = list(str(i))
  if len(l) % 2 == 1:
    s += 1
print(s)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = 0
for i in range(n+1):
  l = list(i)
  if len(l) % 2 == 1:
    s += 1
print(s)

Buggy submission (verdict: Runtime Error):
n = input()
s = 0
for i in range(n+1):
  l = list(str(i))
  if len(l) % 2 == 1:
    s += 1
print(s)

Buggy submission (verdict: Runtime Error):
n = input()
s = 0
for i in range(n+1):
  l = list(int(i))
  if len(l) % 2 == 1:
    s += 1
print(s)

Buggy submission (verdict: Runtime Error):
n = input()
s = 0
for i in range(n+1):
  l = list(i)
  if len(l) % 2 = 1:
    s += 1
print(s)
Problem p02953 (python)

Fixed submission:
n = int(input())
h = [int(i) for i in input().split()]
for j in range(n-1):
  if h[j] - h[j+1] > 1:
    print("No")
    exit()
  elif h[j] == h[j+1] + 1:
    h[j+1] += 1
print("Yes")

Buggy submission (verdict: Runtime Error):
n = int(input())
h = [int(i) for i in input().split()]
for j in range(n):
  if h[j] - h[j+1] > 1:
    print("No")
    exit()
  else:
    continue
for k in range(n-1):
  if h[k] > h[k+1] and h[k+1] > h[k+2]:
    print("No")
    exit()
  else:
    continue
print("Yes")

Buggy submission (verdict: Runtime Error):
n = int(input())
h = [int(i) for i in input().split()]
for j in range(n):
  if h[j] - h[j+1] > 1:
    print("No")
    exit()
  else:
    h[j] = h[j] -1
  if h[j] > h[j+1]:
    print("No")
    exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
n = int(input())
h = [int(i) for i in input().split()]
for j in range(n):
  if h[j] - h[j+1] < -1:
    print("No")
    exit()
  else:
    h[j+1] = h[j+1] -1
  if h[j] < h[j+1]:
    print("No")
    exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
n = int(input())
h = [int(i) for i in input().split()]
for j in range(n):
  if h[j] - h[j+1] < -1:
    print("No")
    exit()
  else:
    continue
for k in range(n-1):
  if h[k] < h[k+1] and h[k+1] < h[k+2]:
    print("No")
    exit()
  else:
    continue
print("Yes")

Buggy submission (verdict: Runtime Error):
n = int(input())
h = [int(i) for i in input().split()]
for j in range(n-1):
  if h[j] - h[j+1] < -1:
    print("No")
    exit()
  else:
    continue
for k in range(n-2):
  if  h[k] < h[k+1] and h[k+1] < h[k+2]:
     print("No")
    exit()
  else:
    continue
print("Yes")

Buggy submission (verdict: Runtime Error):
n = int(input())
h = [int(i) for i in input().split()]
if h[j] - h[j+1] < -1 for j in range(n):
  print("No")
elif h[k+2] > h[k+1] and h[k+1] <= h[k] for k in range(n-1):
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
n = int(input())
h = [int(i) for i in input().split()]
if h[j+1] - h[j] < -1 for j in range(n):
  print("No")
elif h[k+2] < h[k+1] and h[k+1] <= h[k] for k in range(n-1):
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
n = int(input())
h = [int(i) for in in input().split()]
if h[j+1] - h[j] < -1 for j in range(n):
  print("No")
elif h[k+2] < h[k+1] and h[k+1] <= h[k] for k in range(n-1):
  print("No")
else:
  print("Yes")
Problem p02957 (python)

Fixed submission:
a, b = map(int, input().split())
c = a + b
if c % 2 == 0:
  print(c//2)
else:
  print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
c = a+b
print(c//2 if c%2==0)
Problem p02969 (python)

Fixed submission:
r = int(input())
print(3 * r**2)

Buggy submission (verdict: Runtime Error):
print(3 * (int(input())**2 )
Problem p02971 (python)

Fixed submission:
n = int(input())
a = [int(input()) for _ in range(n)]
s = max(a)
if a.count(s) >= 2:
  for i in range(n):  
    print(s)
else:
  for i in range(n):
    if a[i] == s:
      l = a.copy()
      l.sort()
      print(l[-2])
    else:
      print(s)

Buggy submission (verdict: Runtime Error):
n = int(input())
for i in range(n):
  a = [int(j) for j in input().split()]
  a[i] = 0
  print(max(a))
Problem p02988 (python)

Fixed submission:
n = int(input())
p = [int(i) for i in input().split()]
s = 0
for i in range(1,n-1):
  l1 = p[i-1:i+2]
  l2 = l1.copy()
  l2.sort()
  if l1[1] == l2[1]:
    s += 1
print(s)

Buggy submission (verdict: Runtime Error):
n = int(input())
p = [int(i) for i in range(n)]
s = 0
for i in range(1,n-1):
  l1 = p[i-1,i+2]
  l2 = l1.copy()
  l2.sort()
  if l1[1] == l2[2]:
    s += 1
print(s)
Problem p02999 (python)

Fixed submission:
x, a = map(int, input().split())
if x < a:
  print(0)
else:
  print(10)

Buggy submission (verdict: Runtime Error):
x, a = map(int, input())
if x < a:
  print(0)
else:
  print(10)