ZhenlongDai/ACPR huggingface dataset:
Problem: p03107
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
S=input()
a=S.count('0')
b=S.count('1')
print(min(a,b))

Failing test case input:
01101000110011

Expected output:
14


Actual output:
7


Fixed submission (verdict: Accepted):
S=input()
a=S.count('0')
b=S.count('1')
print(min(a,b)*2)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
ans=0
i=0
while i!=len(s) and len(s)>=2:
  if s[i:i+2]=="01" or s[i:i+2]=="10":
      s=s[:i+1]+s[i+2:]
      ans+=2
      i-=1
  else:
    i+=1
print(ans)

Failing test case input:
11001000101001

Expected output:
12


Actual output:
16


Fixed submission (verdict: Accepted):
s=input()
ans=0
i=0
while i!=len(s) and len(s)>=2:
  if s[i:i+2]=="01" or s[i:i+2]=="10":
      s=s[:i]+s[i+2:]
      ans+=2
      i=max(0,i-1)
  else:
    i+=1
print(ans)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

S=input()
a=''
c=0
for s in S:
	if a[-1:]==s:
		a=a[:-1]
		c+=2
	else:
		a+=s
print(c)

Failing test case input:
00001110001001

Expected output:
10


Actual output:
12


Fixed submission (verdict: Accepted):

S=input()
a=''
c=0
for s in S:
	if a=='':
		a+=s
	elif a[-1:]!=s:
		a=a[:-1]
		c+=2
	else:
		a+=s
print(c)

Problem: p03107
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import math

s_L = [int(val) for val in input()]

n = len(s_L)
g = sum(s_L)

if g > n/2:
    g = g - math.ceil(n/2)
elif g == n/2:
    print(n)
    exit()
elif n ==0:
    print(0)

print(n-2*g)

Failing test case input:
00001110000011

Expected output:
10


Actual output:
4


Fixed submission (verdict: Accepted):
s_L = [int(val) for val in input()]
n = len(s_L)

if sum(s_L) == 0 or sum(s_L) == n:
    print(0)
    exit()
elif n == 1:
    print(0)
    exit()

one = s_L.count(1)
zero = s_L.count(0)
print(2*min(zero,one))

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = list(input())

last = S.pop(0)
stack = [last]
can_pop = True
cnt = 0
for s in S:
    if last != s and can_pop:
        stack.pop()
        can_pop = False
        
        cnt += 2
    else:
        stack.append(s)
        last = s
        can_pop = True

print(cnt)


Failing test case input:
11001000111001

Expected output:
14


Actual output:
10


Fixed submission (verdict: Accepted):
S = list(input())

last = S.pop(0)
stack = [last]
can_pop = True
cnt = 0
for s in S:
    if last != s and can_pop:
        stack.pop()
        if len(stack) == 0:
            can_pop = False
        
        cnt += 2
    else:
        stack.append(s)
        last = s
        can_pop = True

print(cnt)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
 
ans = 0
stack = []
 
for c in s:
  if stack == []:
    continue
  if c == stack[-1]:
    ans += 2
    stack.pop(-1)
  else:
    stack.append(c)
    
print(ans)

Failing test case input:
11000110100010

Expected output:
12


Actual output:
0


Fixed submission (verdict: Accepted):
s = input()
 
ans = 0
stack = []
 
for c in s:
  if stack == []:
    stack.append(c)
    continue
  if c != stack[-1]:
    ans += 2
    stack.pop(-1)
  else:
    stack.append(c)
    
print(ans)
Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
z,o=0,0
for i in range(len(s)):
  if s[i]=="0":
    z+=1
  else:
    o+=1
    print(2*min(z,o))

Failing test case input:
00101010111011

Expected output:
12


Actual output:
2
4
6
8
10
10
12
12


Fixed submission (verdict: Accepted):
s=input()
z,o=0,0
for i in range(len(s)):
  if s[i]=="0":
    z+=1
  else:
    o+=1
print(2*min(z,o))

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def f(s):
    ans = 0
    num = 0
    for c in s:
        if c == "0":
            num += 1
        else:
            if num > 0:
                num -= 1
                ans += 2
    return ans

def solve(s):
    return max(map(f, [s,s[::-1]]))

assert solve("0011") == 4
assert solve("11011010001011") == 12
assert solve("0") == 0

s = input()
print(solve(s))

Failing test case input:
00111111011000

Expected output:
12


Actual output:
8


Fixed submission (verdict: Accepted):
def solve(s):
    odd = 0
    even = 0
    for c in s:
        if c == "0":
            even += 1
        else:
            odd += 1
    return 2*min(even, odd)

assert solve("0011") == 4
assert solve("11011010001011") == 12
assert solve("0") == 0

s = input()
print(solve(s))

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
A = S.count('0')
B = S.count('1')
print(min(A,B))

Failing test case input:
11010100110010

Expected output:
14


Actual output:
7


Fixed submission (verdict: Accepted):
S = input()
A=S.count('0')
B=S.count('1')
print(2*min(A,B))

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=list(input())
n=len(s)
zero=s.count(0)
one=s.count(1)
if len(s)==1:print(0)
elif s[0]==s[-1]:print(n-2)
else:print(n-2*min(zero,one))

Failing test case input:
11000000101100

Expected output:
10


Actual output:
14


Fixed submission (verdict: Accepted):
s=list(input())
n=len(s)
zero=s.count("0")
one=s.count("1")
if n==1:print(0)
else:print(2*min(zero,one))

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import collections

l=list(input())
c=collections.Counter(l)
print(c['0'],c['1'])
if c['0']==c['1']:
    print(c['0']*2)
else:
    print(min(c['0'],c['1'])*2)

Failing test case input:
00011111111000

Expected output:
12


Actual output:
6 8
12


Fixed submission (verdict: Accepted):
import collections

l=list(input())
c=collections.Counter(l)

if c['0']==c['1']:
    print(c['0']*2)
