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

Fixed submission:
s = input()
chk = ['a','e','i','o','u']
print("vowel" if s in chk else "consonant")

Buggy submission (verdict: Runtime Error):
print("vowel" if input() in 'a','e','i','o','u' else ""consonant)
Problem p03962 (python)

Fixed submission:
a = list(map(int,input().split()))
a = set(a)
print(len(a))

Buggy submission (verdict: Runtime Error):
a = list(input().split)
a = set()
print(len(a))
Problem p02681 (python)

Fixed submission:
S=input()
T=input()
count=1
for i in range(len(S)):
  if S[i]==T[i]:
    count=1
  else:
    count=0
    break
    
if count==1:
  if (len(S)+1)==len(T):
    print('Yes')
  else:
    print('No')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
N,M,X=map(int,input().split())
ca=[list(map(int,input().split())) for i in range(N)]
ans=float('inf')
for i in range(1,2**N):
  money=0
  rikaido=[0]*M
  for j in range(M):
    if i>>j&1:
      money+=ca[j][0]
      for k in range(1,M+1):
        rikaido[k-1]+=ca[j][k]
    for l in range(M):
      if all(rikaido[l]>=X for l in range(M)):
        ans=min(ans,money)

if ans==float('inf'):
  print(-1)
else:
  print(ans)

Buggy submission (verdict: Runtime Error):
N,M,X=map(int,input().split())
ca=[list(map(int,input().split())) for i in range(N)]
ans=float('inf')
for i in range(1,2**N):
  money=0
  rikaido=[0]*M
  for j in range(M):
    if i>>j&1:
      money+=ca[j][0]
      for k in range(1,M+1):
        rikaido[k-1]+=ca[j][k]
    for l in range(M):
      if all(rikaido[l]>=X for l in range(M)):
        ans=min(ans,money)

if ans==float('inf'):
  print(-1)
else:
  print(money)
Problem p02761 (python)

Fixed submission:
N, M = map(int, input().split())
S = []
C = []
for i in range(M):
    s, c = input().split()
    S.append(int(s))
    C.append(int(c))


A = ["x"]*N
for a, b in zip(S, C):
    if A[a-1] == "x":
        A[a-1] = b
    else:
        if b == A[a-1]:
            A[a-1] = b
        else:
            print(-1)
            exit()

if N != 1 and A[0] == "x":
    A[0] = 1

if A[0] == "x":
    if N != 1:
        print(-1)
        exit()
if A[0] == 0 and N != 1:
    print(-1)
    exit()

for a in range(N):
    if A[a-1] == "x":
        A[a-1] = 0
for a in A:
    print(a, end="")

Buggy submission (verdict: Runtime Error):
A = ["x"]*N
for a, b in zip(S, C):
    if A[a-1] == "x":
        A[a-1] = b
    else:
        if b == A[a-1]:
            A[a-1] = b
        else:
            print(-1)
            exit()

if N != 1 and A[0] == "x":
    A[0] = 1

if A[0] == "x":
    if N != 1:
        print(-1)
        exit()
if A[0] == 0 and N != 1:
    print(-1)
    exit()

for a in range(N):
    if A[a-1] == "x":
        A[a-1] = 0
for a in A:
    print(a, end="")
Problem p02772 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
for a in A:
  if a % 2 == 1:
    continue
  if a % 3 == 0 or a % 5 == 0:
    continue
  print("DENIED")
  exit()
print("APPROVED")

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split())
         
for a in A:
      if a % 2 == 1:
         continue
      if a % 3 == 0:
         continue
      if a % 5 == 0:
         continue
         print("DENIED")
         exit()

print("APPROVED")
Problem p02784 (python)

Fixed submission:
H, N = map(int, input().split())
A = list(map(int, input().split()))
MAX = sum(A)

if MAX < H:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
H, N = map(int, input().split())
A = list(map(int, input().split()))
MAX = sum(A)

if MAX < H:
  print("No)
else:
  print("Yes")
Problem p02969 (python)

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

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(input()) for _ in range(N)]
result = []
for i in range(N):
    C = A[i]
    A[i] = 0
    result.append(max(A))
    A[i] = C

for a in result:
    print(a)
Problem p02995 (python)

