Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
def xor_operate(a_list):
    result = 0
    for a in a_list:
        result ^= int(a)
    return str(result)



if __name__ == "__main__":
    N = input()
    a_list = input()

    a_list = a_list.split(" ")

    i_list = []
    for i in range(len(a_list)):
        r_list = a_list[:i]+a_list[i+1:]
        i_list.append(xor_operate(r_list))
    print(" ".join(i_list))
    


        



Fixed submission:
def xor_operate(a_list):
    result = 0
    for a in a_list:
        result ^= int(a)
    return result



if __name__ == "__main__":
    N = input()
    a_list = input()

    a_list = a_list.split(" ")

    bit_value = xor_operate(a_list)

    i_list = []
    for a in a_list:
        i_list.append(str(bit_value ^ int(a)))
    print(" ".join(i_list))

Buggy python submission (verdict: Runtime Error):
def xor_operate(a_list):
    result = 0
    for a in a_list:
        result ^= int(a)
    return str(result)



if __name__ == "__main__":
    N = input()
    a_list = input()

    a_list = a_list.split(" ")

    i_list = []
    for i in range(len(a_list)):
        r_list = a_list[:i]+a_list[i+1:]
        i_list.append(xor_operate(r_list))
    return " ".join(i_list)
    


        



Fixed submission:
def xor_operate(a_list):
    result = 0
    for a in a_list:
        result ^= int(a)
    return result



if __name__ == "__main__":
    N = input()
    a_list = input()

    a_list = a_list.split(" ")

    bit_value = xor_operate(a_list)

    i_list = []
    for a in a_list:
        i_list.append(str(bit_value ^ int(a)))
    print(" ".join(i_list))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
result = 1
for i in range(N):
	result = result*A[i]

if result>10**18:
	result = -1
print(result)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
result = 1
if 0 in A:
	result = 0
else:
	for i in range(N):
		result = result*A[i]

		if result>10**18:
			result = -1
			break
print(result)
Buggy python submission (verdict: Runtime Error):
import math
R = input()
a = 2*R*math.pi
print(round(a,3))

Fixed submission:
import math
R = int(input())
a = 2*math.pi*R
print(a)

Buggy python submission (verdict: Runtime Error):
import math
R = input()
a = 2*R*math.pi
print(round(a,3))

Fixed submission:
import math
R = int(input())
a = 2*math.pi*R
print(a)

Buggy python submission (verdict: Runtime Error):
import math
R = input()
a = 2*R*math.pi
print(a)

Fixed submission:
import math
R = int(input())
a = 2*math.pi*R
print(a)

Buggy python submission (verdict: Runtime Error):
import math
R = input 
return 2*R*math.pi

Fixed submission:
import math
R = int(input())
a = 2*math.pi*R
print(a)

Buggy python submission (verdict: Runtime Error):
import math
R = input()
return 2*math.pi

Fixed submission:
import math
R = int(input())
a = 2*math.pi*R
print(a)
Buggy python submission (verdict: Runtime Error):
N,M = input().split()
A = list(map(int, input().split()))

S =sum(A)

if N-S >=0:
    print(N-S)
else: print("-1")

Fixed submission:
N,M = map(int, input().split()) 
A = list(map(int, input().split()))
S =sum(A)

if N-S >=0:
    print(N-S)
else: print("-1")

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

S =sum(A)

if S-N >=0:
  print(S-N)
else print(-1)

Fixed submission:
N,M = map(int, input().split()) 
A = list(map(int, input().split()))
S =sum(A)

if N-S >=0:
    print(N-S)
else: print("-1")
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
t = int(input())

x = (t+0.5)%a
return b*x

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

