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

Fixed submission:
X=int(input())
five=[i**5 for i in range(1000) ]
flg=0
for i in range(len(five)):
    for j in range(len(five)):
        if five[i]+five[j]==X:
            flg=1
            ans_1=i
            ans_2=-j
        if five[i]-five[j]==X:
            ans_1=i
            ans_2=j
print(ans_1,ans_2)

Buggy submission (verdict: Runtime Error):
X=int(input())
five=[i**5 for i in range(100) ]
flg=0
for i in range(len(five)):
    for j in range(len(five)):
        if five[i]+five[j]==X:
            flg=1
            ans_1=i
            ans_2=-j
        if five[i]-five[j]==X:
            ans_1=i
            ans_2=j
print(ans_1,ans_2)
Problem p02717 (python)

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

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


A=list(map(int,input().split()))
Sum=sum(A)
pop=[]
l=Sum/(4*M)
for i in range(N):
    if(A[i]>l):
        pop.append(A[i])
        
print("Yes" if len(pop)=M else "No")
Problem p02830 (python)

Fixed submission:
n = int(input())
s, t = input().split()

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

print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
S,T=input().split()
ans=str()
for i in range(N):
    ans+=S[i]
    ans+=T[j]


print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
S,T=input().split()
ans=str()
for i in range(N):
    ans+=S[i]
    ans+=T[j]


print(ans)
Problem p02848 (python)

Fixed submission:
a = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
N = int(input())
S = input()
 
for i in S:
    b = a.index(i) + N
    if b <= 25:
        print(a[b], end="")
    else:
        print(a[b-26], end="")

Buggy submission (verdict: Runtime Error):
a=list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
b=int(input())
s=input()

for i in s:
    b=a.index(i)+N
    if b<=25:
        print(a[b],end="")
    else:
        print(a[b-26],end="")

Buggy submission (verdict: Runtime Error):
a=list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
b=int(input())
s=input()

for i in s:
    b=a.index(i)+N
    if b<=25:
        print(a[b],end="")
    else:
        print(a[b-26],end="")
Problem p03106 (python)

Fixed submission:
A,B,K=map(int,input().split())
div=[]
for i in range(1,max(A,B)+1):
    if A%i==0 and B%i==0:
        div+=[i]
print(div[-K])

Buggy submission (verdict: Runtime Error):
A,B,K=map(int,input().split())
div=[]
for i in range(1,max(A,B)):
    if A%i==0 and B%i==0:
        div+=[i]
print(div[-K])

Buggy submission (verdict: Runtime Error):
A,B,K=map(int,input().split())
div=[]
for i in range(1,max(A,B)):
    if A%i==0 and B%i==0:
        div+=[i]
print(div[-K])

Buggy submission (verdict: Runtime Error):
A,B,K=map(int,input().split())
div=[]
for i in range(1,max(A,B)):
    if A%i==0 and B%i==0:
        div+=[i]

print(div[-K])

Buggy submission (verdict: Runtime Error):
A,B,K=map(int,input().split())
div=[]
for i in range(1,max(A,B)):
    if A%i==0 and B%i==0:
        div+=[i]

       
print(div[-K])
Problem p03434 (python)

Fixed submission:
n=int(input())
a = sorted(list(map(int,input().split())),reverse=True)
print(sum(a[::2])-sum(a[1::2]))

