ZhenlongDai/ACPR huggingface dataset:
Problem: p02712
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
sum1=0
for i in range(n):
    if not(i%3==0 or i%5==0):
        sum1=sum1+i
    else:
        sum1=sum1
print(sum1)



Failing test case input:
1110001

Expected output:
328561110001


Actual output:
328560000000


Fixed submission (verdict: Accepted):
n=int(input())
sum1=0
for i in range(1,n+1):
    if not(i%3==0 or i%5==0):
        sum1=sum1+i
print(sum1)

Problem: p02712
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
ans = 0
for i in range(n):
    if i % 3 == 0:
        continue
    if i % 5 == 0:
        continue
    ans += i
print(ans)


Failing test case input:
1110001

Expected output:
328561110001


Actual output:
328560000000


Fixed submission (verdict: Accepted):
n = int(input())
ans = 0
for i in range(1,n+1):
    if i % 3 == 0:
        continue
    if i % 5 == 0:
        continue
    ans += i
print(ans)

Problem: p02712
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())

ans=0
for i in range(n):
    if i%3!=0 and i%5!=0 :
        ans+=i

print(ans)

Failing test case input:
1110001

Expected output:
328561110001


Actual output:
328560000000


Fixed submission (verdict: Accepted):
n = int(input())

ans=0
for i in range(1,n+1):
    if i%3!=0 and i%5!=0 :
        ans+=i

print(ans)

Problem: p02712
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
def main():
    i = int(input())
    s = 0
    for j in range(1, i):
        if j % 3 == 0 and s % 5 == 0:
            pass  
        elif j % 3 == 0:
            pass  
        elif j % 5 == 0:
            pass  
        else:
            s += j
    print(s)


main()


Failing test case input:
1110001

Expected output:
328561110001


Actual output:
328560000000


Fixed submission (verdict: Accepted):
def main():
    i = int(input())+1
    s = 0
    for j in range(1, i):
        if j % 3 == 0 and s % 5 == 0:
            pass  
        elif j % 3 == 0:
            pass  
        elif j % 5 == 0:
            pass  
        else:
            s += j
    print(s)


main()

Problem: p02712
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
a = list(range(n))
sum = 0
for i in a:
  if a[i] % 3 == 0 or a[i] % 5 == 0:
    a[i] = 0
  sum += a[i]
print(sum)

Failing test case input:
1110001

Expected output:
328561110001


Actual output:
328560000000


Fixed submission (verdict: Accepted):
n = int(input())
a = list(range(1, n + 1))
sum = 0
for i in range(n):
  if a[i] % 3 == 0 or a[i] % 5 == 0:
    a[i] = 0
  sum += a[i]
print(sum)

Problem: p02712
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())

ans = 0
for i in range(n):
    if i % 3 != 0 or i % 3 != 5:
        ans += i
print(ans)

Failing test case input:
1111110

Expected output:
329217448560


Actual output:
617282160495


Fixed submission (verdict: Accepted):
n = int(input())

ans = 0
for i in range(1, n+1):
    if i % 3 != 0 and i % 5 != 0:
        ans += i
print(ans)
Problem: p02712
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N = int(input())
sum = 0
for i in range(N):
    if (i%3)*(i%5):
        sum += i

print(sum)

Failing test case input:
1110001

Expected output:
328561110001


Actual output:
328560000000


Fixed submission (verdict: Accepted):
N = int(input())
sum = 0
for i in range(1, N+1):
    if (i%3)*(i%5):
        sum += i

print(sum)

Problem: p02712
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
sum([i for i in range(1, int(input())+1) if i % 3 != 0 and i % 5 != 0])

Failing test case input:
1110001

Expected output:
328561110001


Actual output:

Fixed submission (verdict: Accepted):
print(sum([i for i in range(1, int(input())+1) if i % 3 != 0 and i % 5 != 0]))

Problem: p02712
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
sum = 0
for i in range(1 , n + 1 ):
    if (i % 3 == 0) and (i % 5 == 0):
        n = "FizzBuzz"
    elif (i % 3 == 0):
        n = "Fizz"
    elif (i % 5 == 0):
        n = "ZBuzz"
    else:
        sum += 1

print(sum)

Failing test case input:
1111010

Expected output:
329158562362


Actual output:
592539


Fixed submission (verdict: Accepted):
N = int(input())
list = []

for i in range(1, N + 1):
    if i % 3 == 0 and i % 5 == 0:
        "FizzBuzz"
    elif i % 3 == 0:
        "Fizz"
    elif i % 5 == 0:
        "Buzz"
    else:
        list.append(i)
print(sum(list))

Problem: p02712
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())

l = [i for i in range(n) if i % 3 != 0 and i % 5 != 0]

print(sum(l))

