Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
S=input()
slen = len(S)
slen2 = slen // 2
ans=0
for i in range slen2:
  if S[i] != S[-i]:
    ans += 1
print(ans)


Fixed submission:
S=input()
slen = len(S)
slen2 = slen // 2
ans=0
for i in range (slen2):
  if S[i] != S[-i-1]:
    ans += 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())
A = list(map(int,input().split()))
min = min(A)
for i in range(M):
  B,C=map(int,input().split())
  if min < C:
    A = A + [C for j in range(B)]
    A.sort(reverse=True)
    A = A[0:N]
    min = A[N-1]
print(sum(A[0:N]))


Fixed submission:
N,M=map(int,input().split())
A = list(map(int,input().split()))
bc = []

for i in range(N):
  bc.append( [1, A[i]])

for i in range(M):
  bc.append(list(map(int,input().split())))
bc = sorted( bc, key=lambda ii:ii[1], reverse=True)
p = []
tmp=0
for i in range(N):
  if bc[tmp][0] == 0:
    tmp +=1
  p.append( bc[tmp][1] )
  bc[tmp][0] -= 1
print( sum(p) )

Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())
A = list(map(int,input().split()))
min = min(A)
for i in range(M):
  B,C=map(int,input().split())
  if min < C:
    A = A + [C for j in range(B)]
    A.sort(reverse=True)
    A = A[0:N]
print(sum(A[0:N]))


Fixed submission:
N,M=map(int,input().split())
A = list(map(int,input().split()))
bc = []

for i in range(N):
  bc.append( [1, A[i]])

for i in range(M):
  bc.append(list(map(int,input().split())))
bc = sorted( bc, key=lambda ii:ii[1], reverse=True)
p = []
tmp=0
for i in range(N):
  if bc[tmp][0] == 0:
    tmp +=1
  p.append( bc[tmp][1] )
  bc[tmp][0] -= 1
print( sum(p) )

Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())
A = list(map(int,input().split()))
for i in range(M):
  B,C=map(int,input().split())
  A = A + [C for j in range(B)] 
A.sort(reverse=True)
print(sum(A[0:N]))


Fixed submission:
N,M=map(int,input().split())
A = list(map(int,input().split()))
bc = []

for i in range(N):
  bc.append( [1, A[i]])

for i in range(M):
  bc.append(list(map(int,input().split())))
bc = sorted( bc, key=lambda ii:ii[1], reverse=True)
p = []
tmp=0
for i in range(N):
  if bc[tmp][0] == 0:
    tmp +=1
  p.append( bc[tmp][1] )
  bc[tmp][0] -= 1
print( sum(p) )
Buggy python submission (verdict: Time Limit Exceeded):
R,G,B,N = map( int, input().split())
count = 0
rmax = N//R
gmax = N//G
for r in range(rmax+1):
  tmp = r * R
  for g in range(gmax+1):
    tmp2 = tmp+g*G
    if N < tmp2:
      break
    if ((N - (tmp + g * G)) % B) == 0:
      count+=1
print(count)


Fixed submission:
R,G,B,N = map( int, input().split())
count = 0
rmax = N//R
gmax = N//G
for r in range(rmax+1):
  tmp = r * R
  for g in range(gmax+1):
    tmp2 = N - (tmp+g*G)
    if tmp2 < 0:
      break
    if (tmp2 % B) == 0:
      count+=1
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
X,Y,Z,K = map(int,input().split())
#A = np.empty(X,dtype=int)
#B = np.empty(Y,dtype=int)
#C = np.empty(Z,dtype=int)
A = sorted(list(map(int, input().split())), reverse=True)
B = sorted(list(map(int, input().split())), reverse=True)
C = sorted(list(map(int, input().split())), reverse=True)

AB = [ a+b for a in A for b in B] 
ABC = [ab+c for ab in AB for c in C]
ABCs = sorted(ABC, reverse=True)[:K]
for i in range(K):
  print(ABCs[i])

Fixed submission:
X,Y,Z,K = map(int,input().split())
#A = np.empty(X,dtype=int)
#B = np.empty(Y,dtype=int)
#C = np.empty(Z,dtype=int)
A = sorted(list(map(int, input().split())), reverse=True)
B = sorted(list(map(int, input().split())), reverse=True)
C = sorted(list(map(int, input().split())), reverse=True)

