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

Fixed submission:
s=input()
k=int(input())

lis=[]

for i in range(len(s)):
    for j in range(k):
        tmp=s[i:i+j+1]
        lis.append(tmp)

lis=sorted(list(set(lis)))        
print(lis[k-1])

Buggy submission (verdict: Runtime Error):
s=input()
n=len(s)
k=int(input())
st=min(s)

if k==1:
    print(st)
    exit()

ans=[]
x=1
while x<6:
    for i in range(n-x):
        if i<0:
            continue
        for j in range(i+x,n+x):
            if j>n:
                continue
            ans.append(s[i:j])
    x+=1
    
ans=list(set(ans))
ans=sorted(ans)
print(ans[k-1])

Buggy submission (verdict: Runtime Error):
s=input()
n=len(s)
k=int(input())
st=min(s)

if k==1:
    print(st)
    exit()

ans=[]
x=1
while x<6:
    for i in range(n-x):
        if n-x<0:
            continue
        for j in range(i+x,n+x):
            if n+x>n:
                continue
            ans.append(s[i:j])
    x+=1
    
ans=list(set(ans))
ans=sorted(ans)
print(ans[k-1])

Buggy submission (verdict: Runtime Error):
s=input()
n=len(s)
k=int(input())
st=min(s)

if k==1:
    print(st)
    exit()

ans=[]
x=1
while x<6:
    for i in range(n-x):
        for j in range(i+x,n+x):
            ans.append(s[i:j])
    x+=1
    
ans=list(set(ans))
ans=sorted(ans)
print(ans[k-1])

Buggy submission (verdict: Runtime Error):
s=input()
n=len(s)
k=int(input())
st=min(s)

if k==1:
    print(st)
    exit()

if n<=20:
    ans=[]
    for i in range(n-1):
        for j in range(i+1,n+1):
            ans.append(s[i:j])
    ans=list(set(ans))
    ans=sorted(ans)
    print(ans[k-1])
    exit()

option=[]
option.append(st)
ans=[]
while option:
    option=sorted(option)
    now=option[0]
    print(option,now)
    option=option[1:]
    ans.append(now)
    if len(ans)>=k:
        break
    for i in range(n-len(now)):
        tmp=s[i:i+len(now)+1]
        if tmp[:len(now)]==now and tmp not in option:
            option.append(tmp)

ans=sorted(ans)
print(ans[k-1])
Problem p03361 (python)

Fixed submission:
h,w=map(int,input().split())
dx=[-1,1,0,0]
dy=[0,0,-1,1]
a=[]
for i in range(h):
    a.append(list(input()))
for i in range(h):
    for j in range(w):
        if a[i][j]=="#":
            frag=False
            if j-1>=0 and a[i][j-1]=="#":
                frag=True
            if j+1<=w-1 and a[i][j+1]=="#":
                frag=True
            if i-1>=0 and a[i-1][j]=="#":
                frag=True
            if i+1<=h-1 and a[i+1][j]=="#":
                frag=True
            if frag==False:
                print("No")
                exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
h,w=map(int,input().split())
dx=[-1,1,0,0]
dy=[0,0,-1,1]
a=[]
for i in range(h):
    a.append(list(input()))
for i in range(h):
    for j in range(w):
        frag=False
        if a[i][j]=="#":
            for k in range(4):
                x=j+dx[k]
                y=i+dy[k]
                if x<0 or x>w-1 or y<0 or y>h-1:
                    continue
                if a[x][y]=="#":
                    frag=True
            if frag==False:
                print("No")
                exit()
print("Yes")
Problem p03386 (python)

Fixed submission:
a,b,k=map(int,input().split())
li=[]
for i in range(a,a+k):
    if a<=i<=b:
        li.append(i)
for i in range(b-k+1,b+1):
    if a<=i<=b:
        li.append(i)
li=sorted(set(li))
for i in li:
    print(i)

Buggy submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
l=[i for i in range(a,b+1)]
for i in range(k):
    print(l[i])
for i in l[len(l)-k:]:
    print(i)