Failing test case input:
1110001

Expected output:
328561110001


Actual output:
328560000000


Fixed submission (verdict: Accepted):
n = int(input())

l = [i for i in range(n+1) if i % 3 != 0 and i % 5 != 0]

print(sum(l))

Problem: p02712
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N=int(input())
sum = 0
for i in range(N):
  if i % 3 == 0 or i % 5 == 0:
    pass
  else:
    sum += i
print(sum)

Failing test case input:
1110001

Expected output:
328561110001


Actual output:
328560000000


Fixed submission (verdict: Accepted):
N=int(input())+1
sum = 0
for i in range(N):
  if i % 3 == 0 or i % 5 == 0:
    pass
  else:
    sum += i
print(sum)

Problem: p02712
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
list = []
list1 = []
for i in range(1, n):
    if i%5==0 and i%3==0:
        list.append('FizzBuzz')
    elif i%3==0:
        list.append('Fizz')
    elif i%5==0:
        list.append('Buzz')
    else:
        list.append(i)
for j in list:
    if isinstance(j, int):
        list1.append(j)

print(sum(list1))

Failing test case input:
1110001

Expected output:
328561110001


Actual output:
328560000000


Fixed submission (verdict: Accepted):
n = int(input())
list = []
list1 = []
for i in range(1, n+1):
    if i%5==0 and i%3==0:
        list.append('FizzBuzz')
    elif i%3==0:
        list.append('Fizz')
    elif i%5==0:
        list.append('Buzz')
    else:
        list.append(i)
for j in list:
    if isinstance(j, int):
        list1.append(j)
print(sum(list1))
Problem: p02712
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
sum = 0
for i in range(n):
    if i % 5 != 0 and i % 3 != 0:
        sum += i
print(sum)


Failing test case input:
1110001

Expected output:
328561110001


Actual output:
328560000000


Fixed submission (verdict: Accepted):
n = int(input())
sum = 0
for i in range(n + 1):
    if i % 5 != 0 and i % 3 != 0:
        sum += i
print(sum)

Problem: p02712
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N=int(input())
num_list=[]
for i in range(N+1):
  if i%3!=0 or i%5!=0:
    num_list.append(i)
print(sum(num_list))

Failing test case input:
1101100

Expected output:
323311955632


Actual output:
565797298735


Fixed submission (verdict: Accepted):
N=int(input())
num_list=[]
for i in range(N+1):
  if i%3!=0 and i%5!=0:
    num_list.append(i)
print(sum(num_list))

Problem: p02712
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N=int(input())
P=0
for i in range(N):
    if i%3==0 or i%5==0:
        P+=1
print(P)

Failing test case input:
1101100

Expected output:
323311955632


Actual output:
513847


Fixed submission (verdict: Accepted):
N=int(input())
P=0
for i in range(N+1):
    if i%3!=0 and i%5!=0:
        P+=i
print(P)

Problem: p02712
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
x=0
for i in range(1,1+N):
  if (N % 3) != 0 or (N%5) !=0:
    x = x + i
print(x)


Failing test case input:
1110001

Expected output:
328561110001


Actual output:
616051665001


Fixed submission (verdict: Accepted):
N = int(input())
x = 0
for i in range(1, N+1):
    if (i % 3) != 0 and (i % 5) != 0:
        x = x+i
print(x)

Problem: p02712
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
SUM = [0]*N
for i in range(N):
    if i%3 == 0 and i%5 == 0:
        SUM[i] = 0
    elif i%3 == 0:
        SUM[i] = 0
    elif i%5 == 0:
        SUM[i] = 0
    else:
        SUM[i] = i
print(sum(SUM))

Failing test case input:
1110001

Expected output:
328561110001


Actual output:
328560000000


Fixed submission (verdict: Accepted):
N = int(input())
SUM = [0]*(N+1)
for i in range(1,N+1):
    if i%3 == 0 and i%5 == 0:
        SUM[i] = 0
    elif i%3 == 0:
        SUM[i] = 0
    elif i%5 == 0:
        SUM[i] = 0
    else:
        SUM[i] = i
print(sum(SUM))

Problem: p02712
Buggy submission (Python (3.8.2), verdict: Wrong Answer):



def MI():return map(int,input().split())
def LI():return list(MI())

n=int(input())

def fb(x):
    if x%15==0:
        return 0
    if x%5==0:
        return 0
    if x%3==0:
        return 0
    return x
ans=0
for i in range(n):
    ans+=fb(i)
    
print(ans)

Failing test case input:
1110001

Expected output:
328561110001


Actual output:
328560000000


Fixed submission (verdict: Accepted):



def MI():return map(int,input().split())
def LI():return list(MI())

n=int(input())

