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

Fixed submission:
h = int(input())
def Count(a):
  if a==1:
    return 1
  return 1+2*Count(a//2)
print(Count(h))

Buggy submission (verdict: Runtime Error):
h = int(input())
def Count(a):
  if a==1:
    return 1
  return 1+2*Count(a//2)
print(Count(a))

Buggy submission (verdict: Runtime Error):
h = int(input())
def Count(a):
  if a==1:
    return 1
  return 1+2*count(a//2)
print(Count(a))
Problem p02885 (python)

Fixed submission:
a,b= map(int,input().split(" "))
c=a -2*b
if c>0:
  print(c)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
a,b= map(int,input().split(" "))
c=a -2＊b
if c>0:
  print(c)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
a,b map(int,input().split(" ")
print(a -2＊b)
Problem p02887 (python)

Fixed submission:
n = int(input())
s = input()
color = ""
count = 0
for i in range(len(s)):
  if color != s[i]:
    color = s[i]
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
color = ""
for i in range(len(s)):
  if color != s[i]:
    color = s[i]
    count += 1
print(count)
Problem p02899 (python)

Fixed submission:
import numpy as np
n = int(input())
a = list(map(int,input().split(" ")))
b = [0]*n
order = ""
for i in range(n):
	b[a[i]-1]= i+1
for i in b:
  order += str(i) + " "
order.rstrip
print(order)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = input().split(" ")
order = ""
j = 1
for i in a:
  b = {j=>i}
print(b)
'''  
order.rstrip()
print(order)  
'''

Buggy submission (verdict: Runtime Error):
n = int(input())
a = map(int,input().split(" "))
order = ""
for i in range(n):
  for j in a:
    if j == i+1:
      order += j + " "
print(order.rstrip)
Problem p03456 (python)

Fixed submission:
a,b = input().split(" ")
ab = int(a+b)
for i in range(1,400):
  if i**2 == ab:
    print("Yes")
    exit()
print("No")

Buggy submission (verdict: Runtime Error):
import mathpy as math
a,b = input().split(" ")
ab = int(a+b)
if math.sqrt(ab) = int(np.sqrt(ab)):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
import math
a,b = input().split(" ")
ab = int(a+b)
if math.sqrt(ab) = int(np.sqrt(ab)):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
import numpy as np
a,b = input().split(" ")
ab = int(a+b)
if np.sqrt(ab) = int(np.sqrt(ab)):
  print("Yes")
else:
  print("No")
Problem p02621 (python)

Fixed submission:
import sys

a = int(input())
print(a + a**2 + a**3)

Buggy submission (verdict: Runtime Error):
int b
b = a + a^2 + a^3
return b
Problem p02640 (python)

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

ymax = 4 * x
ymin = 2 * x

if y >= ymin and y <= ymax and y % 2 == 0:
  print('Yes')
else:
  print('No')

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

ymax = 4 * x
ymin = 2 * x

if y >= ymin and y <= ymax and y % 2 == 0:
  print('Yes')
else:
  print('No')
Problem p02641 (python)

Fixed submission:
import collections
x, n= map(int, input().split())
P = list(map(int, input().split()))
 
PX = list(map(lambda p: p-x,P))
CPX = collections.Counter(PX)
ans = 0

for i in range(100):
  if CPX[-i] == 0:
    ans = x -i
    break
  elif CPX[i] == 0:
    ans = x +i
    break

print(ans)

Buggy submission (verdict: Runtime Error):
import collections
x, n= map(int, input().split())
P = list(map(int, input().split()))
 
PX = list(map(lambda p: p-x,P))
CPX = collections.Counter(PX)
ans = 0
 
for i in range(100):
  elif CPX[-i] == 0:
    ans = x -i
    break
  elif CPX[i] == 0:
    ans = x +i
    break

print(ans)

Buggy submission (verdict: Runtime Error):
import collections
x, n= map(int, input().split())
P = list(map(int, input().split()))
 
PX = list(map(lambda p: p-x,P))
CPX = collections.Counter(PX)
ans = 0
 
for i in range(100):
  elif CPX[-i] == 0:
    ans = x -i
    break
  elif CPX[i] == 0:
    ans = x +i
    break

print(ans)

Buggy submission (verdict: Runtime Error):
import collections
x, n= map(int, input().split())
P = list(map(int, input().split()))
 
PX = list(map(lambda p: p-x,P))
CPX = collections.Counter(PX)
ans = 0
 
for i in range(max(max(P),x)):
  if P == []:
    ans = x
    break
  elif CPX[-i] == 0:
    ans = x -i
    break
  elif CPX[i] == 0:
    ans = x +i
    break

print(ans)

Buggy submission (verdict: Runtime Error):
import collections
x, n= map(int, input().split())
P = list(map(int, input().split()))
 
PX = list(map(lambda p: p-x,P))
CPX = collections.Counter(PX)
ans = 0
 
for i in range(max(max(P),x)):
  if P = []:
    ans = x
    break
  elif CPX[-i] == 0:
    ans = x -i
    break
  elif CPX[i] == 0:
    ans = x +i
    break

print(ans)

Buggy submission (verdict: Runtime Error):
import collections
x, n= map(int, input().split())
P = list(map(int, input().split()))

PX = list(map(lambda p: p-x,P))
CPX = collections.Counter(PX)
ans = 0

for i in range(max(max(P),x)):
  if CPX[-i] == 0:
    ans = x -i
    break
  elif CPX[i] == 0:
    ans = x +i
    break

print(ans)

Buggy submission (verdict: Runtime Error):
import collections
x, n = map(int,input().split())
P = list(map(int, input().split()))
 
PX = list(map(lambda p: p-x,P))
CPX = collections.Counter(PX)
ans = 0
 
for i in range(max(max(P),x)):
  if CPX[-i] == 0:
    ans = x -i
    break
  elif CPX[i] == 0:
    ans = x +i
    break

print(ans)

Buggy submission (verdict: Runtime Error):
import collections
x, n = map(int,input().split())
P = list(map(int, input().split()))
 
PX = list(map(lambda p: p-x,P))
CPX = collections.Counter(PX)
ans = 0
 
for i in range(max(max(P),x)):
  if CPX[-i] == 0:
    ans = x -i
    break
  elif CPX[i] == 0:
    ans = x +i
    break
 
print(ans)

Buggy submission (verdict: Runtime Error):
import collections
x, n = map(int,input().split())
P = list(map(int, input().split()))

PX = list(map(lambda p: p-x,P))
CPX = collections.Counter(PX)
ans = 0

for i in range(max(max(P),x))
  if CPX[-i] == 0:
    ans = x -i
    break
  elif CPX[i] == 0:
    ans = x +i
    break

print(ans)
Problem p02658 (python)

Fixed submission:
n = int(input())
A = list(map(int, input().split()))
 
ans = 1
 
if 0 in A:
  ans = 0
else:
  for i in A:
    ans = ans*i
    if ans > 10**18:
      ans = -1
      break
print(ans)

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

if 0 in A:
  ans = 0
  break    
else:
  for i in A:
    ans = ans*i
    if ans > 10**18:
      ans = -1
      break
      
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
A = list(map(int, input().split()))
 
int ans = 1
 
for i in A:
  ans = ans*i
  if ans > 10**18:
    ans = -1
    break
    
print(ans)
Problem p02600 (python)

Fixed submission:
n = int(input())
if n < 600:
    ans = 8
elif  n < 800:
    ans = 7
elif n < 1000:
    ans = 6
elif n < 1200:
    ans = 5
elif  n < 1400:
    ans = 4
elif  n < 1600:
    ans = 3
elif  n < 1800:
    ans = 2
else:
    ans = 1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
if n < 600:
    ans = 8
elif  n < 800:
    ans = 7
elif n < 1000:
    ans = 6
elif n < 1200:
    ans = 5
elif  n < 1400:
    ans = 4
elif  n < 1600:
    ans = 3
elif  n < 1800:
    ans = 2
else:
    ans = 1
print(str(ans) + '-kyu')
n = int(input())
if n < 600:
    ans = 8
elif  n < 800:
    ans = 7
elif n < 1000:
    ans = 6
elif n < 1200:
    ans = 5
elif  n < 1400:
    ans = 4
elif  n < 1600:
    ans = 3
elif  n < 1800:
    ans = 2
else:
    ans = 1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
if n < 600:
  ans = 8
else if n < 800:
  ans = 7
else if n < 1000:
  ans = 6
else if n < 1200:
  ans = 5
else if n < 1400:
  ans = 4
else if n < 1600:
  ans = 3
else if n < 1800:
  ans = 2
else :
  ans = 1
print(str(ans) + '-kyu')
Problem p03061 (python)

Fixed submission:

# 最大公約数を求める
def gcd(x,y):
    if y==0:
        return x
    else:
        return gcd(y,x%y)

n=int(input())
a_array=[int(a) for a in input().split()]

# 累積GCDの計算(A1, A2, ... Ai-1の最大公約数)
left_gcd=[a_array[0]] # 
a=a_array[0] # 最初のループはgcd(a_array[0], a_array[1])になる
for i in range(1, n-1):
    a=gcd(a,a_array[i])
    left_gcd.append(a)

# 累積GCDの計算(Ai, Ai+1, ... ANの最大公約数)
right_gcd=[a_array[-1]]
b=a_array[-1] # 最初のループはgcd(a_array[-1], a_array[-2])になる
for i in range(n-2,0,-1):
    b=gcd(b,a_array[i])
    right_gcd.append(b)

# i番目の数値以外の最大公約数を格納
ans_gcd=[right_gcd[n-2],left_gcd[n-2]]

for i in range(n-2):
    ans_gcd.append(gcd(left_gcd[i],right_gcd[n-i-3]))

print(max(ans_gcd))

Buggy submission (verdict: Runtime Error):
def gcd(x,y):
    if y==0:
        return x
    else:
        return gcd(y,x%y)

n=int(input())
a_array=[int(a) for a in input().split()]

for i in range(1, n-1):
    a=gcd(a,a_array[i])
    left_gcd.append(a)

right_gcd=[a_array[-1]]
for i in range(n-2,0,-1):
    b=gcd(b,a_array[i])
    right_gcd.append(b)

ans_gcd=[right_gcd[n-2],left_gcd[n-2]]

for i in range(n-2):
    ans_gcd.append(gcd(left_gcd[i],right_gcd[n-i-3]))

print(max(ans_gcd))
Problem p03145 (python)

Fixed submission:
ab,bc,ca = map(int, input().split())

print(bc * ab // 2)

Buggy submission (verdict: Runtime Error):
n = int(input())
h_list = [int(_) for _ in input().split()]
ans = 0
while sum(h_list) != 0:
    # 0で区切られた、1以上の数のかたまりを数える
    # 要素が全て1以上ならansに+1して次のループ
    if h_list.count(0) == 0:
        ans += 1
    else:
        for i in range(1, n):
            # 1以上から0に下がった時にかたまりをカウント
            if h_list[i] == 0 and h_list[i - 1] != 0:
                ans += 1
            elif i == n - 1 and h_list[i] != 0:
                ans += 1
    # 1以上の箇所を1段ずつ落とす
    for i in range(n):
        if h_list[i] != 0:
            h_list[i] -= 1

print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
h_list = [int(_) for _ in input().split()]
ans = 0 
while sum(h_list) != 0:
    # 0で区切られた、1以上の数のかたまりを数える
    # 要素が全て1以上ならansに+1して次のループ
    if h_list.count(0) == 0:
        ans += 1
    else:
        for i in range(0,n):
            # 1以上から0に下がった時にかたまりをカウント
            if i != 0 and h_list[i] == 0 and h_list[i - 1] != 0:
                ans += 1
            elif i == n and h_list[i] != 0:
                ans += 1
    # 1以上の箇所を1段ずつ落とす
    for j in range(n):
        if h_list[j] != 0:
            h_list[j] -= 1

print(ans)
Problem p03150 (python)

Fixed submission:
s = input()
l = len(s)

for i in range(l):
    for j in range (i, l):
        if 'keyence' == (s[:i] + s[j:]):
            print("YES")
            exit()

print("NO")

Buggy submission (verdict: Runtime Error):
s = input()
correct_count = 0
wrong_char_index_list = []

for i in range(len(s)):
    if s[i] == "keyence"[correct_count]:
        correct_count += 1
        if correct_count == len("keyence"):
            break
    else:
        wrong_char_index_list.append(i)

# 全部間違い
if len(wrong_char_index_list) == len(s):
    print("NO")
    exit()

# 間違い箇所が飛んでたらダメ
if len(wrong_char_index_list) >= 2:
    for i in range(1, len(wrong_char_index_list) + 1):
        if wrong_char_index_list[i] - wrong_char_index_list[i-1] != 1:
            print("NO")
            exit()

print("YES")
exit()
Problem p03285 (python)

Fixed submission:
n = int(input())

if n < 4:
    print('No')
    exit()
elif n % 7 == 0 or n % 4 == 0:
    print('Yes')
    exit()
elif n % 7 % 4 == 0 or n % 4 % 7 == 0:
    print('Yes')
    exit()
else:
    for i in range(1, n % 7):
        tmp = n - 7 * i
        if tmp < 0:
            break
        elif tmp % 4 == 0:
            print('Yes')
            exit()
    for i in range(1, n & 4):
        tmp = n - 4 * i
        if tmp < 0:
            break
        elif tmp % 7 == 0:                                                                                      
            print('Yes')
            exit()

print('No')

Buggy submission (verdict: Runtime Error):
if n < 4:
    print('No')
    exit()
                                                                                                                
for i in range(1, n % 7):
    tmp = n - 7 * i
    if tmp % 4 == 0:
        print('Yes')
        exit()
for i in range(1, n & 4):
    tmp = n - 4 * i
    if tmp % 7 == 0:
        print('Yes')
        exit()

print('No')
Problem p03328 (python)

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

y = b - a - 1
w_hight = 0

for i in range(1, y + 1):
    w_hight += i

print(w_hight - a)

Buggy submission (verdict: Runtime Error):
a,b = map(input().split())

y = b - a - 1
w_hight = 0

for i in range(1, y):
    w_hight += i

print(w_hight - a)
Problem p03415 (python)

Fixed submission:
c_list = []
for i in range(3):
    c_list.append(input())

print(c_list[0][0] + c_list[1][1] + c_list[2][2])

Buggy submission (verdict: Runtime Error):
c_list = []
for i in range(3):
    c_list.append(input().split())

print(c_list[0] + c_list[3] + c_list[6])

Buggy submission (verdict: Runtime Error):
c_list = []
for i in range(3):
    c_list.append(input().split())
    
print(c_list[0] + c_list[3] + c_list[5])
Problem p03423 (python)

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

Buggy submission (verdict: Runtime Error):
print(input() // 3)
Problem p03434 (python)

Fixed submission:
n = int(input())
a_list = list(map(int, input().split()))
alice = 0
bob = 0


for i in range(len(a_list)):
    if i % 2:
        bob += sorted(a_list, reverse=True)[i]
    else:
        alice += sorted(a_list, reverse=True)[i]

print(str(alice - bob))

Buggy submission (verdict: Runtime Error):
n = int(input())
a_list = list(map(int, input().split()))
alice = 0
bob = 0
tmp_value = 0
tmp_index = 0

while len(a_list) > 0:
    for i in range(len(a_list)):
        if tmp_value < a_list[i]:
            tmp_value = a_list[i]
            tmp_index = i
    alice += tmp_value
    del a_list[tmp_index]
    tmp_value, tmp_index = 0, 0
    if len(a_list) == 0:
        break
    for k in range(len(a_list)):                                                                                  
        if tmp_value < a_list[k]:
            tmp_value = a_list[k]
            tmp_index = k
    bob += tmp_value
    del a_list[tmp_index]

print(str(alice - bob))
Problem p03455 (python)

Fixed submission:
list = input().split()
a, b = int(list[0]), int(list[1])

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

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

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

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

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

Buggy submission (verdict: Runtime Error):
if int(input()) % 2 == 0:
    print("Even")
else:
    print("Odd")
Problem p03457 (python)

Fixed submission:
n = int(input())
for i in range(n):
    t, x, y = map(int, input().split())
    if x + y > t or ((x + y) % 2 != t % 2):                                                                       
        print("No")
        exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
n = int(input())
for i in range(n):
    t, x, y = map(int, input().split())
    if x + y < t or (X + y) % 2 != t % 2:                                                                         
        print("No")
        exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
n = int(input())
for i in range(n):
    t, x, y = map(int, input().split())
    if x + y < t or (X + y + t) % 2:
        print("No")
        exit()
print("Yes")
Problem p03846 (python)

Fixed submission:
n = int(input())
a = [int(i) for i in input().split()]

a_dict = {}
for v in a:
    if v in a_dict:
        a_dict[v] += 1
    else:
        a_dict[v] = 1

 
if n % 2 == 0:
    possible_list = {i: True for i in range(1, n, 2)}
    for k, v in a_dict.items():
        if v != 2 or k not in possible_list:
            print(0)
            exit()
else:
    possible_list = {i: True for i in range(0, n, 2)}
    if a_dict[0] != 1:
        print(0)
        exit()
    else:
        a_dict[0] = 2
        for k, v in a_dict.items():
            if v != 2 or k not in possible_list:
                print(0)
                exit()
 
print(2 ** (n // 2) % (10 ** 9 + 7))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(i) for i in input().split()]

# aの各数値の個数をdictで保持(数値:個数) 
a_dict = {}
for v in a:
    if v in a_dict:
        a_dict[v] += 1
    else:
        a_dict[v] = 1

# a_dictの中になければならない数値のリストを作成
possible_list = {i: True for i in range(1, n, 2)}
 
can = True
if n % 2 == 0:
    for k, v in a_dict.items():
        # 数値が2個でない、もしくはkがpossible_list内に存在しないならFalse
        if v != 2 or k not in possible_list:
            can = False
            break
else:
　　　　if a_dict[0] != 1:
        can = Falsen = int(input())
a = [int(i) for i in input().split()]

# aの各数値の個数をdictで保持(数値:個数) 
a_dict = {}
for v in a:
    if v in a_dict:
        a_dict[v] += 1
    else:
        a_dict[v] = 1

# a_dictの中になければならない数値のリストを作成(0以外)
 
if n % 2 == 0:
    possible_list = {i: True for i in range(1, n, 2)}
    for k, v in a_dict.items():
        # 2個でない、もしくはpossible_list内に存在しない数値ならFalse
        if v != 2 or k not in possible_list:
            print(0)
            exit()
else:
    possible_list = {i: True for i in range(0, n, 2)}
    if a_dict[0] != 1:
        print(0)
        exit()
    else:
        a_dict[0] = 2
        for k, v in a_dict.items():
            if v != 2 or k not in possible_list:
                print(0)
                exit()
 
print(2 ** (n // 2) % (10 ** 9 + 7))
    else:
        for k, v in a_dict.items():
            if v != 2 or k not in possible_list:
                can = False
                break
 
if can:
    print(2 ** (n // 2) % (10 ** 9 + 7))
else:
    print(0)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(i) for i in input().split()]

# aの各数値の個数をdictで保持(数値:個数) 
a_dict = {}
for v in a:
    if v in a_dict:
        a_dict[v] += 1
    else:
        a_dict[v] = 1

# a_dictの中になければならない数値のリストを作成
possible_list = {i: True for i in range(1, n, 2)}
 
can = True
if n % 2 == 0:
    for k, v in a_dict.items():
        # 数値が2個でない、もしくはkがpossible_list内に存在しないならFalse
        if v != 2 or k not in possible_list:
            can = False
            break
else:
　　　　if a_dict[0] != 1:
        can = False
    else:
        for k, v in a_dict.items():
            if v != 2 or k not in possible_list:
                can = False
                break
 
if can:
    print(2 ** (n // 2) % (10 ** 9 + 7))
else:
    print(0)
Problem p02609 (python)

Fixed submission:
import sys
#DEBUG=True
DEBUG=False
if DEBUG:
    f=open("202007_2nd/D_input.txt")
else:
    f=sys.stdin
#from 2nd count
def cnt_func(num):
    cnt=0
    while num:
        num%=bin(num).count("1")
        cnt+=1
    return cnt+1
n=int(f.readline().strip())
s=f.readline().strip()
input_val=int(s,2)
input_one_count=s.count("1")
#Base value
zero_first=input_val%(input_one_count+1)
one_first=input_val%(input_one_count-1) if input_one_count>1 else 0
ans=0
for idx,emt in enumerate(s):
    p=n-idx-1
    if emt=="0": #inverted to "1"
        ans=cnt_func((zero_first+(pow(2,p,input_one_count+1)))%(input_one_count+1))
    else: #inverted to "0"
        if input_one_count>1:
            ans=cnt_func((one_first-(pow(2,p,input_one_count-1)))%(input_one_count-1))
        else:
            ans=0
    print(ans)
f.close()

Buggy submission (verdict: Runtime Error):
import sys
#DEBUG=True
DEBUG=False
if DEBUG:
    f=open("202007_2nd/D_input.txt")
else:
    f=sys.stdin
#from 2nd count
def cnt_func(num):
    cnt=0
    while num:
        num%=bin(num).count("1")
        cnt+=1
    return cnt+1
n=int(f.readline().strip())
s=f.readline().strip()
input_val=int(s,2)
input_one_count=s.count("1")
#Base value
zero_first=input_val%(input_one_count+1)
one_first=input_val%(input_one_count-1) if input_one_count>1 else 0
ans=0
for idx,emt in enumerate(s):
    p=n-idx-1
    if emt=="0": #inverted to "1"
        ans=cnt_func((zero_first+(pow(2,p,input_one_count+1)))%(input_one_count+1))
    else: #inverted to "2"
        ans=cnt_func((one_first-(pow(2,p,input_one_count-1)))%(input_one_count-1))
    print(ans)
f.close()
Problem p02614 (python)

Fixed submission:
import sys
from itertools import combinations
#DEBUG = True
DEBUG = False
if DEBUG:
    f=open("202007_1st/C_input.txt")
else:
    f=sys.stdin
WHITE='.'
BLACK='#'
def count_black(H_index,W_index):
    count_tmp=0
    for _ in range(H):
        if _ in H_index:
            continue
        for __ in range(W):
            if __ in W_index:
                continue
            if S[_][__]==BLACK:
                count_tmp+=1
    return count_tmp
ans=0
H,W,K=map(int,f.readline().split())
S=[f.readline().strip() for _ in range(H)]
H_indices=[_ for _ in range(0,H)]
W_indices=[_ for _ in range(0,W)]
combi_list_H=[[-1]]
combi_list_W=[[-1]]
for _ in range(1,H):
    combi_list_H.extend(list(combinations(H_indices,_)))
for _ in range(1,W):
    combi_list_W.extend(list(combinations(W_indices,_)))
for _ in combi_list_H:
    for __ in combi_list_W:
        if count_black(_,__)==K:
            ans+=1
print(ans)
f.close()

Buggy submission (verdict: Runtime Error):
import sys
from itertools import combinations
#DEBUG = True
DEBUG = False
if DEBUG:
    f=open("202007_1st/C_input.txt")
else:
    f=sys.stdin
WHITE='.'
BLACK='#'
def count_black(H_index,W_index):
    count_tmp=0
    for H_entries in H_index:
        for _ in H_entries:
            if _==H_index:
                continue
            for W_entries in W_index:
                for __ in W_entries:
                    if __==W_index:
                        continue
                if S[_][__]==BLACK:
                    count_tmp+=1
    return count_tmp
ans=0
H,W,K=map(int,f.readline().split())
S=[f.readline().strip() for _ in range(H)]
H_indices=[_ for _ in range(0,H)]
W_indices=[_ for _ in range(0,W)]
combi_list_H=[(-1)]
combi_list_W=[(-1)]
for _ in range(1,H):
    combi_list_H.extend(list(combinations(H_indices,_)))
for _ in range(1,W):
    combi_list_W.extend(list(combinations(W_indices,_)))
for _ in combi_list_H:
    for __ in combi_list_W:
        if count_black(_,__)==5:
            ans+=1
print(ans)
f.close()
Problem p02885 (python)

Fixed submission:
A, B = map(int, input().split())
print(max(0, A - 2*B))

Buggy submission (verdict: Runtime Error):
N = int(input())
d = list(map(int, input().split()))
ans = 0
for i in range(N - 1):
  for j in range(i + 1, N):
    ans += d[i] * d[j]
print(ans)
Problem p02972 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
B = [0 for _ in range(N + 1)]
x = []

for n in range(N):
    i = N - n
    BB = B[::i]
    if (sum(BB)) % 2 == A[i - 1]:
        B[i] = 0
    else:
        B[i] = 1
    if B[i] == 1:
        x.append(str(i))

if len(x) == 0:
    print(0)
else:
    print(len(x))
    print(' '.join(x))

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

b = []

for i in range(1, N+1)[::-1]:
    if len(list(filter(lambda x: x % i == 0, b))) % 2 != a[i-1]:
        b += [i]

print(len(b))
ans = ""
for i in range(len(b) - 1):
    ans += str(b[i])
    ans += " "
ans += str(b[-1])
print(ans)