Problem p03449 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
maxi=0
for i in range(n):
    total=0
    x=sum(a[:i+1])
    y=sum(b[i:])
    total=x+y
    maxi=max(total,maxi)
print(maxi)

Buggy submission (verdict: Runtime Error):
n=int(input())
a1=list(map(int,input().split()))
a2=list(map(int,input().split()))
total=0
i=0
frag=True
while frag:
    total+=a1[i]
    sum1=sum(a1[i+1:])
    sum2=sum(a2[i:])
    if sum1>=sum2:
        i+=1
    else:
        if a1[i+1]>a2[i]:
            i+=1
        else:
            frag=False
total+=sum(a2[i:])
print(total)
Problem p03673 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=[]
i=n-1
if n==1:
    print(a[0])
    exit()
for _ in range(n//2+1):
    b.append(a[i])
    i-=2
    if i<=-1:
        break
if n%2==0: 
    i=0
else:
    i=1
for _ in range(n//2+1):
    b.append(a[i])
    i+=2
    if i>=n-1:
        break
print(' '.join(map(str,b)))

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
b=[]
i=n-1
for _ in range(n//2+1):
    b.append(a[i])
    i-=2
    if i<=-1:
        break
if n%2==0: 
    i=0
else:
    i=1
for _ in range(n//2+1):
    b.append(a[i])
    i+=2
    if i>=n-1:
        break
print(' '.join(map(str,b)))
Problem p03697 (python)

Fixed submission:
a,b=map(int,input().split())
x=a+b
if x>=10:
    print('error')
else:
    print(x)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input(),split())
x=a+b
if x>=10:
    print('error')
else:
    print(x)
Problem p03722 (python)

Fixed submission:
def shortest_path(s,n,w,es):
#s→iの最短距離
# s:始点, n:頂点数, w:辺の数, es[i]: [辺の始点,辺の終点,辺のコスト]
    d = [float('inf')] * n
    #d[i] : s→iの最短距離
    d[s] = 0
    while True:
        for p,q,r in es:
        # e: 辺iについて [from,to,cost]
            #print(d,p,q,r)
            if d[p] != float('inf') and d[q] > d[p] + r:
                d[q] = d[p] + r
                update = True
            ans1=d[-1]
        update = False
        for p,q,r in es:
        # e: 辺iについて [from,to,cost]
            #print(d,p,q,r)
            if d[p] != float('inf') and d[q] > d[p] + r:
                d[q] = d[p] + r
            ans2=d[-1]
        return -ans1 if ans1==ans2 else 'inf' 
################
n,w = map(int,input().split()) #n:頂点数　w:辺の数
es = [] #es[i]: [辺の始点,辺の終点,辺のコスト]
for _ in range(w):
 x,y,z = map(int,input().split())
 es.append([x-1,y-1,-z])
print(shortest_path(0,n,w,es))

Buggy submission (verdict: Runtime Error):
def shortest_path(s,n,w,es):
#s→iの最短距離
# s:始点, n:頂点数, w:辺の数, es[i]: [辺の始点,辺の終点,辺のコスト]
    d = [float('inf')] * n
    #d[i] : s→iの最短距離
    d[s] = 0
    while True:
        update = False
        for p,q,r in es:
        # e: 辺iについて [from,to,cost]
            #print(d,p,q,r)
            if d[p] != float('inf') and d[q] > d[p] + r:
                d[q] = d[p] + r
                update = True
            if not update:
                print(1)
                break
            ans1=d[-1]
        update = False
        for p,q,r in es:
        # e: 辺iについて [from,to,cost]
            #print(d,p,q,r)
            if d[p] != float('inf') and d[q] > d[p] + r:
                d[q] = d[p] + r
                update = True

            ans2=d[-1]
        return -ans1 if ans1==ans2 else 'inf' 
################
n,w = map(int,input().split()) #n:頂点数　w:辺の数
es = [] #es[i]: [辺の始点,辺の終点,辺のコスト]
for _ in range(w):
 x,y,z = map(int,input().split())
 es.append([x-1,y-1,-z])
print(shortest_path(0,n,w,es))
Problem p03796 (python)

Fixed submission:
n=int(input())
import math 
print(math.factorial(n)%((10**9)+7))

Buggy submission (verdict: Runtime Error):
def training(n):
    if n==1:
        return 1
    else:
        x=training(n-1)*n
        return x%mod
import sys
sys.setrecursionlimit(n+1)
n=int(input())
mod=10**9+7
print(training(n))
Problem p03815 (python)

Fixed submission:
x=int(input())
if x%11>6:
    ans=(x//11)*2+2
elif x%11==0:
    ans=(x//11)*2
else:
    ans=(x//11)*2+1
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
if n<=6:
    print(1)
    exit()
if n<=11:
    print(2)
    exit()
ans=(n//11)*2
mod=n%11
if 6<=mod<=10 :
    print(an+2)
elif mod==0:
    print(ans)
else:
    print(ans+1)
Problem p03944 (python)

Fixed submission:
w,h,n=map(int,input().split())
a=[[int(i) for i in input().split()] for i in range(n)]
nx=w
ny=h
x=0
y=0
for i in a:
    if i[2]==1:
        x=max(i[0],x)
    elif i[2]==2:
        nx=min(i[0],nx)
    elif i[2]==3:
        y=max(y,i[1])
    else :
        ny=min(ny,i[1])
xx=nx-x
yy=ny-y
print(xx*yy if xx>0 and yy>0 else 0)

Buggy submission (verdict: Runtime Error):
x,y=0,0
for s,t,u in a:
    if u==1:
        x=max(x,s)
    elif u==2:
        w=min(w,s)
    elif u==3:
        y=max(y,t)
    else:
        h=min(h,t)
height=max(0,h-y)
width=max(0,w-x)
print(height*width)
Problem p03994 (python)

Fixed submission:
def need(a):
    if a=="a":
        return 0
    else:
        return 123-ord(a)

s=list(input())
x=int(input())
i=0
while x>0:
    count=need(s[i])
    if x>=count:
        s[i]="a"
        x-=count
    
    if i==len(s)-1:
        s[i]=chr(ord(s[i])+(x%26))
        x=0
    i+=1
print("".join(s))

Buggy submission (verdict: Runtime Error):
a=list(input())
k=int(input())
al = "abcdefghijklmnopqrstuvwxyz"
alpha2num=lambda x:ord(x)-ord('a')+1
ans=[""]*len(a)

for i in range(len(a)):
    num=alpha2num(a[i])
    need=27-num
    if need==26:
        need=0
    if need<=k and i!=len(a)-1:
        ans[i]="a"
        k-=need
    elif need<=k and i==len(a)-1:
        remain=k%26
        if need<=remain:
            go=remain-need
        ans[-1]=chr(ord("a")+go)
    elif need>k and i!=len(a)-1:
        ans[i]=a[i]
    elif need>k and i==len(a)-1:
        ans[-1]=chr(ord(a[-1])+k)
print(''.join(ans))
Problem p03031 (python)

Fixed submission:
from itertools import product
N, M = map(int, input().split(" "))
s = []
for i in range(M):
    s.append(list(map(int, input().split(" ")))[1:])

p = list(map(int, input().split(" ")))
ans = 0
for tup in product(range(2), repeat=N):
    for i in range(M):
        flg = True
        cnt = 0
        for d in s[i]:
            cnt += tup[d - 1]
        if cnt % 2 != p[i]:
            flg = False
            break

    if flg:
        ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
from itertools import product
N, M = map(int, input().split(" "))
s = []
for i in range(M):
    s.append(list(map(int, input().split(" ")))[1:])

p = list(map(int, input().split(" ")))
ans = 0
for tup in product(range(2), repeat=M):
    for i in range(M):
        flg = True
        cnt = 0
        for d in s[i]:
            cnt += tup[d - 1]
        if cnt % 2 != p[i]:
            flg = False
            break

    if flg:
        ans += 1

print(ans)
Problem p03044 (python)

Fixed submission:
N = int(input())
W = [ [] for _ in range(N) ]
used = [-1] * N

for i in range(N-1):
    u,v,w = map(int,input().split(" "))
    W[u-1].append(( v-1, w))
    W[v-1].append((u-1, w))

used[0] = 0
lst = [ 0 ]
while len(lst) != 0:
    newList = []
    for v in lst:
        for (nx, w) in W[v]:
            if used[nx] == -1:
                if w % 2 == 0:
                    used[nx] = used[v]
                else:
                    used[nx] = (used[v] + 1) % 2
                newList.append(nx)
    lst = newList

for ans in used:
    print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
W = [ [] for _ in range(N) ]
dist = [-1] * N
dist[0] = 0

for i in range(N-1):
    u,v,w = map(int,input().split(" "))
    W[u-1].append(( v-1, w))
    W[v-1].append((u-1, w))

def dfs(cur, d, prev):
    for v, w in W[cur]:
        if v == prev:
            continue
        dist[v] = d + w
        dfs(v, dist[v], cur)
    

dfs(0, 0, -1)

for ans in dist:
    print(ans % 2)
Problem p03061 (python)

Fixed submission:
import sys
sys.setrecursionlimit(sys.getrecursionlimit())
N = int(input())
A = list(map(int,input().split(" ")))

def gcd (a: int,b: int) -> int:
    if a < b: a,b = b,a
    return a if b == 0 else gcd(b,a%b)
def lcm (a: int,b: int) -> int:
    return a // gcd(a,b) * b

gcdForward = [0] * N
gcdBackWard = [0] * N
gcdForward[0] =  A[0]
gcdBackWard[N-1] = A[-1]
for i in range(N-1):
    gcdForward[i+1] = gcd(gcdForward[i],A[i+1])
    gcdBackWard[N-i-2] = gcd(gcdBackWard[N-i-1],A[N-i-2])


if N == 2:
    print(max(A))
    exit(0)
else:
    ans = max(gcdBackWard[1],gcdForward[N-2])
    for i in range(1,N-1):
        ans = max(ans,gcd(gcdForward[i-1],gcdBackWard[i+1]))
    print(ans)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(sys.getrecursionlimit())
N = int(input())
A = list(map(int,input().split(" ")))

def gcd (a: int,b: int) -> int:
    if a < b: a,b = b,a
    return a if b == 0 else gcd(b,a%b)
def lcm (a: int,b: int) -> int:
    return a // gcd(a,b) * b

memo = [-1] * N 
def dfs(i,v,flg):
    if i == N-1:
        if flg:
            return gcd(A[N-1],v)
        else:
            return v
    if flg:
        if memo[i] != -1:
            return memo[i]
        else:
            memo[i] = dfs(i+1,gcd(A[i],v),True)
            return memo[i]
    else:
        return max(dfs(i+1,gcd(v,A[i]),False),dfs(i+1,v,True))

if N == 2:
    print(max(A))
    exit(0)
else:
    print(max(dfs(1,A[0],False),dfs(2,A[1],True)))

Buggy submission (verdict: Runtime Error):
import sys

sys.setrecursionlimit(sys.getrecursionlimit())
N = int(input())
A = list(map(int,input().split(" ")))

def gcd (a: int,b: int) -> int:
    if a < b: a,b = b,a
    return a if b == 0 else gcd(b,a%b)
def lcm (a: int,b: int) -> int:
    return a // gcd(a,b) * b

def dfs(i,v,flg):
    if i == N-1:
        if flg:
            return gcd(A[N-1],v)
        else:
            return v
    if flg:
        return dfs(i+1,gcd(A[i],v),True)
    else:
        return max(dfs(i+1,gcd(v,A[i]),False),dfs(i+1,v,True))

if N == 2:
    print(max(A))
    exit(0)
else:
    print(max(dfs(1,A[0],False),dfs(2,A[1],True)))

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

def gcd (a: int,b: int) -> int:
    if a < b: a,b = b,a
    return a if b == 0 else gcd(b,a%b)
def lcm (a: int,b: int) -> int:
    return a // gcd(a,b) * b

def dfs(i,v,flg):
    if i == N-1:
        if flg:
            return gcd(A[N-1],v)
        else:
            return v
    if flg:
        return dfs(i+1,gcd(A[i],v),True)
    else:
        return max(dfs(i+1,gcd(v,A[i]),False),dfs(i+1,v,True))

if N == 2:
    print(max(A))
    exit(0)
else:
    print(max(dfs(1,A[0],False),dfs(2,A[1],True)))
Problem p03165 (python)

Fixed submission:
import sys

s = sys.stdin.readline()
t = sys.stdin.readline()

# dp[i][j] = LCS(s[:i],t[:j])
sLen, tLen = len(s),len(t),
dp = [ [( 0 , -1 )]*(tLen+1)  for _ in range(sLen+1) ]
for i in range(1,sLen+1):
    for j in range(1,tLen+1):
        comp = [ dp[i][j-1][0],dp[i-1][j-1][0]+int(s[i-1]==t[j-1]),dp[i-1][j][0]]
        argmax = comp.index(max(comp))
        dp[i][j] = ( comp[argmax] , argmax )

ans = ""
i,j = sLen, tLen
for _ in range(sLen+tLen):
    if dp[i][j][1] == 0:
        j -= 1
    elif dp[i][j][1] == 1:
        ans += s[i-1]
        i -= 1
        j -= 1
    elif dp[i][j][1] == 2:
        i -= 1
    else:
        break

print(ans[::-1])

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(sys.getrecursionlimit())
def trace(i,j):
    global ans
    if i == 0 or j == 0:
        return
    if dp[i][j][1] == 0:
        trace(i,j-1)
    elif dp[i][j][1] == 1:
        ans += s[i-1]
        trace(i-1,j-1)
    elif dp[i][j][1] == 2:
        trace(i-1,j)
    else:
        return

s = input()
t = input()
# dp[i][j] = LCS(s[:i+1],t[:j+1])
dp = [ [( 0 , -1 )]*(len(t)+1)  for _ in range(len(s)+1) ]
for i in range(1,len(s)+1):
    for j in range(1,len(t)+1):
        comp = [ dp[i][j-1][0],dp[i-1][j-1][0]+int(s[i-1]==t[j-1]),dp[i-1][j][0]]
        argmax = comp.index(max(comp))
        dp[i][j] = ( comp[argmax] , argmax )

ans = ""
trace(len(s),len(t))
print(ans[::-1])

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(sys.getrecursionlimit())
def trace(i,j):
    global ans
    if dp[i][j][1] == 0:
        trace(i,j-1)
    elif dp[i][j][1] == 1:
        ans += s[i-1]
        trace(i-1,j-1)
    elif dp[i][j][1] == 2:
        trace(i-1,j)
    else:
        return

s = input()
t = input()
# dp[i][j] = LCS(s[:i+1],t[:j+1])
dp = [ [( 0 , -1 )]*(len(t)+1)  for _ in range(len(s)+1) ]
for i in range(1,len(s)+1):
    for j in range(1,len(t)+1):
        comp = [ dp[i][j-1][0],dp[i-1][j-1][0]+int(s[i-1]==t[j-1]),dp[i-1][j][0]]
        argmax = comp.index(max(comp))
        dp[i][j] = ( comp[argmax] , argmax )

ans = ""
trace(len(s),len(t))
print(ans[::-1])

Buggy submission (verdict: Runtime Error):
def trace(i,j):
    global ans
    if dp[i][j][1] == 0:
        trace(i,j-1)
    elif dp[i][j][1] == 1:
        ans += s[i-1]
        trace(i-1,j-1)
    elif dp[i][j][1] == 2:
        trace(i-1,j)
    else:
        return

s = input()
t = input()
# dp[i][j] = LCS(s[:i+1],t[:j+1])
dp = [ [( 0 , -1 )]*(len(t)+1)  for _ in range(len(s)+1) ]
for i in range(1,len(s)+1):
    for j in range(1,len(t)+1):
        comp = [ dp[i][j-1][0],dp[i-1][j-1][0]+int(s[i-1]==t[j-1]),dp[i-1][j][0]]
        argmax = comp.index(max(comp))
        dp[i][j] = ( comp[argmax] , argmax )

ans = ""
trace(len(s),len(t))
print(ans[::-1])
Problem p03171 (python)

Fixed submission:
import sys
N = int(input())
a = list(map(int,input().split(" ")))

dp = [ [0]*N  for _ in range(N) ]

for l in range(N-1,-1,-1):
    for r in range(l,N):
        turn = ((N - r) + l + 1) % 2

        if turn == 0:
            if r > 0 and l < N-1:
                dp[l][r] = max(a[l] + dp[l+1][r],a[r]+dp[l][r-1])
            elif l < N-1:
                dp[l][r] =  a[l] + dp[l+1][r]
            else:
                dp[l][r] =  a[r] + dp[l][r-1]
        else:
            if r > 0 and l < N-1:
                dp[l][r] = min(-a[l] + dp[l+1][r],-a[r]+dp[l][r-1])
            elif l < N-1:
                dp[l][r] = -a[l] + dp[l+1][r]
            else:
                dp[l][r] = -a[r] + dp[l][r-1]
print(dp[0][N-1])

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

memo = [ [-1]*N  for _ in range(N) ]


def dfs(l,r,turn):
    if l == r:
        return 0

    if memo[l][r-1] != -1:
        return memo[l][r-1]

    if turn % 2 == 0:
        ret = max(a[l] + dfs(l+1,r,(turn+1)%2),a[r-1] + dfs(l,r-1,(turn+1)%2))
    else:
        ret = min(-a[l] + dfs(l+1,r,(turn+1)%2),-a[r-1] + dfs(l,r-1,(turn+1)%2))

    memo[l][r-1] = ret
    return memo[l][r-1]

ans = dfs(0,N,0)
print(ans)
Problem p03213 (python)

Fixed submission:
from itertools import combinations
N = int(input())
if N == 1:
    print(0)
    exit(0)
def get_sieve_of_eratosthenes(n):
    import math
    if not isinstance(n, int):
        raise TypeError('n is int type.')
    if n < 2:
        raise ValueError('n is more than 2')
    prime = []
    limit = math.sqrt(n)
    data = [i + 1 for i in range(1, n)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]
    return prime
prime = get_sieve_of_eratosthenes(N)
n = len(prime)
ans = 0
divNum = [0] + [ N//i for i in range(1,N+1) ]
for p in prime:
    ip = p * p
    while ip <= N:
        divNum[p] += divNum[ip]
        ip *= p

for i in range(n):
    if 74 <= divNum[prime[i]]:
        ans += 1
    for j in range(n):
        if i != j and 4 <= divNum[prime[i]] and 14 <= divNum[prime[j]]:
            ans += 1
        if i != j and 2 <= divNum[prime[i]] and 24 <= divNum[prime[j]]:
            ans += 1
        for k in range(j+1,n):
            if i != j and i != k:
                if 2 <= divNum[prime[i]] and 4 <= divNum[prime[j]] and 4 <= divNum[prime[k]]:
                    ans += 1
            
print(ans)

Buggy submission (verdict: Runtime Error):
from itertools import combinations
N = int(input())
def get_sieve_of_eratosthenes(n):
    import math
    if not isinstance(n, int):
        raise TypeError('n is int type.')
    if n < 2:
        raise ValueError('n is more than 2')
    prime = []
    limit = math.sqrt(n)
    data = [i + 1 for i in range(1, n)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]
    return prime
prime = get_sieve_of_eratosthenes(N)
n = len(prime)
ans = 0
divNum = [0] + [ N//i for i in range(1,N+1) ]
for p in prime:
    ip = p * p
    while ip <= N:
        divNum[p] += divNum[ip]
        ip *= p

for i in range(n):
    if 74 <= divNum[prime[i]]:
        ans += 1
    for j in range(n):
        if i != j and 4 <= divNum[prime[i]] and 14 <= divNum[prime[j]]:
            ans += 1
        if i != j and 2 <= divNum[prime[i]] and 24 <= divNum[prime[j]]:
            ans += 1
        for k in range(j+1,n):
            if i != j and i != k:
                if 2 <= divNum[prime[i]] and 4 <= divNum[prime[j]] and 4 <= divNum[prime[k]]:
                    ans += 1
            
print(ans)
Problem p03219 (python)

Fixed submission:
X,Y = map(int,input().split(" "))
print(X + (Y//2))

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())
T,A = map(int,input().split(" "))
H =  list(map(lambda x:abs(T - float(x)*0.006 - A),input().split(" ")))
print(np.argmin(H)+1)
Problem p03220 (python)

Fixed submission:
import numpy as np
N = int(input())
T,A = map(int,input().split(" "))
H =  list(map(int,input().split(" ")))
H = list(map(lambda x: abs((T - x*0.006)-A),H))

print(np.argmin(H)+1)

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())
T,A = map(int,input().split(" "))
H =  list(map(int,input().split(" ")))
H = list(map(lambda x: abs((T - x*0.006)-A),H))

print(np.argmin(H)+1)
Problem p03247 (python)

Fixed submission:
N = int(input())
X,Y = [0]*N,[0]*N
U,V = [0]*N,[0]*N
mod = [0] * N
for i in range(N):
    X[i],Y[i] = map(int,input().split(" "))
    mod[i] = (X[i] + Y[i]) % 2
    U[i],V[i] = (X[i]+Y[i]),(X[i]-Y[i])

l = len(list(filter(lambda x: x == 1,mod)))

if l != 0 and l != N:
    print(-1)
    exit(0)

# 偶数
if l == 0:
    d = [ 1 << i for i in range(38,-1,-1) ] + [1]

else:
    d = [ 1 << i for i in range(39,-1,-1) ]

ans = []
for i in range(N):
    move = []
    curU,curV = 0,0
    for step in d:
        if curU <= U[i] and curV <= V[i]:
            curU += step
            curV += step
            move.append('R')

        elif curU > U[i] and curV <= V[i]:
            curU -= step
            curV += step
            move.append('D')

        elif curU <= U[i] and curV > V[i]:
            curU += step
            curV -= step
            move.append('U')

        elif curU > U[i] and curV > V[i]:
            curU -= step
            curV -= step
            move.append('L')

    ans.append(move)

print(len(d))
print(*d)
for i in range(N):
    print("".join(ans[i]))

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

X = [0] * N
Y = [0] * N

X[0],Y[0] = map(int,input().split(" "))
ev = abs(X[0] + Y[0])%2
flg = False
for i in range(N-1):
    X[i+1],Y[i+1] = map(int,input().split(" "))
    if abs(X[i+1] + Y[i+1]) % 2 != ev:
        flg = True

if flg:
    print(-1)
    exit(0)

if ev == 1:
    m =  39
else:
    m = 40

stop = "LR"

print(m)
print('1 ' * (m-1) + '1')
for i in range(N):
    need = (abs(X[i])+abs(Y[i]))
    s = stop * (m - need)
    if X[i] < 0:
        s += ("L" * abs(X[i]))
    else:
        s += ("R" * abs(X[i]))
        
    if Y[i] < 0:
        s += ("D" * abs(Y[i]))
    else:
        s += ("U" * abs(Y[i]))

    print(s)

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

X = [0] * N
Y = [0] * N


X[0],Y[0] = map(int,input().split(" "))
ev = (X[0] + Y[0])%2
flg = False
for i in range(N-1):
    X[i+1],Y[i+1] = map(int,input().split(" "))
    if(X[i+1] + Y[i+1] ) % 2 != ev:
        flg = True

if flg:
    print(-1)
    exit(0)

if ev == 1:
    m =  39
else:
    m = 40

stop = "LR"

print(m)
d = [ 1 for i in range(m) ]
print(*d)
for i in range(N):
    need = (abs(X[i])+abs(Y[i]))
    s = stop * (m - need)
    if X[i] < 0:
        s += ("L" * abs(X[i]))
    else:
        s += ("R" * abs(X[i]))
    if Y[i] < 0:
        s += ("D" * abs(Y[i]))
    else:
        s += ("U" * abs(Y[i]))
    print(s)