def fb(x):
    if x%15==0:
        return 0
    if x%5==0:
        return 0
    if x%3==0:
        return 0
    return x
ans=0
for i in range(1,n+1):
    ans+=fb(i)
    
print(ans)
Problem: p02712
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
ans = 0
for i in range(n):
    if i%3 != 0 and i%5 != 0:
        ans += i
print(ans)

Failing test case input:
1110001

Expected output:
328561110001


Actual output:
328560000000


Fixed submission (verdict: Accepted):
n = int(input())
ans = 0
for i in range(n+1):
    if i%3 != 0 and i%5 != 0:
        ans += i
print(ans)
Problem: p03806
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, A, B = map(int, input().split())
X = [1<<100] * 8080
for _ in range(N):
    a, b, c = map(int, input().split())
    t = A*b-B*a
    X[t] = min(X[t], c)
    X = [min(X[i], X[(i-t)%N] + c) for i in range(8080)]

print(-1 if X[0] > 1<<80 else X[0])

Failing test case input:
3 1 1
0 2 2
2 1 4
0 3 16

Expected output:
-1


Actual output:
8


Fixed submission (verdict: Accepted):
N, A, B = map(int, input().split())
X = [1<<20] * 8080
for _ in range(N):
    a, b, c = map(int, input().split())
    t = A*b-B*a
    X = [min(X[i], (0 if (i-t)%8080 == 0 else X[(i-t)%8080]) + c) for i in range(8080)]
print(-1 if X[0] > 1<<18 else X[0])

Problem: p03806
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, A, B = map(int, input().split())
X = [1<<20] * 8080
for _ in range(N):
    a, b, c = map(int, input().split())
    t = A*b-B*a
    X = [min(X[i], (0 if i == t else X[(i-t)%8080]) + c) for i in range(8080)]
print(-1 if X[0] > 1<<18 else X[0])

Failing test case input:
3 1 1
3 0 2
2 1 2
0 3 22

Expected output:
24


Actual output:
-1


Fixed submission (verdict: Accepted):
N, A, B = map(int, input().split())
X = [1<<20] * 8080
for _ in range(N):
    a, b, c = map(int, input().split())
    t = A*b-B*a
    X = [min(X[i], (0 if (i-t)%8080 == 0 else X[(i-t)%8080]) + c) for i in range(8080)]
print(-1 if X[0] > 1<<18 else X[0])

Problem: p03806
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, A, B = map(int, input().split())
X = [1<<20] * 4040
for _ in range(N):
    a, b, c = map(int, input().split())
    t = A*b-B*a
    X[t] = min(X[t], c)
    X = [min(X[i], X[(i-t)%N] + c) for i in range(4040)]

print(-1 if X[0] > 1<<19 else X[0])

Failing test case input:
3 1 1
2 0 2
2 1 2
0 3 11

Expected output:
15


Actual output:
-1


Fixed submission (verdict: Accepted):
N, A, B = map(int, input().split())
X = [1<<20] * 8080
for _ in range(N):
    a, b, c = map(int, input().split())
    t = A*b-B*a
    X = [min(X[i], (0 if (i-t)%8080 == 0 else X[(i-t)%8080]) + c) for i in range(8080)]
print(-1 if X[0] > 1<<18 else X[0])

Problem: p03806
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, A, B = map(int, input().split())
X = [1<<100] * 8080
for _ in range(N):
    a, b, c = map(int, input().split())
    t = A*b-B*a
    X = [min(X[i], (0 if i == t else X[(i-t)%N]) + c) for i in range(8080)]

print(-1 if X[0] > 1<<80 else X[0])

Failing test case input:
3 1 1
3 0 2
2 1 2
0 3 22

Expected output:
24


Actual output:
-1


Fixed submission (verdict: Accepted):
N, A, B = map(int, input().split())
X = [1<<20] * 8080
for _ in range(N):
    a, b, c = map(int, input().split())
    t = A*b-B*a
    X = [min(X[i], (0 if (i-t)%8080 == 0 else X[(i-t)%8080]) + c) for i in range(8080)]
print(-1 if X[0] > 1<<18 else X[0])
Problem: p03806
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, A, B = map(int, input().split())
X = [1<<20] * 4040
for _ in range(N):
    a, b, c = map(int, input().split())
    t = A*b-B*a
    X = [min(X[i], (0 if i == t else X[(i-t)%4040]) + c) for i in range(4040)]
print(-1 if X[0] > 1<<18 else X[0])

Failing test case input:
3 1 1
2 0 2
2 1 2
0 3 22

Expected output:
26


Actual output:
-1


Fixed submission (verdict: Accepted):
N, A, B = map(int, input().split())
X = [1<<20] * 8080
for _ in range(N):
    a, b, c = map(int, input().split())
    t = A*b-B*a
    X = [min(X[i], (0 if (i-t)%8080 == 0 else X[(i-t)%8080]) + c) for i in range(8080)]
