Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N,D=map(int,input().split())
cnt=0
for idx in range(N):
  X,Y=map(int,input().split())
  if X**2+Y**2<=D**2:
    cnt=cnt+1
print(cnt)


Fixed submission:
X = int(input())
if X >= 30:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
import numpy as np
L=np.array(map(int,input()))
N=L(0,0)
D=L(0,1)
cnt=0
for idx in range(1,N):
  if L(idx,0)**2+L(idx,1)**2<=D**2:
    cnt=cnt+1
print(cnt)
  

Fixed submission:
N,D=map(int,input().split())
cnt=0
for idx in range(N):
  X,Y=map(int,input().split())
  if X**2+Y**2<=D**2:
    cnt=cnt+1
print(cnt)
Buggy python submission (verdict: Runtime Error):
N,K=map(int,input().split())
p = list(map(int,input().split()))
p=p.sort()
price=0
for idx in range(K):
  price=price+p[idx]
print(price)

Fixed submission:
N,K=map(int,input().split())
p=list(map(int, input().split()))
p.sort()

price=0
for idx in range(K):
    price=price+p[idx]
print(price)
Buggy python submission (verdict: Runtime Error):
x = int(input())
x = list(x)

for idx in range(len(x)):
  if x[idx] == 0:
    print(idx + 1)
    break

Fixed submission:
x1, x2, x3, x4, x5 = map(int, input().split())

if x1 == 0:
  print(1)
elif x2 == 0:
  print(2)
elif x3 == 0:
  print(3)
elif x4 == 0:
  print(4)
else:
  print(5)

Buggy python submission (verdict: Runtime Error):
x = int(input())

x = tuple(x)

for idx in range(5):
  if x[idx] == 0:
    print(idx + 1)
    break

Fixed submission:
x1, x2, x3, x4, x5 = map(int, input().split())

if x1 == 0:
  print(1)
elif x2 == 0:
  print(2)
elif x3 == 0:
  print(3)
elif x4 == 0:
  print(4)
else:
  print(5)
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input())

print(A*B

Fixed submission:
A,B = map(int, input().split())
print(A*B)
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
X=1
if 0 in A:
  print(0)
  break

else:
  for idx in range(N):
  	X=X*A[idx]
  	if X >1*10**18:
   		print(-1)
    	break
	else:
  	print(X)


Fixed submission:
N=int(input())
A=list(map(int,input().split()))
X=1
if 0 in A:
    print(0)
else:
    for idx in range(N):
        X=X*A[idx]
        if X >10**18:
            print(-1)
            break
    else:
        print(X)

Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
X=1
if 0 in A:
  print(0)
  return

for idx in range(N):
  X=X*A[idx]
  if X >1*10**18:
    print(-1)
    return

print(X)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
X=1
if 0 in A:
    print(0)
else:
    for idx in range(N):
        X=X*A[idx]
        if X >10**18:
            print(-1)
            break
    else:
        print(X)

Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
X=1
for idx in range(N):
  X=X*A[idx]

if X >10**18:
  print(-1)
  break
else:
  print(X)


Fixed submission:
N=int(input())
A=list(map(int,input().split()))
X=1
if 0 in A:
    print(0)
else:
    for idx in range(N):
        X=X*A[idx]
        if X >10**18:
            print(-1)
            break
    else:
        print(X)
Buggy python submission (verdict: Runtime Error):
K=int(input())
S=input()
if len(S)<=len(K):
  print(S)
else:
  print(S[0:len(K)])

Fixed submission:
K=int(input())
S=input()
if len(S)<=K:
  print(S)
else:
  print(S[0:K]+'...')
Buggy python submission (verdict: Runtime Error):
N,K=map(int,input().split())
A=[]
people=list(range(1,N+1,1))
for idx in range(K):
    d=int(input())
    X=list((map(int,input().split())))
    for i in range(len(X)):
        A.append(X[i])
ans =[i for i in people if not i in A]
print(ans[0])

Fixed submission:
N,K=map(int,input().split())
A=[]
people=list(range(1,N+1,1))
for idx in range(K):
    d=int(input())
    X=list((map(int,input().split())))
    for i in range(len(X)):
        A.append(X[i])
ans =[i for i in people if not i in A]
print(len(ans))
Buggy python submission (verdict: Runtime Error):
K = int(input())
A,B = map(int, input().split())

if A%K==0 or B%K==0 or ABS(B-A)>=K:
  print('OK')
else:
  print('NG')


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

for num in range(A, B+1, 1):
  if num % K == 0:
    print('OK')
    break
else:
  print('NG')

Buggy python submission (verdict: Runtime Error):
K = int(input())
A,B = map(int, input())

if A%K==0 or B%K==0 or ABS(B-A)>=K:
  print('OK')
else:
  print('NG')

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

for num in range(A, B+1, 1):
  if num % K == 0:
    print('OK')
    break
else:
  print('NG')
Buggy python submission (verdict: Runtime Error):
import numpy as np
R=int(input())
circle=float(R*2*np.pi))
print(circle)