else:
    print(min(c['0'],c['1'])*2)
Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
num_length = len(S)
counter_0 = 0
counter_1 = 0
for i in range(num_length):
    if S[i] == 0:
        counter_0 += 1
    if S[i] == 1:
        counter_1 += 1

if counter_0 <= counter_1:
    print(2*counter_0)
else:
    print(2*counter_1)

Failing test case input:
01001000100100

Expected output:
8


Actual output:
0


Fixed submission (verdict: Accepted):
S = input()
num_length = len(S)
counter_0 = 0
counter_1 = 0
for i in range(num_length):
    if S[i] == '0':
        counter_0 += 1
    if S[i] == '1':
        counter_1 += 1
if counter_0 <= counter_1:
    print(2*counter_0)
else:
    print(2*counter_1)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):




















n = input()
print(min(n.count('0'), n.count('1')))


Failing test case input:
01001001100000

Expected output:
8


Actual output:
4


Fixed submission (verdict: Accepted):




















n = input()
print(min(n.count('0'), n.count('1')) * 2)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import Counter
s = input().rstrip()
ctr = Counter(s)
if len(ctr) > 2:
    x = min(ctr.values())
else:
    x = 0
print(x * 2)

Failing test case input:
01000010100010

Expected output:
8


Actual output:
0


Fixed submission (verdict: Accepted):
from collections import Counter
s = input().rstrip()
ctr = Counter(s)
if len(ctr) == 2:
    x = min(ctr.values())
else:
    x = 0
print(x * 2)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=input()
print(min(S.count('0')*2,S.count('1')))

Failing test case input:
00101010111011

Expected output:
12


Actual output:
8


Fixed submission (verdict: Accepted):
S=input()
print(min(S.count('0')*2,S.count('1')*2))

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = [i for i in input()]
one = S.count("1")
zero = S.count("0")
print(min(one,zero))

Failing test case input:
00001010010011

Expected output:
10


Actual output:
5


Fixed submission (verdict: Accepted):
S = [i for i in input()]
one = S.count("1")
zero = S.count("0")
print(min(one,zero)*2)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
cnt_0, cnt_1 = s.count('0'), s.count('1')
print(max(cnt_0, cnt_1) - min(cnt_0, cnt_1))

Failing test case input:
00101000111011

Expected output:
14


Actual output:
0


Fixed submission (verdict: Accepted):
s = input()
cnt_0, cnt_1 = s.count('0'), s.count('1')
print(len(s) - (max(cnt_0, cnt_1) - min(cnt_0, cnt_1)))

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=input()
L=len(S)
print(abs(S.count("1")-S.count("0")))



Failing test case input:
00001000111011

Expected output:
12


Actual output:
2


Fixed submission (verdict: Accepted):
S=input()
print(len(S)-abs(S.count("1")-S.count("0")))
Problem: p03107
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
S=input()
s0=S.count("0")
s1=S.count("1")

print(min(s0,s1))

Failing test case input:
00001010110011

Expected output:
12


Actual output:
6


Fixed submission (verdict: Accepted):
S=input()
s0=S.count("0")
s1=S.count("1")

print(2*min(s0,s1))

Problem: p03107
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
S=input()
n0,n1=0,0
for s in S:
  if s=='1':
    n1+=1
  elif s=='0':
    n0+=1
print(min(n1,n0))

Failing test case input:
01000110100010

Expected output:
10


Actual output:
5


Fixed submission (verdict: Accepted):
S=input()
n0,n1=0,0
for s in S:
  if s=='1':
    n1+=1
  elif s=='0':
    n0+=1
print(min(n1,n0)*2)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
print(min(s.count("1"),s.count("2"))*2)

Failing test case input:
11010100110010

Expected output:
14


Actual output:
0


Fixed submission (verdict: Accepted):
s = input()
print(min(s.count("1"),s.count("0"))*2)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()













ans = min(s.count('0'), s.count('1'))
print(ans)

Failing test case input:
01111011011100

Expected output:
10


Actual output:
5


Fixed submission (verdict: Accepted):
s = input()













ans = min(s.count('0'), s.count('1'))*2
print(ans)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = list(input())
ans = 0

zero = s.count('0')
one = len(s) - zero

if zero == one:
    ans = 0
else:
    ans = min(zero, one) * 2

print(ans)

Failing test case input:
01010000111011

Expected output:
14


Actual output:
0


Fixed submission (verdict: Accepted):
s = list(input())
ans = 0

zero = s.count('0')
one = len(s) - zero
ans = min(zero, one) * 2

print(ans)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
a = 0
b = 0
for i in range(len(s)):
         if s[i] == "0":
                 a += 1
         else:
                  b += 1
print(min(a,b))


Failing test case input:
00101000111011

Expected output:
14


Actual output:
7


Fixed submission (verdict: Accepted):
s = input()
a = 0
b = 0
for i in range(len(s)):
         if s[i] == "0":
                 a += 1
         else:
                  b += 1
print(min(a,b)*2)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()

count_0 = 0
count_1 = 1
for i in range(len(s)):
    if s[i] == '0':
        count_0 += 1
    else:
        count_1 += 1

print(min(count_0,count_1) * 2)


Failing test case input:
00001110001011

Expected output:
12


Actual output:
14


Fixed submission (verdict: Accepted):
s = input()
0

count_0 = 0
count_1 = 0
for i in range(len(s)):
    if s[i] == '0':
        count_0 += 1
    else:
        count_1 += 1

print(min(count_0,count_1) * 2)
Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()


score=0
for i in range(len(s)):
	if s[i]=="0":
		score = score +1
	else:
		score = score -1

print(len(s)-score)

Failing test case input:
01111011111100

Expected output:
8


Actual output:
20


Fixed submission (verdict: Accepted):
s = input()


score=0
for i in range(len(s)):
	if s[i]=="0":
		score = score +1
	else:
		score = score -1

print(len(s)-abs(score))

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
zero = len([x for x in s if x == "0"])
one = len(s) - zero

print(min(zero, one))

Failing test case input:
00011111111000

