Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import numpy as np

grid = []
#for i in range(1):
array = list(map(int,input().strip().split()))
#    grid.append(array)
#print(array)
a = array[0]
b = array[1]

min8 = a/0.08
max8 = (a+1)/0.08
min10 = b/0.1
max10 = (b+1)/0.1

def lists(a,b):
    if a%1==0:
        a2 = a
    else:
        a2 = int(a)+1
    if b%1==0:
        b2 = b-1
    else:
        b2 = int(b)
    return np.arange(a2,b2+1)

list8 = lists(min8,max8)
list10 = lists(min10,max10)
#print(list8,list10)
hosii = list(set(list8)&set(list10))
if len(hosii)>0:
    print(int(np.min(hosii)))
else:
    print(-1)

Fixed submission:
import numpy as np

bus = input()

if bus == "AAA":
    print("No")
elif bus == "BBB":
    print("No")
else:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
import sys

def main(n):

  if n%2 == 0:
    print(n/2)
  else:
    print(int(n/2)+1)

if __name__ == '__main__':
    main(input())


Fixed submission:
s = input().strip()
s = int(s)

if s%2 == 0:
    print(int(s/2))
else:
    print(int(s/2)+1)

Buggy python submission (verdict: Runtime Error):
import sys

def main(argv):

  #L = int(argv.pop())
  #tree = [int(s) for s in argv]
  n = int(argv[0])
  if n%2 == 0:
    print(n/2)
  else:
    print(int(n/2)+1)

if __name__ == '__main__':
    main(sys.argv[1:])


Fixed submission:
s = input().strip()
s = int(s)

if s%2 == 0:
    print(int(s/2))
else:
    print(int(s/2)+1)

Buggy python submission (verdict: Runtime Error):
import sys

def main(argv):
 #L = int(argv.pop())
 #tree = [int(s) for s in argv]
 n = int(argv[0])
 if n%2 == 0:
    print(n/2)
 else:
    print(int(n/2)+1)

if __name__ == '__main__':
    main(sys.argv[1:])


Fixed submission:
s = input().strip()
s = int(s)

if s%2 == 0:
    print(int(s/2))
else:
    print(int(s/2)+1)

Buggy python submission (verdict: Runtime Error):
import sys

def main(argv):
 #L = int(argv.pop())
 #tree = [int(s) for s in argv]
 n = int(argv[0])
 if n%2 == 0:
    print(n/2)
 else:
    print(n/2+1)

if __name__ == '__main__':
    main(sys.argv[1:])


Fixed submission:
s = input().strip()
s = int(s)

if s%2 == 0:
    print(int(s/2))
else:
    print(int(s/2)+1)

Buggy python submission (verdict: Runtime Error):
import sys

def main(argv):
 #L = int(argv.pop())
 #tree = [int(s) for s in argv]
 n = argv[1]
 if n%2 == 0:
    print(n/2)
 else:
    print(n/2+1)

if __name__ == '__main__':
    main(sys.argv[1:])

Fixed submission:
s = input().strip()
s = int(s)

if s%2 == 0:
    print(int(s/2))
else:
    print(int(s/2)+1)
Buggy python submission (verdict: Runtime Error):
import numpy as np

grid = []
for i in range(3):
    array = list(map(int,input().strip().split()))
    grid.append(array)
    
grid = np.array(grid)

N = int(input().split())
s = [int(input()) for i in range(N)]

for i in s:
    b = np.where(grid==i,0,grid)
    
if grid[0][0]==0 & grid[0][1]==0 & grid[0][2]==0:
    han = "Yes"
elif grid[1][0]==0 & grid[1][1]==0 & grid[1][2]==0:
    han = "Yes"
elif grid[2][0]==0 & grid[2][1]==0 & grid[2][2]==0:
    han = "Yes"
elif grid[0][0]==0 & grid[1][0]==0 & grid[2][0]==0:
    han = "Yes"
elif grid[0][1]==0 & grid[1][1]==0 & grid[2][1]==0:
    han = "Yes"
elif grid[0][2]==0 & grid[1][2]==0 & grid[2][2]==0:
    han = "Yes"