print(-1 if X[0] > 1<<18 else X[0])
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(min(num0,num1))



Failing test case input:
00101000110011

Expected output:
12


Actual output:
7


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):
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:
10000000111100

Expected output:
10


Actual output:
11


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):
S=input()
stack=[]
ans=0

for i in range(len(S)-1):
    if len(stack)==0:
        stack.append(S[i])
    elif stack[len(stack)-1]!=S[i]:
        stack.pop()
        ans+=2
    else:
        stack.append(S[i])

print(ans)

Failing test case input:
11010100111010

Expected output:
12


Actual output:
10


Fixed submission (verdict: Accepted):
S=input()
stack=[]
ans=0

for i in range(len(S)):
    if len(stack)==0:
        stack.append(S[i])
    elif stack[len(stack)-1]!=S[i]:
        stack.pop()
        ans+=2
    else:
        stack.append(S[i])

print(ans)

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

Failing test case input:
01011110111010

Expected output:
10


Actual output:
12


Fixed submission (verdict: Accepted):
S = input()
ans = 0
stack = []
for i in range(len(S)):
    if len(stack)==0:
        stack.append(S[i])
        continue
    if S[i] != stack[-1]:
        ans += 2
        stack.pop()
    else:
        stack.append(S[i])
print(ans)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=input()
lenS=len(S)
ls=[]
ls.append(S[0])
for i in range(1,lenS):
	if len(ls)==0:
		ls.append(S[0])
		continue
	tmp=ls.pop(-1)
	if tmp==S[i]:
		ls.append(tmp)
		ls.append(S[0])
print(lenS-len(ls))





Failing test case input:
11001000001001

Expected output:
10


Actual output:
12


Fixed submission (verdict: Accepted):
S=input()
lenS=len(S)
ls=[]
ls.append(S[0])
for i in range(1,lenS):
	if len(ls)==0:
		ls.append(S[i])
		continue
	tmp=ls.pop(-1)
	if tmp==S[i]:
		ls.append(tmp)
		ls.append(S[i])
print(lenS-len(ls))
Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = list(input())
cnt1 = 0
cnt0 = 0
for i in s:
    if i == '1':
        cnt1 += 1
    else:
        cnt0 += 1
print(max(cnt1, cnt0))



Failing test case input:
11001000101001

Expected output:
12


Actual output:
8


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

Problem: p03107
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
s=list(input())
n=len(s)
a=s.count('1')
b=n-a
print(abs(a-b))

Failing test case input:
01101111001001

Expected output:
12


Actual output:
2


Fixed submission (verdict: Accepted):
s=list(input())
n=len(s)
a=s.count('1')
b=n-a
c=abs(a-b)
print(n-c)

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

Failing test case input:
11001011111101

Expected output:
8


Actual output:
4


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):
a=list(str(input()))
b=a.count('0')
c=a.count('1')
print(b if b<=c else c)

Failing test case input:
01011011011101

Expected output:
10


Actual output:
5


Fixed submission (verdict: Accepted):
a=list(str(input()))
b=a.count('0')
c=a.count('1')
print(b*2 if b<=c else c*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:
00011111111000

Expected output:
12


Actual output:
6


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):
try:
  print(Counter(input()).most_common()[1][1] * 2)
except:
  print(0)

Failing test case input:
01100110100010

Expected output:
12


Actual output:
0


Fixed submission (verdict: Accepted):
from collections import Counter
try:
  print(Counter(input()).most_common()[1][1] * 2)
except:
  print(0)

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


Failing test case input:
11000101110010

Expected output:
14


Actual output:
7


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

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

S = str(input())
cube = list(S)
count0 = 0
count1 = 0

for string in cube:
    if string == '0':
        count0 = count0 + 1
    else:
        count1 = count1 + 1

print(min(count0,count1))


Failing test case input:
01001010101001

Expected output:
12


Actual output:
6


Fixed submission (verdict: Accepted):
S = str(input())
cube = list(S)
count0 = 0
count1 = 0

for string in cube:
    if string == '0':
        count0 = count0 + 1
    else:
        count1 = count1 + 1

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

Failing test case input:
01101000110011

Expected output:
14


Actual output:
0


Fixed submission (verdict: Accepted):
s=input()
zero=0
one=0
for i in range(len(s)):
  if s[i]=='0':
    zero+=1
  else:
    one+=1
print(len(s)-abs(one-zero))

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

a=s.count('0')
b=s.count('0')
print(min(a,b)*2)

Failing test case input:
00101000110011

Expected output:
12


Actual output:
16


Fixed submission (verdict: Accepted):
s=str(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):
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)