Expected output:
12


Actual output:
6


Fixed submission (verdict: Accepted):
s = input()
zero = len([x for x in s if x == "0"])
one = len(s) - zero

print(min(zero, one) * 2)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
print(S)
stack = []
ans = 0
for c in S:
    if stack and stack[0] != c:

        stack.pop()
        ans += 2
    else:

        stack.append(c)

print(ans)

Failing test case input:
01100111001010

Expected output:
14


Actual output:
01100111001010
14


Fixed submission (verdict: Accepted):
S = input()

stack = []
ans = 0
for c in S:
    if stack and stack[0] != c:

        stack.pop()
        ans += 2
    else:

        stack.append(c)

print(ans)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
num_length = len(S)
counter_0 = 0
counter_1 = 0
for i in range(num_length):
    if S[i] == 0:
        counter_0 += 1
    if S[i] == 1:
        counter_1 += 1

if counter_0 <= counter_1 and counter_0 > 0:
    print(2*counter_0)
elif counter_0 > counter_1 and counter_1 > 0:
    print(2*counter_1)
else:
    print(0)

Failing test case input:
01011110111010

Expected output:
10


Actual output:
0


Fixed submission (verdict: Accepted):
S = input()
num_length = len(S)
counter_0 = 0
counter_1 = 0
for i in range(num_length):
    if S[i] == '0':
        counter_0 += 1
    if S[i] == '1':
        counter_1 += 1
if counter_0 <= counter_1:
    print(2*counter_0)
else:
    print(2*counter_1)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
if len(s) == 1:
    print(0)
else:
    count0 = 0
    count1 = 0
    for i in range(len(s)):
        if s[i:i+1] == "0":
            count0 += 1
        else:
            count1 += 1
    print(2*max([count0,count1]))

Failing test case input:
00001000111011

Expected output:
12


Actual output:
16


Fixed submission (verdict: Accepted):
s = input()
if len(s) == 1:
    print(0)
else:
    count0 = 0
    count1 = 0
    for i in range(len(s)):
        if s[i:i+1] == "0":
            count0 += 1
        else:
            count1 += 1
    print(2*min([count0,count1]))
Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
S = S + S[-1]
res = 0
tmp1 = 0
tmp0 = 0
now = 0
while True:
    if S[now] != S[now + 1]:
        res += 2
        flag = True
        now += 1
    else:
        if S[now] == '1':
            tmp1 += 1
        else:
            tmp0 += 1
            
        flag = False
        
    now += 1
    if now >= len(S) - 1:
        break
        
    
    
if flag == False:
    if S[len(S) - 1] == '1':
        tmp1 += 1
    else:
        tmp0 += 1
        
print(res + 2 * min(tmp1, tmp0))
    

Failing test case input:
00001010110011

Expected output:
12


Actual output:
14


Fixed submission (verdict: Accepted):
S = input()
S = list(S)

tmp = [0 for i in range(len(S))]

for i in range(len(S)):
    if S[i] == '1':
        tmp[i] = 1
    elif S[i] == '0':
        tmp[i] = 0
     
flag = False
for i in range(len(S)-1):
    if S[i] != S[i+1] and flag == False:
        tmp[i] = -1
        tmp[i+1] = -1
        flag = True
    else:
        flag = False
  
count1 = 0
count0 = 0
res = 0
for i in range(len(S)):
    if tmp[i] == 1:
        count1 += 1
        
    elif tmp[i] == 0:
        count0 += 1
        
    else:
        res += 1
        
print(res + min(count0, count1) * 2)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = input()
zeronum = N.count("0")
onenum = N.count("1")

ans = 2 + min(zeronum,onenum)
print(ans)


Failing test case input:
00001000111011

Expected output:
12


Actual output:
8


Fixed submission (verdict: Accepted):
N = input()
zeronum = N.count("0")
onenum = N.count("1")

ans = 2 * min(zeronum,onenum)
print(ans)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()

zero = 0
one = 1
for n in S:
  if n == "0":
    zero+=1
  elif n == "1":
    one+=1

print(min(zero,one)*2)



Failing test case input:
11001010001001

Expected output:
12


Actual output:
14


Fixed submission (verdict: Accepted):
S = input()

zero = 0
one = 0
for n in S:
  if n == "0":
    zero+=1
  elif n == "1":
    one+=1

print(min(zero,one)*2)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
n = len(s)
a = []
i = 0
ct = 0
for i in range(n):
  a.append(int(s[i]))
i = -1

while ct < n:
  n = len(a)
  i += 1
  if i >= n-1: break
  if a[i] == 0 and a[i+1] == 1:
    a.pop(i)
    a.pop(i)
    ct += 1
    i -= 2
    continue
  elif a[i] == 1 and a[i+1] == 0:
    a.pop(i)
    a.pop(i)
    ct += 1
    i -= 2
  if i <0 :i = 0
    
print(ct*2)

Failing test case input:
00011110111000

Expected output:
14


Actual output:
12


Fixed submission (verdict: Accepted):
s = input()
n = len(s)
a = []
i = 0
ct = 0
for i in range(n):
  a.append(int(s[i]))
i = -1

while ct < 100000000000:
  n = len(a)
  i += 1
  if i >= n-1: break
  if a[i] == 0 and a[i+1] == 1:
    a.pop(i)
    a.pop(i)
    ct += 1
    i -= 2
    if i <= 1: i=-1
    continue
  elif a[i] == 1 and a[i+1] == 0:
    a.pop(i)
    a.pop(i)
    ct += 1
    i -= 2
    if i <= 1 :i = -1
    
print(ct*2)
Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
stack = []
r = 0
for c in s:
  n = int(c)
  if len(stack) > 0 and stack[-1] ^ n == 1:
    stack.pop()
    r += 1
  else:
    stack.append(n)
print(r)

Failing test case input:
01001001100000

Expected output:
8


Actual output:
4