elif grid[0][0]==0 & grid[1][1]==0 & grid[2][2]==0:
    han = "Yes"
elif grid[0][2]==0 & grid[1][1]==0 & grid[2][0]==0:
    han = "Yes"
else:
    han = "No"
print(han)


Fixed submission:
import numpy as np

grid = []
for i in range(3):
    array = list(map(int,input().strip().split()))
    grid.append(array)
    
grid = np.array(grid)

N = int(input())
s = [int(input()) for i in range(N)]

for i in s:
    grid = np.where(grid==i,0,grid)
    
#print(grid)
    
if grid[0][0]==0 and grid[0][1]==0 and grid[0][2]==0:
    han = "Yes"
elif grid[1][0]==0 and grid[1][1]==0 and grid[1][2]==0:
    han = "Yes"
elif grid[2][0]==0 and grid[2][1]==0 and grid[2][2]==0:
    han = "Yes"
elif grid[0][0]==0 and grid[1][0]==0 and grid[2][0]==0:
    han = "Yes"
elif grid[0][1]==0 and grid[1][1]==0 and grid[2][1]==0:
    han = "Yes"
elif grid[0][2]==0 and grid[1][2]==0 and grid[2][2]==0:
    han = "Yes"
elif grid[0][0]==0 and grid[1][1]==0 and grid[2][2]==0:
    han = "Yes"
elif grid[0][2]==0 and grid[1][1]==0 and grid[2][0]==0:
    han = "Yes"
else:
    han = "No"
print(han)
Buggy python submission (verdict: Time Limit Exceeded):
s=input()
check=list(s)
n=len(s)
cnt=0
if n==1:
    print(0)
else:
    flag=False
    while 1:
        for i in range(n-1):
            if check[i]=='B' and check[i+1]=='W':
                cnt+=1
                check[i]='W'
                check[i+1]='B'
                break
            if i==n-2:
                flag=True
        if flag:
            break
    print(cnt)

Fixed submission:
s=input()
check=list(s)
n=len(s)
cntb=0
for i in check:
    if i=='B':
        cntb+=1
minus=sum([i+1 for i in range(n) if check[i]=='B' ])
plus=sum(range(n-cntb+1,n+1))
print(plus-minus)

Buggy python submission (verdict: Time Limit Exceeded):
s=input()
check=list(s)
n=len(s)
cnt=0
if n==1:
    print(0)
else:
    flag=False
    while 1:
        for i in range(n-1):
            if check[i]=='B' and check[i+1]=='W':
                cnt+=1
                check[i]='W'
                check[i+1]='B'
                break
            if i==n-2:
                flag=True
        if flag:
            break
    print(cnt)

Fixed submission:
s=input()
check=list(s)
n=len(s)
cntb=0
for i in check:
    if i=='B':
        cntb+=1
minus=sum([i+1 for i in range(n) if check[i]=='B' ])
plus=sum(range(n-cntb+1,n+1))
print(plus-minus)
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
n,x=map(int,input().split())
a=list(map(int, input().split()))
if sum(a)<x:
    print(len(a)-1)
else:
    ans=0
    for i in range(1,n+1):
        for v in itertools.combinations(a,i):
            if sum(v)<=x:
                ans=len(v)
    print(ans)

Fixed submission:
n,x=map(int,input().split())
a=list(map(int, input().split()))

ans=0
rest=x
target=sorted(a)
if sum(target)<x:
    print(n-1)
elif sum(target)==x:
    print(n)
else:
    for i in range(n):
        rest-=target[i]
        if rest<0:
            ans=i
            break
        if rest==0:
            ans=i+1
            break
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
import sys
import math
sys.setrecursionlimit(500005)


def solve(N: int):
    for i in range(1,N+1):
        ri = math.ceil(math.sqrt(i))
        counter = 0
        for x in range(1,ri+1):
            for y in range(1,ri+1):
                for z in range(1,ri+1):
                    if (x*x+y*y+z*z+x*y+y*z+z*x == i):
                        counter += 1
        print(counter)


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3
import sys
import math
sys.setrecursionlimit(500005)