AB = [ a+b for a in A for b in B]
AB = sorted(AB, reverse=True)
AB = AB[:3000]
ABC = [ab+c for ab in AB for c in C]
ABCs = sorted(ABC, reverse=True)[:K]
for i in range(K):
  print(ABCs[i])

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
X,Y,Z,K = map(int,input().split())
#A = np.empty(X,dtype=int)
#B = np.empty(Y,dtype=int)
#C = np.empty(Z,dtype=int)
A = np.array(list(map(int, input().split())))
B = np.array(list(map(int, input().split())))
C = np.array(list(map(int, input().split())))
A.sort()
B.sort()
C.sort()

AB = [ a+b for a in A for b in B] 
ABC = [ab+c for ab in AB for c in C]
ABC.sort()
ABC = ABC[::-1]
for i in range(K):
  print(ABC[i])

Fixed submission:
X,Y,Z,K = map(int,input().split())
#A = np.empty(X,dtype=int)
#B = np.empty(Y,dtype=int)
#C = np.empty(Z,dtype=int)
A = sorted(list(map(int, input().split())), reverse=True)
B = sorted(list(map(int, input().split())), reverse=True)
C = sorted(list(map(int, input().split())), reverse=True)

AB = [ a+b for a in A for b in B]
AB = sorted(AB, reverse=True)
AB = AB[:3000]
ABC = [ab+c for ab in AB for c in C]
ABCs = sorted(ABC, reverse=True)[:K]
for i in range(K):
  print(ABCs[i])

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
X,Y,Z,K = map(int,input().split())
#A = np.empty(X,dtype=int)
#B = np.empty(Y,dtype=int)
#C = np.empty(Z,dtype=int)
A = np.array(list(map(int, input().split())))
B = np.array(list(map(int, input().split())))
C = np.array(list(map(int, input().split())))
A.sort()
B.sort()
C.sort()

AB = [ a+b for a in A for b in B] 
AB.sort()
AB = AB[::-1]
AB= AB[:3000]
ABC = [ab+c for ab in AB for c in C]
ABC.sort()
ABC = ABC[::-1]
for i in range(K):
  print(ABC[i])

Fixed submission:
X,Y,Z,K = map(int,input().split())
#A = np.empty(X,dtype=int)
#B = np.empty(Y,dtype=int)
#C = np.empty(Z,dtype=int)
A = sorted(list(map(int, input().split())), reverse=True)
B = sorted(list(map(int, input().split())), reverse=True)
C = sorted(list(map(int, input().split())), reverse=True)

AB = [ a+b for a in A for b in B]
AB = sorted(AB, reverse=True)
AB = AB[:3000]
ABC = [ab+c for ab in AB for c in C]
ABCs = sorted(ABC, reverse=True)[:K]
for i in range(K):
  print(ABCs[i])
Buggy python submission (verdict: Runtime Error):
N,M,C=map(int.input().split())
B=list(map(int.input().split()))
ans = 0
for i in range(N):
  A = list(map(int.input().split()))
  tmp = C
  for j in range(M):
    tmp += A[j]*B[j]
  if tmp > 0:
    ans += 1
print(ans)


Fixed submission:
N,M,C=map(int,input().split())
B=list(map(int,input().split()))
ans = 0
for i in range(N):
  A = list(map(int,input().split()))
  tmp = C
  for j in range(M):
    tmp += A[j]*B[j]
  if tmp > 0:
    ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
CV = 380000.0
N=int(input())
total = 0
for i in range(N):
  x,u = input().split()
  x = int(x)
  if u == "BTC":
    x *= CV
  total += x
print(total)

Fixed submission:
CV = 380000.0
N=int(input())
total = 0
for i in range(N):
  x,u = input().split()
  x = float(x)
  if u == "BTC":
    x *= CV
  total += x
print(total)
Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
m= [ 0 for in range(M)]
for i in range(N):
  A = list(map(int, input().split()))
  for j in range(A[0]):
    m[A[j+1]-1]+=1
ans=0
for i in range(M):
  if m[i] == N:
    ans += 1
print(ans)
    

Fixed submission:
N,M=map(int,input().split())
c= [ 0 for _ in range(M)]
for i in range(N):
  A = list(map(int, input().split()))
  for j in range(A[0]):
    c[A[j+1]-1]+=1