Fixed submission (verdict: Accepted):
s = input()
stack = []
r = 0
for c in s:
  n = int(c)
  if len(stack) > 0 and stack[-1] ^ n == 1:
    stack.pop()
    r += 2
  else:
    stack.append(n)
print(r)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys

def main():
    S  = list(map(int, input()))
    o = S.count(0)
    l = S.count(1)
    print(o,l)

    print(min(o, l) * 2)

main()

Failing test case input:
11000000111100

Expected output:
12


Actual output:
8 6
12


Fixed submission (verdict: Accepted):
import sys

def main():
    S  = list(map(int, input()))
    o = S.count(0)
    l = S.count(1)

    print(min(o, l) * 2)

main()

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x=0
y=0
for i in list(input()):
  if i=='0':
    x+=1
  else:
    y+=1
print(min(x,y))

Failing test case input:
00111111111100

Expected output:
8


Actual output:
4


Fixed submission (verdict: Accepted):
x=0
y=0
for i in list(input()):
  if i=='0':
    x+=1
  else:
    y+=1
print(min(x,y)*2)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
if __name__ == "__main__":
    n = input()
    a = 0
    b = 0
    for c in n:
        if(c == '1'):
            a += 1
        else:
            b += 1
    if(a>b):
        print(b)
    else:
        print(a)

Failing test case input:
01100110100010

Expected output:
12


Actual output:
6


Fixed submission (verdict: Accepted):
if __name__ == "__main__":
    n = input()
    a = 0
    b = 0
    for c in n:
        if(c == '1'):
            a += 1
        else:
            b += 1
    if(a>b):
        print(b*2)
    else:
        print(a*2)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = list(input())
zero = s.count("0")
ans = max(len(s)-zero,zero)
print(ans*2)

Failing test case input:
00001100110011

Expected output:
12


Actual output:
16


Fixed submission (verdict: Accepted):
s = list(input())
zero = s.count("0")
ans = min(len(s)-zero,zero)
print(ans*2)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

S = input()
work=list(S)
i=0
o_cout=0
z_cout=0
for x in work:
    if(x=='1'):
        o_cout+=1
    else:
        z_cout+=1
    
if(o_cout>z_cout):
    cout=o_cout
else:
    cout=z_cout
    

print(cout*2)

Failing test case input:
11001000001001

Expected output:
10


Actual output:
18


Fixed submission (verdict: Accepted):

S = input()
work=list(S)
i=0
o_cout=0
z_cout=0
for x in work:
    if(x=='1'):
        o_cout+=1
    else:
        z_cout+=1
    
if(o_cout>z_cout):
    cout=z_cout
else:
    cout=o_cout
    

print(cout*2)
Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys

def parse(inp):
    S=list(next(inp))
    return S
  
def main(inp):
    S = inp
    zeros=0
    ones=0
    for i in range(len(S)):
        if(S[i]=='0'): zeros+=1
        else: ones+=1
            
    return 2*min(ones,zeros)
  
print(main(parse(sys.stdin)))

Failing test case input:
10000000111000

Expected output:
8


Actual output:
10


Fixed submission (verdict: Accepted):
import sys

def parse(inp):
    S=list(next(inp))
    return S
  
def main(inp):
    S = inp
    zeros=0
    ones=0
    for i in range(len(S)):
        if(S[i]=='0'): zeros+=1
        elif(S[i]=='1'): ones+=1
            
    return 2*min(ones,zeros)
  
print(main(parse(sys.stdin)))

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
s0 = 0
s1 = 1
for c in s:
  if c == '0':
    s0 += 1
  else:
    s1 += 1
print(min(s0, s1) * 2)

Failing test case input:
11001000001001

Expected output:
10


Actual output:
12


Fixed submission (verdict: Accepted):
s = input()
s0 = 0
s1 = 0
for c in s:
  if c == '0':
    s0 += 1
  else:
    s1 += 1
print(min(s0, s1) * 2)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
nums=str(input())
arr=list(map(int,nums))
l=len(arr)
a=0
i=0
while i<len(arr)-1:
    if arr[i]!=arr[i+1]:
        del arr[i:i+2]
        
        a+=2
        i=0
    i+=1
print(a)

Failing test case input:
01100010100010

Expected output:
10


Actual output:
8


Fixed submission (verdict: Accepted):
nums=str(input())
arr=list(map(int,nums))
l=len(arr)
a=0
i=0
while i<len(arr)-1:
    if i<0:
        i=0
    if arr[i]!=arr[i+1]:
        del arr[i:i+2]
        
        a+=2
        i-=2
    i+=1
print(a)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
a=s.count("1")
b=s.count("2")

print(min(a,b)*2)


Failing test case input:
01001001100100

Expected output:
10


Actual output:
0


Fixed submission (verdict: Accepted):
s=input()
a=s.count("1")
b=s.count("0")

print(min(a,b)*2)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

S = input()
print(2*min(S.count("0"), S.count("1c")))

Failing test case input:
11011010001001

Expected output:
14


Actual output:
0


Fixed submission (verdict: Accepted):

S = input()
print(2*min(S.count("0"), S.count("1")))

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import deque

s = input()
cnt = 0
i = 0
n = len(s)
stack = deque()
while i < n:
    stack.append(s[i])
    while len(stack) > 0 and i < n and stack[-1] == s[i]:
        stack.pop()
        i += 1
        cnt += 2
    i += 1
print(cnt)


Failing test case input:
01001010100100

Expected output:
10


Actual output:
14


Fixed submission (verdict: Accepted):
from collections import deque

s = input()
cnt = 0
i = 0
n = len(s)
stack = deque()
updated = True
while updated:
    updated = False
    while i < n and len(stack) > 0 and stack[-1] != s[i]:
        updated = True
        stack.pop()
        i += 1
        cnt += 2
    if i < n:
        updated = True
        stack.append(s[i])
    i += 1

print(cnt)
Problem: p03107
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
S = input()

count_0 = 0
count_1 = 1
for s in S:
    if s == "0":
        count_0 += 1
    else:
        count_1 += 1
        