Fixed submission:
import numpy as np
R=int(input())
circle=float(R*2*np.pi)
print(circle)
Buggy python submission (verdict: Runtime Error):
N=input()
for idx in len(N):
  if N[idx] == str(7):
    print('Yes')
    break
else:
  print('No')


Fixed submission:
N=input()
for idx in range(len(N)):
  if N[idx] == str(7):
    print('Yes')
    break
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
N=input()
for idx in len(N):
  if N[idx] == 7:
    print('Yes')
    break
else:
  print('No')

Fixed submission:
N=input()
for idx in range(len(N)):
  if N[idx] == str(7):
    print('Yes')
    break
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
A,B,C=X,Y,Z=map(int,input().split())

A = Y
B = X
A = Z
C = X

print(str(A)+' '+str(B)+' '+str(C))

Fixed submission:
X,Y,Z=map(int,input().split())
A,B,C=X,Y,Z
 
A = Y
B = X
A = Z
C = Y
 
print(str(A)+' '+str(B)+' '+str(C))
Buggy python submission (verdict: Runtime Error):
import numpy as np

A1=np.array(list(map(int,input().split())))
A2=np.array(list(map(int,input().split())))
A3=np.array(list(map(int,input().split())))
A=np.concatenate([A1,A2,A3]).reshape(3,3)

N=int(input())

for i in range(N):
    b=int(input())
    A[np.where(A==b)] = 0

if np.all(A[0,:]==0) or np.all(A[1,:]==0) or np.all(A[2,:]==0) or np.all(A[:,0]==0) or np.all(A[:,1]==0) 
\or np.all(A[:,2]==0) or A[0,0]**2+A[1,1]**2+A[2,2]**2==0:
    print('Yes')
else:
    print('No')

Fixed submission:
import numpy as np

A1=np.array(list(map(int,input().split())))
A2=np.array(list(map(int,input().split())))
A3=np.array(list(map(int,input().split())))
A=np.concatenate([A1,A2,A3]).reshape(3,3)

N=int(input())

for i in range(N):
    b=int(input())
    A[np.where(A==b)] = 0

if np.all(A[0,:]==0) or np.all(A[1,:]==0) or np.all(A[2,:]==0) or np.all(A[:,0]==0) or np.all(A[:,1]==0) \
    or np.all(A[:,2]==0) or A[0,0]**2+A[1,1]**2+A[2,2]**2==0 or A[0,2]**2+A[1,1]**2+A[2,0]**2==0:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
alphabet = [a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,\
            t,u,v,w,x,y,z]
C=input()
idx=alphabet.index(C)
print(alphabet[idx+1])

Fixed submission:
C=input()
al=[]
for idx in range(97,123):
  al.append(chr(idx))
idx = al.index(C)
print(al[idx+1])
Buggy python submission (verdict: Runtime Error):
A,B=map(int,input().split())
x = [A,B]
A = [1,2,3]
for idx in range(len(A)):
  if (A[idx] in x )== False:
    print(A[idx])
    break
 