ans=0
for i in range(M):
  if c[i] == N:
    ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
x=int(input())
if x == 3 or x == 5 x == 7:
  print("YES")
else:
  print("NO")
  

Fixed submission:
x=int(input())
if x == 3 or x == 5 or x == 7:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
N=int(input())
T,A=map(int, input().split())
H=list(map(int, input().split()))
tmin = 10000000
for i in range(N):
  if tmin < abs(T - H[i] * 0.006):
    ans = i+1
    tmin = abs(T - H[i] * 0.006)
print(ans)
    

Fixed submission:
N=int(input())
T,A=map(int, input().split())
H=list(map(int, input().split()))
tmin = 10000000
for i in range(N):
  if tmin > abs(A - (T - H[i] * 0.006)):
    ans = i+1
    tmin = abs(A - (T - H[i] * 0.006))
print(ans)

Buggy python submission (verdict: Runtime Error):
N=int(input())
T,A=map(int, input().split())
H=list(map(int, input().split()))
tmin = 10000000
for i in range(N):
  if tmin < (T - H[i] * 0.006):
    ans = i+1
    tmin = T - H[i] * 0.006
print(ans)
    

Fixed submission:
N=int(input())
T,A=map(int, input().split())
H=list(map(int, input().split()))
tmin = 10000000
for i in range(N):
  if tmin > abs(A - (T - H[i] * 0.006)):
    ans = i+1
    tmin = abs(A - (T - H[i] * 0.006))
print(ans)
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=int(input())
B=int(input())
if N==1:
  print("Hello World")
else:
  print(A+B)
  

Fixed submission:
N=int(input())
if N==1:
  print("Hello World")
else:
  A=int(input())
  B=int(input())
  print(A+B)
Buggy python submission (verdict: Runtime Error):
S=input()
for i in range(3):
  if S[i]=='1':
    S[i] = '9'
  elif S[i]=='9':
    S[i] = '1'
print(S)
    

Fixed submission:
S=input()
S = S.replace("1", "Z")
S = S.replace("9", "1")
S = S.replace("Z", "9")
print(S)
Buggy python submission (verdict: Runtime Error):
N,K=map(int,input())
if N%K==0:
  print(0)
else:
  print(1)
  

Fixed submission:
N,K=map(int,input().split())
if N%K==0:
  print(0)
else:
  print(1)
Buggy python submission (verdict: Runtime Error):
A,B,C=map(int, input().split())
d = [0 0 0]
d[0] = abs(A-B)
d[1] = abs(A-C)
d[2] = abs(C-B)
d.sort()
print(d[0]+d[1])


Fixed submission:
A,B,C=map(int, input().split())
d = [0,0,0]
d[0] = abs(A-B)
d[1] = abs(A-C)
d[2] = abs(C-B)
d.sort()
print(d[0]+d[1])
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
for i in range(N):
  A[i] = A[i] - i - 1