print(2 * min(count_0, count_1))

Failing test case input:
00001010110011

Expected output:
12


Actual output:
14


Fixed submission (verdict: Accepted):
S = input()

count_0 = 0
count_1 = 0
for s in S:
    if s == "0":
        count_0 += 1
    else:
        count_1 += 1
        
print(2 * min(count_0, count_1))

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()

num0 = S.count("0")
num1 = len(S)-1

print(min(num0,num1)*2)

Failing test case input:
01100010100010

Expected output:
10


Actual output:
18


Fixed submission (verdict: Accepted):
S = input()

num0 = S.count("0")
num1 = len(S)-num0

print(min(num0,num1)*2)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
n = len(s)
a = []
i = 0
ct = 0
for i in range(n):
  a.append(int(s[i]))
i = -1

while ct < n:
  n = len(a)
  i += 1
  if i >= n-1: break
  if a[i] == 0 and a[i+1] == 1:
    a.pop(i)
    a.pop(i)
    ct += 1
    i -= 2
    if i <= 1: i=-1
    continue
  elif a[i] == 1 and a[i+1] == 0:
    a.pop(i)
    a.pop(i)
    ct += 1
    i -= 2
    if i <= 1 :i = -1
    
print(ct*2)

Failing test case input:
00011111111000

Expected output:
12


Actual output:
10


Fixed submission (verdict: Accepted):
s = input()
n = len(s)
a = []
i = 0
ct = 0
for i in range(n):
  a.append(int(s[i]))
i = -1

while ct < 100000000000:
  n = len(a)
  i += 1
  if i >= n-1: break
  if a[i] == 0 and a[i+1] == 1:
    a.pop(i)
    a.pop(i)
    ct += 1
    i -= 2
    if i <= 1: i=-1
    continue
  elif a[i] == 1 and a[i+1] == 0:
    a.pop(i)
    a.pop(i)
    ct += 1
    i -= 2
    if i <= 1 :i = -1
    
print(ct*2)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
c0=0
c1=0
for i in input():
  if i=="1":
    c1+=1
  else:
    c0+=1
print(min(c0,c1))

Failing test case input:
01001001101000

Expected output:
10


Actual output:
5


Fixed submission (verdict: Accepted):
c0=0
c1=0
for i in input():
  if i=="1":
    c1+=1
  else:
    c0+=1
print(min(c0,c1)*2)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=input()
print(min(S.count("0"),S.count("1")))

Failing test case input:
11000000101100

Expected output:
10


Actual output:
5


Fixed submission (verdict: Accepted):
S=input()
print(min(S.count("0"),S.count("1"))*2)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def resolve():
    S = input()
    zeros = S.count("0")
    print(min(zeros, len(S))* 2)

if '__main__' == __name__:
    resolve()

Failing test case input:
11001000101001

Expected output:
12


Actual output:
16


Fixed submission (verdict: Accepted):
def resolve():
    S = input()
    zeros = S.count("0")
    print(min(zeros, len(S)-zeros)* 2)

if '__main__' == __name__:
    resolve()
Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
n = len(s)
a = []
i = 0
ct = 0
for i in range(n):
  a.append(int(s[i]))
i = -1

while ct < n:
  n = len(a)
  i += 1
  if i >= n-1: break
  if a[i] == 0 and a[i+1] == 1:
    a.pop(i)
    a.pop(i)
    ct += 1
    i -= 2
    if i < 0: i=0
    continue
  elif a[i] == 1 and a[i+1] == 0:
    a.pop(i)
    a.pop(i)
    ct += 1
    i -= 2
    if i <0 :i = 0
    
print(ct*2)

Failing test case input:
00101000111011

Expected output:
14


Actual output:
12


Fixed submission (verdict: Accepted):
s = input()
n = len(s)
a = []
i = 0
ct = 0
for i in range(n):
  a.append(int(s[i]))
i = -1

while ct < 100000000000:
  n = len(a)
  i += 1
  if i >= n-1: break
  if a[i] == 0 and a[i+1] == 1:
    a.pop(i)
    a.pop(i)
    ct += 1
    i -= 2
    if i <= 1: i=-1
    continue
  elif a[i] == 1 and a[i+1] == 0:
    a.pop(i)
    a.pop(i)
    ct += 1
    i -= 2
    if i <= 1 :i = -1
    
print(ct*2)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    string = input()
    lists = list(string)
    original_len = len(lists)
    zero = lists.count('0')
    one = lists.count('1')
    print(original_len - min(zero,one)*2)
if __name__ == "__main__":
    main()



Failing test case input:
01111011011101

Expected output:
8


Actual output:
6


Fixed submission (verdict: Accepted):
def main():
    string = input()
    lists = list(string)
    original_len = len(lists)
    zero = lists.count('0')
    one = lists.count('1')
    print(min(zero,one)*2)
if __name__ == "__main__":
    main()

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
if __name__ == '__main__':
    S = str(input())
    N = len(S)

    count_0 = S.count('0')
    count_1 = S.count('1')

    answer = min(count_1, count_1)

    print(answer)

Failing test case input:
01100110001010

Expected output:
12


Actual output:
6


Fixed submission (verdict: Accepted):
if __name__ == '__main__':
    S = str(input())
    N = len(S)

    count_0 = S.count('0')
    count_1 = S.count('1')

    answer = 2 * min(count_0, count_1)

    print(answer)

Problem: p03107
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
s = list(input())
cnt = 0

def counter(array):
    from collections import Counter
    return list(Counter(array).most_common())
c = counter(s)

try:
    cnt = min(cnt,c[0][1])
    cnt = min(cnt,c[0][0])
except:
    pass
print(cnt)



Failing test case input:
01011000111011

Expected output:
12


Actual output:
0


Fixed submission (verdict: Accepted):
s = list(input())
cnt = 0

def counter(array):
    from collections import Counter
    return list(Counter(array).most_common())
c = counter(s)
if len(c) == 2:
    cnt = min(c[0][1],c[1][1])