Fixed submission:
A,B,C,D =map(int, input().split())
import fractions
lcm = C * D // fractions.gcd(C, D)
E = B - (B // C + B // D - B // lcm)
F = (A-1) - ((A-1) // C + (A-1) // D - (A-1) // lcm)
result = E-F
print(result)

Buggy submission (verdict: Runtime Error):
A,B,C,D =map(int, input().split())
import math
lcm = C * D // math.gcd(C, D)
E = B - (B // C + B // D - B // lcm)
F = (A-1) - ((A-1) // C + (A-1) // D - (A-1) // lcm)
result = E-F
print(result)
Problem p03680 (python)

Fixed submission:
N = int(input())
a = [int(input()) for _ in range(N)]
count = 0
i = 1
x = 0
osita = [0]*(N+1)
for b in range(N+1):
    osita[b] = i
    i = a[i-1]
    
if 2 in osita:
    print(osita.index(2))
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
N = int(input())
a = [int(input()) for _ in range(N)]
count = 0
i = 1
x = 0
osita = [0]*N
while 2 not in osita and count < N + 10:
    osita[x] = i
    i = a[i-1]
    count += 1
    x += 1
    
if count > N:
    print(-1)
else:
    print(count-1)
Problem p03129 (python)

Fixed submission:
N,K = map(int ,input().split())
if N%2 == 0:
    if N/2 >= K:
        print("YES")
    else:
        print("NO")
else:
    if (N+1)/2 >= K:
        print("YES")
    else:
        print("NO")

Buggy submission (verdict: Runtime Error):
L = int(input())
A =[]
for i in range(L):
    A.append(int(input()))
def reader(x):
    s = 0
    for i in x:
        if i ==0:
            s = s -1
        else:
            s = s + i
    return s
j = 0
flag = 0
startpoint = []
endpoint = []
for i in A:
    j = j+1
    if i == 0:
        if flag ==1:
            endpoint.append(j-2)
            flag = 0
    else:
        if flag == 0:
            startpoint.append(j-1)
            flag = 1
menseki = []
for s in startpoint:
    for e in endpoint:
        menseki.append(reader(A[s:(e+1)]))
m = max(menseki)
real = reader(A)
print(real-m)

Buggy submission (verdict: Runtime Error):
x = []
for i in range(3):
    x.append(list(map(int,input().split())))
one,two,three,four = 0,0,0,0
def push(a):
    global one,two,three,four
    if a == 1:
        one = one + 1
    elif a ==2:
        two += 1
    elif a == 3:
        three += 1
    else :
        four +=1
for i in x:
    push(i[0])
    push(i[1])
if one*two*three*four ==0 or one ==3 or two ==3 or three ==3 or four ==3:
    print("NO")
else :
    print("YES")
Problem p03136 (python)

Fixed submission:
n = int(input())
l = list(map(int,input().split()))
m = max(l)
s = sum(l) - m
if m < s:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
L = []
for i in range(N):
  L.append(int(input())

 
maxL = max(L)
sumL = sum(L) - maxL
           
if maxL >= sumL :
           return 'No'
else:
           return 'Yes'
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):
s = int(input())
if == 3 or 5 or 7:
  print("YES")
else:
  print("NO")

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

Fixed submission:
a,b = map(int,input().split())
c = b/2 + a
print(int(c))

Buggy submission (verdict: Runtime Error):
a,b = map(int(),input().split())
print(a+b/2)
Problem p03220 (python)

Fixed submission:
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
tem = 1000
z = 0
for i in h:
  c = t-0.006*i
  d = c - a
  e = tem - a
  if d**2 < e**2:
    tem = c
    z = i 
aa = h.index(z) + 1
print(aa)

Buggy submission (verdict: Runtime Error):
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
tem = 1000
for i in h:
  c = t-0.006*i
  d = c - a
  if d**2 < tem:
    tem = c
answer = h.index(tem) + 1
print(answer)
Problem p02642 (python)

Fixed submission:
#!python3

import sys
iim = lambda: map(int, sys.stdin.readline().rstrip().split())

def resolve():
    it = map(int, sys.stdin.read().split())
    N = next(it)
    A = [next(it) for i in range(N)]

    if N == 1:
        print(1)
        return

    ax = max(A)+1
    dp = [0]*ax
    for ai in A:
        da = dp[ai]
        if da > 1:
            continue
        dp[ai] += 1
        if da == 0:
            for aj in range(2*ai, ax, ai):
                dp[aj] = 2
    ans = 0
    for ai in A:
        if dp[ai] == 1:
            ans += 1
    print(ans)


if __name__ == "__main__":
    resolve()

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import collections
import math
import copy

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

def get_sieve_of_eratosthenes(n):
    if not isinstance(n, int):
        raise TypeError('n is int type.')
    if n < 2:
        raise ValueError('n is more than 2')
    prime = []
    limit = math.sqrt(n)
    data = [i + 1 for i in range(1, n)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]
    return data

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

max_num = max(A)
data = get_sieve_of_eratosthenes(max_num)
select_prime = list(set(data) & set(A))
remove_prime = sorted(list(set(A).difference(set(data))))

if len(remove_prime)==0:
    print(0)
else:
    for min_num in remove_prime:
        divisor = make_divisors(min_num) 
        remove_max = sorted(divisor)[:-1] 
        if (list(set(remove_prime)&set(remove_max))==[])&(list(set(select_prime)&set(remove_max))==[]):
            select_prime.append(min_num)
    print(len(select_prime))
Problem p02748 (python)

Fixed submission:
import itertools
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

#2次元配列
grid = []
for i in range(M):
    array = list(map(int, input().strip().split()))
    grid.append(array)
    
sum_fee = []
a_min = min(a)
b_min = min(b)
sum_fee.append(a_min+b_min)

for l, m, n in grid:
    sum_fee.append(a[l-1] + b[m-1] - n)
    

print(min(sum_fee))

Buggy submission (verdict: Runtime Error):
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
# 2次元配列
grid = []
for i in range(M):
    array = list(map(int, input().strip().split()))
    grid.append(array)
    
sum_fee = []
comb_pro = list(itertools.product(a, b))
for com in comb_pro:
    sum_fee.append(sum(com))

for l, m , n in grid:
    sum_fee.append(a[l-1] + b[m-1] - n)
    
print(min(sum_fee))
Problem p02981 (python)

Fixed submission:
def main(n,a,b):
    if (1 <= n <= 20 )and (1 <= a <= 50) and (1 <= b <= 50) :
        sum_list = [n * a, b] 
    return min(sum_list)

if __name__ == '__main__':
    s = list(map(int, input().split()))
    huga = main(s[0],s[1],s[2])
    print(huga)

Buggy submission (verdict: Runtime Error):
def main(n,a,b):
    if 1 <= n <= 20 and 1 <= a <= 50 and 1 <= b <= 50 :
        sum_list = [(n-x)*b + x * a for x in range(1,n)]
    return min(sum_list)

if __name__ == '__main__':
    s = list(map(int, input().split()))
    huga = main(s[0],s[1],s[2])
    print(huga)
Problem p02988 (python)

Fixed submission:
if __name__ == '__main__':
  
  z = int(input())
  if 20 >= z and z >= 3:
    num_list = list(map(int, input().strip().split()))
    count = 0
    for i in range(z-2):
      hoge = num_list[i:i+3]
      hoge_sort = sorted(hoge)
      if hoge[1]==hoge_sort[1]:
        count += 1
    print(count)

Buggy submission (verdict: Runtime Error):
if __name__ == '__main__':
  z = input()
  num_list = input()
  count = 0
  for i in range(z-3):
    hoge = num_list[i:i+3]
    hoge_sort = hoge.sort()
    if hoge[1]=hoge_sort[1]:
      count += 1
  print(count)

Buggy submission (verdict: Runtime Error):
n = 5
num_list = [1,2,3,2,1]
count = 0
for i in range(len(num_list)-3):
	hoge = num_list[i:i+3].sort_values()
    if hoge[1] = num_list[1]:
      count += 1
 
print(count)
Problem p02642 (python)

Fixed submission:
from collections import Counter
n=int(input())
a=list(map(int,input().split()))
c=Counter(a)
s=list(set(a))
p=[True]*(10**6+1)

for x in s:
    t=x*2
    while t<=10**6:
        p[t]=False
        t+=x
ans=0
for x in a:
    if c[x]==1 and p[x]==True:
        ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
x=[0]*len(a)

for i in range(n):
  for j in range(n):
    if i==j:
      continue
    if a[i]%b[j]==0:
      x[i]+=1
      continue
print(x.count(0))
Problem p02646 (python)

Fixed submission:
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())
s=v-w
s*=t
if abs(a-b)<=s:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input)
s=v-w
s*=t
if abs(a-b)<=s:
  print("YES")
else:
  print("NO")
Problem p02747 (python)

Fixed submission:
a=input()

if a=="hi"*(len(a)//2):
	print("Yes")
else:
	print("No")

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

if a=="hi"*(len(a)//2):
	print("Yes")
else:
	print"No"
Problem p02778 (python)

Fixed submission:
s=input()
ans=""

for i in range(len(s)):
	ans+="x"

print(ans)

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

for i in range(len(a)):
	ans+="x"

print(ans)
Problem p02783 (python)

Fixed submission:
h,a=map(int,input().split())
print(h//a if h%a==0 else (h//a)+1)

Buggy submission (verdict: Runtime Error):
h,a=map(int,input().split())
print(h//a if h%a+==0 else (h//a)+1)

Buggy submission (verdict: Runtime Error):
h,a=map(int,input.split())
print(h//a)
Problem p02801 (python)

Fixed submission:
list=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
ans=input()

for i in list:
	if i==ans:
		print(list[list.index(i)+1])

Buggy submission (verdict: Runtime Error):
list=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y']
ans=input()

for i in list:
	if i==ans:
		print(list[list.index(i)+1])
Problem p02802 (python)

Fixed submission:
n,m=map(int,input().split())
if m==0:
    print(0,0)
    exit()
AC=[0]*(n+1)
WA=[0]*(n+1)

for i in range(m):
    p,s=map(str,input().split())
    if s=="AC":
        AC[int(p)]+=1
    elif s=="WA" and AC[int(p)]==0:
        WA[int(p)]+=1

for i in range(n+1):
    if AC[i]==0:
        WA[i]=0

cnt=AC.count(0)
answer=len(AC)-cnt
ans=sum(WA)
print(answer,ans)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
if m==0:
    print(0,0)
    exit()
AC=[0]*n+1
WA=[0]*n+1

for i in range(m):
    p,s=map(str,input().split())
    if s=="AC":
        AC[int(p)]+=1
    elif s=="WA" and AC[int(p)]==0:
        WA[int(p)]+=1

for i in range(n+1):
    if AC[i]==0:
        WA[i]=0

cnt=AC.count(0)
answer=len(AC)-cnt
ans=sum(WA)
print(answer,ans)
Problem p02811 (python)

Fixed submission:
k,x=map(int,input().split())
if 500*k>=x:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
k,x=map(int,input().split())
if 500*k=>x:
  print("Yes")
else:
  print("No")
Problem p02817 (python)

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

Buggy submission (verdict: Runtime Error):
s,t=map(input().split())
ans=t+s
print(ans)
Problem p02848 (python)

Fixed submission:
N = int(input())
S = input()

ans = ''
for c in S:
    i = ord(c) - ord('A')
    i = (i+N)%26
    ans += chr(i + ord('A'))
print(ans)

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

ans=s-65+n
if ans>=26:
  ans=ans%26
print(chr(ans+65))

Buggy submission (verdict: Runtime Error):
s=ord(input())
n=int(input())
ans=s-65+n
if ans>=26:
  ans=ans%26
print(chr(ans+65))
Problem p02909 (python)

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

Buggy submission (verdict: Runtime Error):
s=input()
if s ==　"Sunny":
    print("Cloudy")
elif s ==　"Cloudy":
    print("Rainy")
else:
    print("Sunny")

Buggy submission (verdict: Runtime Error):
s=input()
if s ==　Sunny:
    print("Cloudy")
if s ==　Cloudy:
    print("Rainy")
else:
    print("Sunny")

Buggy submission (verdict: Runtime Error):
s=input()
if s ==　"Sunny":
    print("Cloudy")
if s ==　"Cloudy":
    print("Rainy")
else:
    print("Sunny")
Problem p02993 (python)

Fixed submission:
s=input()
a=int(s[0])-int(s[1])
b=int(s[1])-int(s[2])
c=int(s[2])-int(s[3])
if a!=0 and b!=0 and c!=0:
  print("Good")
else:
  print("Bad")

Buggy submission (verdict: Runtime Error):
s=input()
if int(s[0])==int(s[1]) or int(s[1])==int(s[2]) or int(s[2])=int(s[3]):
  print("Bad")
else:
  print("Good")

Buggy submission (verdict: Runtime Error):
s=int(input())
if s[0]==s[1] or s[1]==s[2] or s[2]=s[3]:
  print("Good")
else:
  print("Bad")
Problem p03035 (python)

Fixed submission:
a,b=map(int,input().split())
if a>=13:
  print(b)
if a>=6 and a<=12:
  print(b//2)
if a<=5:
  print(0)

Buggy submission (verdict: Runtime Error):

if a>=13:
  print(b)
if a>=6 and a<=12:
  print(b//2)
if a<=5:
  print(0)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a>=13:
  print(b)
if 6<=a<=12:
  pritn(b/2)
if a<=5:
  print(0)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a>=13:
  print(b)
elif 6<=a<=12:
  pritn(b//2)
else:
  print(0)
Problem p03211 (python)

Fixed submission:
n=input()
print(min(abs(int(n[i:i+3])-753) for i in range(len(n))))

Buggy submission (verdict: Runtime Error):
n=input()
print(min(abs(int(n[i:i+3])-753 for i in range(len(n)))))
Problem p03219 (python)

Fixed submission:
x,y=map(int,input().split())
print(x+(y//2))

Buggy submission (verdict: Runtime Error):
print(int(input())+(int(input())//2))
Problem p03273 (python)

Fixed submission:
H, W = map(int, input().split())
a = []
for _ in range(H):
    i = list(input())
    if '#' in i:
        a.append(i)
ans = zip(*[i for i in zip(*a) if '#' in i])
for s in ans:
    print(*s, sep='')

Buggy submission (verdict: Runtime Error):
h,w=map(int,input().split())
l=[list(map(input().split())) for i in range(h)]

row=[False]*h
col=[False]*w

for i in range(h):
  for j in range(w):
    if a[i][j]=="#":
      row[i]="True"
      col[j]="True"

for i in range(h):
  if row[i]:
    for j in range(w):
      if col[j]:
        print(a[i][j], end="")
    print()
Problem p03284 (python)

Fixed submission:
n,k=map(int,input().split())
if n%k!=0:
  print("1")
else:
  print("0")

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=n//k
b=n%k
print(a+b)-a
Problem p03316 (python)

Fixed submission:
n=int(input())
sum=0
cnt=n

while cnt>0:
  sum+=cnt%10
  cnt//=10
  
if n%sum==0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n=input()
print("No" if int(n)%sum(map(int,input())) else "Yes")

Buggy submission (verdict: Runtime Error):
n=int(input)
sum=0
cnt=n

while cnt>0:
  sum+=cnt%10
  cnt/=10
  
if n%sum==0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n=int(input())
s=sum(list(str(n)))

if n%s==0:
  print("Yes")
else:
  print("No")
Problem p03352 (python)

Fixed submission:
x=int(input())
c=1

for b in range(1,x):
  for p in range(2,x):
    if b**p<=x:c=max(c,b**p)
    else:break

print(c)

Buggy submission (verdict: Runtime Error):
x=int(input())
c=1

for b in range(1,x):
  for p in range(2,x):
    if b**p<=x:c=max(c,b**p)
      else:break

print(c)
Problem p03370 (python)

Fixed submission:
n,x=map(int,input().split())
l=[int(input()) for i in range(n)]

print(n+(x-sum(l))//min(l))

Buggy submission (verdict: Runtime Error):
n,x=map(int,input().split())
l=[int(input()) for i in range(n)]

print(n+(x-sum(l)//min(l))
Problem p03378 (python)

Fixed submission:
n,m,x=map(int,input().split())
a=map(int,input().split())

left=0
right=0

for ai in a:
  if ai<x:
    left+=1
  else:
    right+=1
print(min(left,right))

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

left=0
right=0

for ai in a:
  if ai<x:
    left+=1
  else:
    rihgt+=1
print(min(left,right))
Problem p03502 (python)

Fixed submission:
n=input()
print("Yes" if int(n)%sum(map(int,n))==0 else "No")

Buggy submission (verdict: Runtime Error):
n=str(input())
print("Yes" if n%sum(map(int,n))==0 else "No")
Problem p03544 (python)

Fixed submission:
a,b=2,1
for i in range(int(input())):
  a,b=b,(a+b)
print(a)

Buggy submission (verdict: Runtime Error):
a,b=2,1
for i in range(int(input()):
               a,b=b,(a+b)
print(a)
Problem p03673 (python)

Fixed submission:
from collections import deque
 
N = int(input())
A = [int(i) for i in input().split()]
 
B = deque(maxlen=2*10**5)
 
if N % 2 == 0:
    for i in range(N):
        if i % 2 == 0:
            B.append(A[i])
        else:
            B.appendleft(A[i])
else:
    for i in range(N):
        if i % 2 == 0:
            B.appendleft(A[i])
        else:
            B.append(A[i])
 
print(*B)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
print(*A[::-2], *A[N%2::2])

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
print(*A[::-2],*A[N%2::2])

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
print(*A[::-2],*A[N%2::2])

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

print(*a[::-2],*a[n%2::2])
Problem p03737 (python)

Fixed submission:
a,b,c=input().split()
print((a[0]+b[0]+c[0]).upper())

Buggy submission (verdict: Runtime Error):
a,b,c===input().split()
print((a[0]+b[0]+c[0]).upper())
Problem p03778 (python)

Fixed submission:
w,a,b=map(int,input().split())
print(max(abs(a-b)-w,0))

Buggy submission (verdict: Runtime Error):
W,a,b=map(int,input().split())
print(min(abs(a-b)-w,0))
Problem p03827 (python)

Fixed submission:
input()
s=input()
n,m=0,0

for i in range(len(s)):
  if s[i]=="I":
    n+=1
    m=max(n,m)
  if s[i]=="D":
    n=n-1
    m=max(n,m)
print(m)

Buggy submission (verdict: Runtime Error):
input()
s=input()
n,m=0

for i in range(len(s)):
  if s[i]=="I":
    n+=1
    m=max(n,m)
  if s[i]=="D":
    n=n-1
    m=max(n,m)
print(m)
Problem p03844 (python)

Fixed submission:
a,b,c=input().split()
if b=="+":
  print(int(a)+int(c))
else:
  print(int(a)-int(c))

Buggy submission (verdict: Runtime Error):
a,b,c=input().split()
if b=="+":
  print(int(a)+int(c))
else b=="-":
  print(int(a)-int(c))
Problem p02732 (python)

Fixed submission:
from scipy.special import comb
from collections import Counter

n = int(input())
A = [int(i) for i in input().split()]

count = Counter(A)
combs = {k:comb(count[k], 2) for k in count.keys()}
combs_minas_one = {k:comb(count[k]-1, 2) for k in count.keys()}
all = sum(combs.values())

for a in A:
    ans = all - combs[a] + combs_minas_one[a]
    print(int(ans))

Buggy submission (verdict: Runtime Error):
from scipy.special import comb
from collections import Counter

n = int(input())
A = [int(i) for i in input().split()]

count = Counter(A)
combs = {k:comb(count[k], 2) for k in count.keys()}
all = sum(combs.values())

for a in A:
    ans = all - combs[a] + comb(count[a]-1,2)
    print(int(ans))
Problem p02953 (python)

Fixed submission:
n = int(input())
H = [int(i) for i in input().split()]
high = H[0]
for i in range(1,n):
    tmp = H[i]-high
    if -1<=tmp<=1:
        pass
    elif tmp > 1:
        high = H[i]
    else:
        print('No')
        exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
n = int(input())
H = [int(i) for i in input().split()]
high = H[0]
for i in range(1,n):
    tmp = H[i]-high
    if 0<=tmp<=1:
        pass
    elif tmp = -1:
        high -= 1
    elif tmp > 1:
        high = H[i]
    else:
        print('No')
        exit()
print('Yes')