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

Fixed submission:
t = input()
s = [i for i in t]
if s[0] == "?":
    s[0] = "D"
for i in range(1, len(t) - 1):
    if s[i] == "?":
        if s[i-1] == "D" and s[i+1] == "D":
            s[i] = "P"
        elif s[i-1] == "D" and s[i+1] == "?":
            s[i] = "P"
        else:
            s[i] = "D"
if s[-1] == "?":
    s[-1] = "D"
print("".join(s))

Buggy submission (verdict: Runtime Error):
T = str(input()).upper()
for i in T:
    if i == 'P' or 'D' and i== '?':
        if i + 'D':
            print(T.replace('?','P'))
        else:
            print(T.replace('?','D'))
    else:
        break

Buggy submission (verdict: Runtime Error):
a = input()
b = [i for i in a]
if b[0] == "?":
    bin[0] = "D"
for i in range(1, len(t) - 1):
    if b[i] == "?":
        if b[i-1] == "D" and b[i+1] == "D":
            b[i] = "P"
        elif b[i-1] == "D" and b[i+1] == "?":
            b[i] = "P"
        else:
            b[i] = "D"
if b[-1] == "?":
    b[-1] = "D"
print("".join(b))
Problem p02675 (python)

Fixed submission:
a = int(input())
b = str(a)
c = int(b[-1])
if c in [2,4,5,7,9]:
    print("hon")
elif c in [0,1,6,8]:
    print("pon")
else:
    print("bon")

Buggy submission (verdict: Runtime Error):
U = int(input())
b = str(U)
c = int(b[-1])
if c in [2,4,5,7,9]:
    print("hon")
elif c in [0,1,6,8]:
    print("pon")
else:
    print("bon")S
Problem p02717 (python)

Fixed submission:
x , y, z = map(int,input().split())
print('{} {} {}'.format(z,x,y))

Buggy submission (verdict: Runtime Error):
b = []
for i in range(3): 
    a= int(input())
    b.append(a)
print(b[::-1])
Problem p02719 (python)

Fixed submission:
n,k = map(int,input().split())
if n % k ==0:
    print(0)
else:
    l = [n]
    p = n//k
    c = n-(p*k)
    half = k//2
    while c > half:
        c = abs(c-k)
    l.append(c)
    print(min(l))

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = abs(a - b)
d = abs(c-b)
print(d)
Problem p02741 (python)

Fixed submission:
a = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
b = int(input())
print(a[b-1])

Buggy submission (verdict: Runtime Error):
list = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
a = int(input())
print(list[a+1])
Problem p02783 (python)

Fixed submission:
firstinput = input("")
firstinputsplit = firstinput.split(" ")
H = int(firstinputsplit[0])
N = int(firstinputsplit[1])
kill = 0
if H <= 10000 and N <= 10000:
    while H > 0:
        H = H - N
        kill = kill + 1
    print(kill)
else:
    print(H)

Buggy submission (verdict: Runtime Error):
userinput = input("")
userlist = userinput.split(" ")
H = int(user[0])
A = int(user[1])
numberkill = 0
if H <= 10000 and A <= 1000:
  while H > 0:
    H = H - A
    numberkill = +1
  if H < 0:
    numberkill = +1
    print(numberkill)
  else:
    print(numberkill)
else:
  print("")
Problem p02690 (python)

Fixed submission:
X = int(input())

A = -119
while A<= 120:
    B = -119
    while B<= 120:
        if A**5 - B**5 == X:
            print('%d %d'%(A, B))
            break
        B += 1
    else:
        A+= 1
        continue
    break

Buggy submission (verdict: Runtime Error):
A = -119
while A<= 120:
    B = -119
    while B<= 120:
        if A**5 - B**5 == X:
            break
        B += 1
    A+= 1

print('%d %d'%(A, B))
Problem p02727 (python)