print(cnt*2)
Problem: p03107
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import math

s_L = [int(val) for val in input()]

n = len(s_L)
g = sum(s_L)

if g > n/2:
    g = g - math.ceil(n/2)
    print(n-2*g)
elif g == n/2:
    print(n)
    exit()
elif n ==0:
    print(0)
    exit()
print(2*g)

Failing test case input:
11010110111010

Expected output:
10


Actual output:
10
4


Fixed submission (verdict: Accepted):
s_L = [int(val) for val in input()]
n = len(s_L)

if sum(s_L) == 0 or sum(s_L) == n:
    print(0)
    exit()
elif n == 1:
    print(0)
    exit()

one = s_L.count(1)
zero = s_L.count(0)
print(2*min(zero,one))

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
st = input()
countone = st.count('1')
countzero = st.count('0')
if countone > countzero and countzero > 0:
    print(countone)
elif countone <= countzero and countone > 0:
    print(countzero)
else:
    print('0')

Failing test case input:
00001100110011

Expected output:
12


Actual output:
8


Fixed submission (verdict: Accepted):
st = input()
countone = st.count('1')
countzero = st.count('0')
if countone > countzero and countzero > 0:
    print(countzero*2)
elif countone <= countzero and countone > 0:
    print(countone*2)
else:
    print('0')

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = list(input())
print(min(S.count('0'), S.count('1')) ** 2)

Failing test case input:
01011000111011

Expected output:
12


Actual output:
36


Fixed submission (verdict: Accepted):
S = list(input())
print(min(S.count('0'), S.count('1')) * 2)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
num_length = len(S)
counter_0 = 0
counter_1 = 0
for i in range(num_length):
    if S[i] == 0:
        counter_0 += 1
    if S[i] == 0:
        counter_1 += 1

if counter_0 <= counter_1:
    print(2*counter_0)
else:
    print(2*counter_1)

Failing test case input:
11011010001011

Expected output:
12

Actual output:
0


Fixed submission (verdict: Accepted):
S = input()
num_length = len(S)
counter_0 = 0
counter_1 = 0
for i in range(num_length):
    if S[i] == '0':
        counter_0 += 1
    if S[i] == '1':
        counter_1 += 1
if counter_0 <= counter_1:
    print(2*counter_0)
else:
    print(2*counter_1)
Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):



import copy

string = [x for x in input()]

concat_string = copy.copy(string)
count = 0
while True:
    num_delete = 0
    flags_delete = [False] * len(string)
    
    i = 0
    j = 1
    while j < len(concat_string):
        if concat_string[i] != concat_string[j]:
            flags_delete[i] = True
            flags_delete[j] = True
            num_delete += 2
            
            if i == 0:
                i = j + 1
                j = i + 1
            else:
                i = i - 1
                j = j + 1
        else:
            i = j
            j = i + 1
           
    if num_delete == 0:
        break
    
    count += num_delete
    concat_string = [concat_string[i] for i in range(len(concat_string)) if flags_delete[i] == False]

print(count)

Failing test case input:
11000111100010

Expected output:
14


Actual output:
18


Fixed submission (verdict: Accepted):



import copy

string = [x for x in input()]

concat_string = copy.copy(string)
num_delete = 0

i = 0
j = 1
not_delete_list = []
while True:
    if j >= len(concat_string) or i < 0:
        break
    if concat_string[i] != concat_string[j]:
        num_delete += 2
        
        if i == 0:
            i = j + 1
            j = i + 1
        else:
            if len(not_delete_list) > 0:
                i = not_delete_list.pop(-1)
                j = j + 1
            else:
                i = j + 1
                j = i + 1
    else:
        not_delete_list.append(i)
        i = j
        j = i + 1


print(num_delete)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
class Solver:

    def __init__(self):
        pass


    def solve(self, s):
        one = 0
        zero = 0
        for ch in s:
            if ch == '1':
                one += 1
            else:
                zero += 1
        return abs(one-zero)


if __name__ == '__main__':

    solver = Solver()
    s = input()
    n = solver.solve(s)
    print(n)


Failing test case input:
01101111001010

Expected output:
12


Actual output:
2


Fixed submission (verdict: Accepted):
class Solver:

    def __init__(self):
        pass


    def solve(self, s):
        one = 0
        zero = 0
        for ch in s:
            if ch == '1':
                one += 1
            else:
                zero += 1
        return len(s) - abs(one-zero)


if __name__ == '__main__':

    solver = Solver()
    s = input()
    n = solver.solve(s)
    print(n)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
S = S.replace("0","r")
S = S.replace("1","b")
r = 0
b = 0
for s in S:
    if s == "r":
        r+=1
    else:
        b+=1
print(min([r,b]))

Failing test case input:
01010000111011

Expected output:
14


Actual output:
7


Fixed submission (verdict: Accepted):
S = input()
S = S.replace("0","r")
S = S.replace("1","b")
r = 0
b = 0
for s in S:
    if s == "r":
        r+=1
    else:
        b+=1
print(min([r,b])*2)
Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=str(input())
ue=-1
ans=0
for i in range(len(s)):
  if(ue==-1):
    ue=int(s[i])
  elif(int(s[i])==ue):
    ans+=2
    if(ans==i+1):
      ue=-1
    else:
      ue=1-ue
  else:
    ue=1-ue
print(ans)


Failing test case input:
00001100110011

Expected output:
12


Actual output:
14


Fixed submission (verdict: Accepted):
s=str(input())
ue=-1
ans=0
for i in range(len(s)):
  if(ue==-1):
    ue=int(s[i])
  elif(int(s[i])!=ue):
    ans+=2
    if(ans==i+1):
      ue=-1
print(ans)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b=input(),0
for i in range(len(a)):
    if a[i]=='0':
        b+=1
print(max(min(b,int(a)-b),0)*2)        

Failing test case input:
00001110001001

Expected output:
10


Actual output:
18


Fixed submission (verdict: Accepted):
a,b=input(),0
for i in range(len(a)):
    if a[i]=='0':
        b+=1