def solve(N: int):
    rn = math.ceil(math.sqrt(N))
    arr = [0] * N
    counter = 0
    for x in range(1,rn+1):
        for y in range(1,rn+1):
            for z in range(1,rn+1): 
                if ((x*x+y*y+z*z+x*y+y*z+z*x) > N ):
                    continue
                else:
                    arr[(x*x+y*y+z*z+x*y+y*z+z*x) -1 ] += 1
    for i in arr:
        print(i)

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys
import bisect


def solve(X: int, N: int, p: "List[int]"):
    sortp = sorted(p)
    if(N == 0):
        print(X)
        exit()

    for i in range(100):
        # 左側
        l = X - i
        index = bisect.bisect_left(sortp,l)
        if(sortp[index] != l):
            print(l)
            exit()

        # 右側
        r = X + i
        index = bisect.bisect_left(sortp,r)
        if(sortp[index] != r):
            print(r)
            exit()

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  # type: int
    N = int(next(tokens))  # type: int
    p = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(X, N, p)

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3
import sys
import bisect


def solve(X: int, N: int, p: "List[int]"):
    sortp = sorted(p)
    if(N == 0):
        print(X)
        exit()

    for i in range(100):
        # 左側
        l = X - i
        index = bisect.bisect_left(sortp,l)
        if(index == N or sortp[index] != l):
            print(l)
            exit()

        # 右側
        r = X + i
        index = bisect.bisect_left(sortp,r)
        if(index == N or sortp[index] != r):
            print(r)
            exit()

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  # type: int
    N = int(next(tokens))  # type: int
    p = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(X, N, p)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
import sys


def solve(N: int, A: "List[int]"):
    ans = 1
    threshold = 1000000000000000000
    for x in A:
        ans *= x
    if (ans > threshold):
        print(-1)
    else:
        print(ans)


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, A)

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3
import sys


def solve(N: int, A: "List[int]"):
    ans = 1
    threshold = 1000000000000000000
    if 0 in A:
        print(0)
        exit()

    for x in A:
        ans *= x
        if (ans > threshold):
            print(-1)
            exit()
    print(ans)


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, A)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys 

n = int(input())
a = list(map(int, input().split()))

a_sorted = sorted(a)

a_max = a_sorted[-1]
a_min = a_sorted[0] - n

kanasisa_min = sys.maxsize
for b in range(a_min,a_max+1):
    kanasisa = 0
    for i,data in enumerate(a):
        kanasisa += abs(data - (b + i + 1))
    if kanasisa < kanasisa_min:
        kanasisa_min = kanasisa

print(kanasisa_min)

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

a_max = max(a)
a_min = min(a) - n

t = (a_min + a_max) // 2

while (a_min <= a_max):
    plus_minus = 0
    for i,data in enumerate(a):
        if data < t + i + 1:
            plus_minus -= 1
        elif data > t + i + 1:
            plus_minus += 1

    if (plus_minus == 0):
        break
    elif (plus_minus > 0):
        a_min = t + 1
    elif (plus_minus < 0):
        a_max = t - 1
    t = (a_min + a_max) // 2

kanasisa = 0
for i,data in enumerate(a):
    kanasisa += abs(data - (t + i + 1))

print(kanasisa)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import math 
# 整数の入力
k = int(input())

for n in range(1,k+1):
    if (n % 9) == 0:
        print ("9" * math.floor(n/9))
    else:
        print(str((n % 9)) + "9" * math.floor(n/9))


Fixed submission:
# -*- coding: utf-8 -*-
# 整数の入力
s = input()

res = 0
for i in s:
    if("+" == i):
        res += 1
    else:
        res -= 1

# 出力
print("{}".format(res))
Buggy python submission (verdict: Runtime Error):
from sys import stdin
import collections
import math

n,m,r   = [int(x) for x in stdin.readline().rstrip().split()]
r_arr = [int(x) for x in stdin.readline().rstrip().split()]

ways = [[int(c)  for c in stdin.readline().rstrip().split()] for _ in range(m)]

cost = [[float("inf") for j in range(n)] for i in range(n)]
for i in range(n):
    cost[i][i] = 0