Fixed submission:
A = int(input())
B = int(input())
print(6-A-B)

Buggy python submission (verdict: Runtime Error):
A,B=map(int,input().split())
x = [A,B]
A = [1,2,3]
for idx in range(len(A)):
  if A[idx] in x == False:
    print(A[idx])
    break
 

Fixed submission:
A = int(input())
B = int(input())
print(6-A-B)

Buggy python submission (verdict: Runtime Error):
A,B=map(int,input().split())
x = [A,B]
A = [1,2,3]
print(A[x in A == False])

Fixed submission:
A = int(input())
B = int(input())
print(6-A-B)

Buggy python submission (verdict: Runtime Error):
A,B=map(int,input().split())
x=[1,2,3]
print(x[x!=A and x!=B])

Fixed submission:
A = int(input())
B = int(input())
print(6-A-B)

Buggy python submission (verdict: Runtime Error):
A,B=map(int,input().split())
x=[1,2,3]
print(x(x!=A and x!=B))

Fixed submission:
A = int(input())
B = int(input())
print(6-A-B)

Buggy python submission (verdict: Runtime Error):
A,B=map(int,input().split())
print(6-A-B)


Fixed submission:
A = int(input())
B = int(input())
print(6-A-B)

Buggy python submission (verdict: Runtime Error):
A,B=map(int,input().split())
print(6-A-B)


Fixed submission:
A = int(input())
B = int(input())
print(6-A-B)

Buggy python submission (verdict: Runtime Error):
A,B=map(int,input().split())
pritn(6-A-B)

Fixed submission:
A = int(input())
B = int(input())
print(6-A-B)
Buggy python submission (verdict: Runtime Error):
A,B=map(int,input().split())

if 1<=A,B<=9:
  print(A*B)
else:
  print(-1)

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

if 1<=A<=9 and 1<=B<=9:
  print(A*B)
else:
  print(-1)
