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

Fixed submission:
N=int(input())
S=input()
a=0
for i in range(N-2):
    if S[i]=="A":
        if S[i+1]=="B":
            if S[i+2]=="C":
                a+=1
                i+=2
print(a)

Buggy submission (verdict: Runtime Error):
N=int(input())
S=input()
a=0
for i in range(N):
    if S[i]=="A":
        if S[i+1]=="B":
            if S[i+2]=="C":
                a+=1
                i+=2
print(a)
Problem p02814 (python)

Fixed submission:
import fractions
N,M=map(int,input().split())
a=list(map(int,input().split()))
l=1
count=0
A=a[0]
ans=0
flag=1
while A%2==0:
    A=A//2
    count=count+1
for i in range(N):
    A=a[i]
    b=A//(2**count)
    if b==0 or b%2==0:
        flag=0
        break
    A=A//2
    l=l*A//fractions.gcd(l,A)
if flag==1:
    ans=M//l
    if ans%2==0:
        print(ans//2)
    else:
        print(ans//2+1)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
import math
N,M=map(int,input().split())
a=list(map(int,input().split()))
l=1
count=0
A=a[0]
ans=0
flag=1
while A%2==0:
    A=A//2
    count=count+1
for i in range(N):
    A=a[i]
    b=A//(2**count)
    if b==0 or b%2==0:
        flag=0
        break
    A=A//2
    l=l*A//math.gcd(l,A)
if flag==1:
    ans=M//l
    if ans%2==0:
        print(ans//2)
    else:
        print(ans//2+1)
else:
    print(0)
Problem p02936 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10 ** 6)
def input():
    return sys.stdin.readline()[:-1]

N,Q=map(int,input().split())
graph=[[]for _ in range(N)]
point=[0]*N
for _ in range(N-1):
    a,b=map(int,input().split())
    graph[a-1].append(b-1)
    graph[b-1].append(a-1)
for _ in range(Q):
    a,b=map(int,input().split())
    a=a-1
    point[a]=point[a]+b

def dfs(now,prev=-1):
    for next in graph[now]:
        if next==prev:
            continue
        point[next]=point[next]+point[now]
        dfs(next,now)
dfs(0)
print(*point)

Buggy submission (verdict: Runtime Error):
N,Q=map(int,input().split())
graph=[[]for _ in range(N)]
point=[0]*N
for _ in range(N-1):
    a,b=map(int,input().split())
    graph[a-1].append(b-1)
    graph[b-1].append(a-1)
for _ in range(Q):
    a,b=map(int,input().split())
    a=a-1
    point[a]=point[a]+b

def dfs(now,prev=-1):
    for next in graph[now]:
        if next==prev:
            continue
        point[next]=point[next]+point[now]
        dfs(next,now)
dfs(0)
print(*point)

Buggy submission (verdict: Runtime Error):
N,Q=map(int,input().split())
graph=[[]for _ in range(N)]
point=[0]*N
for _ in range(N-1):
    a,b=map(int,input().split())
    graph[a-1].append(b-1)
    graph[b-1].append(a-1)
for _ in range(Q):
    a,b=map(int,input().split())
    a=a-1
    point[a]=point[a]+b

def dfs(now,prev=-1):
    for i in graph[now]:
        if i==prev:
            continue
        point[i]=point[i]+point[now]
        dfs(i,now)
dfs(0)
print(*point)

Buggy submission (verdict: Runtime Error):
N,Q=map(int,input().split())
graph=[[]for _ in range(N)]
point=[0]*N
for _ in range(N-1):
    a,b=map(int,input().split())
    graph[a-1].append(b-1)
for _ in range(Q):
    a,b=map(int,input().split())
    a=a-1
    point[a]=point[a]+b

def dfs(now,prev=-1):
    for i in graph[now]:
        if i==prev:
            continue
        point[i]=point[i]+point[now]
        dfs(i,now)
dfs(0)
print(*point)
Problem p02953 (python)

Fixed submission:
N=int(input())
H=list(map(int,input().split()))
a=0
for i in range(N-1)[::-1]:
    if H[i]>H[i+1]:
        H[i]-=1
for i in range(N-1):
    if H[i]>H[i+1]:
        a=1
        break
if a==0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N=int(input())
H=list(map(int,input().split()))
h=0
a=0
for i in range(N-1):
    h1=H[i+1]-H[i]
    if h1<-1:
        a=1
        break
    elif h1==-1:
        h2=H[i+2]-H[i+1]
        if h2<0:
            a=1
            break
if a==0:
    print('Yes')
else:
    print('No')
Problem p02960 (python)

Fixed submission:
S=input()
MOD=10**9+7
dp=[[0]*13 for i in range(len(S)+1)]
dp[0][0]=1
for i in range(len(S)):
    if S[i]=="?":
        for j in range(10):
            for k in range(13):
                dp[i+1][(10*k+j)%13]+=dp[i][k]%MOD
    else:
        a=int(S[i])
        for k in range(13):
            dp[i+1][(10*k+a)%13]+=dp[i][k]%MOD
print(dp[len(S)][5]%MOD)

Buggy submission (verdict: Runtime Error):
S=list(input())
MOD=10**9+7
dp=[0]*13
dp[0]=1
for i in range(1,len(S)+1):
    ans=[0]*13
    if S[-i]=="?":
        for j in range(10):
            a=(j*10**(i-1))%13
            for k in range(13):
                ans[(k+a)%13]=ans[(k+a)%13]+dp[k]
    else:
        a=int(S[-i])
        a=(a*10**(i-1))%13
        for k in range(13):
            ans[(k+a)%13]=ans[(k+a)%13]+dp[k]
    dp=ans.copy()
print(ans[5]%MOD)

Buggy submission (verdict: Runtime Error):
S=input()
MOD=10**9+7
dp=[[0]*13 for i in range(len(S)+1)]
dp[0][0]=1
for i in range(len(S)):
    if S[i]=="?":
        for j in range(10):
            for k in range(13):
                dp[i+1][(10*k+j)%13]+=dp[i][k]%MOD
    else:
        a=int(S[i])
        for k in range(13):
            dp[i+1][(10*k+j)%13]+=dp[i][k]%MOD
print(dp[len(S)][5]%MOD)
Problem p02983 (python)

Fixed submission:
L,R=map(int,input().split())
c=2019
z=0
for i in range(L,R+1):
    for j in range(i+1,R+1):
        a=i*j
        b=a%2019
        if c>b:
            c=b
        if c==0:
            z=1
            break
    if z==1:
        break
print(c)

Buggy submission (verdict: Runtime Error):
L,R=map(int,input().split())
l=L//2019
r=R//2019
if l==r:
    for i in range(L,R+1):
        for j in range(i+1,R+1):
            a=i*j
            b=a%2019
            if c>b:
                c=b
        if c==0:
            break
    print(c)
else:
    print(0)
Problem p02985 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10 ** 6)
N,K=map(int,input().split())
tree=[[]for _ in range(N+1)]
MOD=10**9+7
ans=K
enuk=[1]*(N)
for i in range(N-1):
    a,b=map(int,input().split())
    tree[a].append(b)
    tree[b].append(a)
    enuk[i+1]=(enuk[i]*(K-2-i))%MOD
def dfs(a,b):
    if a==1:
        node=len(tree[a])
        ret=1
        for i in range(node):
            ret*=K-1-i
            ret%=MOD
    else:
        node=len(tree[a])-1
        ret=enuk[node]%MOD
    for i in tree[a]:
        if i==b:
            continue
        ret=ret*dfs(i,a)%MOD
    return ret
ans*=dfs(1,0)
print(ans%MOD)

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
tree=[[]for _ in range(N+1)]
MOD=10**9+7
ans=K
for i in range(N-1):
    a,b=map(int,input().split())
    tree[a].append(b)
    tree[b].append(a)
def enu(a,b):
    num=1
    for i in range(b):
        num=num*(a-i)
        num%=MOD
    return num
def dfs(a,b):
    if a==1:
        node=len(tree[a])
        ret=enu(K-1,node)%MOD
    else:
        node=len(tree[a])-1
        ret=enu(K-2,node)%MOD
    for i in tree[a]:
        if i==b:
            continue
        ret=ret*dfs(i,a)%MOD
    return ret
ans*=dfs(1,0)
print(ans%MOD)

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
tree=[[]for _ in range(N+1)]
MOD=10**9+7
ans=K
for i in range(N-1):
    a,b=map(int,input().split())
    tree[a].append(b)
    tree[b].append(a)
def enu(a,b):
    num=1
    for i in range(b):
        num=num*(a-i)
        num%=MOD
    return num
def dfs(a,b):
    if a==1:
        node=len(tree[a])
        ret=enu(K-1,node)%MOD
    else:
        node=len(tree[a])-1
        ret=enu(K-2,node)%MOD
    for i in tree[a]:
        if i==b:
            continue
        ret=ret*dfs(i,a)%MOD
    return max(ret,1)
ans*=dfs(1,0)
print(ans%MOD)

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
tree=[[]for _ in range(N+1)]
MOD=10**9+7
ans=K
for i in range(N-1):
    a,b=map(int,input().split())
    tree[a].append(b)
    tree[b].append(a)
def comb(a,b):
    x,y=1,1
    for i in range(b):
        x*=a-i
        y*=i+1
        x%=MOD
        y%=MOD
    return (x*pow(y,MOD-2,MOD))%MOD
def cal(a):
    num=1
    for i in range(1,a+1):
        num*=i
    return num
def dfs(a,b):
    if a==1:
        node=len(tree[a])
        ret=cal(node)*comb(K-1,node)%MOD
    else:
        node=len(tree[a])-1
        ret=cal(node)*comb(K-2,node)%MOD
    for i in tree[a]:
        if i==b:
            continue
        ret=ret*dfs(i,a)%MOD
    return max(ret,1)
ans*=dfs(1,0)
print(ans%MOD)
Problem p02991 (python)

Fixed submission:
import collections
N,M=map(int,input().split())
tree=[[] for _ in range(N)]
for _ in range(M):
    u,v=map(int,input().split())
    tree[u-1].append(v-1)
S,T=map(int,input().split())
s=S-1
t=T-1
ischecked=[[0]*3 for _ in range(N)]
ischecked[s][0]=1
ans=-1
q=collections.deque()
q.append([s,0])
while q:
    v,c=q.popleft()
    if v==t and c%3==0:
        ans=c//3
        break
    for i in tree[v]:
        if ischecked[i][(c+1)%3]==0:
            q.append([i,c+1])
            ischecked[i][(c+1)%3]=1
print(ans)

Buggy submission (verdict: Runtime Error):
import collections
N,M=map(int,input().split())
tree=[[] for _ in range(N)]
for _ in range(M):
    u,v=map(int,input().split())
    tree[u-1].append(v-1)
S,T=map(int,input().split())
s=S-1
t=T-1
ischecked=[[0]*3 for _ in range(N)]
ischecked[s][0]=1
ans=-1
q=collections.deque()
q.append([s,0])
while q:
    v,c=q.pop(0)
    if v==t and c%3==0:
        ans=c//3
        break
    for i in tree[v]:
        if ischecked[i][(c+1)%3]==0:
            q.append([i,c+1])
            ischecked[i][(c+1)%3]==1
print(ans)
Problem p03161 (python)

Fixed submission:
def main():
    N,K = map(int,input().split())
    h = list(map(int,input().split()))
    dp = [0]*N
    for i in range(1,N):
        dp[i]= min(abs(h[i]-h[j])+dp[j] for j in range(max(0,i-K),i))
    print(dp[-1])
main()

Buggy submission (verdict: Runtime Error):
def main():
    N,K=map(int,input().split())
    h=list(map(int,input().split()))
    ans=[0]*N
    ans[1]=ans(h[1]-h[0])
    for i in range(2,N):
        ans[i]= min(abs(h[i]-h[j])+ans[j] for j in range(max(0,i-K),i))
    print(ans[-1])
main()

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
h=list(map(int,input().split()))
ans=[0]*N
ans[1]=abs(h[1]-h[0])
for i in range(2,N):
    cost=[]
    for j in range(max(0,i-K),i):
        cost.append(abs(h[i]-h[c])+ans[c])
    ans[i]=min(cost)
print(ans[-1])
Problem p03163 (python)

Fixed submission:
import numpy as np
N,W=map(int,input().split())
dp=np.zeros(W+1,dtype=int)
for i in range(N):
    w,v=map(int,input().split())
    dp[w:]=np.maximum(dp[w:],dp[:-w]+v)
print(dp[-1])

Buggy submission (verdict: Runtime Error):
import numpy as np
def main():
    N,W=map(int,input().split())
    dp=np.zeros((N+1,W+1),dtype=int)
    for i in range(1,N+1):
        w,v=map(int,input().split())
        dp[i][w:]=np.maximum(dp[i-1][w:],dp[i-1][:-w]+v)
        dp[i][:w]=dp[i-1][:w]
    print(max(dp))
main()
Problem p02534 (python)

Fixed submission:
K=int(input())
print("ACL"*K)

Buggy submission (verdict: Runtime Error):
import numpy as np
number=input().rstrip().split(' ')
N=int(number[0])
M=int(number[1])
judge=np.zeros([N-1])

for i in range(M):
    cities=input().rstrip().split(' ')
    A=int(cities[0])
    judge[A-1]=1

print(np.count_nonzero(judge==0))

Buggy submission (verdict: Runtime Error):
import numpy as np
number=input().rstrip().split(' ')
N=int(number[0])
M=int(number[1])
judge=np.zeros([N-1],dtype=np.int16)

for i in range(M):
    cities=input().rstrip().split(' ')
    A=int(cities[0])
    judge[A-1]=1

print(np.count_nonzero(judge==0))
Problem p02536 (python)

Fixed submission:
from networkx import *
 
n,m = map(int, input().split())
G = Graph()
 
for i in range(m):
    a,b = map(int, input().split())
    G.add_edges_from([(a, b)])
 
m3 = list(connected_components(G))

count = 0
 
if len(max(connected_components(G), key=len)) == n:
    print(0)
    exit()
else:
    for i in m3:
        count += len(i)
 
sub = n - count
 
print((len(m3)-1)+sub)

Buggy submission (verdict: Runtime Error):
import numpy as np
number=input().rstrip().split(' ')

N=int(number[0])
M=int(number[1])
judge=np.zeros([N-1,N],dtype=np.int16)

for i in range(M):
    cities=input().rstrip().split(' ')
    A=int(cities[0])
    B=int(cities[1])
    judge[A-1][B-1]=1
    
print(np.count_nonzero(np.all(judge==0,axis=1)))
Problem p02690 (python)

Fixed submission:
X = int( input().strip() ) ;

d = {} ;
for x in range ( 150 ) : 
	v1 = pow ( x, 5 ) ; 
	d[x] = v1 ; 
	d[-x] = -v1 ;
ans = None ;
for A in d :
	if not ans is None :
		break ;
	for B in d :
		if d[A] - d[B] == X : 
			ans = ( A, B, ) ; 
			break ;
if not ans is None :
	print ( "{0} {1}".format ( ans[0] , ans[1] ) );

Buggy submission (verdict: Runtime Error):
N , K = map( int , input().strip().split(" ") ) ;

arr = [ 1 for x in range ( N ) ] ;
for x in range ( K ) :
	r = input() ;
	for x in map( int, input().strip().split(" ") ) :
		arr[x-1] = 0 ;
print ( sum( arr ) ) ;
Problem p02534 (python)

Fixed submission:
k = int(input())
text = "ACL" * k
print(text)

Buggy submission (verdict: Runtime Error):
k = input()
text = "ACL"*k
print(k)

Buggy submission (verdict: Runtime Error):
return "ACL"*K

Buggy submission (verdict: Runtime Error):
text = "ACL"
output = text * K
print(output)

Buggy submission (verdict: Runtime Error):
text = "ACL"*int(K)
print(text)

Buggy submission (verdict: Runtime Error):
text = "ACL"*K
print(text)
Problem p02534 (python)

Fixed submission:
n=int(input())
s=""
for i in range(0,n):
    s+="ACL"

print(s)

Buggy submission (verdict: Runtime Error):
a,b,c,d=list(map(int ,input().split()))
max_v=max(a,c)
min_v=min(b,d)
if(max_v-min_v>0 or min_v-max_v<0):
  print("No")
elif(max_v-min_v>0):
  print("Yes")
Problem p02576 (python)

Fixed submission:
import math
 
n, x, t = map(int, input().split())
 
# count = math.ceil(n / x)
# print(count * t)
 
count = n // x
if n % x != 0:
    count = count + 1
print(count * t)

Buggy submission (verdict: Runtime Error):
# cook your dish here
n,x,t=list(map(int,input().split()))
rate=int(x/t)
if(rate==0 or rate==1):
    answer=n*t
    print(int(answer))
elif(rate!=0 and rate!=1):
    answer=n/rate
    print(int(answer))
elif(n==20 , x=12 , t=6 ):
    print(12)
Problem p02600 (python)

Fixed submission:
print(10 - int(input()) // 200)

Buggy submission (verdict: Runtime Error):
1 print(10 - int(input()) // 200)
Problem p03059 (python)

Fixed submission:
a, b, t = map(int, input().split())
print(t//a*b)

Buggy submission (verdict: Runtime Error):
a, b, t = map(int, input().split())
print(t//a*b)
debug_pri
Problem p03106 (python)

Fixed submission:
A,B,K=map(int,input().split())
ans=0
n=100
while True:
    if A%n==0 and B%n==0:
        ans+=1
        if ans==K:
            print(n)
            exit()
    n-=1

Buggy submission (verdict: Runtime Error):
a,b,k=list(map(int ,input().split()))
l=[]
count=0
for i in range(1,max(a,b)):
	if(a%i==0 and b%i==0):
		l.append(i)
		
		
	
	else:
		count+=1

l.sort()
l.reverse()
if(len(l)==0):
	
	print(0)
else:
	print(l[k-1])

Buggy submission (verdict: Runtime Error):
a,b,k=list(map(int ,input().split()))
l=[]
count=0
for i in range(1,max(a,b)):
	if(a%i==0 and b%i==0):
		l.append(i)
		
		
	
	else:
		count+=1

l.sort()
l.reverse()
if(l.empty()):
	
	print(0)
else:
	print(l[k-1])

Buggy submission (verdict: Runtime Error):
a,b,k=list(map(int ,input().split()))
l=[]
count=0
for i in range(1,max(a,b)):
	if(a%i==0 and b%i==0):
		l.append(i)
		
		
	
	else:
		count+=1

l.sort()
l.reverse()
if(a==b==k):
	print(a)
else:
	print(l[k-1])

Buggy submission (verdict: Runtime Error):
a,b,k=list(map(int ,input().split()))
l=[]
count=0
for i in range(1,max(a,b)):
	if(a%i==0 and b%i==0):
		l.append(i)
		print(l)
		
	
	else:
		count+=1

l.sort()
l.reverse()
if(a==b==k):
	print(a)
else:
	print(l[k-1])
Problem p03238 (python)

Fixed submission:
n=int(input())

if(n==1):
    print("Hello World")
elif(n==2):
    a=int(input())
    b=int(input())
    print(int(a+b))

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

p = s
factors = {}

while p > 1:
    f = False
    for i in range(2, int(p**0.5)+1):
        if p % i == 0:
            if i in factors:
                factors[i] += 1
            else:
                factors[i] = 1

            p //= i
            f = True
            break

    if not f:
        if p in factors:
            factors[p] += 1
        else:
            factors[p] = 1
        break

if len(factors) == 0:
    print(1)
else:
    primes = list(factors.keys())
    exp = [0] * len(primes)
    upper = s/k
    ans = 1

    while exp[0] <= factors[primes[0]]:
        num = 1
        for i in range(len(primes)):
            num *= pow(primes[i], exp[i])

        if num == upper:
            ans = num
            break
        elif num < upper:
            ans = max(ans, num)

        index = len(primes)-1
        done = False
        while not done:
            exp[index] += 1
            if exp[index] > factors[primes[index]]:
                if index == 0:
                    break
                else:
                    exp[index] = 0
                    index -= 1
            else:
                done = True

    print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=int(input())
b=int(input())
if(n==1):
    print("Hello World")
elif(n==2):
    print(int(a+b))
Problem p04029 (python)

Fixed submission:
ans=0
n=int(input())
for i in range(1,n+1):
	ans+=i
	
print(ans)

Buggy submission (verdict: Runtime Error):
s=input()
list_s=list(s)
element='B'
l1=['0','1','B']
for i in range(0,len(list_s)-i):
	if(list_s[i] == element):
		index_element=list_s[i-1]
		if(index_element):
			list_s.remove(index_element)
			list_s.remove(element)
			print(list_s)
		else:
		    list_s.append("s")
		    list_s.remove("s")

	else:
		list_s.append("s")
		list_s.remove("s")
		print(list_s)
Problem p02607 (python)

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

for k in range(N+1):
    if k % 2 == 0:
        continue
    else:
        if a[k-1] % 2 != 0:
            count += 1

print(count)

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

#print(a)
count = 0
D = []
for i in range(N+1):
    if i % 2 == 0:
        D.append(i)

#print(D)   

for j in D:
    if a[j] % 2 != 0:
        count += 1
        

print(count)
Problem p02658 (python)

Fixed submission:
N =int(input())

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

B = 1
C = 10 ** 18

for i in range(N):
    B = B * A[i]
    if B == 0:
        break
    elif B > C:
        B = -1
        break

print(B)

Buggy submission (verdict: Runtime Error):
N =int(input())
B = 1
for i in range(N):
    A =list( map(int,input().split()))
    for i in A:
        B = B * i
        #print(B)
    
#print(B)
C = 10 ** 18
#print(C)
if B > C:
    print(-1)
else:
    print(B)
Problem p02607 (python)

Fixed submission:
N = int(input())
a = list(map(int, input().split()))
print(len([i for i, ai in enumerate(a) if i%2==0 and ai%2]))

Buggy submission (verdict: Runtime Error):
 = int(input())
a = list(map(int, input().split()))
print(len([i for i, ai in enumerate(a) if i%2 and ai%2]))
Problem p02608 (python)

Fixed submission:
N = int(input())
 
res = {i+1: 0 for i in range(N)}
 
for i in range(1, int(N**0.5)):
  for j in range(1, int(N**0.5)):
    for k in range(1, int(N**0.5)):
      n = i**2 + j**2 + k**2 + i*j + j*k + k*i
      if n in res:
        res[n] += 1
for r in res.values():
  print(r)

Buggy submission (verdict: Runtime Error):
N = input()
 
res = {i+1: 0 for i in range(N)}
 
for i in range(int(sqrt(N))):
  for j in range(int(sqrt(N))):
    for k in range(int(sqrt(N))):
      n = i**2 + j**2 + k**2 + i*j + j*k + k*i
      if n in res:
        res[n] += 1
for r in res.values():
  print(r)

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

res = {i+1: 0 for i in range(N)}

for i in range(int(sqrt(N))):
  for j in range(int(sqrt(N))):
    for k in range(int(sqrt(N))):
      res[i**2 + j**2 + k**2 + i*j + j*k + k*i] += 1
print(res)
Problem p02614 (python)

Fixed submission:
import numpy as np
'''
K = 2
H, W = 5, 5
a = np.array([
	[0, 0, 0, 0, 1],
	[0, 0, 0, 1, 1],
	[0, 0, 1, 1, 1],
	[0, 1, 1, 1, 1],
	[1, 1, 1, 1, 1]
])
'''

def conv(c):
	#print(c)
	return int(c=='#')
H, W, K = map(int, input().split())
a = np.array([list(map(conv, input())) for _ in range(H)])
count = 0
for i in range(2 ** H - 1):
	b = np.delete(a.copy(), [j for j in range(H) if ((i >> j) & 1)], 0)
	blen = b.shape[1]
	for i in range(2 ** W - 1):
		c = np.delete(b, [j for j in range(blen) if ((i >> j) & 1)], 1)
		#print(np.sum(c))
		if K==np.sum(c):
			count += 1
print(count)
print()

Buggy submission (verdict: Runtime Error):
import numpy as np
'''
K = 2
H, W = 5, 5
a = np.array([
	[0, 0, 0, 0, 1],
	[0, 0, 0, 1, 1],
	[0, 0, 1, 1, 1],
	[0, 1, 1, 1, 1],
	[1, 1, 1, 1, 1]
])
'''

def conv(c):
	return int(c=='#')
H, W, K = map(int, input().split())
a = np.array([map(conv, input().split()) for _ in range(H)])

count = 0
for i in range(2 ** H - 1):
	b = np.delete(a.copy(), [j for j in range(H) if ((i >> j) & 1)], 0)
	for i in range(2 ** W - 1):
		c = np.delete(b.copy(), [j for j in range(H) if ((i >> j) & 1)], 1)
		#print(np.sum(c))
		if K==np.sum(c):
			count += 1
print(count)
print()

Buggy submission (verdict: Runtime Error):
import numpy as np
'''
K = 2
H, W = 5, 5
a = np.array([
	[0, 0, 0, 0, 1],
	[0, 0, 0, 1, 1],
	[0, 0, 1, 1, 1],
	[0, 1, 1, 1, 1],
	[1, 1, 1, 1, 1]
])
'''

H, W, K = map(int, input().split())
a = np.array([map(int, input().split()) for _ in range(H)])

count = 0
for i in range(2 ** H - 1):
	b = np.delete(a.copy(), [j for j in range(H) if ((i >> j) & 1)], 0)
	for i in range(2 ** W - 1):
		c = np.delete(b.copy(), [j for j in range(H) if ((i >> j) & 1)], 1)
		#print(np.sum(c))
		if K==np.sum(c):
			count += 1
print(count)
print()

Buggy submission (verdict: Runtime Error):
import numpy as np
'''
K = 2
H, W = 5, 5
a = np.array([
	[0, 0, 0, 0, 1],
	[0, 0, 0, 1, 1],
	[0, 0, 1, 1, 1],
	[0, 1, 1, 1, 1],
	[1, 1, 1, 1, 1]
])
'''

H, W, K = map(int, input().split())
a = np.array([map(int, input().split()) for _ in range(H)])

count = 0
for i in range(2 ** H - 1):
	b = np.delete(a.copy(), [j for j in range(H) if ((i >> j) & 1)], 0)
	for i in range(2 ** W - 1):
		c = np.delete(b.copy(), [j for j in range(H) if ((i >> j) & 1)], 1)
		#print(np.sum(c))
		if K==np.sum(c):
			count += 1
print(count)
Problem p02534 (python)

Fixed submission:
K = int(input())
print("ACL"*K)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
A = []
# N, K = 10, 3
# A = [1,5,4,3,8,6,9,7,2,4]
for _ in range(N):
  A.append(int(input()))
dp = [0]*N
nextdp = [1]*(300000)
tmp = 0
while tmp < N:
  dp[tmp] = nextdp[A[tmp]]
  for n in range(0,2*K+1):
    n -= K
    if 300000 > A[tmp]+n >= 0:
      nextdp[A[tmp]+n] = max(nextdp[A[tmp]+n], dp[tmp]+1)
  tmp += 1
print(dp[-1])
Problem p02548 (python)

Fixed submission:
N = int(input())
ans = 0
for n in range(1,N):
  ans += int((N-1)/n)
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
ls = [0]*(N)
n = 1
while n <= N-1:
  k = 1
  tmp = 0
  while k**2 <= n:
    if n % k == 0:
      if k ** 2 = n:
        tmp += 1
      else:
        tmp += 2
  ls[n] = tmp
print(sum(ls))
Problem p02553 (python)

Fixed submission:
a,b,c,d = map(int, input().split())
print(max(a*c,a*d,b*c,b*d))

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int, input())
print(max(a*c,a*d,b*c,b*d))