Fixed submission:
x, y, a, b, c = [int(t) for t in input().split()]
p = [int(t) for t in input().split()]
q = [int(t) for t in input().split()]
r = [int(t) for t in input().split()]

s = []
p.sort(reverse=True)
p = p[:x]

q.sort(reverse=True)
q = q[:y]

s = p + q + r
s.sort(reverse=True)
s = s[:x+y]
print(sum(s))

Buggy submission (verdict: Runtime Error):
s = []
r.extend( [0 for i in range(x+y)])
p.sort()
q.sort()
r.sort()


for i in range(x):
    if  p[-1]>= r[-1]:
        s.append(p.pop())
    else:
        s.append(r.pop())
    
for i in range(y):
    if  q[-1]>= r[-1]:
        s.append(q.pop())
    else:
        s.append(r.pop())
        
print(sum(s))
Problem p02646 (python)

Fixed submission:

def method():
  a, v = input().split()
  b, w = input().split()
  t = int(input())

  a = int(a) # Oni cordinate
  v = int(v) # Oni Speed
  b = int(b) # Nige Cordinate
  w = int(w) # Nige Speed

  if a < b:
    distance = b - a
    relative_speed = v - w
    if relative_speed <= 0:
      return 'NO'
    else:
      if (distance / relative_speed) > t:
        return 'NO'
      else:
        return 'YES'
  else: # b < a
    distance = a - b
    relative_speed = v - w
    if relative_speed <= 0:
      return 'NO'
    else:
      if (distance / relative_speed) > t:
        return 'NO'
      else:
        return 'YES'

print(method())

Buggy submission (verdict: Runtime Error):

def method():
  a, v = input().split()
  b, w = input().split()
  t = int(input())

  a = int(a) # Oni cordinate
  v = int(v) # Oni Speed
  b = int(b) # Nige Cordinate
  w = int(w) # Nige Speed

  if a < b:
    distance = b - a
    relative_speed = v - w
    if relative_speed <= 0:
      return 'NO'
    else:
      if (distance / relative_speed) > t:
        return 'NO'
      else:
        return 'YES'
  else: # b < a
    distance = a - b
    relative_speed = v - m
    if relative_speed <= 0:
      return 'NO'
    else:
      if (distance / relative_speed) > t:
        return 'NO'
      else:
        return 'YES'

print(method())
Problem p02657 (python)

Fixed submission:
nums = input()
num1 = int(nums.split()[0])
num2 = int(nums.split()[1])

print(num1 * num2)

Buggy submission (verdict: Runtime Error):
count = int(input())
if count == 0:
  result = 0
else:
  nums_str = input().split()
  nums_int = []
  for strn in nums_str:
    nums_int.append(int(strn))
 
    result = 1

    if 0 in nums_int:
      result = 0
    else:
      for intn in nums_int:
        result *= intn
        if result > 1000000000000000000:
          result = -1
          break
    
print(result)
Problem p02658 (python)

Fixed submission:
def process():
  count = int(input())
  nums_str = input().split()
  nums_int = []
  for strn in nums_str:
    nums_int.append(int(strn))

  if 0 in nums_int:
    result = 0
    return result
  else:
    result = 1
    for intn in nums_int:
      result *= intn
      if result > 1000000000000000000:
        result = -1
        return result
    return result
    
print(process())

Buggy submission (verdict: Runtime Error):
if int(count) == 0:
  result = 0
else:
  nums_str = input().split()
  nums_int = []
  for strn in nums_str:
    nums_int.append(int(strn))
 
    result = 1

  else:
    for intn in nums_int:
      result *= intn
      if result > 10**18:
        result = -1
        break
    
print(result)

Buggy submission (verdict: Runtime Error):
count = input()
nums_str = input().split()
nums_int = []
for strn in nums_str:
  nums_int.append(int(strn))

result = 1
if count == 0:
  result = 0
elif:
  for intn in nums_int:
    result *= intn
    if result > 10**18:
      result = -1
      break
    