x =int((t+0.5)//a)*b

print(x)
Buggy python submission (verdict: Runtime Error):
s = input()
word = ''
for i in range(len(s)//2+1):
	word += s[2*i]
print(word)

Fixed submission:
s = input()
word = ''
for i in range((len(s)+1)//2):
	word += s[2*i]
print(word)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
p = 1
for i in range(1,N+1):
	p = p*i
print(p%(10**9+7))
	

Fixed submission:
N = int(input())
p = 1
for i in range(1,N+1):
	p = (p*i)%(10**9+7)
print(p%(10**9+7))
Buggy python submission (verdict: Runtime Error):
N = int(input())
T = list(map(int,input().split()))
M = int(input())
P = [0]*M
X = [0]*M
for i in range(M):
	P[i],X[i] = map(int,input().split())

for i in range(M):         
	print(sum(T)-T[i]+X[i]) 

Fixed submission:
N = int(input())
T = list(map(int,input().split()))
M = int(input())
P = [0]*M
X = [0]*M
for i in range(M):
	P[i],X[i] = map(int,input().split())

for i in range(M):         
	print(sum(T)-T[P[i]-1]+X[i])
Buggy python submission (verdict: Time Limit Exceeded):
a,b,x = map(int,input().split())
Cnt = 0
for i in range(a,b+1):
	if i%x==0:
		Cnt+=1
print(Cnt)


Fixed submission:
a,b,x = map(int,input().split())
result = b//x - a//x
if a%x == 0:
	result +=1
    
print(result)

Buggy python submission (verdict: Runtime Error):
import numpy as np
a,b,x = map(int,input().split())
Cnt = 0

A = np.array(range(a,b+1))
A = A%x
print(np.count_nonzero(A==0))

Fixed submission:
a,b,x = map(int,input().split())
result = b//x - a//x
if a%x == 0:
	result +=1
    
print(result)
Buggy python submission (verdict: Time Limit Exceeded):
N,x = map(int,input().split())
A = list(map(int,input().split()))
A_org = sum(A)
if A[0]>x:
	A[0]=x
for i in range(N-1):
	while A[i]+A[i+1]>x:
		A[i+1]-= 1

print(A_org-sum(A))

Fixed submission:
N,x = map(int,input().split())
A = list(map(int,input().split()))
A_org = sum(A)
if A[0]>x:
	A[0]=x
for i in range(N-1):
	if A[i]+A[i+1]>x:
		A[i+1] = x-A[i]

print(A_org-sum(A))
Buggy python submission (verdict: Runtime Error):
Cnd = list(map(int,input().split()))
Cnd = sorted(Cnd)
result = 'No'
if Cnd[0]=Cnd[1]+Cnd[2]:
	result ='Yes'
id Cnd[0]+Cnd[1]=Cnd[2]:
	result ='Yes'
print(result)

Fixed submission:
Cnd = list(map(int,input().split()))
Cnd = sorted(Cnd)
result = 'No'
if Cnd[0]==Cnd[1]+Cnd[2]:
	result ='Yes'
if Cnd[0]+Cnd[1]==Cnd[2]:
	result ='Yes'
print(result)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
T =[0]*N
A =[0]*N
Cnt=[1]*N
Cnt_pre =1
for i in range(N):
	T[i],A[i] = map(int,input().split())

for i in range(1,N):
	Cnt_pre = Cnt[i-1]
	while T[i]*Cnt[i]<T[i-1]*Cnt_pre:
		Cnt[i] += 1
	while A[i]*Cnt[i]<A[i-1]*Cnt_pre:
		Cnt[i] += 1
print(Cnt[N-1]*(T[N-1]+A[N-1])) 

Fixed submission:
N = int(input())
T =[0]*N
A =[0]*N
Cnt=[1]*N
Cnt_pre =1
for i in range(N):
	T[i],A[i] = map(int,input().split())

for i in range(1,N):
	Cnt_pre = Cnt[i-1]
	if T[i]<T[i-1]*Cnt_pre:
		if (T[i-1]*Cnt_pre)%T[i]==0:
			Cnt[i] = (T[i-1]*Cnt_pre)//T[i]
		else:Cnt[i]= (T[i-1]*Cnt_pre)//T[i] + 1
	if A[i]*Cnt[i]<A[i-1]*Cnt_pre:
		if (A[i-1]*Cnt_pre)%A[i]==0:
			Cnt[i]=(A[i-1]*Cnt_pre)//A[i]
		else:Cnt[i]=(A[i-1]*Cnt_pre)//A[i]+1
print(Cnt[N-1]*(T[N-1]+A[N-1]))
Buggy python submission (verdict: Runtime Error):
print(int(a+a^2+a^3))

Fixed submission:
a = int(input())
print(int(a + a**2 + a**3))
Buggy python submission (verdict: Runtime Error):
n=int(input())
A=list(map(int,input().split()))
q=int(input())
BC=[list(map(int,input().split())) for i in range(q)]
Alist=[0]*(10**5)
ans=[]

for a in A:
    Alist[a]+=1

sum=0
for i in range(1,len(Alist)):
    sum+=i*Alist[i]

for bc in BC:
    sum=sum-bc[0]*Alist[bc[0]]+bc[1]*Alist[bc[0]]
    Alist[bc[1]]+=Alist[bc[0]]
    Alist[bc[0]]=0
    ans.append(sum)
ans='\n'.join(map(str,ans))
print(ans)

Fixed submission:
n=int(input())
A=list(map(int,input().split()))
q=int(input())
BC=[list(map(int,input().split())) for i in range(q)]
Alist=[0]*(10**5+1)
ans=[]

for a in A:
    Alist[a]+=1

sum=0
for i in range(1,len(Alist)):
    sum+=i*Alist[i]

for bc in BC:
    sum=sum-bc[0]*Alist[bc[0]]+bc[1]*Alist[bc[0]]
    Alist[bc[1]]+=Alist[bc[0]]
    Alist[bc[0]]=0
    ans.append(sum)
ans='\n'.join(map(str,ans))
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
A=list(map(int,input().split()))
ans=[]
for i in range(n):
    l=A[:i]+A[i+1:]
    sum=0
    for a in l:
        sum=sum^a
    ans.append(sum)
ans=' '.join(map(str,ans))
print(ans)

Fixed submission:
n=int(input())
A=list(map(int,input().split()))
ans=[]
sum=0
for a in A:
    sum=sum^a
for a in A:
    ans.append(sum^a)
ans=' '.join(map(str,ans))
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
A=list(map(int,input().split()))
ans=[]
for i in range(n):
    l=A[:i]+A[i+1:]
    sum=0
    for a in l:
        sum=sum^a
    ans.append(sum)
ans=' '.join(map(str,ans))
print(ans)

Fixed submission:
n=int(input())
A=list(map(int,input().split()))
ans=[]
sum=0
for a in A:
    sum=sum^a
for a in A:
    ans.append(sum^a)
ans=' '.join(map(str,ans))
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
A_list = list(map(int, input().split()))

ans=1
for a in A_list:
    ans=ans*a
if ans>10**18:
    ans=-1
print(ans)

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

ans=1
if 0 in A_list:
    ans=0
else:
    for a in A_list:
        ans=ans*a
        if ans>10**18:
            ans=-1
            break
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,a,b=map(int,input().split())
ans=0
while n>0:
    if n-a<0:
        ans=ans+n
        break
    n=n-a
    ans=ans+a
    n=n-b
print(ans)

Fixed submission:
n,a,b=map(int,input().split())
if n<a:
    print(n)
    exit()
katamari=max(n//(a+b),1)
if n>a+b:
    amari=min(n%(a+b),a)
else:
    amari=0
print(a*katamari+amari)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
Alist=[0]+[int(input()) for i in range(n)]

now=1
Hist=[1]

for i in range(n):
    now=Alist[now]
    if now==2:
        print(i+1)
        break
    if now in Hist:
        print(-1)
        break
    Hist.append(now)

Fixed submission:
n=int(input())
Alist=[0]+[int(input()) for i in range(n)]

now=1
count=0

for _ in range(n):
    now=Alist[now]
    count+=1
    if now==2:
        print(count)
        exit()
print(-1)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
Alist=[0]+[int(input()) for i in range(n)]

now=1
count=0
Hist=[1]

while now!=2:
    now=Alist[now]
    count+=1
    if now in Hist:
        count=-1
        break
    Hist.append(now)
print(count)

Fixed submission:
n=int(input())
Alist=[0]+[int(input()) for i in range(n)]

now=1
count=0

for _ in range(n):
    now=Alist[now]
    count+=1
    if now==2:
        print(count)
        exit()
print(-1)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
Alist=[0]+[int(input()) for i in range(n)]

now=1
count=0
Hist=[]

while now!=2:
    now=Alist[now]
    count+=1
    if now in Hist:
        count=-1
        break
    Hist.append(now)
print(count)

Fixed submission:
n=int(input())
Alist=[0]+[int(input()) for i in range(n)]

now=1
count=0

for _ in range(n):
    now=Alist[now]
    count+=1
    if now==2:
        print(count)
        exit()
print(-1)
Buggy python submission (verdict: Time Limit Exceeded):
k,s=map(int,input().split())
ans=0

for x in range(k+1):
    for y in range(k+1):
        for z in range(k+1):
            if x+y+z==s:
                ans+=1
print(ans)

Fixed submission:
k,s=map(int,input().split())
ans=0

for x in range(k+1):
    for y in range(k+1):
       if 0<=s-(x+y)<=k:
           ans+=1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
k,s=map(int,input().split())
ans=0

for x in range(k+1):
    for y in range(k+1):
        for z in range(k+1):
            if x+y+z==s:
                ans+=1
print(ans)

Fixed submission:
k,s=map(int,input().split())
ans=0

for x in range(k+1):
    for y in range(k+1):
       if 0<=s-(x+y)<=k:
           ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
k=int(input())
s=list(input())
if(len(s)<=k):
  for i in range(len(s)):
    print(s[i],end="")
else:
  for j in range(k):
    print(s[j],end="")
  print("...")

Fixed submission:
h=[2,4,5,7,9]
p=[0,1,6,8]
a=list(map(int,input()))
t=len(a)
if(a[t-1] in h):
  print("hon")
elif(a[t-1] in p):
  print("pon")
else:
  if(a[t-1]==3):
    print("bon")
Buggy python submission (verdict: Runtime Error):
N = input()
A = input()
 
if A >= (N % 500):
  print("Yes")
else:
  print("No")

Fixed submission:
N = int(input())
A = int(input())
 
if  A >= (N%500):
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
N = input()
A = input()
 
if (N-A) % 500 == 0:
  print("Yes")

else:
  print("No")


Fixed submission:
N = int(input())
A = int(input())
 
if  A >= (N%500):
  print("Yes")
else:
  print("No")

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

if (N-A) % 500 ==0{
  print("Yes")
}
else{
  print("No")
}

Fixed submission:
N = int(input())
A = int(input())
 
if  A >= (N%500):
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
import sys
K=int(input())
A,B=map(int,input().split())
for i in range(A,B):
  if i%K==0:
    print("OK")
    sys.sxit()
print("NG")

Fixed submission:
import sys
K=int(input())
A,B=map(int,input().split())
for i in range(A,B+1):
  if i%K==0:
    print("OK")
    sys.exit()
print("NG")
Buggy python submission (verdict: Runtime Error):
import math
A=int(input())
c=0
d=100
while(1):
  d=math.floor(d*1.01)
  c+=1
  if d>A:
    print(c)

Fixed submission:
import math
A=int(input())
c=0
d=100
while(1):
  d=math.floor(d*1.01)
  c+=1
  if d>=A:
    print(c)
    break
Buggy python submission (verdict: Runtime Error):
n,k=int(input())
list=list(map(int,input().split()))
list.sort()
ans=0
for i in range(k):
  ans+=list[i]
print(ans)

Fixed submission:
n,k=map(int,input().split())
list=list(map(int,input().split()))
list.sort()
ans=0
for i in range(k):
  ans+=list[i]
print(ans)
Buggy python submission (verdict: Runtime Error):
import math

a=int(input())
b=int(input())
h=int(input())
m=int(input())
t=360*h+m/60-30*h-m/720
ans2=a**2+b**2-math.cos(math.radians(t))

Fixed submission:
import math

a,b,h,m=map(int,input().split())
t=360*h+m*6-30*h-m/2
ans2=a**2+b**2-2*a*b*math.cos(math.radians(t))
print(math.sqrt(ans2))
Buggy python submission (verdict: Runtime Error):
a,b,n=map(int,input().split())
x=[]
x.append(int(a*n/b)
if n>=b:
  x.append(int(a*(b-1)/b)
print(max(x))

Fixed submission:
a,b,n=map(int,input().split())
x=[]
if n>=b:
  x.append(int(a*(b-1)/b))
else:
  x.append(int(a*n/b))
print(max(x))

Buggy python submission (verdict: Time Limit Exceeded):
a,b,n=map(int,input().split())
x=[]
for i in range(n+1):
  x.append(int(a*i/b)-a*int(i/b))
print(max(x))

Fixed submission:
a,b,n=map(int,input().split())
x=[]
if n>=b:
  x.append(int(a*(b-1)/b))
else:
  x.append(int(a*n/b))
print(max(x))
Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
flag="F"
while flag="F":
  c=c-b
  if c<=0:
    print("Yes")
    break
  a=a-d
  if a<=0:
    print("No")
    break

Fixed submission:
a,b,c,d=map(int,input().split())
flag="F"
while flag=="F":
  c=c-b
  if c<=0:
    flag="Y"
  else:
    a=a-d
    if a<=0:
      flag="N"
if flag=="Y":
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
s=input()
n=len(s)
t=0
for i in range(n):
  if s[i]==p:
    t+=1
print(int(n/2)-t)

Fixed submission:
s=input()
n=len(s)
t=0
for i in range(n):
  if s[i]=="p":
    t+=1
print(int(n/2)-t)
Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
h=int(inupt())
print((a+b)*h/2)

Fixed submission:
a=int(input())
b=int(input())
h=int(input())
print(int((a+b)*h/2))
Buggy python submission (verdict: Runtime Error):
A=input()
B=input()
C=input()
t=[0,0,0]
flag="a"
while True:
  if flag=="a":
    if len(A)==t[0]+1:
      print("A")
      break
    else:
      flag=A[t[0]]
      t[0]+=1
  elif flag=="b":
    if len(B)==t[1]+1:
      print("B")
      break
    else:
      flag=B[t[1]]
      t[1]+=1
  elif flag=="c":
    if len(C)==0:
      print("C")
      break
    else:
      flag=C[t[2]]
      t[2]+=1


Fixed submission:
A=input()
B=input()
C=input()
t=[0,0,0]
flag="a"
while True:
  if flag=="a":
    if len(A)==t[0]:
      print("A")
      break
    else:
      flag=A[t[0]]
      t[0]+=1
  elif flag=="b":
    if len(B)==t[1]:
      print("B")
      break
    else:
      flag=B[t[1]]
      t[1]+=1
  elif flag=="c":
    if len(C)==t[2]:
      print("C")
      break
    else:
      flag=C[t[2]]
      t[2]+=1

Buggy python submission (verdict: Runtime Error):
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
flag="a"
while True:
  if flag=="a":
    if len(A)==0:
      print("A")
      break
    else:
      flag=A.pop(0)
  elif flag=="b":
    if len(B)==0:
      print("B")
      break
    else:
      flag=B.pop(0)
  elif flag=="c":
    if len(C)==0:
      print("C")
      break
    else:
      flag=C.pop(0)

Fixed submission:
A=input()
B=input()
C=input()
t=[0,0,0]
flag="a"
while True:
  if flag=="a":
    if len(A)==t[0]:
      print("A")
      break
    else:
      flag=A[t[0]]
      t[0]+=1
  elif flag=="b":
    if len(B)==t[1]:
      print("B")
      break
    else:
      flag=B[t[1]]
      t[1]+=1
  elif flag=="c":
    if len(C)==t[2]:
      print("C")
      break
    else:
      flag=C[t[2]]
      t[2]+=1
Buggy python submission (verdict: Runtime Error):
a=input()
ans=""
while len(a)>0:
  if a[0]=="0":
    ans+="0"
  elif a[0]=="1":
    ans+="1"
  elif len(ans)>0:
    ans=ans[,-1]
print(ans)

Fixed submission:
a=input()
ans=""
while len(a)>0:
  if a[0]=="0":
    ans+="0"
  elif a[0]=="1":
    ans+="1"
  elif len(ans)>0:
    ans=ans[:-1]
  a=a[1:]
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=input()
b=[]
for i in range(n):
  b.append(int(a[i*2]))
ave=sum(b)/n
if ave<int(ave)+0.5:
  ave=int(ave)
else:
  ave=int(ave)+1
ans=0
for i in range(n):
  ans+=(b[i]-ave)**2
print(ans)

Fixed submission:
n=int(input())
a=[]
a=list(map(int,input().split()))
ave=sum(a)/n
if ave<int(ave)+0.5:
  ave=int(ave)
else:
  ave=int(ave)+1
ans=0
for i in range(n):
  ans+=(a[i]-ave)**2
print(ans)

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=input()
b=[]
for i in range(n):
  b.append(a[i*2])
ave=sum(b)/n
if ave<int(ave)+0.5:
  ave=int(ave)
else:
  ave=int(ave)+1
ans=0
for i in range(n):
  ans+=(b[i]-ave)**2
print(ans)

Fixed submission:
n=int(input())
a=[]
a=list(map(int,input().split()))
ave=sum(a)/n
if ave<int(ave)+0.5:
  ave=int(ave)
else:
  ave=int(ave)+1
ans=0
for i in range(n):
  ans+=(a[i]-ave)**2
print(ans)
Buggy python submission (verdict: Runtime Error):
a=input()
t=-1
flag="False"
for i in range(n-1):
  if a[i]==a[i+1]:
    flag="True1"
    t=i
    break
  if i!=n-2:
    if a[i]==a[i+2]:
      flag="True2"
      t=i
      break
if flag=="False":
  print("{} {}".format(-1,-1))
elif flag=="True1":
  print("{} {}".format(t+1,t+2))
else flag=="True2":
  print("{} {}".format(t+1,t+2))

Fixed submission:
a=input()
t=-1
flag="False"
for i in range(len(a)-1):
  if a[i]==a[i+1]:
    flag="True1"
    t=i
    break
  if i!=len(a)-2:
    if a[i]==a[i+2]:
      flag="True2"
      t=i
      break
if flag=="False":
  print("{} {}".format(-1,-1))
elif flag=="True1":
  print("{} {}".format(t+1,t+2))
else:
  print("{} {}".format(t+1,t+3))

Buggy python submission (verdict: Runtime Error):
a=input()
t=-1
flag="False"
for i in range(n-1):
  if a[i]==a[i+1]:
    flag="True1"
    t=i
    break
  if i!=n-2 and a[i]==a[i+2]:
    flag="True2"
    t=i
    break
if flag=="False":
  print("{} {}".format(-1,-1))
elif flag=="True1":
  print("{} {}".format(t+1,t+2))
else flag=="True2":
  print("{} {}".format(t+1,t+2))

Fixed submission:
a=input()
t=-1
flag="False"
for i in range(len(a)-1):
  if a[i]==a[i+1]:
    flag="True1"
    t=i
    break
  if i!=len(a)-2:
    if a[i]==a[i+2]:
      flag="True2"
      t=i
      break
if flag=="False":
  print("{} {}".format(-1,-1))
elif flag=="True1":
  print("{} {}".format(t+1,t+2))
else:
  print("{} {}".format(t+1,t+3))
Buggy python submission (verdict: Runtime Error):
a,n=map(int,input())
b=[]
for i in range(n):
  b.append(int(input())
flag="F"
which flag=="F":
  k=a
  fflag="T"
  which k>=1 and fflag=="T":
    l=int(k%10)
    for i in range(n):
      if a[i]==l:
        fflag="F"
    break
  if fflag=="T":
    flag="T"
  else:
    a+=1
print(a)

Fixed submission:
a,n=map(int,input().split())
b=input()
c=[]
for i in range(n):
  c.append(int(b[2*i]))
flag="F"
while flag=="F":
  k=a
  fflag="T"
  while k>=1:
    l=int(k%10)
    for i in range(n):
      if c[i]==l:
        fflag="F"
        break
    k=int(k/10)
    if fflag=="F":
      break
  if fflag=="T":
    flag="T"
  else:
    a+=1
print(a)
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3

from typing import Iterable


def main() -> None:
    N, K = rmi()
    D, A = [], []
    for n in range(N):
        d = ri()
        D.append(d)
        A.append(rmi())
    target = [False] * N
    for k in range(K):
        for a in A[k]:
            target[a] = True
    w(target.count(False))


def r() -> str:
    return input().strip()


def ri() -> int:
    return int(input())


def rmi(delim: str = ' ') -> int:
    return tuple(map(int, input().split(delim)))


def w(data) -> None:
    print(data)


def wm(data: Iterable) -> None:
    print(' '.join(data))


if __name__ == '__main__':
    main()


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

from typing import Iterable


def main() -> None:
    N, K = rmi()
    D, A = [], []
    for k in range(K):
        d = ri()
        D.append(d)
        A.append(rmi())
    target = [False] * N
    for k in range(K):
        for a in A[k]:
            target[a - 1] = True
    w(target.count(False))


def r() -> str:
    return input().strip()


def ri() -> int:
    return int(r())


def rmi(delim: str = ' ') -> int:
    return tuple(map(int, input().split(delim)))


def w(data) -> None:
    print(data)


def wm(data: Iterable) -> None:
    print(' '.join(data))


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


def main() -> None:
    H, W = rmi()
    s = []
    for h in range(H):
        line = list(map(lambda c: c == '.', list(r())))
        s.append(line)
    dp = []
    for _ in range(H):
        dp.append([-1] * W)
    dp[0][0] = 0 if s[0][0] else 1
    for h in range(1, H):
        dp[h][0] = dp[h - 1][0] if s[h][0] else dp[h - 1][0] + 1
    for w in range(1, W):
        dp[0][w] = dp[0][w - 1] if s[0][w] else dp[0][w - 1] + 1
    for h in range(1, H):
        for w in range(1, W):
            minimum = min(dp[h - 1][w], dp[h][w - 1])
            dp[h][w] = minimum if s[h][w] else minimum + 1
    print(dp[H][W])


def r() -> str:
    return input().strip()


def ri() -> int:
    return int(r())


def rmi(delim: str = ' ') -> tuple:
    return tuple(map(int, input().split(delim)))


def w(data) -> None:
    print(data)


def wm(*data, delim: str = ' ') -> None:
    print(delim.join(map(str, data)))


if __name__ == '__main__':
    import sys
    sys.setrecursionlimit(10 ** 9)
    main()


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


def main() -> None:
    H, W = rmi()
    s = []
    for h in range(H):
        line = list(map(lambda c: c == '.', list(r())))
        s.append(line)
    dp = []
    for _ in range(H):
        dp.append([H + W + 1] * W)
    dp[0][0] = 0 if s[0][0] else 1
    for h in range(1, H):
        dp[h][0] = dp[h - 1][0] + int(s[h - 1][0] != s[h][0] and not s[h][0])
    for w in range(1, W):
        dp[0][w] = dp[0][w - 1] + int(s[0][w - 1] != s[0][w] and not s[0][w])
    for h in range(1, H):
        for w in range(1, W):
            dp[h][w] = min(dp[h - 1][w] + int(s[h - 1][w] != s[h][w] and not s[h][w]),
                           dp[h][w - 1] + int(s[h][w - 1] != s[h][w] and not s[h][w]))
    print(dp[H - 1][W - 1])


def r() -> str:
    return input().strip()


def ri() -> int:
    return int(r())


def rmi(delim: str = ' ') -> tuple:
    return tuple(map(int, input().split(delim)))


def w(data) -> None:
    print(data)


def wm(*data, delim: str = ' ') -> None:
    print(delim.join(map(str, data)))


if __name__ == '__main__':
    import sys
    sys.setrecursionlimit(10 ** 9)
    main()