Failing test case input:
10000000111000

Expected output:
8


Actual output:
10


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.4.3), verdict: Wrong Answer):
S=input()
stack=[]
count=0
for s in S:
    if not stack:
        stack.append(s)
    elif s[-1]!=s:
        stack.pop()
        count+=2
    else:
        stack.append(s)
print(count)

Failing test case input:
11010100110010

Expected output:
14


Actual output:
0


Fixed submission (verdict: Accepted):
S=input()
stack=[]
count=0
for s in S:
    if not stack:
        stack.append(s)
    elif stack[-1]!=s:
        stack.pop()
        count+=2
    else:
        stack.append(s)
print(count)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
r = 0
b = 0
for a in input():
    if a == '0':
        r += 1
    else:
        b += 1

print(min(r, b))

Failing test case input:
11001000001001

Expected output:
10


Actual output:
5


Fixed submission (verdict: Accepted):
r = 0
b = 0
for a in input():
    if a == '0':
        r += 1
    else:
        b += 1

print(min(r, b)*2)

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

s = list(input())
zero = 0
one = 0
for i in s:
    if i == "1":
        one += 1
    else:
        zero += 1
print(min(one,zero))

Failing test case input:
01101111001010

Expected output:
12


Actual output:
6


Fixed submission (verdict: Accepted):


s = list(input())
zero = 0
one = 0
for i in s:
    if i == "1":
        one += 1
    else:
        zero += 1
print(2*min(one, zero))
Problem: p03107
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
S = input()
n = 0
stack = 0
for s in S:
    if s == S[0]:
        stack += 1
    else:
        if stack > 0:
            n += 2
            stack -= 1
print(n)

Failing test case input:
01100010100010

Expected output:
10


Actual output:
8


Fixed submission (verdict: Accepted):
S = input()
n = 0
i = 0
while i < len(S):
    
    if len(set(S[i:i+2])) == 2:
        S = S[:i]+S[i+2:]
        n += 2
        if i != 0:
            i -= 1
    else:
        i += 1
print(n)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
li = list(input())
a = li.count("0")
if a < len(li):
    print(2*a)
else:
    print(2*(len(li)-a))


Failing test case input:
01100110001010

Expected output:
12


Actual output:
16


Fixed submission (verdict: Accepted):
li = list(input())
a = li.count("0")
import math
if a < math.ceil(len(li)/2):
    print(2*a)
else:
    print(2*(len(li)-a))

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) - 1:
        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:
11011110111010

Expected output:
8


Actual output:
6


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):
s=str(input())
if s.count('1')>s.count('0'):
    print(s.count('1')-s.count('0'))
else:
    print(s.count('0')-s.count('1'))


Failing test case input:
01001000101001

Expected output:
10


Actual output:
4


Fixed submission (verdict: Accepted):
s=str(input())
if s.count('1')>s.count('0'):
    print(s.count('0')*2)
else:
    print(s.count('1')*2)
Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):






s = input()
an0 = 0
an1 = 0
for i in s:
    if s == "1":
        an1 += 1
    if s == "0":
        an0 += 1
print(min(an0, an1))

Failing test case input:
01001001100100

Expected output:
10


Actual output:
0


Fixed submission (verdict: Accepted):






s = list(input())
an0 = 0
an1 = 0
for i in s:
    if i == "1":
        an1 += 1
    if i == "0":
        an0 += 1
print(min(an0, an1)*2)

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

c0=0
c1=0

for s in S:
  if s=='0':
    c0 += 1
  else:
    c1 += 1
print(min(c0,c1))

Failing test case input:
01111011011100

Expected output:
10


Actual output:
5


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

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = list(input())
L = len(S)
i = 1
while len(S)>0 and i<len(S)-1:
  if int(S[i]) != int(S[i-1]):
    S.pop(i-1)
    S.pop(i-1)
    i=0
  else:
    i+=1

print(L-len(S))

Failing test case input:
01010000111011

Expected output:
14


Actual output:
12


Fixed submission (verdict: Accepted):
S = list(input())
SL = len(S)
L = len(S)
i = 1
while len(S)>1 and i<len(S):
  if int(S[i]) != int(S[i-1]):
    S.pop(i-1)
    S.pop(i-1)
    i-=1
  else:
    i+=1
  if i==0:
    i+=1
print(L-len(S))

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_0, count_1)

    print(answer)

Failing test case input:
01101111001010

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 (Python (3.4.3), verdict: Wrong Answer):






s = input()
an0 = 0
an1 = 0
for i in s:
    if s == "1":
        an1 += 1
    if s == "0":
        an0 += 1
print(min(an0, an1)*2)

Failing test case input:
11010101110010

Expected output:
12


Actual output:
0


Fixed submission (verdict: Accepted):