print( A.sum() // N )


Fixed submission:
N=int(input())
A=list(map(int,input().split()))
for i in range(N):
  A[i] = A[i] - i - 1
A.sort()
b = A[N//2]
ans = 0
for i in range(N):
  ans += abs(A[i] - b)
print(ans)
Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
p = list(map(int,input().split()))
for i in range(N): p[i] -= 1

par = [ i for i in range(N)]

def uf_root(a):
  if par[a] == a: return a
  par[a] = uf_root( par[a] )
  return par[a]

def uf_same(a,b):
  if (uf_root(a) ==uf_root(b)): return True
  return false

def uf_union(a,b):
  if (uf_same(a,b)): return
  a = uf_root(a)
  b = uf_root(b)
  par[a] = b
  return

for i in range(M):
  x,y = map(int, input().split())
  x -= 1
  y -= 1
  uf_union(x,y)

ans = 0
for i in range(N):
  if ( uf_same(i,p[i]) ):
    ans += 1
print(ans)




Fixed submission:
N,M=map(int,input().split())
p = list(map(int,input().split()))
for i in range(N): p[i] -= 1

par = [ i for i in range(N)]

def uf_root(a):
  if par[a] == a: return a
  par[a] = uf_root( par[a] )
  return par[a]

def uf_same(a,b):
  if (uf_root(a) ==uf_root(b)): return True

def uf_union(a,b):
  if (uf_same(a,b)): return
  a = uf_root(a)
  b = uf_root(b)
  par[a] = b
  return

for i in range(M):
  x,y = map(int, input().split())
  x -= 1
  y -= 1
  uf_union(x,y)

ans = 0
for i in range(N):
  if ( uf_same(i,p[i]) ):
    ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int, input().split())
ans = a+b+c
m = max(a, max(b,c))
ans += (pow(2,K)-1) * m
print(ans)


Fixed submission:
a,b,c=map(int, input().split())
K=int(input())
ans = a+b+c
m = max(a, max(b,c))
ans += (pow(2,K)-1) * m
print(ans)
Buggy python submission (verdict: Runtime Error):
H,W=map(int, input().split())
s = []
dx = [ -1, -1, 1, 1]
dy = [ -1, 1, -1, 1]
ans = "Yes"
for i in range(H):
  s.append( input())
for y in range(H):
  for x in range(W):
    if s[y][x] == '#':
      ng = 1
      for i in range(4):
        nx = x + dx[i]
        ny = y + dy[i]
        if (ny < 0) or (ny >= H) or (nx<0) or (nx>=W):
          continue
        if s[ny][nx] == '#':
          ng = 0
    if ng == 1:
      ans = "No"
print(ans)
        

  
    

Fixed submission:
H,W=map(int, input().split())
s = []
dx = [  0, 0, 1, -1]
dy = [ -1, 1, 0, 0]
ans = "Yes"
for i in range(H):
  s.append( input())
for y in range(H):
  for x in range(W):
    if s[y][x] == '#':
      ng = 1
      for i in range(4):
        nx = x + dx[i]
        ny = y + dy[i]
        if (ny < 0) or (ny >= H) or (nx<0) or (nx>=W):
          continue
        if s[ny][nx] == '#':
          ng = 0
      if ng == 1:
        ans = "No"
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
A=list(map(int,input().split()))
ma = max(A)
mid = ma / 2
l = 10000000000
for i in rage(n):
  l = min(l, abs(A[i]-mid))
print(ma, mid-l)

Fixed submission:
n=int(input())
A=list(map(int,input().split()))
ma = max(A)
mid = ma / 2
l = 10000000000
f = 0
for i in range(n):
  if ((ma == A[i]) and (f==0)):
    f = 1
    continue
  if abs(l) > abs(A[i]-mid):
    l = A[i]-mid
print(ma, int(mid+l))
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int, input()))
A.sort(reverse=True)
ans = 0
for i in range(N):
  if i%2==0:
    ans += A[i]
  else:
    ans -= A[i]
print(ans)


Fixed submission:
N=int(input())
A=list(map(int, input().split()))
A.sort(reverse=True)
ans = 0
for i in range(N):
  if i%2==0:
    ans += A[i]
  else:
    ans -= A[i]
print(ans)
Buggy python submission (verdict: Runtime Error):
N=int(input())
A0 = list(map(int, input().split()))
A1 = list(map(int, input().split()))
ans = 0
for i in range(N-1):
  A0[i+1] += A[i]
for i in range(N-1,0,-1):
  A1[i-1] += A[i]
for i in range(N):
  ans = max(ans, A0[i] + A1[i])
print(ans)



Fixed submission:
N=int(input())
A0 = list(map(int, input().split()))
A1 = list(map(int, input().split()))
ans = 0
for i in range(N-1):
  A0[i+1] += A0[i]
for i in range(N-1,0,-1):
  A1[i-1] += A1[i]
for i in range(N):
  ans = max(ans, A0[i] + A1[i])
print(ans)
Buggy python submission (verdict: Runtime Error):
A,B=map(int, input().split())
s=input()

ng = 0
if !(s[0:A].isdecimal()):
  ng = 1
if s[A] != "-": ng = 1
if !(s[A+1:A+B+1].isdecimal()):
  ng = 1
if ng == 1:
  print("No")
else:
  print("Yes")
  

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

ng = 0
if not (s[0:A].isdecimal()):
  ng = 1
if s[A] != "-": ng = 1
if not (s[A+1:A+B+1].isdecimal()):
  ng = 1
if ng == 1:
  print("No")