Buggy submission (verdict: Runtime Error):
n=int(input())
A=sorted(list(map(int,input().split()),reverse=True)
print(sum(a[::2])-sum(a[1::2]))
Problem p03469 (python)

Fixed submission:
S = input()
print(S.replace("2017/","2018/",1))

Buggy submission (verdict: Runtime Error):
date = str(input())
date[3]="8"
print(date)
Problem p03470 (python)

Fixed submission:
n = int(input())
print(len(set(map(int,[input() for i in range(n)]))))

Buggy submission (verdict: Runtime Error):
n = int(input())
print(len(set(map(int,[input() for i in range(n)])))
Problem p03494 (python)

Fixed submission:
input()
A=list(map(int,input().split()))
count=0

while all(a%2==0 for a in A):
    A=[a/2 for a in A]
    count +=1
print(count)

Buggy submission (verdict: Runtime Error):
input()
A=list(map(int,input().split())
count=0

while all(a%2==0 for a in A):
    A=[a/2 for a in A]
    count +=1
print(count)
Problem p04030 (python)

Fixed submission:
from collections import deque
s=deque(list(input()))
p=deque()
for i in range(len(s)):
    w=s.popleft()
    if w=="0":
        p.append("0")
    elif w=="1":
        p.append("1")
    else:
        if len(p)==0:
            continue
        else:
            p.pop()

for i in range(len(p)):
    print(p[i],end="")

Buggy submission (verdict: Runtime Error):
from collections import deque
s=deque(list(input()))
p=deque()
for i in range(len(s)):
    w=s.popleft()
    if w=="0":
        p.append("0")
    elif w=="1":
        p.append("1")
    else:
        p.pop()
for i in range(len(p)):
    print(p[i],end="")
Problem p02675 (python)

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

Buggy submission (verdict: Runtime Error):
import sys
 
n = sys.stdin.readline()
 
last = int(n[-1])
 
result = ''
if last in [0,1,6,8]:
    result = 'pon'
elif last == 3:
    result = 'bon'
else:
    result = 'hon'
 
print(result)

Buggy submission (verdict: Runtime Error):
import sys

n = sys.stdin.readline()

last = int(n[-1])

result = ''
if last in [0,1,6,8]:
    result = 'pon'
elif last == 3:
    result = 'bon'
else:
    result = 'hon'

print(result)

Buggy submission (verdict: Runtime Error):
import sys

n = sys.stdin.readline()

last = int(n[-1])

result = ''
if last in [0,1,6,8]:
    result = 'pon'
elif last == 3:
    result = 'bon'
else:
    result = 'hon'

print(result)

Buggy submission (verdict: Runtime Error):
import sys

n = sys.stdin.readline()

last = int(n[-1])

resutl = ''
if last in [0,1,6,8]:
    result = 'pon'
elif last == 3:
    result = 'bon':
else:
    result = 'hon'

print(result)
Problem p02687 (python)

Fixed submission:
S = input()

if S == 'ARC':
    print('ABC')
else:
    print('ARC')

Buggy submission (verdict: Runtime Error):
S = input().split()

if S == 'ARC':
    print('ABC')
elif S == 'ABC' 
    print('ARC')

Buggy submission (verdict: Runtime Error):
S = input().split()

if S == 'ARC':
    print('ABC')
elif S = 'ABC' 
    print('ARC')
Problem p02705 (python)

Fixed submission:
import math
R = input()
R = int(R)
R = R * 2 * math.pi

print(R)

Buggy submission (verdict: Runtime Error):
N, = input().split()
A = input().split() 
ans = [0] * 2000001
for i in range(int(N) - 1):
    ans[int(A[i])] += 1
for i in range(1, int(N)+1):
    print(ans[i])
Problem p02705 (python)

Fixed submission:
import math
r = int(input())
print(math.pi*r*2)

Buggy submission (verdict: Runtime Error):
import math
r = int(input)
print(math.pi*r*2)
Problem p02923 (python)

Fixed submission:
n = int(input())
h = list(map(int,input().split()))
cnt = 0
max = 0

for i in range(1,len(h)):
    if h[i] <= h[i-1]:
        cnt+=1
        if cnt > max:
            max = cnt
    else:
        cnt = 0

print(max)

Buggy submission (verdict: Runtime Error):
#C
n = int(input())
h = list(map(int,input().split()))
dif = []

for i in range(len(h)-1):
    dif.append(h[i]-h[i+1])
cnt_list = []
for i in range(len(dif)):
    if dif[i] >= 0:
        cnt = 1
        for j in range(i+1,len(dif)):
            if dif[j] >= 0:
                cnt += 1
            else:
                break
    else:
        cnt = 0
    cnt_list.append(cnt)

print(max(cnt_list))
Problem p03109 (python)

Fixed submission:
S = input()
print('Heisei' if S <= '2019/04/30' else 'TBD')

Buggy submission (verdict: Runtime Error):
S = input()
print('Heisei' if S <= '2019/04/30' else 'TBD)
Problem p03261 (python)

Fixed submission:
N = int(input())
list = []
bool = True

for i in range(N):
    list.append(input())
if len(set(list)) != len(list):
    bool = False
else:
    for i in range(N - 1):
        if list[i][-1] != list[i+1][0]:
            bool = False

if bool:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
list = []
bool = True

for i in range(N):
    list.append(input())
if len(set(list)) != len(list):
    bool = False
else:
    for i in range(N - 1):
        if list[i][-1] != li[i+1][0]:
            bool = False

if bool:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
list = []
bool = True

for i in range(N):
    list.append(input())
if len(set(list)) != len(list):
    bool = False
else:
    for i in range(N - 1):
        if list[i][-1] != li[i+1][0]:
            bool = False

if bool:
    print('Yes')
else:
    print('No')
Problem p03262 (python)

Fixed submission:
from fractions import gcd

n, x = map(int,input().split())
x_list = list(map(int,input().split()))
x_list.append(x)
x_list.sort()
dis_list = []

for i in range(n):
    dis_list.append(x_list[i+1] - x_list[i])

ans = dis_list[0]
for i in range(n):
    ans = gcd(dis_list[i],ans)

print(ans)

Buggy submission (verdict: Runtime Error):
from math import gcd

n, x = map(int,input().split())
x_list = list(map(int,input().split()))
x_list.append(x)
x_list.sort()
dis_list = []

for i in range(n):
    dis_list.append(x_list[i+1] - x_list[i])

ans = dis_list[0]
for i in range(n):
    ans = gcd(dis_list[i],ans)

print(ans)

Buggy submission (verdict: Runtime Error):
import math
n, x = map(int,input().split())
x_list = list(map(int,input().split()))
x_list.append(x)
x_list.sort()
dis_list = []
for i in range(n):
    dis_list.append(x_list[i+1]-x_list[i])

ans = dis_list[0]
for i in range(n):
    ans = math.gcd(dis_list[i],ans)

print(ans)

Buggy submission (verdict: Runtime Error):
import math
n, x = map(int,input().split())
x_list = list(map(int,input().split()))
x_list.append(x)
x_list.sort()
dis_list = []
for i in range(n):
    dis_list.append(x_list[i+1]-x_list[i])

print(ans)

Buggy submission (verdict: Runtime Error):
import math
n, x = map(int,input().split())
x_list = list(map(int,input().split()))
x_list.append(x)
x_list.sort()
dis_list = []
for i in range(n):
    dis_list.append(x_list[i+1]-x_list[i])

ans = dis_list[0]
for i in range(n):
    ans = math.gcd(dis_list[i],ans)

print(ans)

Buggy submission (verdict: Runtime Error):
import math
n, x = map(int,input().split())
x_list = list(map(int,input().split()))
x_list.append(x)
x_list.sort()
dis_list = []
for i in range(n):
    dis_list.append(x_list[i+1]-x_list[i])

gcd = dis_list[0]
for i in range(n):
    gcd = math.gcd(dis_list[i],gcd)

print(gcd)

Buggy submission (verdict: Runtime Error):
import math
n, x = map(int,input().split())
x_list = list(map(int,input().split()))
x_list.append(x)
x_list.sort()
dis_list = []
for i in range(n):
    dis_list.append(x_list[i+1]-x_list[i])

gcd = dis_list[0]
for i in range(n):
    gcd = math.gcd(dis_list[i],gcd)

print(gcd)
Problem p03274 (python)

Fixed submission:
n, k = map(int,input().split())
x = list(map(int,input().split()))
result = []
for i in range(n-k+1):
    l, r = x[i], x[i+k-1]
    if l * r >= 0:
        result.append(max(abs(l), abs(r)))
    else:
        result.append(abs(2*l-r))
        result.append(abs(2*r-l))
print(min(result))

Buggy submission (verdict: Runtime Error):
n, k = map(int,input().split())
x = list(map(int,input().split()))
x.append(0)
x.sort()
ans = 100
for i in range(n-k+1):
    cnt = 0
    cnt += abs(x[i])
    for j in range(i,k+i):
        cnt += abs(x[j+1] - x[j])    
    if cnt < ans:
        ans = cnt

print(min(ans))

Buggy submission (verdict: Runtime Error):
n, k = map(int,input().split())
x = list(map(int,input().split()))
x.append(0)
x.sort()
ans = 100000000
for i in range(n-k+1):
    cnt = 0
    cnt += abs(x[i])
    for j in range(i,k+i):
        cnt += abs(x[j+1] - x[j])    
    if cnt < ans:
        ans = cnt

print(min(ans))

Buggy submission (verdict: Runtime Error):
n, k = map(int,input().split())
x = list(map(int,input().split()))
x.append(0)
x.sort()
ans = 10 ** 18
for i in range(n-k+1):
    cnt = 0
    cnt += abs(x[i])
    for j in range(i,k+i):
        cnt += abs(x[j+1] - x[j])    
    if cnt < ans:
        ans = cnt

print(min(ans))
Problem p03352 (python)

Fixed submission:
N = int(input())
list=[]
for i in range(1, N+1):
    for j in range(2, N + 2):
        tmp = i ** j
        if tmp <= N:
            list.append(tmp)
        else:
            break

print(max(list))

Buggy submission (verdict: Runtime Error):
N = int(input())
list=[]
for i in range(1, N+1):
    for j in range(2, N):
        tmp = i ** j
        if tmp <= N:
            list.append(tmp)
        else:
            break

print(max(list))
Problem p03417 (python)

Fixed submission:
n,m = map(int,input().split())
print(abs((n-2)*(m-2)))

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
nm = ['#'] * n
nm.insert(0,0)
nm.insert(n+1,0)
nm = [nm]*m
nm.insert(0,[0]*(m+2))
nm.insert(m+1,[0]*(m+2))
ans = 0

for i in range(1,m+1):
    for j in range(1,n+1):
        cnt = 0
        if nm[i+1][j+1] == '#':
            cnt += 1
        if nm[i+1][j] == '#':
            cnt += 1
        if nm[i+1][j-1] == '#':
            cnt += 1
        if nm[i][j+1] == '#':
            cnt += 1
        if nm[i][j] == '#':
            cnt += 1
        if nm[i][j-1] == '#':
            cnt += 1
        if nm[i-1][j+1] == '#':
            cnt += 1
        if nm[i-1][j] == '#':
            cnt += 1
        if nm[i-1][j-1] == '#':
            cnt += 1
        if cnt % 2 != 0:
            ans+=1

print(ans)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
nm = ['#'] * n
nm.insert(0,0)
nm.insert(n+1,0)
nm = [nm]*m
nm.insert(0,[0]*(m+2))
nm.insert(m+1,[0]*(m+2))
total = []
ans = 0

for i in range(1,m+1):
    for j in range(1,n+1):
        cnt = 0
        if nm[i+1][j+1] == '#':
            cnt += 1
        if nm[i+1][j] == '#':
            cnt += 1
        if nm[i+1][j-1] == '#':
            cnt += 1
        if nm[i][j+1] == '#':
            cnt += 1
        if nm[i][j] == '#':
            cnt += 1
        if nm[i][j-1] == '#':
            cnt += 1
        if nm[i-1][j+1] == '#':
            cnt += 1
        if nm[i-1][j] == '#':
            cnt += 1
        if nm[i-1][j-1] == '#':
            cnt += 1
        total.append(cnt)

for i in range(n*m):
    if total[i] % 2 != 0:
        ans += 1

print(ans)
Problem p03425 (python)

Fixed submission:
N = int(input())
m = 0
a = 0
r = 0
c = 0
h = 0

for i in range(N):
    S = input()
    if S[0] == 'M':
        m += 1
    elif S[0] == 'A':
        a += 1
    elif S[0] == 'R':
        r += 1
    elif S[0] == 'C':
        c += 1
    elif S[0] == 'H':
        h += 1

ans = m * a * (r+c+h) + m * r * (c+h) + m * c * h + a * r * (c + h) + a * c * h + r * c * h
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
cnt = [0,0,0,0,0]
comp = 'MARCH'
ans = 0

for i in range(N):
    word = input()
    for j in range(len(comp)):
        if word[0] == comp[j]:
            cnt[j] += 1

for i in range(len(cnt)):
    for j in range(i+1,len(cnt)):
        for k in range(j+1,len(cnt)):
            ans += cnt[i] * cnt[j] * cnt[k]
print(ans)
Problem p03471 (python)

Fixed submission:
n,y = map(int,input().split())

for i in range(n+1):
    for j in range(n+1-i):
        k = n - i - j
        if (10000*i + 5000*j + 1000*k == y) and (i + j + k == n):
            print(i,j,k)
            exit()
print('-1 -1 -1')

Buggy submission (verdict: Runtime Error):
n,y = map(int,input().split())

for i in range(n+1):
    for j in range(n+1-i):
        j = n - i - j
        if (10000*i + 5000*j + 1000*c == y) and (i + j + c == n):
            print(i,j,k)
            exit()
print('-1 -1 -1')
Problem p03495 (python)

Fixed submission:
from collections import Counter
n,k = map(int,input().split())
a = list(map(int,input().split()))
ans = 0
x = len(set(a))
if x <= k:
    print(ans)
else:
    b = Counter(a).most_common(x)
    for i in range(x-1,k-1,-1):
        ans += b[i][1]
    print(ans)

Buggy submission (verdict: Runtime Error):
from collections import OrderedDict
n,k = map(int,input().split())
a = list(map(int,input().split()))
b = collections.Counter(a)
ans = 0
num_keys = len(b.keys())

if num_keys > k:
    c = sorted(b.items(),key=lambda x:x[1])
    for i in range(len(c)):
        num_keys -= c[i][1]
        c[-1][1] += c[i][1] 
        ans += c[i][1]
        if num_keys <= k:
            break
            
print(ans)

Buggy submission (verdict: Runtime Error):
from collections import OrderedDict
n,k = map(int,input().split())
a = list(map(int,input().split()))
b = collections.Counter(a)
ans = 0
num_keys = len(b.keys())

if num_keys > k:
    if k != 0:
        c = sorted(b.items(),key=lambda x:x[1])
        for i in range(len(c)):
            num_keys -= c[i][1]
            ans += c[i][1]
            if num_keys <= k:
                break
    else:
        ans += k
            
print(ans)

Buggy submission (verdict: Runtime Error):
from collections import OrderedDict
n,k = map(int,input().split())
a = list(map(int,input().split()))
b = collections.Counter(a)
ans = 0
num_keys = len(b.keys())

if num_keys > k:
    if k != 0:
        c = sorted(b.items(),key=lambda x:x[1])
        for i in range(len(c)):
            num_keys -= c[i][1]
#           c[-1][1] += c[i][1] 
            ans += c[i][1]
            if num_keys <= k:
                break
    else:
        ans += k
            
print(ans)
Problem p03611 (python)

Fixed submission:
import statistics,collections

n = int(input())
a = list(map(int,input().split()))
ans = []

for i in range(n):
    ans.append(a[i])
    ans.append(a[i]-1)
    ans.append(a[i]+1)

c = collections.Counter(ans)
print(c.most_common()[0][1])

Buggy submission (verdict: Runtime Error):
import statistics
n = int(input())
a = list(map(int,input().split()))
ans = []

for i in range(n):
    ans.append(a[i])
    ans.append(a[i]-1)
    ans.append(a[i]+1)

print(ans.count(statistics.mode(ans)))
Problem p03624 (python)

Fixed submission:
l=[chr(ord("a")+i) for i in range(26)]
s=set(input())
for i in s:
    l.remove(i)
print(l[0] if len(l)>0 else "None")

Buggy submission (verdict: Runtime Error):
s = input()
alphabet = 'abcdefghijklmnopqrstuvwxyz'

s_list = set(s)
s_list = sorted(s_list)

if alphabet in s_list:
    print('None')
else:
    for i in range(len(s)):
        if s_list[i] != alphabet[i]:
            print(alphabet[i])
            break

Buggy submission (verdict: Runtime Error):
s = input()
alphabet = 'abcdefghijklmnopqrstuvwxyz'

s_list = set(s)
s_list = sorted(s_list)


for i in range(len(s)):
    if s_list[i] != alphabet[i]:
        print(alphabet[i])
        break
if alphabet in s_list:
    print('None')

Buggy submission (verdict: Runtime Error):
s = input()
alphabet = 'abcdefghijklmnopqrstuvwxyz'

s_list = set(s)
s_list = sorted(s_list)


for i in range(len(s)):
    if s_list[i] != alphabet[i]:
        print(alphabet[i])
        break
if alphabet in s:
    print('None')

Buggy submission (verdict: Runtime Error):
s = input()
alphabet = 'abcdefghijklmnopqrstuvwxyz'

s_list = set(s)
s_list = sorted(s_list)

if alphabet in s:
    print('None')
else:
    for i in range(len(s)):
        if s_list[i] != alphabet[i]:
            print(alphabet[i])
            break

Buggy submission (verdict: Runtime Error):
s = input()
alphabet = 'abcdefghijklmnopqrstuvwxyz'

s_list = set(s)
s_list = sorted(s_list)

if alphabet in s:
    print('None')
else:
    for i in range(len(s)):
        if s_list[i] != alphabet[i]:
            print(alphabet[i])
            break
Problem p03633 (python)

Fixed submission:
import fractions

n = int(input())
t = [int(input()) for _ in range(n)]

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

ans = t[0]

for i in range(1,n):
    ans = lcm(ans,t[i])

print(ans)

Buggy submission (verdict: Runtime Error):
import math

n = int(input())
t = [int(input()) for _ in range(n)]

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

ans = t[0]

for i in range(1,n):
    ans = lcm(ans,t[i])

print(ans)
Problem p03673 (python)

Fixed submission:
n = int(input())
a = list(input().split())
print(" ".join(a[::-2] + a[n%2::2]))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
ans = ''

for i in range(n):
    if i % 2 == 0:
        ans = ans + str(a[i]) + 
    else:
        ans = str(a[i]) + ans
        
print(ans)
Problem p02675 (python)

Fixed submission:
n = int(input()[-1])

if n in [2, 4, 5, 7, 9]:
  print("hon")
elif n in [0, 1, 6, 8]:
  print("pon")
else:
  print("bon")

Buggy submission (verdict: Runtime Error):
n = int(input()[-1])

if  in [2, 4, 5, 7, 9]:
  print("hon")
elif n in [0, 1, 6, 8]:
  print("pon")
else:
  print("bon")
Problem p02765 (python)

Fixed submission:
n, r = map(int, input().split())
if n >= 10:
  print(r)
else:
  print(r + 100 * (10 - n))

Buggy submission (verdict: Runtime Error):
n, r = int(input().split())
if n >= 10:
  print(r)
else:
  print(r + 100 * (10 - n))
Problem p02817 (python)

Fixed submission:
s, t = input().split()
print(t + s)

Buggy submission (verdict: Runtime Error):
print(input() + input())

Buggy submission (verdict: Runtime Error):
print(input() + input())
Problem p02953 (python)

Fixed submission:
n = int(input())
h = list(map(int, input().split()))
for i in range(n-1):
  if h[n-1-i] >= h[n-2-i]:
    continue
  elif h[n-2-i] - h[n-1-i] == 1:
    h[n-2-i] -= 1
  else:
    print("No")
    break
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))
for i in range(1,n+1):
  if h[-i] >= h[-i-1]:
    continue
  elif h[-i-1] - h[-i] == 1:
    h[-i-1] -= 1
  else:
    print("No")
    break
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))
for i in range(n-1):
  if h[i+1] - h[i] > 1:
    print("No")
    break