print(max(min(b,len(a)-b),0)*2)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
n = len(s)
a = []
i = 0
ct = 0
for i in range(n):
  a.append(int(s[i]))
i = -1

while ct < n:
  n = len(a)
  i += 1
  if i >= n-1: break
  if a[i] == 0 and a[i+1] == 1:
    a.pop(i)
    a.pop(i)
    ct += 1
    i -= 2
    if i < 0: i=-1
    continue
  elif a[i] == 1 and a[i+1] == 0:
    a.pop(i)
    a.pop(i)
    ct += 1
    i -= 2
    if i <0 :i = -1
    
print(ct*2)

Failing test case input:
01001000111011

Expected output:
14


Actual output:
10


Fixed submission (verdict: Accepted):
s = input()
n = len(s)
a = []
i = 0
ct = 0
for i in range(n):
  a.append(int(s[i]))
i = -1

while ct < 100000000000:
  n = len(a)
  i += 1
  if i >= n-1: break
  if a[i] == 0 and a[i+1] == 1:
    a.pop(i)
    a.pop(i)
    ct += 1
    i -= 2
    if i <= 1: i=-1
    continue
  elif a[i] == 1 and a[i+1] == 0:
    a.pop(i)
    a.pop(i)
    ct += 1
    i -= 2
    if i <= 1 :i = -1
    
print(ct*2)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input();print(min(s.count("0"),s.count("1")))

Failing test case input:
00101010111011

Expected output:
12


Actual output:
6


Fixed submission (verdict: Accepted):
s=input();print(2*min(s.count("0"),s.count("1")))
Problem: p03107
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
from collections import deque

def unification(string):

    n = len(string)

    if n == 1:
        return 0

    q = deque()
    idx = 2
    q.appendleft(string[0])
    q.appendleft(string[1])
    count = 0

    while idx < n:
        while len(q) > 1 and q[0] != q[1]:
            q.popleft()
            q.popleft()
            count += 2

        q.appendleft(string[idx])
        idx += 1

    return count


if __name__ == "__main__":
    string = input()
    print(unification(string))

Failing test case input:
00111011111100

Expected output:
10


Actual output:
8


Fixed submission (verdict: Accepted):
from collections import deque

def unification(string):

    n = len(string)

    if n == 1:
        return 0

    q = deque()
    idx = 2
    q.appendleft(string[0])
    q.appendleft(string[1])
    count = 0

    while idx < n:
        while len(q) > 1 and q[0] != q[1]:
            q.popleft()
            q.popleft()
            count += 2

        q.appendleft(string[idx])
        idx += 1

    if len(q) > 1 and q[0] != q[1]:
        q.popleft()
        q.popleft()
        count += 2

    return count


if __name__ == "__main__":
    string = input()
    print(unification(string))

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = str(input())

zero_num = 0
one_num = 0

for i in range(len(S)):
    if S[i] == 0:
        zero_num += 1
    else:
        one_num += 1

print(2*min(zero_num, one_num))

Failing test case input:
11000000111100

Expected output:
12


Actual output:
0


Fixed submission (verdict: Accepted):
S = str(input())

zero_num = 0
one_num = 0

for i in range(len(S)):
    if S[i] == "0":
        zero_num += 1
    else:
        one_num += 1

print(2*min(zero_num, one_num))

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
q = []
l = 0
o = 0
for c in s:
    q.append(c)
    l += 1
    while 2 < l and q[l-1] == q[l-2]:
        q.pop()
        q.pop()
        o += 2
        l -= 2
print(o)


Failing test case input:
01010000111011

Expected output:
14


Actual output:
12


Fixed submission (verdict: Accepted):
s = input()
q = []
l = 0
o = 0
for c in s:
    q.append(c)
    l += 1
    while 1 < l and q[l-1] != q[l-2]:
        q.pop()
        q.pop()
        o += 2
        l -= 2
print(o)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = list(input())
print(min(s.count('0'),s.count('1')))

Failing test case input:
00001000111011

Expected output:
12


Actual output:
6


Fixed submission (verdict: Accepted):
s = list(input())
print(2*min(s.count('0'),s.count('1')))

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()

print(min(s.count("0"), s.count("1")))

Failing test case input:
01001000100100

Expected output:
8


Actual output:
4


Fixed submission (verdict: Accepted):
s = input()

print(min(s.count("0"), s.count("1")) * 2)
Problem: p03107
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
s=list(input())
from collections import Counter
d=Counter(s)
print(min(d[0], d[1])*2)


Failing test case input:
11010100110010

Expected output:
14


Actual output:
0


Fixed submission (verdict: Accepted):
s=list(input())
from collections import Counter
d=Counter(s)
print(min(d["0"], d["1"])*2)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from sys import stdin


sdi = stdin.readline().rstrip()




l = list(sdi)
l.reverse()
start = len(l)
r = 0
i = 0
while len(l) >= i + 2:
    if l[i] != l[i + 1]:
        l.pop(i + 1)
        l.pop(i)
        print("cut", i, i+1)
        i = max(i-2, 0)
    i += 1

print(start - len(l))


Failing test case input:
11001010111001

Expected output:
12


Actual output:
cut 0 1
cut 3 4
cut 3 4
cut 3 4
cut 2 3
10


Fixed submission (verdict: Accepted):
from sys import stdin


sdi = stdin.readline().rstrip()



l = list(sdi)
l.reverse()
start = len(l)
i = 0
while len(l) - 1 >= i + 1:
    if l[i] != l[i + 1]:
        l.pop(i + 1)
        l.pop(i)
        i = max(i - 2, 0)
        continue
    i += 1
print(start - len(l))

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
IS = lambda: sys.stdin.readline().rstrip()
II = lambda: int(IS())
MII = lambda: list(map(int, IS().split()))
from collections import deque