print(result)
Problem p02780 (python)

Fixed submission:
def main():
    N,K = map(int, input().split())
    p = list(map(int, input().split()))
    if N>K:
        esum = [0]*N
        psum = [0]*(N-K)
        esum[0] = p[1]
        for i in range(1,K):
            esum[i] = esum[i-1]+p[i]
        for i in range(K,N):
            esum[i] = esum[i-1]+p[i]
            psum[i-K] = esum[i]-esum[i-K]
        ans = (max(psum)+K)*0.5
    else:
        ans = (sum(p)+K)*0.5

    print(ans)
    return

if __name__=="__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    N,K = map(int, input().split())
    p = list(map(int, input().split()))
    esum = [0]*N
    psum = [0]*(N-K)
    esum[0] = p[1]
    for i in range(1,K):
        esum[i] = esum[i-1]+p[i]
    for i in range(K,N):
        esum[i] = esum[i-1]+p[i]
        psum[i-K] = esum[i]-esum[i-K]

    print(  (max(psum)+K)*0.5  )
    return

if __name__=="__main__":
    main()
Problem p03493 (python)

Fixed submission:
def main():
    s = input()
    print( sum( [ s[i]=='1' for i in range(len(s)) ] ) )
    

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
    s = input()
    print( sum( [ s[i]=='1' for i in range(len(s)) ] ) )
Problem p02576 (python)

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

