TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.  The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`.  You want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.  At least how many tiles need to be repainted to satisfy the condition?

Submission attempts (in order):
S = input()
first = S[0]
inverse = str(1-int(first))
unit = first+inverse
if len(S) % 2 == 0:
  sample = unit*len(S)//2
else:
  sample = unit*len(S)//2+first

count = 0
for k in range(len(S)):
  if S[k] != sample[k]:
    count += 1

print(count)


if len(S) % 2 == 0:
  whiteS = '01'*len(S)//2
  blackS = '10'*len(S)//2
else:
  whiteS = '01'*len(S)//2 + '0'
  blackS = '10'*len(S)//2 + '1'
  
S = input()
first = S[0]
inverse = str(1-int(first))
unit = first+inverse
if len(S) % 2 == 0:
  sample = unit*len(S)//2
else:
  sample = unit*len(S)//2+first

count = 0
for k in range(len(S)):
  if S[k] != sample[k]:
    count += 1

print(count)

S = input()
first = S[0]
inverse = str(1-int(first))
unit = first+inverse
if len(S) % 2 == 0:
  sample = unit*(len(S)//2)
else:
  sample = unit*(len(S)//2)+first

count = 0
for k in range(len(S)):
  if S[k] != sample[k]:
    count += 1

print(count)


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.  The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`.  You want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.  At least how many tiles need to be repainted to satisfy the condition?

Submission attempts (in order):
a=sum(i%2^int(c)for i,c in enumerate(input()));print(min(a,n-a))

*s,=map(int,input())
n=len(s)
a=sum(s[::2])+n//2-sum(s[1::2])
print(min(a,n-a))

Verdicts: Runtime Error

Accepted
Problem: N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.  The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`.  You want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.  At least how many tiles need to be repainted to satisfy the condition?

Submission attempts (in order):
s = input()
n = len(s)
if n % 2 == 1:
    n += 1
pattern = '01' * (n // 2)

ans_a = 0
ans_b = 0
for i, (a, b) in enumerate(zip(pattern[1:], pattern[:-1])):
    if pattern[i] != a:
        ans_a += 1
    if pattern[i] != b:
        ans_b += 1
print(min(ans_a, ans_b))


s = input()
n = len(s)
if n % 2 == 1:
    pattern1 = '01' * (n // 2) + '0'
    pattern2 = '10' * (n // 2) + '1'
else:
    pattern1 = '01' * (n // 2)
    pattern2 = '10' * (n // 2)

diff1 = 0
diff2 = 0
for i in range(n):
    if pattern1[i] != s[i]:
        diff1 += 1
    if pattern2[i] != s[i]:
        diff2 += 1
print(min(diff1, diff2))

Verdicts: Wrong Answer

Accepted
Problem: N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.  The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`.  You want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.  At least how many tiles need to be repainted to satisfy the condition?

Submission attempts (in order):
#ABC124_C
S=input()
 
S_rev=list(S)[::-1]
 
s=0
st0=0
st1=0
 
def bit_count(x):
    x=bin(x)[2:]
    ans=0
    for i in range(len(x)):
        if int(x[i])==1:
            ans+=1
    return ans
            
 
for i in range(len(S)):
    if i%2==0:
        st0+=2**i
    else:
        st1+=2**i
    if int(S_rev[i])==1:
        s+=2**i
 
cand0=st0^s
cand1=st1^s
 
    
bc0=bit_count(cand0)
bc1=bit_count(cand1)
if bc0>bc1:
    print(bc1)