def main():
    s = IS()
    dq = deque()
    n = len(s)
    dq.append(s[0])
    cnt = 0
    idx = 1
    while idx < n:
        if not len(dq) > 0: dq.append(s[idx]); continue
        a = dq[-1]
        b = s[idx]
        if a == b:
            dq.append(b)
        else:
            dq.pop()
            cnt += 2
        idx += 1
    print(cnt)

if __name__ == '__main__':
    main()


Failing test case input:
01100110001010

Expected output:
12


Actual output:
16


Fixed submission (verdict: Accepted):
import sys
IS = lambda: sys.stdin.readline().rstrip()
II = lambda: int(IS())
MII = lambda: list(map(int, IS().split()))
from collections import deque

def main():
    s = IS()
    dq = deque()
    dq.append(s[0])
    cnt = 0
    for i in range(1, len(s)):
        if len(dq) == 0: dq.append(s[i]); continue
        a = dq[-1]
        b = s[i]
        if a == b: dq.append(b)
        else: dq.pop(); cnt += 2
    print(cnt)

if __name__ == '__main__':
    main()
Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


A = input()
N = len(A)

zero_num = A.count('0')
one_num = A.count('1')

if N == 1 or zero_num == 0 or one_num == 0:
    print(0)
    exit()

if N == 3:
    if zero_num == 1 or one_num == 1:
        print(2)
        exit()

if zero_num == one_num:
    ans = one_num*2
elif zero_num > one_num:
    ans = (int(zero_num/one_num) * one_num)*2
else:
    ans = (int(one_num / zero_num) * zero_num)*2

print(ans)

Failing test case input:
01001000101000

Expected output:
8


Actual output:
16


Fixed submission (verdict: Accepted):


A = input()
N = len(A)

zero_num = A.count('0')
one_num = A.count('1')


if N == 1 or zero_num == 0 or one_num == 0:
    print(0)
    exit()

if zero_num == 1 or one_num == 1:
    print(2)
    exit()

if zero_num == one_num:
    ans = one_num*2
elif zero_num > one_num:
    ans = one_num*2
else:
    ans = zero_num*2

print(ans)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=input()

num0=0
num1=1

for i in range(len(S)):
    if S[i]=='0':
        num0+=1
    else:
        num1+=1
print(2*min(num0,num1))

Failing test case input:
11000000111100

Expected output:
12


Actual output:
14


Fixed submission (verdict: Accepted):
S=input()

num0=0
num1=0

for i in range(len(S)):
    if S[i]=='0':
        num0+=1
    else:
        num1+=1
print(2*min(num0,num1))

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from sys import stdin


sdi = stdin.readline().rstrip()




l = list(sdi)
l.reverse()
start = len(l)
r = 0
i = 0
while len(l) >= i + 2:
    if l[i] != l[i + 1]:
        l.pop(i + 1)
        l.pop(i)
        i = max(i-2, 0)
    i += 1

print(start - len(l))


Failing test case input:
00101000110011

Expected output:
12


Actual output:
10


Fixed submission (verdict: Accepted):
from sys import stdin


sdi = stdin.readline().rstrip()



l = list(sdi)
l.reverse()
start = len(l)
i = 0
while len(l) - 1 >= i + 1:
    if l[i] != l[i + 1]:
        l.pop(i + 1)
        l.pop(i)
        i = max(i - 2, 0)
        continue
    i += 1
print(start - len(l))
Problem: p03370
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, x = map(int, input().split())
m = [int(input()) for _ in range(n)]

print(sum(m) + max(m)*(x-n))

Failing test case input:
4 477
3
19
126
24

Expected output:
105


Actual output:
59770


Fixed submission (verdict: Accepted):
n, x = map(int, input().split())
m = [int(input()) for _ in range(n)]

print(n + (x - sum(m))

Problem: p03370
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, x = map(int, input().split())
m = []
for i in range(n):
    m.append(int(input()))
x = x - sum(m)
c = n
min_m = min(m)
if x > 0:
    c -= 1
while (x > 0):
    c += 1
    x = x - min_m
print(c)

Failing test case input:
4 227
664
6
6
172

Expected output:
-100


Actual output:
4


Fixed submission (verdict: Accepted):
import math
n, x = map(int, input().split())
m = []
for i in range(n):
    m.append(int(input()))
x = x - sum(m)
c = n
min_m = min(m)
c += math.floor(x / min_m)
print(c)

Problem: p03370
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,x = map(int,input().split())
m = []
for i in range(n):
    m += map(int,input().split())
while (x - sum(m)) > min(m):
    x -= min(m)
    n += 1
print(n)

Failing test case input:
3 2
668
3
9
15

Expected output:
-223


Actual output:
3


Fixed submission (verdict: Accepted):
n,x = map(int,input().split())
m = []
for i in range(n):
    m += map(int,input().split())
print(n + (x - sum(m))

Problem: p03370
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, x = map(int, input().split())
m = [int(input()) for _ in range(n)]

print(sum(m) + min(m)*(x-n))


Failing test case input:
3 1001
120
110
140

Expected output:
8


Actual output:
110150


Fixed submission (verdict: Accepted):
n, x = map(int, input().split())
m = [int(input()) for _ in range(n)]

print(n + (x - sum(m))

Problem: p03370
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, X = map(int, input().split())

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

X -= sum(m)

ans = X 

print(ans)

Failing test case input:
4 293
144
13
27
90

Expected output:
5


Actual output:
19


Fixed submission (verdict: Accepted):
N, X = map(int, input().split())

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

X -= sum(m)

ans = (X 

print(ans)

Problem: p03370
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, x = map(int, input().split())
mn = []
for _ in range(n):
  mi = int(input())
  mn.append(mi)
mn.sort()
x -= sum(mn)
print(n + (x % mn[0]))

Failing test case input:
4 227
275
6
6
90

Expected output:
-21


Actual output:
4


Fixed submission (verdict: Accepted):
n, x = map(int, input().split())
mn = []
for _ in range(n):
  mi = int(input())
  mn.append(mi)
mn.sort()
x -= sum(mn)
print(n + (x