if N%X == 0:
    print(N//X*T)
else:
    print((N//X+1)*T)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
count = 0
max = A[0]#最大値を保持しておくことでオーダーを減らす
for i in range (0,N):
    while(max>A[i]):
        count = count + 1
        
       # print(A)
    if(max<=A[i]):
        max = A[i]
      #  print(A)
print(count)
Problem p02696 (python)

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

def f(a, b, n):
   # fl1 = (a * (n + 1)) // b
    #fl2 = (n + 1) // b
    #fl = fl1 - a * fl2
    #return fl
   return int(a * n / b) - a * int(n / b)

print(f(A, B, B-1) if N >= B-1 else f(A, B, N))

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

def f(a, b, n):
    fl1 = (a * (n + 1)) // b
    fl2 = (n + 1) // b
    fl = fl1 - a * fl2
    return fl

print(f(a, b, b-1) if n >= b-1 else f(a, b, n))
Problem p02717 (python)

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

A = X
B = Y
C = Z

A,B = B,A
A,C = C,A

print(A,B,C)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = list(map(int, input().split()))
vote = sum(A)
#print(vote)
count = 0
line = 4*M
line2 = vote/line
ans = "No"

for i in A:
    if (i >= line2):
        count += 1

#print(count)
if (count > M):
    ans = "Yes"


print(ans)
Problem p02719 (python)

Fixed submission:
N,K = map(int, input().split())
ans = 0


#if (N < K):
 #   ans = N
if(N % K == 0):
    ans = 0
else:
    if (N < K):
        ans = N
    N = N % K
    if(N <= abs(N-K)):
        ans = N
    else:
        ans = abs(N-K)

print(ans)

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


if (N < K):
    ans = N
#elif(N % K == 0):
 #   ans = 0
else:
    if (N % K == 0):
        ans = 0
    else:
    N = N % K
    if(N <= abs(N-K)):
        ans = N
    else:
        ans = abs(N-K)

print(ans)
Problem p03160 (python)

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

dp = []
dp.append(0)
dp.append(abs(h[1]-h[0]))

for i in range(2,N):
     t1 = dp[i - 2] + abs(h[i] - h[i - 2])
     t2 = dp[i - 1] + abs(h[i] - h[i - 1])
     dp.append(min(t1, t2))



print(dp[N-1])

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

dp = []
dp[0]=0
dp[1]=abs(h[1]-h[0])

for i in range(2,N):
     t1 = dp[i - 2] + abs(h[i] - h[i - 2])
     t2 = dp[i - 1] + abs(h[i] - h[i - 1])
     dp[i] = min(t1, t2)



print(dp[N-1])
Problem p04030 (python)

Fixed submission:
C = []
A = input()
for i in A:
    if i == '0':
        C.append(i)
    if i == '1':
        C.append(i)
    if i == 'B' and  len(C)!=0:
        C.pop()
    else: pass

print("".join(C))

Buggy submission (verdict: Runtime Error):
C = []
A = input()
for i in A:
    if i == '0':
        C.append(i)
    if i == '1':
        C.append(i)
    if i == 'B' and  len(C)!=0:
        C.pop()

print("".join(C)

Buggy submission (verdict: Runtime Error):
C = []
A = input()
for i in A:
    if i == '0':
        C.append(i)
    if i == '1':
        C.append(i)
    if i == 'B':
        C.pop()

print(C)
Problem p03998 (python)

Fixed submission:
lstA = list(input())
lstB = list(input())
lstC = list(input())

maxA = len(lstA)
maxB = len(lstB)
maxC = len(lstC)

numA = 0
numB = 0
numC = 0

res = ''
tmp = 'a'

while True:
	if tmp == 'a':
		if numA == maxA:
			res = 'A'
			break
		tmp = lstA[numA]
		numA += 1

	elif tmp == 'b':
		if numB == maxB:
			res = 'B'
			break
		tmp = lstB[numB]
		numB += 1

	else:
		if numC == maxC:
			res = 'C'
			break
		tmp = lstC[numC]
		numC += 1

print(res)

Buggy submission (verdict: Runtime Error):
lstA = list(input())
lstB = list(input())
lstC = list(input())

maxA = len(lstA)
maxB = len(lstB)
maxC = len(lstB)

numA = 0
numB = 0
numC = 0

res = ''
tmp = 'a'



while True:
	if tmp == 'a':
		if numA == maxA:
			res = 'A'
			break
		tmp = lstA[numA]
		numA += 1

	elif tmp == 'b':
		if numB == maxB:
			res = 'B'
			break
		tmp = lstB[numB]
		numB += 1

	elif tmp == 'c':
		if numC == maxC:
			res = 'C'
			break
		tmp = lstC[numC]
		numC += 1

print(res)
Problem p03377 (python)

Fixed submission:
a=input().split(' ')
A=int(a[0])
B=int(a[1])
X=int(a[2])
if A<=X and A+B>=X:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
A=int(input())
B=int(input())
X=int(input())
if A<=X and A+B>=X:
  print('Yes')
else:
  print('No')
Problem p03407 (python)

Fixed submission:
A,B,C=map(int,input().split())
print('Yes' if A+B>=C else 'No')

Buggy submission (verdict: Runtime Error):
blue=int(input())
b=[]
r=[]
count=[]
for i in range(blue):
  b.append(input())
red=int(input())
for i in range(red):
  r.append(input())
for i in b:
  count.append(b.count(i)-r.count(i))
if max(count)<0:
  print(0)
else:
  print(max(count))
Problem p03423 (python)

Fixed submission:
N=int(input())
print(N//3)

Buggy submission (verdict: Runtime Error):
N=int(input())
name=[]
for i in range(N):
  name.append(input())
M=0
A=0
R=0
C=0
H=0
letters=['M','A','R','C','H']
for i in range(N):
  for j in letters:
    if name[i][0]==j:
      if j=='M':
        M+=1
      elif j=='A':
        A+=1
      elif j=='R':
        R+=1
      elif j=='C':
        C+=1
      elif j=='H':
        H+=1
if M==0:
  M+=1
if A==0:
  A+=1
if C==0:
  C+=1
if R==0:
  R+=1
if H==0:
  H+=1
print(M*A*C*R*H)

Buggy submission (verdict: Runtime Error):
N=int(input())
name=[]
for i in range(N):
  name.append(input())
M=0
A=0
R=0
C=0
H=0
letters=['M','A','R','C','H']
for i in range(N):
  for j in letters:
    if name[i][0]==j:
      if j=='M':
        M+=1
      elif j=='A':
        A+=1
      elif j=='R':
        R+=1
      elif j=='C':
        C+=1
      elif j=='H':
        H+=1
kazu=!
if M==0:
  M+=1
if A==0:
  A+=1
if C==0:
  C+=1
if R==0:
  R+=1
if H==0:
  H+=1
print(M*A*C*R*H)
Problem p03424 (python)

Fixed submission:
N=int(input())
A=list(map(str, input().split()))
color=['P','W','G','Y']
counter=0
for i in color:
  if i in A:
    counter+=1
if counter==4:
  print('Four')
else:
  print('Three')

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(str, input().split()))
counter=0
if 'P', 'W', 'G', 'Y' in A:
  print('Four')
else:
  print('Three')
Problem p03455 (python)

Fixed submission:
a,b=map(int, input().split())
c=a*b
if c%2==0:
  print('Even')
else:
  print('Odd')

Buggy submission (verdict: Runtime Error):
N=int(input())
t=[]
x=[]
y=[]
x_2=0
y_2=0
counter=0
hantei=[-1,1]
for i in range(N):
  t_1, x_1, y_1=map(int, input().split())
  t.append(t_1)
  x.append(x_1)
  y.append(y_1)
  
for i in range(N):
  x_2=0
  y_2=0
  for j in range(t[i]):
    for k in hantei:
      for l in hantei:
        x_2+=k
        y_2+=l
        if x_2==x[i] and y_2==y[i]:
          counter+=1
 
if counter==N:
  print('Yes')
else:
  print('No')
Problem p03469 (python)

Fixed submission:
S=input()
S_array=S.split('/')
print('2018/'+S_array[1]+'/'+S_array[2])

Buggy submission (verdict: Runtime Error):
N,Y=map(int, input().split())
ichiman=0
gosen=0
sen=0
a=0
for i in range(N+1):
  for j in range(N+1-i):
    for k in range(N+1-i-j):
      if 10000*i+5000*j+1000*k==Y and i+j+k==N:
        a=1
        ichiman=i
        gosen=j
        sen=k
        print(str(i)+' '+str(j)+' '+str(k))
        exit()
    
print('-1 -1 -1')
Problem p03477 (python)

Fixed submission:
A,B,C,D = map(int, input().split())
if A+B>C+D:
  print('Left')
elif A+B==C+D:
  print('Balanced')
elif A+B<C+D:
  print('Right')

Buggy submission (verdict: Runtime Error):
N,A,B=map(int,input().split())
souryou=0
for i in range(N):
  j=i+1
  j_str=str(j)
  goukei=0
  for k in range(len(j_str)):
    goukei=goukei+int(j_str[k])
  if goukei>=A and goukei<=B:
    souryou=souryou+j
print(str(souryou))

Buggy submission (verdict: Runtime Error):
A, B, C, D = [int(input()) for i in range(4)]
if A+B>C+D:
  print('Left')
elif A+B==C+D:
  print('Balanced')
elif A+B<C+D:
  print('Right')

Buggy submission (verdict: Runtime Error):
if A+B>C+D:
  print('Left')
elif A+B==C+D:
  print('Balanced')
elif A+B<C+D:
  print('Right')
Problem p03478 (python)

Fixed submission:
N,A,B=map(int,input().split())
souryou=0
for i in range(N):
  j=i+1
  j_str=str(j)
  goukei=0
  for k in range(len(j_str)):
    goukei=goukei+int(j_str[k])
  if goukei>=A and goukei<=B:
    souryou=souryou+j
print(str(souryou))

Buggy submission (verdict: Runtime Error):
N,A,B=map(int,input().split())
souryou=0
for i in range(N):
  j=i+1
  j_str=str(j)
  goukei=0
  for k in range(len(j_str)):
    goukei=goukei+int(j_str[k])
  if goukei>=A&&goukei<=B:
    souryou=souryou+j
print(str(souryou))
Problem p03485 (python)

Fixed submission:
a,b=map(int, input().split())
if (a+b)/2>(a+b)//2:
  print((a+b)//2+1)
elif (a+b)/2==(a+b)//2:
  print((a+b)//2)

Buggy submission (verdict: Runtime Error):
s=input()
t=input()
s_array=[]
t_array=[]
for i in range(len(s)):
  s_array.append(s[i])
for i in range(len(t)):
  t_array.append(t[i])

s_array=sorted(s_array)

t_array=sorted(t_array,reverse=True)
for i in range(min([len(s_array),len(t_array)])):
  if s_array[i]<t_array[i]:
    print('Yes')
    exit()
  elif s_array[i]>t_array[i]:
    print('No')
    exit()
if len(s_array)<len(t_array):
  print('Yes')
  exit()
print('No')
Problem p03486 (python)

Fixed submission:
s=input()
t=input()
s_array=[]
t_array=[]
for i in range(len(s)):
  s_array.append(s[i])
for i in range(len(t)):
  t_array.append(t[i]) 
s_array=sorted(s_array)
 
t_array=sorted(t_array,reverse=True)
for i in range(min([len(s_array),len(t_array)])):
  if s_array[i]<t_array[i]:
    print('Yes')
    exit()
  elif s_array[i]>t_array[i]:
    print('No')
    exit()
if len(s_array)<len(t_array):
  print('Yes')
  exit()
print('No')

Buggy submission (verdict: Runtime Error):
s,t=map(str,input().split())
s_array=[]
t_array=[]
for i in range(len(s)):
  s_array.append(s[i])
for i in range(len(t)):
  t_array.append(t[i])

s_array=sorted(s_array)

t_array=sorted(t_array,reverse=True)
for i in range(min([len(s_array),len(t_array)])):
  if s_array[i]<t_array[i]:
    print('Yes')
    exit()
  elif s_array[i]>t_array[i]:
    print('No')
    exit()
print('No')
Problem p02553 (python)

Fixed submission:
a,b,c,d=list(map(int, input().split()))
ac=a*c
ad=a*d
bc=b*c
bd=b*d
print(max([ac,ad,bc,bd]))

Buggy submission (verdict: Runtime Error):
a,b,c,d=list(map(int, input().split()))
ac=a*c
ad=a*d
bc=b*c
cd=b*d
print(max([ac,ad,bc,bd]))
Problem p02576 (python)

Fixed submission:
N,X,T=map(int, input().split())
if N%X==0:
  print(int(N/X*T))
else:
  print((int(N/X)+1)*T)

Buggy submission (verdict: Runtime Error):
N,X,T=map(int, input().split())
if N%X==0:
  print(N/X*T)
  else:
  print((int(N/X)+1)*T)
Problem p02789 (python)

Fixed submission:
x,y = map(int,input().split())
if x-y == 0:
  print("Yes")
else:
  print("No")

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

res = 0
for i in range(n):
    for j in range(n):
        if j > i:
            res += 1
            break
        if  li[j]<li[i]:
            break
        if len(li)-1==i and n-1 ==j:
            res += 1
            break


print(res)

Buggy submission (verdict: Runtime Error):
x,y = map(int,input().split())
if x-y == 0:
  print("Yes")
 else:
  print("No")
Problem p02818 (python)

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

def eat_cookie(A,B,K):
    if A >= K:
        return A-K,B
    else:
        if B-K+A > 0:
            return 0,B-K+A
        else:
            return 0,0


resultA,resultB = eat_cookie(A,B,K)
print(resultA,resultB)

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

def eat_cookie(A,B,K):
    if A == 0 && B == 0:
        return 0,0
    if A >= K:
        return A-K,B
    else:
        if B-A+k > 0:
            return 0,B-K+A
        else:
            return 0,0


resultA,resultB = eat_cookie(A,B,K)
print(resultA,resultB)
Problem p02885 (python)

Fixed submission:
def main():
    width_of_window,width_of_cartain = map(int,input().split())
    print(cover_window(width_of_window,width_of_cartain))

def cover_window(width_of_window,width_of_cartain):
    if width_of_window <= width_of_cartain*2:
        return 0
    else:
        return width_of_window - width_of_cartain*2

main()

Buggy submission (verdict: Runtime Error):
def main():
    number_of_bars = int(input())
    bar_list = list(map(int,input().split()))
    print(len(traiangle_maker(bar_list))//3)
    # print(traiangle_maker(bar_list))


def traiangle_maker(bar_list):
    bar_list.sort(reverse=True)
    result_list = []
    for i in range(len(bar_list)):
        for j in range(len(bar_list)):
            if i == j or bar_list[i] < bar_list[j]:
                continue
            minimum_length = bar_list[i] - bar_list[j]
            max_length = bar_list[i] + bar_list[j]
            for k in bar_list:
                if k < minimum_length:
                    break
                if k > minimum_length and k < max_length and k != bar_list[i] and k != bar_list[j]:
                    traiangle = [bar_list[i],bar_list[j],k]
                    result_list.append(traiangle)

    return result_list


main()

Buggy submission (verdict: Runtime Error):
def main():
    number_of_bars = int(input())
    bar_list = list(map(int,input().split()))
    print(len(traiangle_maker(bar_list))//3)


def traiangle_maker(bar_list):
    bar_list.sort(reverse=True)
    result_list = []
    for i in range(len(bar_list)):
        for j in range(len(bar_list)):
            if i == j or bar_list[i] < bar_list[j]:
                continue
            minimum_length = bar_list[i] - bar_list[j]
            max_length = bar_list[i] + bar_list[j]
            for k in bar_list:
                if k > minimum_length and k < max_length and k != bar_list[i] and k != bar_list[j]:
                    traiangle = [bar_list[i],bar_list[j],k]
                    result_list.append(traiangle)

    return result_list


main()
Problem p02909 (python)

Fixed submission:
S = input()

if S == "Sunny":
    print("Cloudy")
elif S == "Rainy":
    print("Sunny")
else:
    print("Rainy")

Buggy submission (verdict: Runtime Error):
import collections
def main():
    li = list(map(int,input().split()))
    respondents = [int(input()) for i in range(li[2])]
    number_of_respondes = respondes_number_of_participants(respondents)
    check_surviver(number_of_respondes,li[0],li[1],li[2])


def respondes_number_of_participants(respondents):
    return collections.Counter(respondents)


def check_surviver(number_of_respondes,number_of_participants,gived_points,number_of_questions):
    for i in range(number_of_participants):
        if number_of_respondes[i+1]:
            if gived_points - number_of_questions + number_of_respondes[i+1] > 0:
                print("Yes")
            else:
                print("No")
        else:
            if gived_points - number_of_questions > 0:
                print("Yes")
            else:
                print("No")

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def participants_maker(number_of_participates,point):
    return [point]*number_of_participates



def point_getter(participates,respondents):
    for i in range(len(respondents)):
        participates = list(map(lambda x : x-1, participates))
        participates[respondents[i]-1] += 1
    return participates

def discriminate_serviver(result_score):
    for i in range(len(result_score)):
        if result_score[i] <= 0:
            print("NO")
        else:
            print("YES")








def main():
    li = list(map(int,input().split()))
    respondents = [int(input()) for i in range(li[2])]
    participates = participants_maker(li[0],li[1])
    result_score = point_getter(participates,respondents)
    discriminate_serviver(result_score)


if __name__ == "__main__":
    main()