s = list(input())
an0 = 0
an1 = 0
for i in s:
    if i == "1":
        an1 += 1
    if i == "0":
        an0 += 1
print(min(an0, an1)*2)

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:
11010100110010

Expected output:
14


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):
l=list(map(str,input()))
print(2*(min(l.count(0),l.count(1))))


Failing test case input:
00011111011000

Expected output:
14


Actual output:
0


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

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(2*g)
elif g == n/2:
    print(n)
    exit()
elif n ==0:
    print(0)
    exit()
print(2*g)

Failing test case input:
00101010111011

Expected output:
12


Actual output:
2
2


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 = input()
print(len(s) - 2 * min([sum([v == '1' for v in s]), sum([v == '0' for v in s])]))

Failing test case input:
11000110100010

Expected output:
12


Actual output:
2


Fixed submission (verdict: Accepted):
s = input()
print(2 * min([sum([v == '1' for v in s]), sum([v == '0' for v in s])]))

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

Failing test case input:
00101000011011

Expected output:
12


Actual output:
10


Fixed submission (verdict: Accepted):
S = list(input())
obj = min(S.count("0"),S.count("1"))
print(obj*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:
00101010110011

Expected output:
14


Actual output:
7


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):
s=input()
ans=min(s.count('0'),s.count('1'))
print(ans)

Failing test case input:
00101000111011

Expected output:
14


Actual output:
7


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):
from collections import Counter
s=input()
if len(set(s)) == 1:
  print(0)
else:
  cs=Counter()
  print(min(cs['0'],cs['1'])*2)


Failing test case input:
11001000100100

Expected output:
10


Actual output:
0


Fixed submission (verdict: Accepted):
from collections import Counter
s=input()
if len(set(s)) == 1:
  print(0)
else:
  cs=Counter(s)
  print(min(cs['0'],cs['1'])*2)

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

count = 0
for i in range(N):
    if S[i] == 0:
        count += 1

ans = min(count, N - count) * 2
print(ans)


Failing test case input:
11000110100010

Expected output:
12


Actual output:
0


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

count = 0
for i in range(N):
    if S[i] == "0":
        count += 1

ans = min(count, N - count) * 2
print(ans)
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 True:
        if j >= len(concat_string) or i < 0:
            break
        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:
01001001100000

Expected output:
8


Actual output:
10


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):
s=input()
a=s.count("1")
b=s.count("2")

print(min(a,b))


Failing test case input:
01001000111011

Expected output:
14


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()

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:
01001001100100

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):
def inpl():
    return list(map(int, input().split()))


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

Failing test case input:
00011110111000

Expected output:
14


Actual output:
7


Fixed submission (verdict: Accepted):
def inpl():
    return list(map(int, input().split()))


S = input()
print(min(S.count('0'), S.count('1')) * 2)
Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = list(map(int, list(input())))
i = [x for x in s if x == 1]
n = len(s)
m = sum(i)
if n <= m:
    print(n*2)
else:
    print(m*2)

Failing test case input:
11010101111010

Expected output:
10


Actual output:
18


Fixed submission (verdict: Accepted):
s = list(map(int, list(input())))
i = [x for x in s if x == 1]
m = sum(i)
n = len(s)-m

if n <= m:
    print(n*2)
else:
    print(m*2)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
input = sys.stdin.readline
s = input()
count = 0

if s.count("0") != 0 and s.count("1") != 0:
    if s.count("0") > s.count("1"):
        print(2*s.count("1"))
    elif s.count("1") > s.count("0"):
        print(2*s.count("0"))
    else:
        print(len(s))
else:
    print(0)


Failing test case input:
11001000111001

Expected output:
14


Actual output:
15


Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.readline
s = input().rstrip()
 
if s.count("0") != 0 and s.count("1") != 0:
    if s.count("0") > s.count("1"):
        print(2*s.count("1"))
    elif s.count("1") > s.count("0"):
        print(2*s.count("0"))
    else:
        print(len(s))
else:
    print(0)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
s=list(s)
zeroc=0
onec=0
for i in s:
  if i == 0:
    zeroc+=1
  if i == 1:
    onec+=1
print(min(zeroc,onec)*2)


Failing test case input:
01000010100010

Expected output:
8


Actual output:
0


Fixed submission (verdict: Accepted):
s = input()
s=list(s)
zeroc=0
onec=0
for i in s:
  if i == "0":
    zeroc+=1
  if i == "1":
    onec+=1
print(min(zeroc,onec)*2)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
if len(s)==1:
    print(1)
else:
    print(len(s)-len(s.strip("01")))

Failing test case input:
01000010100010

Expected output:
8


Actual output:
14


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

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=[i for i in input()]
m=0
for i in range(len(S)):
  if S[i]==1:
    m+=1
  else:
    m-=1