else:
  for i in range(n-1):
    if h[i+2] - h[i+1] == h[i+1] - h[i] == 1:
      print("No")
      break
  else:
    print("Yes")
Problem p02971 (python)

Fixed submission:
n = int(input())
import numpy as np
a = np.array([int(input()) for _ in range(n)])
M = max(a)
if np.sum(a==M) >= 2:
  [print(M) for _ in range(n)]
else:
  result = [M]*n
  result[np.argmax(a)] = sorted(a)[-2]
  [print(i) for i in result]

Buggy submission (verdict: Runtime Error):
n = int(input())
import numpy as np
a = np.array([int(input()) for _ in range(n)])
M1,M2 = sorted(set(a))[::-1][0:2]
for b,i in zip(a==M1,a):
  if b:
    print(M2)
  else:
    print(M1)
Problem p03000 (python)

Fixed submission:
import numpy as np
n,x = map(int, input().split())
l = list(map(int, input().split()))
pop = [0] * (n)
pre = 0
for idx,i in enumerate(l):
  pop[idx] = pre + i
  pre = pop[idx]

print(np.sum(np.array([0]+pop) <= x))

Buggy submission (verdict: Runtime Error):
import numpy as np
n,x = map(int, input().split())
l = list(map(int, input().split()))
pop = [0] * (n)
pre = 0
for idx,i in enumerate(l):
  pop[idx] = pre + i
  pre = pop[idx]