for way in ways:
    cost[way[0]-1][way[1]-1] = way[2]
    cost[way[1]-1][way[0]-1] = way[2]


# ワーシャルフロイド
for k in range(n):
    for i in range(n):
        for j in range(n):
            cost[i][j] = min(cost[i][j], cost[i][k] + cost[k][j])

# rの訪れ方を全パターン試して、最小の距離のものを答えにする。
tours = []
for perm in itertools.permutations(r_arr):
    d = 0
    for i in range(r-1):
        d += cost[perm[i]][perm[i+1]]
    tours.append(d)
print(min(tours))

Fixed submission:
from sys import stdin
import collections
import math
import itertools

n,m,r   = [int(x) for x in stdin.readline().rstrip().split()]
r_arr = [int(x) for x in stdin.readline().rstrip().split()]

ways = [[int(c)  for c in stdin.readline().rstrip().split()] for _ in range(m)]
inf = float('inf')
cost = [[inf] * n for _ in range(n)]
for i in range(n):
    cost[i][i] = 0

for way in ways:
    cost[way[0]-1][way[1]-1] = way[2]
    cost[way[1]-1][way[0]-1] = way[2]


# ワーシャルフロイド
for k in range(n):
    for i in range(n):
        for j in range(n):
            cost[i][j] = min(cost[i][j], cost[i][k] + cost[k][j])

# rの訪れ方を全パターン試して、最小の距離のものを答えにする。
tours = []
for perm in itertools.permutations(r_arr):
    d = 0
    for i in range(r-1):
        d += cost[perm[i]-1][perm[i+1]-1]
    tours.append(d)
print(min(tours))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
num=1
while True:
    if (num*num)*6>n:
        break
    num=num+1
num=num*num
d={}
for i in range(1,n+1):
    d[i]=0
for i in range(1,num+1):
    for j in range(1,num+1):
        for k in range(1,num+1):
            val=(i*i)+(j*j)+(k*k)+(i*j)+(j*k)+(k*i)
            if val>n:
                continue
            # print(i,end=" ")
            # print(j,end=" ")
            # print(k)
            d[val]=d[val]+1
for i in range(1,n+1):
    print(d[i])

Fixed submission:
n=int(input())
num=100
d={}
for i in range(1,n+1):
    d[i]=0
for i in range(1,num+1):
    for j in range(1,num+1):
        for k in range(1,num+1):
            val=(i*i)+(j*j)+(k*k)+(i*j)+(j*k)+(k*i)
            if val>n:
                continue
            # print(i,end=" ")
            # print(j,end=" ")
            # print(k)
            d[val]=d[val]+1
for i in range(1,n+1):
    print(d[i])
Buggy python submission (verdict: Runtime Error):
n,m=map(int, input().split())
l=list(map(int, input().split()))
ans=0
l.sort()
for i in range(k):
    ans=ans+l[k]
print(ans)

Fixed submission:
n,m=map(int, input().split())
l=list(map(int, input().split()))
ans=0
l.sort()
for i in range(m):
    ans=ans+l[i]
print(ans)
Buggy python submission (verdict: Runtime Error):
n,k=map(int, input().split())
num=abs(n-k)
if num>k:
    print(num%k)
else:
    print(k%num)

Fixed submission:
n,k=map(int, input().split())
if n>k:
    num=n%k
    print(min(num,k-num))
elif n==k:
    print(0)
else:
    print(min(n,k-n))
Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter 
def anagram(input1, input2): 
    return Counter(input1) == Counter(input2) 
n=int(input())
val=0
l=[]
for i in range(n):
    s=input()
    l.append(s)
for j in range(len(l)):
    for k in range(j+1,len(l)):
        if anagram(l[j],l[k]):
            val+=1
print(val)      
        

Fixed submission:
from collections import Counter  
n=int(input())
val=0
l=[]
for i in range(n):
    s=input()
    s=sorted(s)
    l.append("".join(s))
for i in Counter(l).values():
    val+=(i*(i-1))//2
print(val)
Buggy python submission (verdict: Runtime Error):
i = input()
p = i.index(0) + 1
print(p)