print(len(S)-abs(m))

Failing test case input:
11011011111101

Expected output:
6


Actual output:
0


Fixed submission (verdict: Accepted):
S=[i for i in input()]
m=0
for i in range(len(S)):
  if S[i]=='1':
    m+=1
  else:
    m-=1
print(len(S)-abs(m))

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
cnt_one = s.count('1')
cnt_zero = len(s) - cnt_one
print(len(s) - min(cnt_zero, cnt_one)*2)

Failing test case input:
11000101100010

Expected output:
12


Actual output:
2


Fixed submission (verdict: Accepted):
s = input()
cnt_one = s.count('1')
cnt_zero = len(s) - cnt_one
print(min(cnt_zero, cnt_one)*2)
Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()

num_0 = S.count('0')
num_1 = S.count('1')
print(min(num_0,num_1))
        
      

Failing test case input:
01001010100100

Expected output:
10


Actual output:
5


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

num_0 = S.count('0')
num_1 = S.count('1')
print(2*min(num_0,num_1))

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import Counter
C = Counter(list(input()))
print(C["0"] if C["0"]<=C["1"] else C["1"])

Failing test case input:
11010100111010

Expected output:
12


Actual output:
6


Fixed submission (verdict: Accepted):
from collections import Counter
C = Counter(list(input()))
print(C["0"]*2 if C["0"]<=C["1"] else C["1"]*2)

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

end_flg = False
ans = 0

while not end_flg:
    for i in range(len(S)-1):
        if i == len(S)-2:
            end_flg = True
            break
        if (S[i] == '1' and S[i+1] == '0') or (S[i] == '0' and S[i+1] == '1'):
            ans += 2
            S.pop(i)
            S.pop(i)
            break

print(ans)

Failing test case input:
01101111001000

Expected output:
14


Actual output:
12


Fixed submission (verdict: Accepted):
import sys

S = list(input())
i = 0
cnt = 0

if len(S) == 1:
    print(0)
    sys.exit()

while True:
    if i == len(S) - 2:
        if S[i] != S[i+1]:
            cnt += 2
        break
    if S[i] != S[i+1]:
        cnt += 2
        S.pop(i)
        S.pop(i)
        if i > 0:
            i -= 1
    else:
        i += 1
print(cnt)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
input = sys.stdin.readline

S = input()
stack = []
count = 0
for s in S:
  if not stack:
    stack.append(s)
  elif s != stack[-1]:
    stack.pop()
    count += 2
  else:
    stack.append(s)
print(count)    

Failing test case input:
00001100110011

Expected output:
12


Actual output:
14


Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.readline

S = input().rstrip()
stack = []
count = 0
for s in S:
  if not stack:
    stack.append(s)
  elif s != stack[-1]:
    stack.pop()
    count += 2
  else:
    stack.append(s)
print(count)

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = list(input())
SL = len(S)
L = len(S)
i = 1
while len(S)>0 and i<len(S):
  if int(S[i]) != int(S[i-1]):
    S.pop(i-1)
    S.pop(i-1)
    i=0
  else:
    i+=1

print(L-len(S))

Failing test case input:
00101100110011

Expected output:
14


Actual output:
12


Fixed submission (verdict: Accepted):
S = list(input())
SL = len(S)
L = len(S)
i = 1
while len(S)>1 and i<len(S):
  if int(S[i]) != int(S[i-1]):
    S.pop(i-1)
    S.pop(i-1)
    i-=1
  else:
    i+=1
  if i==0:
    i+=1
print(L-len(S))
Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = list(map(int,input()))
if  1  not in s or 0 not in s:
    print(0)
    exit()
print((s.count(min(0,1)))*2)

Failing test case input:
11001000100100

Expected output:
10


Actual output:
18


Fixed submission (verdict: Accepted):
s = list(map(int,input()))
if  1  not in s or 0 not in s:
    print(0)
    exit()
print(2*min(s.count(0),s.count(1)))

Problem: p03107
Buggy submission (PyPy3 (2.4.0), 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.4.3), verdict: Wrong Answer):
s = input()
print(min(s.count('0'), s.count('1')))

Failing test case input:
01101100110011

Expected output:
12


Actual output:
6


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):
s = input()
n0, n1 = 0, 0

for c in s:
  if c == '0':
    n0 += 1
  else:
    n1 += 1
      
print(min(n0, n1))

Failing test case input:
11001000100100

Expected output:
10


Actual output:
5


Fixed submission (verdict: Accepted):
s = input()
n0, n1 = 0, 0

for c in s:
  if c == '0':
    n0 += 1
  else:
    n1 += 1
      
print(min(n0, n1)*2)

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

print(max(s.count("1"), s.count("0")) * 2)


Failing test case input:
01001001101000