print(np.sum(np.array([0]+pop) <= x))
Problem p03068 (python)

Fixed submission:
N = int(input())
S = input()
K = int(input())
t = S[K-1]
ans = ""
for s in S:
  if s == t:
    ans += s
  else:
    ans += "*"
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
K = int(input())
ab = "abcdefghijklmnopqrstuvwxyz".replace(S[K],"")
for i in ab:
  S = S.replace(i,"*")
print(S)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
K = int(input())
T = ""
for s in S:
  if s == S[K]:
    T += s
  else:
    T += "*"
print(T)
Problem p03210 (python)

Fixed submission:
X = int(input())
if X==3 or X==5 or X==7:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
X = int(input())
if x==3 or x==5 or x==7:
  print("YES")
else:
  print("NO")
Problem p03308 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
print(max(a) - min(a))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input()))
print(max(a) - min(a))
Problem p03353 (python)

Fixed submission:
s = input()
k = int(input())
result = []
for i in range(min(len(s),k)):
  result = result + [s[j:j+i+1] for j in range(len(s)-i)]
  
result = sorted(set(result))
print(result[k-1])

Buggy submission (verdict: Runtime Error):
s = input()
k = int(input())
result = []
for i in range(min(len(s),k)):
  result = result + [s[j:j+i+1] for j in range(len(s)-i)]
  
result = sorted(set(result))
print(result[3])