Fixed submission:
i = input().split(' ')
l_si_i = [int(s) for s in i]
p = l_si_i.index(0) + 1
print(p)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
print('Even' if num % 2 == 0 else 'Odd')

Fixed submission:
a, b = map(int, input().split())
print('Even' if a * b % 2 == 0 else 'Odd')
Buggy python submission (verdict: Runtime Error):
import numpy as np
x,n=map(int,input().split())
p=np.array(list(map(int,input().split())))
p_abs=sorted(list(map(lambda k:abs(k-x),p)))
#print(p_abs)

if(len(p_abs)==0 or p_abs[0]!=0):
    print(x)
else:
    i=1
    while(True):
        if(p_abs[2*i-1]!=i or p_abs[2*i]!=i):
            if(x-i not in p):
                print(x-i)
            else:
                print(x+i)
            break
        else:
            i+=1

Fixed submission:
import numpy as np
x,n=map(int,input().split())
p=np.array(list(map(int,input().split())))
p_abs=sorted(list(map(lambda k:abs(k-x),p)))
#print(p_abs)

if(len(p_abs)==0 or p_abs[0]!=0):
    print(x)
else:
    i=1
    while(True):
        if(2*i>=len(p)):
            if(x-i not in p):
                print(x-i)
            else:
                print(x+i)
            break
        elif(p_abs[2*i-1]!=i or p_abs[2*i]!=i):
            if(x-i not in p):
                print(x-i)
            else:
                print(x+i)
            break
        else:
            i+=1
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=sorted(list(map(int,input().split())))
is_a=[False for _ in range(n)]
ans=0

for i in range(n):
    if(not is_a[i]):
        ans+=1
        for j in range(i+1,n):
            if(not is_a[j] and a[j]%a[i]==0):
                is_a[j]=True

        if(i<n-1 and a[i]==a[i+1] and (i==0 or a[i]!=a[i-1])):
            ans-=1

print(ans)


Fixed submission:
import numpy as np
n=int(input())
a=sorted(list(map(int,input().split())))

dp=np.array([0 for _ in range(max(a)+1)])
for i in range(n):
    ai=a[i]
    if(dp[ai]>=2):
        continue

    j=1
    while(ai*j<=a[-1]):
        dp[ai*j]+=1
        j+=1

print(sum(dp[ai]==1 for ai in a))

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=sorted(list(map(int,input().split())))

ans_set=set(a)

i=0
while(i<len(a)):
    if(a[i] in ans_set):
        j=i+1
        while(j<len(a)):
            if(a[j] in ans_set and a[j]%a[i]==0):
                ans_set.remove(a[j])
                del a[j]
                j-=1
            j+=1
    i+=1
#print(ans_set)
print(len(ans_set))


Fixed submission:
import numpy as np
n=int(input())
a=sorted(list(map(int,input().split())))

dp=np.array([0 for _ in range(max(a)+1)])
for i in range(n):
    ai=a[i]
    if(dp[ai]>=2):
        continue

    j=1
    while(ai*j<=a[-1]):
        dp[ai*j]+=1
        j+=1

print(sum(dp[ai]==1 for ai in a))

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=sorted(list(map(int,input().split())))

ans_set=set(a)
for i in range(len(a)):
    if(a[i] not in ans_set):
        continue
    else:
        for j in range(i+1,len(a)):
            if(a[j] in ans_set and a[j]%a[i]==0):
                ans_set.remove(a[j])
#print(ans_set)
print(len(ans_set))


Fixed submission:
import numpy as np
n=int(input())
a=sorted(list(map(int,input().split())))

dp=np.array([0 for _ in range(max(a)+1)])
for i in range(n):
    ai=a[i]
    if(dp[ai]>=2):
        continue

    j=1
    while(ai*j<=a[-1]):
        dp[ai*j]+=1
        j+=1

print(sum(dp[ai]==1 for ai in a))
Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
INF=float("inf")