Expected output:
10


Actual output:
18


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()
cnt0=0
cnt1=0
for i in range(len(s)):
  if s[i]=='0':
    cnt0+=1
  else:
    cnt1+=1
if cnt1<cnt0:
  print(len(s)-2*cnt1)
else:
  print(len(s)-2*cnt0)

Failing test case input:
11001010001001

Expected output:
12


Actual output:
2


Fixed submission (verdict: Accepted):
s=input()
cnt0=0
cnt1=0
for i in range(len(s)):
  if s[i]=='0':
    cnt0+=1
  else:
    cnt1+=1
if cnt1<cnt0:
  print(2*cnt1)
else:
  print(2*cnt0)

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

a = S.count("0")
b = S.count("0")
print(min(a,b)*2)

Failing test case input:
01001000101001

Expected output:
10


Actual output:
18


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()
2*min(S.count('0'), S.count('1'))

Failing test case input:
00101000111011

Expected output:
14


Actual output:

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):
s=input()
if s.count("0")==len(s) or s.count("1"):
    print(0)
else:
    print(min(s.count("0"),s.count("1"))*2)

Failing test case input:
00001000111011

Expected output:
12


Actual output:
0


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

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


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    S = list(input())
    d_1 = deque(S[1:])
    d_2 = deque(S[0])
    ans = 0
    for i in range(1, len(S)):
        if d_2:
            r = d_1.popleft
            l = d_2.pop()
            if r == l:
                ans += 2
            else:
                d_2.append(l)
                d_2.append(r)
        else:
            d_2.append(d_1.popleft())
    print(ans)


if __name__ == '__main__':
    main()


Failing test case input:
11000111100010

Expected output:
14


Actual output:
12


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


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    S = list(map(int, list(input())))
    d_1 = deque(S[1:])
    d_2 = deque([S[0]])
    ans = 0
    for i in range(1, len(S)):
        if d_2:
            r = d_1.popleft()
            l = d_2.pop()
            if r != l:
                ans += 2
            else:
                d_2.append(l)
                d_2.append(r)
        else:
            d_2.append(d_1.popleft())
    print(ans)


if __name__ == '__main__':
    main()

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
ans=0
while len(s)>=2:
  flag=True
  for i in range(len(s)-1):
    if s[i:i+2]=="01" or s[i:i+2]=="10":
      s=s[:i+1]+s[i+2:]
      ans+=2
      flag=False
      break
  if flag:
    break
print(ans)

Failing test case input:
11000101100010

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()
ans = min(S.count("0"), S.count("1"))
print(ans)

Failing test case input:
00001100110011

Expected output:
12


Actual output:
6


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

cnt = 0
i = 1
while True:
	
	if i >= len(ss):
		break
	if ss[i-1] != ss[i]:
		ss.pop(i-1)
		ss.pop(i-1)
		cnt += 2
		if i > 0:
			i -= 1
	else:
		i += 1

print(cnt)

Failing test case input:
00101010110011

Expected output:
14


Actual output:
12


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

cnt = 0
i = 1
while True:
	
	if i >= len(ss):
		break
	if ss[i-1] != ss[i]:
		ss.pop(i-1)
		ss.pop(i-1)
		cnt += 2
		if i > 1:
			i -= 1
	else:
		i += 1

print(cnt)

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

Failing test case input:
11000101100010

Expected output:
12


Actual output:
36


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

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

zero_cnt = S.count("0")
one_cnt = S.count("1")

print( min(zero_cnt, one_cnt) )



Failing test case input:
11001000111001

Expected output:
14


Actual output:
7


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

zero_cnt = S.count("0")
one_cnt = S.count("1")

print( min(zero_cnt, one_cnt) * 2 )

Problem: p03107
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
cubes= list(input())
one=0
zero=0

for i in cubes:
  if i=='1':
    one+=1
  else:
    zero+=1
if one>= zero:
  print(zero)
else:
  print(one)

Failing test case input:
01001000111011

Expected output:
14


Actual output:
7


Fixed submission (verdict: Accepted):
cubes= list(input())
one=0
zero=0

for i in cubes:
  if i=='1':
    one+=1
  else:
    zero+=1
if one>= zero:
  print(zero*2)
else:
  print(one*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:
01101111001001

Expected output:
12


Actual output:
6


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 = input()
N = len(S)

count = 0
for i in range(N):
    if S[i] == 0:
        count += 1

ans = min(count, N - count)
print(ans)


Failing test case input:
01000010100010

Expected output:
8


Actual output:
0


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

count = 0
for i in range(N):
    if S[i] == "0":
        count += 1

ans = min(count, N - count) * 2
print(ans)

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



Failing test case input:
11000110100010

Expected output:
12


Actual output:
6


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