else:
    print(bc0
    

#124_C

S=input()

a=''
b=''

lenS=len(S)

for i in range(lenS):
    if i%2==0:
        a+='1'
        b+='0'
    else:
        a+='0'
        b+='1'
        
ca=0
cb=0
for i in range(lenS):
    if a[i]!=S[i]:
        ca+=1
    if b[i]!=S[i]:
        cb+=1
print(min(ca,cb))
        



Verdicts: Runtime Error

Accepted
Problem: N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.  The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`.  You want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.  At least how many tiles need to be repainted to satisfy the condition?

Submission attempts (in order):
s = list(input())
slen = len(s)

count_0 = 0
count_1 = 0

#0-start

for i in s[0::2]:
	if i != '0':
		count_0 += 1
for i in s[1::2]:
	if i != '1':
		count_0 += 1

for i in s[0::2]:
	if i != '1':
		count_1 += 1
for i in s[1::2]:
	if i != '0':
		count_1 += 1

print("count_0:{}".format(count_0))
print("count_1:{}".format(count_1))

if count_1 > count_0:
	print(count_0)
else:
	print(count_1)

s = list(input())
slen = len(s)

count_0 = 0
count_1 = 0

#0-start

for i in s[0::2]:
	if i != '0':
		count_0 += 1
for i in s[1::2]:
	if i != '1':
		count_0 += 1

for i in s[0::2]:
	if i != '1':
		count_1 += 1
for i in s[1::2]:
	if i != '0':
		count_1 += 1

if count_1 > count_0:
	print(count_0)
else:
	print(count_1)

Verdicts: Wrong Answer

Accepted
Problem: N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.  The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`.  You want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.  At least how many tiles need to be repainted to satisfy the condition?

Submission attempts (in order):
S = list(input())

count = 0
for i,s in enumerate(S):
    if i!=0:
        if S[i-1] == s:
            count += 1
            if s == "0":
                S[i] = "1"
            else:
                S[i] = "0"
            print(S)
print(count)



S = list(input())

count = 0
for i,s in enumerate(S):
    if i!=0:
        if S[i-1] == s:
            count += 1
            if s == "0":
                S[i] = "1"
            else:
                S[i] = "0"
print(count)


Verdicts: Runtime Error

Accepted
Problem: N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.  The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`.  You want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.  At least how many tiles need to be repainted to satisfy the condition?

Submission attempts (in order):
S = list(input())
S = [int(i) for i in S]
sum1,sum2 = 0,0
for i in range(len(S)):
    if i % 2 == 0:
        if S[i] == 0:
            sum1 += 1
    else:
        if S[i] == 1:
            sum1 += 1

for i in range(len(S)):
    if i % 2 == 0:
        if S[i] == 1:
            sum2 += 1
    else:
        if S[i] == 0:
            sum2 += 1
print(sum1,sum2)
if sum1 <= sum2:
    print(sum1)
else:
    print(sum2)


S = list(input())
S = [int(i) for i in S]
print(S)
print(len(S))
sum1,sum2 = 0,0
for i in range(len(S)):
    if i % 2 == 0:
        if S[i] == 0:
            sum1 += 1
    else:
        if S[i] == 1:
            sum1 += 1

for i in range(len(S)):
    if i % 2 == 0:
        if S[i] == 1:
            sum2 += 1
    else:
        if S[i] == 0:
            sum2 += 1
print(sum1,sum2)
if sum1 <= sum2:
    print(sum1)
else:
    print(sum2)


S = list(input())
S = [int(i) for i in S]
sum1,sum2 = 0,0
for i in range(len(S)):
    if i % 2 == 0:
        if S[i] == 0:
            sum1 += 1
    else:
        if S[i] == 1:
            sum1 += 1

for i in range(len(S)):
    if i % 2 == 0:
        if S[i] == 1:
            sum2 += 1
    else:
        if S[i] == 0:
            sum2 += 1
if sum1 <= sum2:
    print(sum1)
else:
    print(sum2)


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.  The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`.  You want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.  At least how many tiles need to be repainted to satisfy the condition?

Submission attempts (in order):
if __name__ == "__main__":
    l = int(input())
    l = [int(x) for x in list(str(l))]
    length = len(l)
    temp1 = []
    temp2 = []
    for i in range(length):
        temp1.append(i % 2)
        temp2.append((i + 1) % 2)
    t1 = 0
    t2 = 0
    for n in range(length):
        if temp1[n] != l[n]:
            t1 += 1
        if temp2[n] != l[n]:
            t2 += 1
    print(min(t1, t2))


l = list(map(int, input().split()))
length = len(l)
temp1 = []
temp2 = []
for i in range(length):
  temp1.append(i%2)
  temp2.append((i+1)%2)
t1=0
t2=0
for n in range(length):
  if temp1[n] != l[n]:
    t1+=1
  if temp2[n] != l[n]:
    t2+=1
print(min(t1, t2))
    

if __name__ == "__main__":
    l = str(input())
    l = [int(x) for x in list(str(l))]
    length = len(l)
    temp1 = []
    temp2 = []
    for i in range(length):
        temp1.append(i % 2)
        temp2.append((i + 1) % 2)
    t1 = 0
    t2 = 0
    for n in range(length):
        if temp1[n] != l[n]:
            t1 += 1
        if temp2[n] != l[n]:
            t2 += 1
    print(min(t1, t2))


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.  The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`.  You want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.  At least how many tiles need to be repainted to satisfy the condition?

Submission attempts (in order):
S = list(map(str, input().split()))

ans = 0
last_str = ''
for s in S:
  if last_str == '':
    last_str = s
  elif (last_str == s) and s == '0':
    ans += 1
    last_str = '1'
  elif (last_str == s) and s == '1':
    ans += 1
    last_str = '0'
  else:
    pass
print(ans)

S = list(str(input()))

ans = 0
last_str = ''
for s in S:
  if (last_str == s) and s == '0':
    ans += 1
    last_str = '1'
  elif (last_str == s) and s == '1':
    ans += 1
    last_str = '0'
  else:
    last_str = s
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.  The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`.  You want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.  At least how many tiles need to be repainted to satisfy the condition?

Submission attempts (in order):
l=str(input())
n=0
for i in range(len(l)):
  if i%2==0,l[i]==0:
    n+=1
  if i%2==1,l[i]==1:
    n+=1
print(min(n,len(l)-n))

l=str(input())
n=0
for i in range(len(l)):
  if i%2==0 and l[i]=='0':
    n+=1
  if i%2==1 and l[i]=='1':
    n+=1
print(min(n,len(l)-n))

Verdicts: Runtime Error

Accepted
Problem: N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.  The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`.  You want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.  At least how many tiles need to be repainted to satisfy the condition?

Submission attempts (in order):
s = str(input())
ans1=0
for i in range(len(s)):
  if(i%2==0 and s[i]!=0):ans1+=1
  if(i%2==1 and s[i]!=1):ans1+=1
ans2=0
for i in range(len(s)):
  if(i%2==0 and s[i]!=1):ans2+=1
  if(i%2==1 and s[i]!=0):ans2+=1
ans=min(ans1,ans2)
print(ans)

s = str(input())
ans1=0
for i in range(len(s)):
  if(i%2==0 and s[i]!='0'):ans1+=1
  if(i%2==1 and s[i]!='1'):ans1+=1
ans2=0
for i in range(len(s)):
  if(i%2==0 and s[i]!='1'):ans2+=1
  if(i%2==1 and s[i]!='0'):ans2+=1
ans=min(ans1,ans2)
print(ans)


Verdicts: Wrong Answer

Accepted
Problem: N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.  The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`.  You want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.  At least how many tiles need to be repainted to satisfy the condition?

Submission attempts (in order):
s=input()
bf='01'*(len(s)//2)
wf='10'*(len(s)//2)
if len(s)%2==1:
  bf+='0'
  wf+='1'
ans=min(len([x!=y if x,y in zip(list(s),list(bf))]),len([x!=y if x,y in zip(list(s),list(wf))]))
print(ans)

s=input()
bf='01'*(len(s)//2)+'0'*(len(s)&1)
wf='10'*(len(s)//2)+'1'*(len(s)&1)
ans=min(len([x!=y if x,y in zip(s,bf)]),len([x!=y if x,y in zip(s,wf)]))
print(ans)

s=input()
bf='01'*(len(s)//2)+('0'*(len(s)&1))
wf='10'*(len(s)//2)+('1'*(len(s)&1))
ans=min(len([x!=y if x,y in zip(s,bf)]),len([x!=y if x,y in zip(s,wf)]))
print(ans)

s=input()
bf='01'*(len(s)//2)
wf='10'*(len(s)//2)
if len(s)%2==1:
  bf+='0'
  wf+='1'
ans=min(len([x!=y if x,y in zip(s,bf)]),len([x!=y if x,y in zip(s,wf)]))
print(ans)

#!/usr/bin/env python3
S = input()
bf = '01' * (len(S) // 2) + '0' * (len(S) & 1)
wf = '10' * (len(S) // 2) + '1' * (len(S) & 1)
ans = 10**5
ans = min(ans, [x != y for x, y in zip(S, bf)].count(True))
ans = min(ans, [x != y for x, y in zip(S, wf)].count(True))
print(ans)


Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.  The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`.  You want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.  At least how many tiles need to be repainted to satisfy the condition?

Submission attempts (in order):
S = input()
back = 0
n = 0
for i in S:
    if i == back:
        back = '0' if i=='1' else '1'
        n += 1
    else:
        back = S

print(n);

S = input()
back = 0
for i in S:
    if i == back:
        back = '0' if i=='1' else '1'
        n += 1
    else:
        back = S

print(n);

S = input()
back = 0
n = 0
for i in S:
    if i == back:
        back = '0' if i=='1' else '1'
        n += 1
    else:
        back = i

print(n);

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.  The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`.  You want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.  At least how many tiles need to be repainted to satisfy the condition?

Submission attempts (in order):
s=list(map(int,str(input())))
print(s)
n=len(s)
a=0
b=0
for i in range(n):
  if ((i%2)+s[i])%2==0:
    a+=1
  else:
    b+=1
print(n-max(a,b))

s=list(map(int,str(input())))
n=len(s)
a=0
b=0
for i in range(n):
  if ((i%2)+s[i])%2==0:
    a+=1
  else:
    b+=1
print(n-max(a,b))

Verdicts: Wrong Answer

Accepted
Problem: N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.  The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`.  You want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.  At least how many tiles need to be repainted to satisfy the condition?

Submission attempts (in order):
S = int(input())
S_list = [int(x) for x in list(str(S))]
S_str = str(S)
S_list_1 = input().split('0')
S_list_2 = input().split('1')
output = 0

for i in range(len(S_list_1)):
  output += int(S_list_1[i]) // 2
for i in range(len(S_list_2)):
  output += int(S_list_2[i]) // 2
  
print(output)

S = int(input())
S_list = [int(x) for x in list(str(S))]
S_str = str(S)
S_list_1 = S_str.split('0')
S_list_2 = S_str.split('1')
output = 0

for i in range(len(S_list_1)):
  output += len(S_list_1[i])//2
for i in range(len(S_list_2)):
  output += len(S_list_2[i])//2
  
print(output)



S = int(input())
S_list = [int(x) for x in list(str(S))]
S_str = str(S)
S_list_1 = S_list.split('0')
S_list_2 = S_list.split('1')
output = 0

for i in range(len(S_list_1)):
  output += int(S_list_1[i]) // 2
for i in range(len(S_list_2)):
  output += int(S_list_2[i]) // 2
  
print(output)


S = list(input())

#1
count_1 = 0
count_2 = 0
for i in range(len(S)):
  #bwbw
  if i % 2 == 0:
    if S[i] == '1':
      count_1 += 1
  elif S[i] == '0':
    count_1 += 1
  
  #wbwb
  if i % 2 == 0:
    if S[i] == '0':
      count_2 += 1
  elif S[i] == '1':
    count_2 += 1
    
print(min(count_1, count_2))



Verdicts: Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.  The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`.  You want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.  At least how many tiles need to be repainted to satisfy the condition?

Submission attempts (in order):
s=input()
count1=0
for i in range(0,len(s)-1,2):
  if s[i]=='0':
    count+=1
  if s[i+1]=='1':
    count+=1
if len(s)%2==1:
  if s[len(s)-1]=='0':
    count+=1
print(min(count,len(s)-count))

s=input()
count=0
for i in range(0,len(s)-1,2):
  if s[i]=='0':
    count+=1
  if s[i+1]=='1':
    count+=1
if len(s)%2==1:
  if s[len(s)-1]=='0':
    count+=1
print(min(count,len(s)-count))


Verdicts: Runtime Error

Accepted
Problem: N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.  The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`.  You want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.  At least how many tiles need to be repainted to satisfy the condition?

Submission attempts (in order):
S = input()
S = [int(i) for i in list(S)]

a = []
b = True
for i in range(len(S)):
    if b:
        a.append(1)
        b=False
    else:
        a.append(0)
        b=True
c = a[::-1]

combined1 = [abs(x-y) for (x, y) in zip(S, a)]
combined2 = [abs(x-y) for (x, y) in zip(S, c)]

if len(S)==1:
    print(0)
else:
    print(min(sum(combined1), sum(combined2)))

S = int(input())
S = [int(i) for i in list(str(S))]

a = []
b = True
for i in range(len(S)):
    if b:
        a.append(1)
        b=False
    else:
        a.append(0)
        b=True
c = a[::-1]

combined1 = [abs(x-y) for (x, y) in zip(S, a)]
combined2 = [abs(x-y) for (x, y) in zip(S, c)]

if len(S)==1:
    print(0)
else:
    print(min(sum(combined1), sum(combined2)))

S = input()
S = [int(i) for i in list(S)]

a = []
c = []
b = True
for i in range(len(S)):
    if b:
        a.append(1)
        c.append(0)
        b=False
    else:
        a.append(0)
        c.append(1)
        b=True

combined1 = [abs(x-y) for (x, y) in zip(S, a)]
combined2 = [abs(x-y) for (x, y) in zip(S, c)]

if len(S)==1:
    print(0)
else:
    print(min(sum(combined1), sum(combined2)))

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.  The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`.  You want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.  At least how many tiles need to be repainted to satisfy the condition?

Submission attempts (in order):
colors = input()
l = len(colors)
count1 = 0
for i in range(l):
	if int(colors[i]) == (i % 2):
		count1 += int(colors[i])
print(min(count1, l-count1))

l = len(colors)
count1 = 0
for i in range(l):
	if colors[i] == i % 2:
		count1 += int(colors[i])
print(min(count1, l-count1))

colors = input()
l = len(colors)
count1 = 0
for i in range(l):
  count1 += int(colors[i])
 print(min(count1, l-count1))

l = len(colors)
count1 = 0
for i in range(l):
	if int(colors[i]) == (i % 2):
		count1 += int(colors[i])
print(min(count1, l-count1))

colors = input()
l = len(colors)
count1 = 0
for i in range(l):
	if int(colors[i]) == (i % 2):
		count1 += 1
print(min(count1, l-count1))

Verdicts: Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.  The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`.  You want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.  At least how many tiles need to be repainted to satisfy the condition?

Submission attempts (in order):
S = input()
n = len(S)
s0 = 0
s1 = 0
for s in S:
    if s == "0":
        s0 += 1
    else:
        s1 += 1

d = abs(s0 - s1)
dd = int(d / 2)
if (d % 2 == 0):
    dd += 2

print(d)

S = input()
n = len(S)
s0 = 0
s1 = 0

for i in range(n):
    if i % 2 == 0:
        if S[i] != "0":
            s0 += 1
        else :
            s1 += 1
    
    else:
        if S[i] != "1":
            s0 += 1
        else:
            s1 += 1

if s0 > s1:
    print(s1)
else:
    print(s0)

Verdicts: Wrong Answer

Accepted
Problem: N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.  The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`.  You want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.  At least how many tiles need to be repainted to satisfy the condition?

Submission attempts (in order):
n = list(map(int, input()))

even_list = list()
odd_list = list()

even_list = n[0::2]
odd_list = n[1::2]

count_zero = 0
count_one = 0

#print(len(even_list))
for i in range(len(even_list)):
    if even_list[i] == 1:
        count_zero += 1
for j in range(len(odd_list)):
    if odd_list[j] == 0:
        count_zero += 1

for n in range(len(even_list)):
    if even_list[n] == 0:
        print(even_list[i])
        count_one += 1
for m in range(len(odd_list)):
    if odd_list[m] == 1:
        count_one += 1

print(min(count_zero, count_one))


n = list(map(int, input()))

even_list = list()
odd_list = list()

even_list = n[0::2]
odd_list = n[1::2]

count_zero = 0
count_one = 0

#print(len(even_list))
for i in range(len(even_list)):
    if even_list[i] == 1:
        count_zero += 1
for j in range(len(odd_list)):
    if odd_list[j] == 0:
        count_zero += 1

for n in range(len(even_list)):
    if even_list[n] == 0:
        count_one += 1
for m in range(len(odd_list)):
    if odd_list[m] == 1:
        count_one += 1

print(min(count_zero, count_one))


Verdicts: Wrong Answer

Accepted
Problem: N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.  The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`.  You want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.  At least how many tiles need to be repainted to satisfy the condition?

Submission attempts (in order):
data = [int(s) for s in input()]
count1 = 0
if data[0] == 0:
  
  
  for s in range(1,len(data)-1):
    
    
    print(s)
    if s % 2 == 0:
        if data[s] != 0:
            count1 += 1
            
    else :
        if data[s] != 1:
            count1 += 1
            
else:
  
  
  for s in range(1,len(data)-1):
    
    if s % 2 == 0:
      if data[s] != 0:
        count1 += 1

      else:
        if data[s] != 1:
          count1 += 1
          


print(count1)

data = [int(s) for s in input()]
count1 = 0
if data[0] == 0:
  
  
  for s in range(1,len(data)-1):
    
    
    print(s)
    if s % 2 == 0:
        if data[s] != 0:
            count1 += 1
            
    else :
        if data[s] != 1:
            count1 += 1
            
else:
  
  
  for s in range(1,len(data)-1):
    
    if s % 2 == 0:
      if data[s] != 0:
        count1 += 1
        
      else:
        if data[s] != 1:
          count1 += 1
          


print(count1)

data = [int(s) for s in input()]
count1 = 0
if data[0] == 0:
  
  
  for s in range(1,len(data)):
    
    
    
    if s % 2 == 0:
        if data[s] != 0:
            count1 += 1
    else :
        if data[s] != 1:
            count1 += 1
            
else:
  
  
  for s in range(1,len(data)):
    
    if s % 2 == 0:
      if data[s] != 1:
        count1 += 1
        
    else:
      if data[s] != 0:
        count1 += 1
          


print(count1)


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.  The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`.  You want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.  At least how many tiles need to be repainted to satisfy the condition?

Submission attempts (in order):
n=input()
s,a="",""
sd,ad=0,0
for i in range(len(n)):
  if i%2:
    s+="1"
    a+="0"
  else:
    s+="0"
    a+="1"
for i in range(n):
  if n[i]!=a[i]:ad+=1
  if n[i]!=s[i]:sd+=1
print(min(ad,sd))

n=input()
s=""
a=""
sd,ad=0,0
for i in range(len(n)):
  if i%2:
    s+="1"
    a+="0"
  else:
    s+="0"
    a+="1"
for i in range(len(n)):
  if n[i]!=a[i]:ad+=1
  if n[i]!=s[i]:sd+=1
print(min(ad,sd))

Verdicts: Runtime Error

Accepted
Problem: N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.  The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`.  You want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.  At least how many tiles need to be repainted to satisfy the condition?

Submission attempts (in order):
S = input()
n = len(S)
T = ['{}'.format(i % 2) for i in range(n)]
print(T)
tmp = 0
for i in range(n):
    if S[i] == T[i]:
        tmp += 1
if tmp >= n - tmp:
    ans = n - tmp
else:
    ans = tmp
print(ans)


S = input()
n = len(S)
T = ['{}'.format(i % 2) for i in range(n)]
tmp = 0
for i in range(n):
    if S[i] == T[i]:
        tmp += 1
if tmp >= n - tmp:
    ans = n - tmp
else:
    ans = tmp
print(ans)


Verdicts: Wrong Answer

Accepted
Problem: N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.  The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`.  You want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.  At least how many tiles need to be repainted to satisfy the condition?

Submission attempts (in order):
a = input()
n = len(a)
if n == 1:
    print(0)
else:
    count0 = 0    #start from 0
    count1 = 0    #start from 1
    for i in range(n):
        if i % 2 == 0:
            if a[i] ==1:
                count0 = count0 +1
            if a[i] ==0:
                count1 = count1 +1
        if i % 2 == 1:
            if a[i] ==1:
                count1 = count1 +1
            if a[i] ==0:
                count0 = count0 +1

    print(max(count0, count1))
    print(n, a[2]) 


a = input()
n = len(a)
count0 = 0    #start from 0
count1 = 0    #start from 1
for i in range(n):
    if i % 2 == 0 and int(a[i]) ==1:
        count0 = count0 +1
    elif i % 2 == 0 and int(a[i]) ==0:
        count1 = count1 +1
    elif i % 2 == 1 and int(a[i]) ==1:
        count1 = count1 +1
    elif i % 2 == 1 and int(a[i]) ==0:
        count0 = count0 +1

print(min(count0, count1))



Verdicts: Wrong Answer

Accepted
Problem: N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.  The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`.  You want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.  At least how many tiles need to be repainted to satisfy the condition?

Submission attempts (in order):
list1 = list(map(int,input().split()))

print(list1)

string = input()
list1 = []
for i in string:
  list1.append(int(i))
  
prev = list1[0]
sum = 0
for i, char in enumerate(list1):
  if (i > 0):
    if (char == prev):
      prev = 1 if char == 0 else 0
      sum += 1
    else:
      prev = char
print(sum)

Verdicts: Wrong Answer

Accepted
Problem: N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.  The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`.  You want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.  At least how many tiles need to be repainted to satisfy the condition?

Submission attempts (in order):
s = input()
ans10 = 10**12
ans01 = 10**12
for i in range(len(s)):
  if i%2==0:
    if s[i]=="0":
      ans10+=1
    if s[i]=="1":
      ans01+=1
  if i%2==1:
    if s[i]=="1":
      ans10+=1
    if s[i]=="0":
      ans01+=1
print(min(ans10,ans01))

s = input()
ans10 = 0
ans01 = 0
for i in range(len(s)):
  if i%2==0:
    if s[i]=="0":
      ans10+=1
    if s[i]=="1":
      ans01+=1
  if i%2==1:
    if s[i]=="1":
      ans10+=1
    if s[i]=="0":
      ans01+=1
print(min(ans10,ans01))

Verdicts: Wrong Answer

Accepted
Problem: N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.  The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`.  You want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.  At least how many tiles need to be repainted to satisfy the condition?

Submission attempts (in order):
str = input()
cnt = 0
num = 0
for i in str:
    if cnt % 2 == 0:
        if i == 0:
            num += 1
    else:
        if i == 1:
            num += 1
    cnt += 1

cnt2 = 0
num2 = 0
for i in str:
    if cnt2 % 2 == 0:
        if i == 1:
            num2 += 1
    else:
        if i == 0:
            num2 += 1
    cnt2 += 1
print(min(3-cnt,3-cnt2))


str = input()
cnt = 0
num = 0
for i in str:
    if cnt % 2 == 0:
        if i == '0':
            num += 1
    else:
        if i == '1':
            num += 1
    cnt += 1
cnt2 = 0
num2 = 0
for i in str:
    if cnt2 % 2 == 0:
        if i == '1':
            num2 += 1
    else:
        if i == '0':
            num2 += 1
    cnt2 += 1
print(min(cnt,cnt2))


str = input()
cnt = 0
num = 0
for i in str:
    if cnt % 2 == 0:
        if i == '0':
            num += 1
    else:
        if i == '1':
            num += 1
    cnt += 1

cnt2 = 0
num2 = 0
for i in str:
    if cnt2 % 2 == 0:
        if i == '1':
            num2 += 1
    else:
        if i == '0':
            num2 += 1
    cnt2 += 1

print(min(num,num2))


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.  The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`.  You want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.  At least how many tiles need to be repainted to satisfy the condition?

Submission attempts (in order):
S = input()
n = len(S)
cnt = 0
cntA = 0
cntB = 0
for i in range(n):
    
    if i%2 == 0:
        if S[i] == 1:
            cntA += 1
    if i%2 != 0:
        if S[i] == 0:
            cntA += 1
    
    if i%2 == 0:
        if S[i] == 0:
            cntB += 1
    if i%2 != 0:
        if S[i] == 1:
            cntB += 1

if cntA > cntB:
    cnt = cntB
if cntA == cntB:
    cnt = cntA
if cntA < cntB:
    cnt = cntA
    
print (cnt)

S = input()

cntA, cntB = 0, 0

for i, t in enumerate(S):
    if i%2 == 0:
        if t == '0': 
            cntA += 1
        else:
            cntB += 1
    else:
        if t == '1':
            cntA += 1
        else:
            cntB += 1
print (min(ci, c2)) 

S = input()

cntA, cntB = 0, 0

for i, t in enumerate(S):
    if i%2 == 0:
        if t == '0': 
            cntA += 1
        else:
            cntB += 1
    else:
        if t == '1':
            cntA += 1
        else:
            cntB += 1
print (min(cntA, cntB)) 

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.  The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`.  You want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.  At least how many tiles need to be repainted to satisfy the condition?

Submission attempts (in order):
S = input()
z_count = 0
o_count = 0
k_count = 0
g_count = 0
for i in range(len(S)):
  if S[i] == "0":
    z_count += 1
    if i % 2 == 0:
      g_count += 1
    else:
      k_count += 1
  else:
    o_count += 1
    if i % 2 == 0:
      g_count += 1
    else:
      k_count += 1
    
if z_count <= o_count:
  if g_count <= k_count:
    print(len(S) - g_count)
  else:
    print(len(s) - k_count)
    
else:
  if g_count <= 

S = input()
ans = len(S)

for i in range(2):
  cnt = 0
  for j in range(len(S)):
    if j % 2 == 0 and S[j] != str(i):
      cnt += 1
    if j % 2 == 1 and S[j] == str(i):
      cnt += 1
  ans = min(ans, cnt)
print(ans)

Verdicts: Runtime Error

Accepted
Problem: N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.  The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`.  You want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.  At least how many tiles need to be repainted to satisfy the condition?

Submission attempts (in order):
import math
import os
import random
import re
import sys
from collections import defaultdict

sys.stdin = open('input.in', 'r')
sys.stdout = open('output.out', 'w') 

def onezero(a):
	count = 0
	for i in range(0, len(a), 2):
		if a[i] == 0:
			count += 1
	for i in range(1, len(a), 2):
		if a[i] == 1:
			count += 1
	return count

def zeroone(a):
	count = 0
	for i in range(0, len(a), 2):
		if a[i] == 1:
			count += 1
	for i in range(1, len(a), 2):
		if a[i] == 0:
			count += 1
	return count


def count(n):
	return min(onezero(n),zeroone(n))

if __name__ == '__main__':
	N = [int(d) for d in input()]
	print(count(N))

import math
import os
import random
import re
import sys
from collections import defaultdict


# sys.stdout = open('output.out', 'w') 

def onezero(a):
	count = 0
	for i in range(0, len(a), 2):
		if a[i] == 0:
			count += 1
	for i in range(1, len(a), 2):
		if a[i] == 1:
			count += 1
	return count

def zeroone(a):
	count = 0
	for i in range(0, len(a), 2):
		if a[i] == 1:
			count += 1
	for i in range(1, len(a), 2):
		if a[i] == 0:
			count += 1
	return count


def count(n):
	return min(onezero(n),zeroone(n))

if __name__ == '__main__':
	N = [int(d) for d in input()]
	print(count(N))

Verdicts: Runtime Error

Accepted
Problem: N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.  The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`.  You want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.  At least how many tiles need to be repainted to satisfy the condition?

Submission attempts (in order):
 = list(input())
count = 0
n = len(s)
if n % 2 == 0:
    for i in range(0,int((n/2)-1)):
        if s[(2*i)+1] == "0":
            count = count + 1
    for i in range(0,int((n/2)-1)):
        if s[2*i] == "1":
            count = count + 1
else:
    for i in range(0,int((n-1)/2)):
        if s[2*i] == "0":
            count = count + 1
    for i in range(0,int(((n-1)/2)-1)):
        if s[2*i + 1] == "1":
            count = count + 1
count2 = n - count
print(min(count,count2))

s = list(input())
count = 0
n = len(s)
if n % 2 == 0:
    for i in range(0,int(n/2)):
        if s[(2*i)+1] == "0":
            count = count + 1
    for j in range(0,int(n/2)):
        if s[2*j] == "1":
            count = count + 1
else:
    for i in range(0,int((n-1)/2)+1):
        if s[2*i] == "0":
            count = count + 1
    for j in range(0,int(((n-1)/2))):
        if s[2*j + 1] == "1":
            count = count + 1
count2 = n - count
print(min(count,count2))

Verdicts: Runtime Error

Accepted
Problem: N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.  The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`.  You want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.  At least how many tiles need to be repainted to satisfy the condition?

Submission attempts (in order):
s = int(input())
count = 0
for i in ragen(len(s)):
    if (i % 2 == 0 and s[i] ==0) or (i % 2 ==1 and s[i] == 1):
        pass
    else:
        count += 1
print(min[count,len(s) - count])

s = int(input())
count = 0
for i in ragen(len(s)):
    if (i % 2 == 0 and s[i] ==0) or (i % 2 ==1 and s[i] == 1):
        pass
    else:
        count += 1
print(min[c,len(s) - c])

s = [int(i) for i in input()]
count = 0
l = len(s)
for i in range(l):
    if (i % 2 == 0 and s[i] ==0) or (i % 2 ==1 and s[i] == 1):
        pass
    else:
        count += 1
print(min([count,l - count]))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.  The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`.  You want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.  At least how many tiles need to be repainted to satisfy the condition?

Submission attempts (in order):
s=input()
c1=c2=0
f1='0'
f2='1'
for x in s:
  if f1==x:
    pass
  else:
    c1+=1
  if f1=='0':
    f1='1'
  else:
    f1='0'
for x in s:
  if f2==x:
    pass
  else:
    c2+=1
  if f2=='0':
    f2='1'
  else:
    f2='0'
print(c1,c2)
print(min(c1,c2))

import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7

def LI(): return list(map(int,input().split()))
def I(): return int(input())
def LS(): return input().split()
def S(): return input()

def main():
  s=list(S())

  c1=c2=0
  f=True
  for x in s:
    if f:
      if x=='0':
        c1+=1
      f=False
    else:
      if x=='1':
        c1+=1
      f=True

  f=False
  for x in s:
    if f:
      if x=='0':
        c2+=1
      f=False
    else:
      if x=='1':
        c2+=1
      f=True

  # print(c1,c2)
  return min(c1,c2)

print(main())


Verdicts: Wrong Answer

Accepted
Problem: N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.  The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`.  You want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.  At least how many tiles need to be repainted to satisfy the condition?

Submission attempts (in order):
S = list(input())
a=0
b=0
if S[0]=="0":
    for i in S[::2]:
        print(i)
        if i=="1":
            a+=1
    for k in S[1::2]:
        if k=="0":
            a+=1

if S[0]=="1":
    for i in S[::2]:
        if i=="0":
            b+=1
    for k in S[1::2]:
        if k=="1":
            b+=1
print(max(a,b))

S = list(input())
a=0
b=0
for i in S[::2]:
    if i=="1":
        a+=1
for k in S[1::2]:
    if k=="0":
        a+=1

for i in S[::2]:
    if i=="0":
        b+=1
for k in S[1::2]:
    if k=="1":
        b+=1
print(min(a,b))

Verdicts: Wrong Answer

Accepted
Problem: N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.  The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`.  You want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.  At least how many tiles need to be repainted to satisfy the condition?

Submission attempts (in order):
s = input()
size = len(s)

def poe(b):
  res = 0
  for i in range(size):
    if b:
      a = '1' if i % 2 == 0 else '0'
    else:
      a = '0' if i % 2 == 0 else '1'
 
    if a != s[i]:
      res+=1

  return res

print (poe(True), poe(False))


s = input()
size = len(s)

def poe(b):
  res = 0
  for i in range(size):
    if b:
      a = '1' if i % 2 == 0 else '0'
    else:
      a = '0' if i % 2 == 0 else '1'
 
    if a != s[i]:
      res+=1

  return res

print(min(poe(True), poe(False)))


Verdicts: Wrong Answer

Accepted
Problem: N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.  The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`.  You want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.  At least how many tiles need to be repainted to satisfy the condition?

Submission attempts (in order):
s = [int(x) for x in list(input())]
a = [x%2 for x in range(len(s))]
b = [(1 - x%2) for x in range(len(s))]
c1=0
c2=0
for i in range(len(s)):
    if a[i] != s[i]:
        c1 += 1
    if b[i] != s[i]:
        c2 += 1

p

s = [int(x) for x in list(input())]
a = [x%2 for x in range(len(s))]
b = [(1 - x%2) for x in range(len(s))]
c1=0
c2=0
for i in range(len(s)):
    if a[i] != s[i]:
        c1 += 1
    if b[i] != s[i]:
        c2 += 1

print(min([c1,c2]))

Verdicts: Runtime Error

Accepted
Problem: N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.  The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`.  You want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.  At least how many tiles need to be repainted to satisfy the condition?

Submission attempts (in order):
def c_coloring_colorfully(S):
    s1 = '10' * (len(S) // 2) + ('1' if len(S) % 2 == 1 else '')
    s2 = '01' * (len(S) // 2) + ('0' if len(S) % 2 == 1 else '')
    ans1, ans2 = 0, 0
    for k, s in enumerate(S):
        if s != s1[k]:
            ans1 += 1
        if s != s2[k]:
            ans2 += 1
    return min(ans1, ans2)

S = input()
print(c_doloring_colorfully(S))

def c_coloring_colorfully(S):
    ans1 = S[::2].count('0') + S[1::2].count('1')  
    ans2 = S[::2].count('1') + S[1::2].count('0')  
    return min(ans1, ans2)

S = input()
print(c_coloring_colorfully(S))

Verdicts: Runtime Error

Accepted
Problem: N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.  The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`.  You want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.  At least how many tiles need to be repainted to satisfy the condition?

Submission attempts (in order):
N = int(input())
H = list(map(int, input().split()))
ans = 1
for i in range(1,N):
  if H[i]>=max(H[:i]):
    ans += 1
print(ans)

s = input()
a = s[::2].count('0') + s[1::2].count('1')
print(min(a, len(s)-a))


Verdicts: Runtime Error

Accepted
Problem: N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.  The i-th tile from the left is painted black if the i-th character of S is `0`, and painted white if that character is `1`.  You want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.  At least how many tiles need to be repainted to satisfy the condition?

Submission attempts (in order):
List=input()
s = len(List)
a = [0] * s
b = [0] * s
b[1::2] = [1] * (s//2)
if s % 2 == 0:
	a[0::2] = [1] * (s//2)
else:
	a[0::2] = [1] * (s//2 + 1)

c1 = 0
c2 = 0

for i,j = zip(List,a):
	if i != j:
      c1 += 1

for i,j = zip(List,b):
	if i != j:
      c2 += 1

if c1 >= c2:
	print(c2)
else:
    print(c1)

List=list(map(int,input().split()))
s = len(List)
a = [0] * s
b = [0] * s
b[1::2] = [1] * (s//2)
if s % 2 == 0:
	a[0::2] = [1] * (s//2)
else:
	a[0::2] = [1] * (s//2 + 1)

c1 = 0
c2 = 0

for i,j = zip(List,a):
	if i != j:
      c1 += 1

for i,j = zip(List,b):
	if i != j:
      c2 += 1

if c1 >= c2:
	print(c2)
else:
    print(c1)

List=input()
s = len(List)
a = [0] * s
b = [0] * s
b[1::2] = [1] * (s//2)
if s % 2 == 0:
	a[0::2] = [1] * (s//2)
else:
	a[0::2] = [1] * (s//2 + 1)

c1 = 0
c2 = 0

for (i,j) in zip(List,a):
	if i != j:
		c1 += 1

for (i,j) in zip(List,b):
	if i != j:
		c2 += 1

if c1 >= c2:
	print(c2)
else:
    print(c1)

List=[int(i) for i in input().split()] 
s = len(List)
a = [0] * s
b = [0] * s
b[1::2] = [1] * (s//2)
if s % 2 == 0:
	a[0::2] = [1] * (s//2)
else:
	a[0::2] = [1] * (s//2 + 1)

c1 = 0
c2 = 0

for i,j = zip(List,a):
	if i != j:
      c1 += 1

for i,j = zip(List,b):
	if i != j:
      c2 += 1

if c1 >= c2:
	print(c2)
else:
    print(c1)

List=list(map(int,input().split()))
s = len(List)
a = [0] * s
b = [0] * s
b[1::2] = [1] * (s//2)
if s % 2 == 0:
	a[0::2] = [1] * (s//2)
else:
	a[0::2] = [1] * (s//2 + 1)

c1 = 0
c2 = 0

for i,j = zip(List,a):
	if i != j:
      c1 += 1

for i,j = zip(List,b):
	if i != j:
      c2 += 1

if a >= b:
	print(b)
else:
    print(a)

List=list(map(int,input().split()))
s = len(List)
a = [0] * s
b = [0] * s
b[1::2] = [1] * (s//2)
if s % 2 == 0:
	a[0::2] = [1] * (s//2)
else:
	a[0::2] = [1] * (s//2 + 1)

c1 = 0
c2 = 0

for i,j = zip(List,a):
	if i != j:
      c1 += 1

for i,j = zip(List,b):
	if i != j:
      c2 += 1

if a >= b:
	print(b)
else:
    print(a)
    
    
print(a)

List=input()
s = len(List)
a = [0] * s
b = [0] * s
b[1::2] = [1] * (s//2)
if s % 2 == 0:
	a[0::2] = [1] * (s//2)
else:
	a[0::2] = [1] * (s//2 + 1)

c1 = 0
c2 = 0

for (i,j) in zip(List,a):
	if int(i) != int(j):
		c1 += 1

for (i,j) in zip(List,b):
	if int(i) != int(j):
		c2 += 1

if c1 >= c2:
	print(c2)
else:
    print(c1)

Verdicts: Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Accepted