Buggy python submission (verdict: Runtime Error):
S=input()
weather=['Sunny','Cloudy','Rainy','Sunny']
print(weather[weather.index(S)+1)

Fixed submission:
S=input()
weather=['Sunny','Cloudy','Rainy','Sunny']
print(weather[weather.index(S)+1])
Buggy python submission (verdict: Runtime Error):
s = input()

if 'RRR' in s:
    ans = 3
elif 'RR' in s:
    ans = 2
elif 'R' in s:
    ans = 1
print(ans)

Fixed submission:
s = input()
ans = 0
if 'RRR' in s:
    ans = 3
elif 'RR' in s:
    ans = 2
elif 'R' in s:
    ans = 1
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
print(a*b)

Fixed submission:
str = input()
if str.islower():
    print('a')
else:
    print('A')
Buggy python submission (verdict: Runtime Error):
input()
a = list(map(int,input().split()))
ans = 1
for n in a:
    ans *= n
    if ans <= 10**18:
        print(ans)
        break:
print(-1)

Fixed submission:
a,b = map(int,input().split())
print(a*b)
Buggy python submission (verdict: Runtime Error):
input()
a = list(map(int,input().split()))
ans = 1
for n in a:
    ans *= n
    if ans <= 10**18:
        print(ans)
    break:
print(-1)

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

if 0 in a:
    print(0)
    exit()

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

Buggy python submission (verdict: Time Limit Exceeded):
input()
a = list(map(int,input().split()))
ans = 1
for n in a:
    ans *= n
if ans <= 10**18:
    print(ans)
else:
    print(-1)

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

if 0 in a:
    print(0)
    exit()

ans = 1
for n in a:
    ans*=n
    
    if ans > 10**18:
        ans = -1
        break
    
print(ans)
Buggy python submission (verdict: Runtime Error):
s,t = input().split()
o = t[:-1]
if ( o == s ):
    print('Yes')
else:
    print('No')

Fixed submission:
s = input()
t = input()
o = t[:-1]
if ( o == s ):
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
n = int(input())
l = []
for i in range(n):
  l.append(list(map(int,input().split())))
m = []
for i in l:
  a,b = i
  k.append(a+b)
  m.append(a-b)
k.sort()
m.sort()
print(max([k[-1]-k[0],m[-1] -m[0]]))

Fixed submission:
n = int(input())
l = []
for i in range(n):
  l.append(list(map(int,input().split())))

k = []
m = []
for i in l:
  a,b = i
  k.append(a+b)
  m.append(a-b)
k.sort()
m.sort()
print(max([k[-1]-k[0],m[-1] -m[0]]))
Buggy python submission (verdict: Runtime Error):
s = input()
for i in range(len(s)):
  if s[i] == "?":
    s[i] = "D"
print(s)

Fixed submission:
s = input()
j = ""
for i in range(len(s)):
  if s[i] == "?":
    j = j + "D"
  else:
    j = j + s[i]
print(j)
Buggy python submission (verdict: Time Limit Exceeded):
num = 0
s = input()
k = int(input())
pre = ""
out = ""
for _ in range(k):
  inp = input()
  if inp[0] == "1":
    num += 1
    num %= 2
  else:
    if (inp[2] == "1" and num == 0) or (inp[2] == "2" and num == 1):
      pre = pre + inp[4]
    else:
      out = out + inp[4]
if num:
      print(out[::-1] + s[::-1] + pre)
else:
  print(pre[::-1] + s + out)

Fixed submission:
num = 0
s = input()
k = int(input())
pre = ""
out = ""
for _ in range(k):
  inp = input()
  if inp[0] == "1":
    num += 1
    num %= 2
  else:
    if (inp[2] == "1" and num == 0) or (inp[2] == "2" and num == 1):
      pre = pre + inp[4]
    else:
      out = out + inp[4]
if num:
      print(out[::-1] + s[::-1] + pre)
else:
  print(pre[::-1] + s + out)

Buggy python submission (verdict: Time Limit Exceeded):
num = 0
s = input()
k = int(input())
for _ in range(k):
  inp = input()
  if inp[0] == "1":
    num += 1
    num %= 2
  else:
    if (inp[2] == "1" and num == 0) or (inp[2] == "2" and num == 1):
      s = inp[4] + s
    else:
      s = s + inp[4]
if num:
      print(s[::-1])
else:
  print(s)

Fixed submission:
num = 0
s = input()
k = int(input())
pre = ""
out = ""
for _ in range(k):
  inp = input()
  if inp[0] == "1":
    num += 1
    num %= 2
  else:
    if (inp[2] == "1" and num == 0) or (inp[2] == "2" and num == 1):
      pre = pre + inp[4]
    else:
      out = out + inp[4]
if num:
      print(out[::-1] + s[::-1] + pre)
else:
  print(pre[::-1] + s + out)

Buggy python submission (verdict: Time Limit Exceeded):
num = 0
s = input()
k = int(input())
for _ in range(k):
  inp = input()
  if inp[0] == "1":
    num += 1
    num %= 2
  else:
    if (inp[2] == "1" and num == 0) or (inp[2] == "2" and num == 1):
      s = inp[4] + s
    else:
      s = s + inp[4]
if num:
      print(s[::-1])
else:
  print(s)

Fixed submission:
num = 0
s = input()
k = int(input())
pre = ""
out = ""
for _ in range(k):
  inp = input()
  if inp[0] == "1":
    num += 1
    num %= 2
  else:
    if (inp[2] == "1" and num == 0) or (inp[2] == "2" and num == 1):
      pre = pre + inp[4]
    else:
      out = out + inp[4]
if num:
      print(out[::-1] + s[::-1] + pre)
else:
  print(pre[::-1] + s + out)
Buggy python submission (verdict: Runtime Error):
print(ord(ord(input())+1))

Fixed submission:
print(chr(ord(input())+1))
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
import math
print(math.gcd(a, b))

Fixed submission:
a,b = map(int,input().split())
import fractions
print(a * b //fractions.gcd(a, b))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
lis = list(map(int,input().split()))
if not (1 in lis):
  print(-1)
  quit()
ans = 0
c = 1
while(lis):
  if lis[0] != c:
    ans += 1
  else: 
    c += 1
  del(lis[0])
print(ans)

Fixed submission:
n = int(input())
lis = list(map(int,input().split()))
if not (1 in lis):
  print(-1)
  quit()
ans = 0
c = 1
for i in range(n):
  if lis[i] != c:
    ans += 1
  else: 
    c += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
lis = list(map(int,input().split()))
if not (1 in lis):
  print(-1)
  quit()
ans = 0
c = 1
while(lis):
  if lis[0] != c:
    ans += 1
  else: 
    c += 1
  del(lis[0])
print(ans)

Fixed submission:
n = int(input())
lis = list(map(int,input().split()))
if not (1 in lis):
  print(-1)
  quit()
ans = 0
c = 1
for i in range(n):
  if lis[i] != c:
    ans += 1
  else: 
    c += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
lis = list(map(int,input().split()))
if not (1 in lis):
  print(-1)
  quit()
ans = 0
c = 1
while(lis):
  if lis[0] != c:
    ans += 1
  else: 
    c += 1
  del(lis[0])
print(ans)

Fixed submission:
n = int(input())
lis = list(map(int,input().split()))
if not (1 in lis):
  print(-1)
  quit()
ans = 0
c = 1
for i in range(n):
  if lis[i] != c:
    ans += 1
  else: 
    c += 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
lis = []
for _ in range(n):
  lis.append(list(map(int,input().split())))
lis.sort()
ans=0
while(1):
  x,y = lis[0]
  if y >= m:
    ans += x*m
    break
  ans += x * y
  m -= y
  del(lis[0])
print(ans)

Fixed submission:
n,m=map(int,input().split())
lis = []
for _ in range(n):
  lis.append(list(map(int,input().split())))
lis.sort()
ans=0
for i in range(n):
  x,y = lis[i]
  if y >= m:
    ans += x*m
    print(ans)
    quit()
  ans += x * y
  m -= y
print(ans)

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
lis = []
for _ in range(n):
  lis.append(list(map(int,input().split())))
lis.sort()
while(1):
  x,y = lis[0]
  if y >= m:
    ans += x*m
    break
  ans += x * y
  m -= y
  del(lis[0])
print(ans)

Fixed submission:
n,m=map(int,input().split())
lis = []
for _ in range(n):
  lis.append(list(map(int,input().split())))
lis.sort()
ans=0
for i in range(n):
  x,y = lis[i]
  if y >= m:
    ans += x*m
    print(ans)
    quit()
  ans += x * y
  m -= y
print(ans)
Buggy python submission (verdict: Runtime Error):
s = input()
t = len(s)
lis = []
for i in range(t-2):
  lis.append(t[i:i+3])
def f(x):
  return(abs(int(x) - 753))
lis = list(map(f,lis))
print(min(lis))

Fixed submission:
s = input()
t = len(s)
lis = []
for i in range(t-2):
  lis.append(s[i:i+3])
def f(x):
  return(abs(int(x) - 753))
lis = list(map(f,lis))
print(min(lis))

Buggy python submission (verdict: Runtime Error):
s = input()
lis = []
for i in range(10):
  for j in range(10):
    for k in range(10):
      if i != j and i != k and j != k:
        lis.append(s[i]+s[j]+s[k])
def f(x):
  return(abs(int(x) - 753))
lis = list(map(f,lis))
print(min(lis))

Fixed submission:
s = input()
t = len(s)
lis = []
for i in range(t-2):
  lis.append(s[i:i+3])
def f(x):
  return(abs(int(x) - 753))
lis = list(map(f,lis))
print(min(lis))
Buggy python submission (verdict: Runtime Error):
ps = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97]
N = int(input())
l = [0 for _ in range(98)]
def fac(n):
  for k in ps:
   if n == 1:
     break
   if n % k == 0:
    l[k] += 1
    fac(n // k)
    break

for i in range(2,N+1):
  fac(i)

p = [k for k in l if k > 1]

ans = 0

def num(n):
  r = 0
  for k in p:
    if k >= n:
      r += 1
  return(r)

if p[0] >= 74:
  ans += 1

#5*15

ans += (num(14) * (num(14) - 1))
ans += (num(14) * (num(4) - num(14)))

#3 * 25
ans += (num(24) * (num(24) - 1))
ans += (num(24) * (num(2) - num(24)))

#3 * 5 * 5
ans += (num(4) * (num(4) - 1) * (num(4) - 2) // 2)
ans += (num(4) * (num(4) - 1) //2) * (num(2) - num(4))

print(ans)

Fixed submission:
ps = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97]
N = int(input())
if N == 1:
  print(0)
  quit()
l = [0 for _ in range(98)]
def fac(n):
  for k in ps:
   if n == 1:
     break
   if n % k == 0:
    l[k] += 1
    fac(n // k)
    break

for i in range(2,N+1):
  fac(i)

p = [k for k in l if k > 1]

ans = 0

def num(n):
  r = 0
  for k in p:
    if k >= n:
      r += 1
  return(r)

if p[0] >= 74:
  ans += 1

#5*15

ans += (num(14) * (num(14) - 1))
ans += (num(14) * (num(4) - num(14)))

#3 * 25
ans += (num(24) * (num(24) - 1))
ans += (num(24) * (num(2) - num(24)))

#3 * 5 * 5
ans += (num(4) * (num(4) - 1) * (num(4) - 2) // 2)
ans += (num(4) * (num(4) - 1) //2) * (num(2) - num(4))

print(ans)
Buggy python submission (verdict: Runtime Error):
i=input;s=split;t,a=map(int,i().s());l=list(map(lambda x:abs(t-int(x)*0.006-a),i().s()));print(l.index(min(l))+1)

Fixed submission:
input();t,a=map(int,input().split());l=list(map(lambda x:abs(t-int(x)*0.006-a),input().split()));print(l.index(min(l))+1)
Buggy python submission (verdict: Runtime Error):
s=input()
if len(s)%2:
  s.reverse()
print(s)

Fixed submission:
s=input()
if len(s)%2:
  s = s[::-1]
print(s)
Buggy python submission (verdict: Runtime Error):
n,t=list(map(int,input().split()))
lis = []
for i in range(n):
  s,k = list(map(int,input().split()))
  if k <= t:
    lis.append(s)
print(min(lis))


Fixed submission:
n,t=list(map(int,input().split()))
lis = []
for i in range(n):
  s,k = list(map(int,input().split()))
  if k <= t:
    lis.append(s)
if lis == []:
  print("TLE")
  quit()
print(min(lis))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
lis = list(map(int,input().split()))
l = []
i = 0
x = 0
while(True):
  if i == N-1:
    x += 1
    l.append(x)
    break
  if lis[i] != lis[i+1]:
    x += 1
    l.append(x)
    x = 0
  else:
    x += 1
s = 0
for i in lis:
  s += (i//2)
print(s)

Fixed submission:
N = int(input())
lis = list(map(int,input().split()))
l = []
i = 0
x = 0
while(True):
  if i == N-1:
    x += 1
    l.append(x)
    break
  if lis[i] != lis[i+1]:
    x += 1
    l.append(x)
    x = 0
  else:
    x += 1
  i += 1
s = 0
for i in l:
  s += (i//2)
print(s)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
lis = list(map(int,input().split()))
l = []
i = 0
x = 0
while(True):
  if i == N-1:
    x += 1
    l.append(x)
    break
  if lis[i] != lis[i+1]:
    x += 1
    l.append(x)
    x = 0
  else:
    x += 1
s = 0
for i in lis:
  s += (i//1)
print(s)

Fixed submission:
N = int(input())
lis = list(map(int,input().split()))
l = []
i = 0
x = 0
while(True):
  if i == N-1:
    x += 1
    l.append(x)
    break
  if lis[i] != lis[i+1]:
    x += 1
    l.append(x)
    x = 0
  else:
    x += 1
  i += 1
s = 0
for i in l:
  s += (i//2)
print(s)
Buggy python submission (verdict: Runtime Error):
i=int
k=input
N = i(k())
l = list(map(i,k().split()))
for j in range(n):
 lis[j] -= (j+1)
l.sort()
print(sum(list(map(lambda x: abs(x - l[N//2]),l))))

Fixed submission:
N = int(input())
lis = list(map(int,input().split()))
for i in range(len(lis)):
  lis[i] -= (i+1)
lis.sort()
m = N // 2
c = lis[m]
print(sum(list(map(lambda x: abs(x - c), lis))))
Buggy python submission (verdict: Runtime Error):
n = map(int,input().split())
lis = list(map(int,input().split()))
ans = 0
def f(x):
 if x%2:
  return(0)
 else:
  return(f(x//2)+1)
for i in range(n):
 ans += f(lis[i])
print(ans)

Fixed submission:
n = int(input())
lis = list(map(int,input().split()))
ans = 0
def f(x):
 if x%2:
  return(0)
 else:
  return(f(x//2)+1)
for i in range(n):
 ans += f(lis[i])
print(ans)

Buggy python submission (verdict: Runtime Error):
n = map(int,input().split())
lis = list(map(int,input().split()))
ans = 0
def f(x):
 if x%2:
  return 0
 else:
  return f(x//2)+1
for i in range(n):
 ans += f(lis[i])
print(ans)

Fixed submission:
n = int(input())
lis = list(map(int,input().split()))
ans = 0
def f(x):
 if x%2:
  return(0)
 else:
  return(f(x//2)+1)
for i in range(n):
 ans += f(lis[i])
print(ans)
Buggy python submission (verdict: Runtime Error):
x=list(map(int,input().split()));x.sort();print(x[0]+x[1]+x[2]*2**int(input())

Fixed submission:
x=list(map(int,input().split()));x.sort();print(x[0]+x[1]+x[2]*2**int(input()))
Buggy python submission (verdict: Runtime Error):
h,w=map(int,input().split())
lis = []
for _ in range(h):
 lis.append(input())
for i in range(h):
 for j in range(w):
  if lis[i][j] = "#":
    if (i == 0 or lis[i-1][j] == ".") and (j==0 or lis[i][j-1] == ".")  and (i == h-1 or lis[i+1][j] == ".") and (j == w-1 or lis[i][j+1] == "."):
      print("No")
      quit()
print("Yes")

Fixed submission:
h,w=map(int,input().split())
lis = []
for _ in range(h):
 lis.append(input())
for i in range(h):
 for j in range(w):
  if lis[i][j] == "#":
    if (i == 0 or lis[i-1][j] == ".") and (j==0 or lis[i][j-1] == ".")  and (i == h-1 or lis[i+1][j] == ".") and (j == w-1 or lis[i][j+1] == "."):
      print("No")
      quit()
print("Yes")

Buggy python submission (verdict: Runtime Error):
h,w = map(int,input().split())
a = []
for i in range(h):
  a.append(input())
for i in range(h):
  for j in range(w):
    if i !=0:
      if a[i][j] != a[i-1][j]:
        print("No")
        quit()
    if j !=0:
      if a[i][j] != a[i][j-1]:
        print("No")
        quit()
    if i !=h:
      if a[i][j] != a[i+1][j]:
        print("No")
        quit()
    if j !=w:
      if a[i][j] != a[i][j+1]:
        print("No")
        quit()
print("Yes")

Fixed submission:
h,w=map(int,input().split())
lis = []
for _ in range(h):
 lis.append(input())
for i in range(h):
 for j in range(w):
  if lis[i][j] == "#":
    if (i == 0 or lis[i-1][j] == ".") and (j==0 or lis[i][j-1] == ".")  and (i == h-1 or lis[i+1][j] == ".") and (j == w-1 or lis[i][j+1] == "."):
      print("No")
      quit()
print("Yes")