#始点,頂点の数,辺(頂点ごとの隣接行列)
def dijkstra(start,v,e):
    pre=[i for i in range(v)]
    x=set([i for i in range(v)])
    dist=[INF for _ in range(v)]

    dist[start]=0

    s=start
    while(len(x)>0):
        x.remove(s)

        min_x=-1
        min_dx=float("inf")
        for xi in x:
            if(dist[xi]>dist[s]+e[s][xi]):
                dist[xi]=dist[s]+e[s][xi]
                pre[xi]=s

            if(min_dx>dist[xi]):
                min_dx=dist[xi]
                min_x=xi

        s=min_x

    return pre

edge=[[INF for _ in range(n)] for _ in range(n)]
for i in range(m):
    a,b=map(int,input().split())
    edge[a-1][b-1]=1
    edge[b-1][a-1]=1

mark=dijkstra(0, n, edge)
#print(mark)
print('Yes')
for i in range(1,len(mark)):
    print(mark[i]+1)

Fixed submission:
from collections import deque
n,m=map(int,input().split())

q=deque([])

edge=[set([]) for _ in range(n+1)]
mark=[-1 for _ in range(n+1)]
used=[False for _ in range(n+1)]
for i in range(m):
    a,b=map(int,input().split())
    edge[a].add(b)
    edge[b].add(a)

q.append(1)
mark[1]=1
used[1]=True
while(len(q)>0):
    vi=q.popleft()
    ei=edge[vi]
    for eij in ei:
        if(used[eij]):
            continue
        else:
            mark[eij]=vi
            used[eij]=True
            q.append(eij)

print('Yes')
for i in range(2,len(mark)):
    print(mark[i])
Buggy python submission (verdict: Runtime Error):
import numpy as np
n,m,x=map(int,input().split())
MAX=9999999999

c=[]
a=[]
for i in range(n):
    ca=list(map(int,input().split()))
    c.append(ca[0])
    a.append(ca[1:])

c=np.array(c)
a=np.array(a)

pat=2**n
ans=MAX
for i in range(pat):
    pat_i=bin(i)[2:].zfill(3)
    ai=np.array([0 for _ in range(m)])
    ansi=0

    for j in range(len(pat_i)):
        if(pat_i[j]=='1'):
            ansi+=c[j]
            ai+=a[j]

    if(min(ai)>=x):
        ans=min(ans,ansi)

if(ans!=MAX):
    print(ans)
else:
    print(-1)

Fixed submission:
import numpy as np
n,m,x=map(int,input().split())
MAX=9999999999

c=[]
a=[]
for i in range(n):
    ca=list(map(int,input().split()))
    c.append(ca[0])
    a.append(ca[1:])

c=np.array(c)
a=np.array(a)

pat=2**n
ans=MAX
for i in range(pat):
    pat_i=bin(i)[2:].zfill(n)
    ai=np.array([0 for _ in range(m)])
    ansi=0

    for j in range(len(pat_i)):
        if(pat_i[j]=='1'):
            ansi+=c[j]
            ai+=a[j]

    if(min(ai)>=x):
        ans=min(ans,ansi)

if(ans!=MAX):
    print(ans)
else:
    print(-1)
Buggy python submission (verdict: Runtime Error):
x=int(input())

b=0
while(True):
    bi=b**5
    ai=x+bi
    aj=int(ai**(1/5))
#    print(ai,aj,bi,b)
    if((aj**5)==ai):
        print(aj,b)
        break
    b*=-1

    bi=b**5
    ai=x+bi
    aj=int(ai**(1/5))
#    print(ai,aj,bi,b)
    if((aj**5)==ai):
        print(aj,b)
        break
    b*=-1

    b+=1


Fixed submission:
x=int(input())

b=0
while(True):
    bi=b**5
    ai=x+bi
#    print(ai,bi,(ai**(1/5))%1.0)
    #X-B^5 は整数を５乗した数か判定
    if(int((ai**(1/5))%1.0) == 0):

        aj=int((ai**(1/5))//1)
#        print(ai,aj,bi,b)
        if((aj**5)==ai):
            print(aj,b)
            break
    b*=-1

    bi=b**5
    ai=x+bi

    if(ai>=0 and int((ai**(1/5))%1.0) == 0):
        aj=int((ai**(1/5))//1)
#        print(ai,aj,bi,b)
        if((aj**5)==ai):
            print(aj,b)
            break
    b*=-1

    b+=1