else:
  print("Yes")
Buggy python submission (verdict: Runtime Error):
N=input()
a=int(N[0])
b=int(N[1])
c=int(N[2])

if a=7 or b=7 or c=7:
  print('Yes')
else :
  print('No')

Fixed submission:
N=input()
a=int(N[0])
b=int(N[1])
c=int(N[2])
 
if a==7 or b==7 or c==7:
  print('Yes')
else :
  print('No')
Buggy python submission (verdict: Runtime Error):
N, M=map(int,input().split())
s=list()
c=list()
a=0
for i in range(0,M):
    s.append(0)
    c.append(0)
for i in range(0,M):
    s[i], c[i]=map(int,input().split())
for i in range(0,M):
    for j in range(0,M):
        if s[i]==s[j] and c[i]!=c[j]:
            print("-1")
            break
    else:
        continue
    break
else:
    if N==1:
        b=[0]
        for i in range(0,M):
            b[s[i]-1]=c[i]
        print(b[0])
    else:
        b=[1]
        for i in range(0,N-1):
            b.append(0)
        if s[i]==1 and c[i]==0:
            print("-1")
        else:
            for i in range(0,M):
                b[s[i]-1]=c[i]
            for i in range(0,N):
                print(b[i],end='')

Fixed submission:
N, M=map(int,input().split())
s=list()
c=list()
a=0
for i in range(0,M):
    s.append(0)
    c.append(0)
for i in range(0,M):
    s[i], c[i]=map(int,input().split())
for i in range(0,M):
    for j in range(0,M):
        if s[i]==s[j] and c[i]!=c[j]:
            print("-1")
            break
    else:
        continue
    break
else:
    if N==1:
        b=[0]
        for i in range(0,M):
            b[s[i]-1]=c[i]
        print(b[0])
    else:
        b=[1]
        for i in range(0,N-1):
            b.append(0)
        for i in range(0,M):
            if s[i]==1 and c[i]==0:
                print("-1")
                break
        else:
            for i in range(0,M):
                b[s[i]-1]=c[i]
            for i in range(0,N):
                print(b[i],end='')
Buggy python submission (verdict: Time Limit Exceeded):
s=input()
s=list(s)
n=len(s)
for i in range(0,n):
    if(s[i]=='?'):
        s[i]='D'
ans=""
for h in s:
    ans+=h
print(ans)

Fixed submission:
s=input()
n=len(s)
for i in range(0,n):
    if(s[i]=='?'):
        print('D',end="")
    else:
        print(s[i],end="")

Buggy python submission (verdict: Time Limit Exceeded):
s=input()
s=list(s)
n=len(s)
if n==1:
    if s[0]=='?':
        print('D')
    else:
        print(s[0])
else:
    for i in range(0,n):
        if i!=(n-1):
            if s[i]=='?' and s[i+1]=='P':
                s[i]='D'
            elif (s[i]=='?'):
                s[i]='P'
        else:
            if s[i]=='?':
                s[i]='D'
    ans=""
    for h in s:
        ans+=h
    print(ans)

Fixed submission:
s=input()
n=len(s)
for i in range(0,n):
    if(s[i]=='?'):
        print('D',end="")
    else:
        print(s[i],end="")

Buggy python submission (verdict: Time Limit Exceeded):
s=input()
s=list(s)
n=len(s)
for i in range(0,n):
    if i!=(n-1):
        if s[i]=='?' and s[i+1]=='P':
            s[i]='D'
        elif (s[i]=='?'):
            s[i]='P'
    else:
        if s[i]=='?':
            s[i]='D'
ans=""
for i in s:
    ans+=i
print(ans)

Fixed submission:
s=input()
n=len(s)
for i in range(0,n):
    if(s[i]=='?'):
        print('D',end="")
    else:
        print(s[i],end="")
Buggy python submission (verdict: Runtime Error):
s=input()
x = chr(ord(ch) + 1)
print(x)

Fixed submission:
s=input()
print(chr(ord(s)+1))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
sum1 = 0
for i in range(len(str(n))):
    sum1 += int(str(n)[i])
if sum1 % 9 == 0:
    print('Yes')
else:
    print('No')

Fixed submission:
n = int(input())
s = str(n)
array = list(map(int, s))
if sum(array) % 9 == 0:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
sum1 = 0
for i in range(len(str(n))):
    sum1 += int(str(n)[i])
if sum1 % 9 == 0:
    print('Yes')
else:
    print('No')

Fixed submission:
n = int(input())
s = str(n)
array = list(map(int, s))
if sum(array) % 9 == 0:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
a,b = map(lambda x : int(x), input().split())
print(max(a - b * 2),0)

Fixed submission:
a,b=map(lambda x:int(x),input().split())
print(max([0,a-b*2]))
Buggy python submission (verdict: Runtime Error):
n=int(input())
d=[int(di) for di in int(input()).split()]
print(sum(d[i]*d[j] for i in range(n) for j in range(i+1,n)))

Fixed submission:
n=int(input())
d=[int(di) for di in input().split()]
print(sum(d[i]*d[j] for i in range(n) for j in range(i+1,n)))
Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().split())
ans = 0
for i in range(k+1):
    for j in range(k+1):
        for l in range(k+1):
            ans = ans + (i+j+l == s)
print(ans)

Fixed submission:
k, s = map(int, input().split())
ans = 0
if s <= k:
    ans = (s+2)*(s+1)/2
else:
    for i in range(k+1):
        for j in range(k+1):
            ans = ans + (0 <= s-i-j <= k)

print(int(ans))
Buggy python submission (verdict: Runtime Error):
n, l = map(int, input().split())
s = []
for _ in range(n):
    s.append(input())
s = sorted(s)
print(''.join(s))


Fixed submission:
a = [int(x) for x in input().split()]
countF = 0
countS = 0
for i in range(3):
    countF += a[i] == 5
    countS += a[i] == 7
if countF == 2 and countS == 1:
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Runtime Error):
s = input()
t = input()
n, m = len(s), len(t)
print(min(sum(si != ti for si, ti in zip(s[i: i+m], t)) for i in range(n-m)))


Fixed submission:
s = input()
t = input()
n, m = len(s), len(t)
print(min(sum(si != ti for si, ti in zip(s[i: i+m], t)) for i in range(n-m+1)))
Buggy python submission (verdict: Runtime Error):
h, w, k = map(int, input().split())
c = [input() for _ in range(h)]

count = 0
for binh in range(2**h):
    for binw in range(2**w):
        redh, redw = bin(binh)[2:], bin(binw)[2:]  # remove suffix '0x'
        squares = [list(row) for row in c]
        for rh in redh:
            for wh in range(w):
                squares[rh][wh] = '*'
        for rw in redw:
            for hw in range(h):
                squares[rw][hw] = '*'
        count += sum(row.count('#') for row in squares) == k

print(k)


Fixed submission:
import itertools
import numpy as np

h, w, k = map(int, input().split())
c = [input() for _ in range(h)]

count = 0
for ph in itertools.product([0, 1], repeat=h):
    for pw in itertools.product([0, 1], repeat=w):
        squares = np.array([[1 if cell == '#' else -1 for cell in row] for row in c])
        squares[np.array(ph) == True, :] *= 0
        squares[:, np.array(pw) == True] *= 0
        if np.count_nonzero(squares == 1) == k:
            count += 1

print(count)

Buggy python submission (verdict: Runtime Error):
from python.c import squares


h, w, k = map(int, input().split())
c = [input() for _ in range(h)]

count = 0
for binh in range(2**h):
    for binw in range(2**w):
        redh, redw = bin(binh)[2:], bin(binw)[2:]  # remove suffix '0x'
        squares = [list(row) for row in c]
        for rh in redh:
            for wh in range(w):
                squares[rh][wh] = '*'
        for rw in redw:
            for hw in range(h):
                squares[rw][hw] = '*'
        count += sum(row.count('#') for row in squares) == k

print(k)


Fixed submission:
import itertools
import numpy as np

h, w, k = map(int, input().split())
c = [input() for _ in range(h)]

count = 0
for ph in itertools.product([0, 1], repeat=h):
    for pw in itertools.product([0, 1], repeat=w):
        squares = np.array([[1 if cell == '#' else -1 for cell in row] for row in c])
        squares[np.array(ph) == True, :] *= 0
        squares[:, np.array(pw) == True] *= 0
        if np.count_nonzero(squares == 1) == k:
            count += 1

print(count)