TnT/CodeNet4Repair huggingface dataset:
Problem:
In this problem, we use the 24-hour clock.  Takahashi gets up exactly at the time H_1 : M_1 and goes to bed exactly at the time H_2 : M_2. (See Sample Inputs below for clarity.) He has decided to study for K consecutive minutes while he is up. What is the length of the period in which he can start studying?

Incorrect submission (verdict: Wrong Answer):
h1,m1,h2,m2,k=input().split()

h1 = int(h1)
m1 = int(m1)
h2 = int(h2)
m2 = int(m2)
k = int(k)

if h1 > h2:
  h2 += 24
  
h = h1 - h2
hm = h * 60

print(hm + m1 - m2 - k)

Fixed, accepted submission:
h1,m1,h2,m2,k=input().split()

h1 = int(h1)
m1 = int(m1)
h2 = int(h2)
m2 = int(m2)
k = int(k)

if h1 > h2:
  h2 += 24
  
h = h2 - h1
hm = h * 60

print(hm - m1 + m2 - k)
Problem:
When l is an odd number, the median of l numbers a_1, a_2, ..., a_l is the (\frac{l+1}{2})-th largest value among a_1, a_2, ..., a_l.  You are given N numbers X_1, X_2, ..., X_N, where N is an even number. For each i = 1, 2, ..., N, let the median of X_1, X_2, ..., X_N excluding X_i, that is, the median of X_1, X_2, ..., X_{i-1}, X_{i+1}, ..., X_N be B_i.  Find B_i for each i = 1, 2, ..., N.

Incorrect submission (verdict: Wrong Answer):
n=int(input())
x=list(map(int,input().split()))
for i in range(1,n):
  tmp=x[:i-1]+x[i:]
  #print(tmp)
  print(tmp[(len(tmp)-1)//2])

Fixed, accepted submission:
n=int(input())
a=list(map(int,input().split()))
b=sorted(a)
p,q=b[n//2-1],b[n//2]
for i in a:print(p if i>=q else q)
Problem:
Given a lowercase English letter c, determine whether it is a vowel. Here, there are five vowels in the English alphabet: `a`, `e`, `i`, `o` and `u`.

Incorrect submission (verdict: Wrong Answer):
S = input()

while len(S) > 0:
  if "dreameraser" in S:
    S = S.replace("dreameraser","")
  elif "dream" in S:
    S = S.replace("dreamer","")
  elif "dreamer" in S:
    S = S.replace("dream","")
  elif "erase" in S:
    S = S.replace("eraser","")
  elif "eraser" in S:
    S = S.replace("erase","")
  else:
    break
    
if len(S) == 0:
  print("YES")
else:
  print("NO")

Fixed, accepted submission:
c = input()
if c in 'aeiou':print('vowel')
else:print('consonant')
Problem:
N persons are standing in a row. The height of the i-th person from the front is A_i.  We want to have each person stand on a stool of some heights - at least zero - so that the following condition is satisfied for every person:  Condition: Nobody in front of the person is taller than the person. Here, the height of a person includes the stool.  Find the minimum total height of the stools needed to meet this goal.

Incorrect submission (verdict: Wrong Answer):
n=int(input())
a = list(map(int,input().split()))
step=[0]*n
for i in range(n-1):
  step[i+1]+=a[i]+step[i]-a[i+1]
  if step[i+1]<0:
    step[i+1]=0
    
total=sum(step)
print(step)
print(total)

Fixed, accepted submission:
n=int(input())
a = list(map(int,input().split()))
step=[0]*n
for i in range(n-1):
  step[i+1]+=a[i]+step[i]-a[i+1]
  if step[i+1]<0:
    step[i+1]=0
    
total=sum(step)
print(total)
Problem:
We call a 4-digit integer with three or more consecutive same digits, such as 1118, **good**.  You are given a 4-digit integer N. Answer the question: Is N **good**?

Incorrect submission (verdict: Wrong Answer):
N = input()

if N[0] == N[1] == N[2] or N[2] == N[2] == N[3]:
    print('YES')
else:
    print('NO')

Fixed, accepted submission:
N = input()

if N[0] == N[1] == N[2] or N[1] == N[2] == N[3]:
    print('Yes')
else:
    print('No')
Problem:
You are given strings s and t, consisting of lowercase English letters. You will create a string s' by freely rearranging the characters in s. You will also create a string t' by freely rearranging the characters in t. Determine whether it is possible to satisfy s' < t' for the lexicographic order.

Incorrect submission (verdict: Wrong Answer):
def main():
    s = list(input())
    t = list(input())
    s = sorted(s)
    t = sorted(t)
    print(s)
    print(t)
    shrt = False
    for i in range(len(t)):
        if s[0] < t[i]:
            shrt = True
            break
    if shrt :
        print("Yes")
    else:
        print("No")
main()

Fixed, accepted submission:
def main():
    s = list(input())
    t = list(input())
    s = sorted(s)
    t = sorted(t)
    t = t[::-1]
    
    if "".join(s) < "".join(t):
        print("Yes")
    else:
        print("No")
main()
Problem:
Write a program which reads a $ n \times m$ matrix $A$ and a $m \times 1$ vector $b$, and prints their product $Ab$.  A column vector with m elements is represented by the following equation.  \\[ b = \left( \begin{array}{c} b_1 \\\ b_2 \\\ : \\\ b_m \\\ \end{array} \right) \\]  A $n \times m$ matrix with $m$ column vectors, each of which consists of $n$ elements, is represented by the following equation.  \\[ A = \left( \begin{array}{cccc} a_{11} & a_{12} & ... & a_{1m} \\\ a_{21} & a_{22} & ... & a_{2m} \\\ : & : & : & : \\\ a_{n1} & a_{n2} & ... & a_{nm} \\\ \end{array} \right) \\]  $i$-th element of a $m \times 1$ column vector $b$ is represented by $b_i$ ($i = 1, 2, ..., m$), and the element in $i$-th row and $j$-th column of a matrix $A$ is represented by $a_{ij}$ ($i = 1, 2, ..., n,$ $j = 1, 2, ..., m$).  The product of a $n \times m$ matrix $A$ and a $m \times 1$ column vector $b$ is a $n \times 1$ column vector $c$, and $c_i$ is obtained by the following formula:  \\[ c_i = \sum_{j=1}^m a_{ij}b_j = a_{i1}b_1 + a_{i2}b_2 + ... + a_{im}b_m \\]

Incorrect submission (verdict: Wrong Answer):
# coding: utf-8
# Here your code !

def func():
    try:
        (n,m) = tuple( [ int(num) for num in input().rstrip().split(" ") ] )
        matrix = [ [int(num) for num in input().rstrip().split(" ")] for i in range(n) ]
        vector = [ int( input().rstrip() ) for i in range(m) ]
    except:
        return inputError()

    result = [ sum( [i*j for i in matrix[k] for j in vector] ) for k in range(n) ]  
    
    for num in result:
        print(num)
    
def inputError():
    print("input error")
    return -1

func()

Fixed, accepted submission:
# coding: utf-8
# Here your code !

def func():
    try:
        (n,m) = tuple( [ int(num) for num in input().rstrip().split(" ") ] )
        matrix = [ [int(num) for num in input().rstrip().split(" ")] for i in range(n) ]
        vector = [ int( input().rstrip() ) for i in range(m) ]
    except:
        return inputError()

    result = [ sum( [ matrix[j][i]*vector[i] for i in range(m) ] ) for j in range(n)  ] 

    for num in result:
        print(num)
    
def inputError():
    print("input error")
    return -1

func()
Problem:
Takahashi is participating in a programming contest called AXC002, and he has just submitted his code to Problem A.  The problem has N test cases.  For each test case i (1\leq i \leq N), you are given a string S_i representing the verdict for that test case. Find the numbers of test cases for which the verdict is `AC`, `WA`, `TLE`, and `RE`, respectively.  See the Output section for the output format.

Incorrect submission (verdict: Wrong Answer):
# B - Judge Status Summary


def main(n, s):
    result_table = {
        'AC': 0,
        'WA': 0,
        'TLE': 0,
        'RE': 0
    }
    for i in s:
        result_table[i] += 1
    return result_table


if __name__ == "__main__":
    n = int(input())
    s = []
    for i in range(n):
        s.append(input())
    results = main(n, s)
    for key, value in results.items():
        print(f"{key} × {value}")


Fixed, accepted submission:
# B - Judge Status Summary


def main(n, s):
    result_table = {
        'AC': 0,
        'WA': 0,
        'TLE': 0,
        'RE': 0
    }
    for i in s:
        result_table[i] += 1
    return result_table


if __name__ == "__main__":
    n = int(input())
    s = []
    for i in range(n):
        s.append(input())
    results = main(n, s)
    for key, value in results.items():
        print(f"{key} x {value}")
Problem:
An _X -layered kagami mochi_ (X ≥ 1) is a pile of X round mochi (rice cake) stacked vertically where each mochi (except the bottom one) has a smaller diameter than that of the mochi directly below it. For example, if you stack three mochi with diameters of 10, 8 and 6 centimeters from bottom to top in this order, you have a 3-layered kagami mochi; if you put just one mochi, you have a 1-layered kagami mochi.  Lunlun the dachshund has N round mochi, and the diameter of the i-th mochi is d_i centimeters. When we make a kagami mochi using some or all of them, at most how many layers can our kagami mochi have?

Incorrect submission (verdict: Wrong Answer):
n=input()
n=list(n)
print(len(n))

Fixed, accepted submission:
n=int(input())
print(len(list(set([int(input()) for x in range(n)]))))
Problem:
There are N positive integers written on a blackboard: A_1, ..., A_N.  Snuke can perform the following operation when all integers on the blackboard are even:    * Replace each integer X on the blackboard by X divided by 2.  Find the maximum possible number of operations that Snuke can perform.

Incorrect submission (verdict: Wrong Answer):
n = int(input())
a = map(int,input().split())
ans = 0
count = 0
for i in a:
    while i%2 ==0:
        i /= 2
        count += 1
    if count > ans:
        ans = count
    count = 0
print(ans)

Fixed, accepted submission:
n = int(input())
a = map(int,input().split())
ap = list()
count = 0
for i in a:
    while i%2 ==0:
        i /= 2
        count += 1
    ap.append(count)
    count = 0
print(min(ap))
Problem:
Let's arrange a deck of cards. There are totally 36 cards of 4 suits(S, H, C, D) and 9 values (1, 2, ... 9). For example, 'eight of heart' is represented by H8 and 'one of diamonds' is represented by D1.  Your task is to write a program which sorts a given set of cards in ascending order by their values using the Bubble Sort algorithms and the Selection Sort algorithm respectively. These algorithms should be based on the following pseudocode:                 BubbleSort(C) 1 for i = 0 to C.length-1 2     for j = C.length-1 downto i+1 3         if C[j].value < C[j-1].value 4             swap C[j] and C[j-1]                 SelectionSort(C) 1 for i = 0 to C.length-1 2     mini = i 3     for j = i to C.length-1 4         if C[j].value < C[mini].value 5             mini = j 6     swap C[i] and C[mini]   Note that, indices for array elements are based on 0-origin.  For each algorithm, report the stability of the output for the given input (instance). Here, 'stability of the output' means that: cards with the same value appear in the output in the same order as they do in the input (instance).

Incorrect submission (verdict: Wrong Answer):
def BubbleSort(a, n):
    for i in range(n):
        for j in range(n-1, i, -1):
            if int(a[j][1]) < int(a[j - 1][1]):
                a[j], a[j-1] = a[j-1], a[j]
    return a


def SelectionSort(a, n):
    for i in range(n):
        mini = i
        for j in range(i, n):
            if int(a[j][1]) < int(a[mini][1]):
                mini = j
        a[i], a[mini] = a[mini], a[i]
    return a


n = int(input())
a = input().split()


b = a
a = BubbleSort(a, n)
b = SelectionSort(b, n)


print(*a)
print("Stable")
print(*b)

if a == b:
    print("Stable")
else:
    print("Not Stable")

Fixed, accepted submission:
def BubbleSort(a, n):
    for i in range(n):
        for j in range(n-1, i, -1):
            if int(a[j][1]) < int(a[j - 1][1]):
                a[j], a[j-1] = a[j-1], a[j]
    return a


def SelectionSort(a, n):
    for i in range(n):
        mini = i
        for j in range(i, n):
            if int(a[j][1]) < int(a[mini][1]):
                mini = j
        a[i], a[mini] = a[mini], a[i]
    return a


n = int(input())
a = input().split()


b = a[:]
a = BubbleSort(a, n)
b = SelectionSort(b, n)


print(*a)
print("Stable")
print(*b)

if a == b:
    print("Stable")
else:
    print("Not stable")
Problem:
Takahashi received _otoshidama_ (New Year's money gifts) from N of his relatives.  You are given N values x_1, x_2, ..., x_N and N strings u_1, u_2, ..., u_N as input. Each string u_i is either `JPY` or `BTC`, and x_i and u_i represent the content of the otoshidama from the i-th relative.  For example, if x_1 = `10000` and u_1 = `JPY`, the otoshidama from the first relative is 10000 Japanese yen; if x_2 = `0.10000000` and u_2 = `BTC`, the otoshidama from the second relative is 0.1 bitcoins.  If we convert the bitcoins into yen at the rate of 380000.0 JPY per 1.0 BTC, how much are the gifts worth in total?

Incorrect submission (verdict: Wrong Answer):
n=int(input())
l=[[],[]]
for i in range(n):
        a,b=map(str,input().split())
        if b=='JPY':
                l[0].append(float(a))
        else:
                l[1].append(float(a)) 
print(l)
ans=0
for i in l[0]:
        ans+=i
for j in l[1]:
        ans+=j*380000
print(ans)

Fixed, accepted submission:
n=int(input())
l=[[],[]]
for i in range(n):
        a,b=map(str,input().split())
        if b=='JPY':
                l[0].append(float(a))
        else:
                l[1].append(float(a)) 
ans=0
for i in l[0]:
        ans+=i
for j in l[1]:
        ans+=j*380000
print(ans)
Problem:
Snuke has a grid consisting of three squares numbered 1, 2 and 3. In each square, either `0` or `1` is written. The number written in Square i is s_i.  Snuke will place a marble on each square that says `1`. Find the number of squares on which Snuke will place a marble.

Incorrect submission (verdict: Wrong Answer):
s = input()
s.count('1')
print(s)

Fixed, accepted submission:
s = input()

print(s.count('1'))
Problem:
Takahashi is participating in a programming contest called AXC002, and he has just submitted his code to Problem A.  The problem has N test cases.  For each test case i (1\leq i \leq N), you are given a string S_i representing the verdict for that test case. Find the numbers of test cases for which the verdict is `AC`, `WA`, `TLE`, and `RE`, respectively.  See the Output section for the output format.

Incorrect submission (verdict: Wrong Answer):
n = int(input())
s = [""]*n

ac = 0
wa = 0
tle = 0
re = 0

for i in range(n):
    s[i] = str(input())
    if s[i] == "AC":
        ac += 1
    elif s[i] == "WA":
        wa += 1
    elif s[i] == "TLE":
        tle += 1
    else:
        re += 1

print("AC × " + str(ac))

print("WA × " + str(wa))

print("TLE × " + str(tle))

print("RE × " + str(re))

Fixed, accepted submission:
n = int(input())
s = [""]*n

ac = 0
wa = 0
tle = 0
re = 0

for i in range(n):
    s[i] = str(input())
    if s[i] == "AC":
        ac += 1
    elif s[i] == "WA":
        wa += 1
    elif s[i] == "TLE":
        tle += 1
    else:
        re += 1

print("AC x " + str(ac))

print("WA x " + str(wa))

print("TLE x " + str(tle))

print("RE x " + str(re))
Problem:
Iroha loves _Haiku_. Haiku is a short form of Japanese poetry. A Haiku consists of three phrases with 5, 7 and 5 syllables, in this order.  To create a Haiku, Iroha has come up with three different phrases. These phrases have A, B and C syllables, respectively. Determine whether she can construct a Haiku by using each of the phrases once, in some order.

Incorrect submission (verdict: Wrong Answer):
i = list(map(int, input().split()))

if 7 in i:
  i.remove(7)
  if i[0] == 5 and i[1] == 5:
    print('Yes')
  else:
    print('No')
else:
  print('No')

Fixed, accepted submission:
i = list(map(int, input().split()))

if 7 in i:
  i.remove(7)
  if i[0] == 5 and i[1] == 5:
    print('YES')
  else:
    print('NO')
else:
  print('NO')
Problem:
Snuke has decided to construct a string that starts with `A` and ends with `Z`, by taking out a substring of a string s (that is, a consecutive part of s).  Find the greatest length of the string Snuke can construct. Here, the test set guarantees that there always exists a substring of s that starts with `A` and ends with `Z`.

Incorrect submission (verdict: Wrong Answer):
s = list(input())

cnt = 0
on = False
result = []
for a in s:
    if a is 'A':
        on = True
    elif a is 'Z':
        result.append(cnt)
        cnt += 1
    if on:
        cnt += 1

print(max(result))

Fixed, accepted submission:
s = list(input())

cnt = 0
on = False
result = []
for a in s:
    if a is 'A':
        on = True
    if on:
        cnt += 1
    if a is 'Z':
        result.append(cnt)

print(max(result))
Problem:
There are N positive integers written on a blackboard: A_1, ..., A_N.  Snuke can perform the following operation when all integers on the blackboard are even:    * Replace each integer X on the blackboard by X divided by 2.  Find the maximum possible number of operations that Snuke can perform.

Incorrect submission (verdict: Wrong Answer):
n = int(input())
a = [int(x) for x in input().split()]
ans = 0

for i in a:
  if not i%2:
    break
    
  else:
    ans += 1
    
print(ans)

Fixed, accepted submission:
import numpy as np

N = int(input())
A = np.array([int(x) for x in input().split()])
ans = 0

while np.all(A%2 == 0):
  A = A/2
  ans += 1
print(ans)
Problem:
Takahashi is participating in a programming contest called AXC002, and he has just submitted his code to Problem A.  The problem has N test cases.  For each test case i (1\leq i \leq N), you are given a string S_i representing the verdict for that test case. Find the numbers of test cases for which the verdict is `AC`, `WA`, `TLE`, and `RE`, respectively.  See the Output section for the output format.

Incorrect submission (verdict: Wrong Answer):
import sys
input = sys.stdin.readline

n = int(input())
s = [input() for _ in range(n)]

print('AC x {}'.format(s.count('AC')))
print('WA x {}'.format(s.count('WA')))
print('TLE x {}'.format(s.count('TLE')))
print('RE x {}'.format(s.count('RE')))


Fixed, accepted submission:
n = int(input())
s = [input() for _ in range(n)]

print('AC x {}'.format(s.count('AC')))
print('WA x {}'.format(s.count('WA')))
print('TLE x {}'.format(s.count('TLE')))
print('RE x {}'.format(s.count('RE')))
Problem:
Takahashi is participating in a programming contest called AXC002, and he has just submitted his code to Problem A.  The problem has N test cases.  For each test case i (1\leq i \leq N), you are given a string S_i representing the verdict for that test case. Find the numbers of test cases for which the verdict is `AC`, `WA`, `TLE`, and `RE`, respectively.  See the Output section for the output format.

Incorrect submission (verdict: Wrong Answer):
n = int(input())
s = []
ac = 0
wa = 0
tle = 0
re = 0
for _ in range(n):
    s.append(input())
for i in range(n):
    if(s[i]=='AC'):
        ac+=1
    elif(s[i]=='WA'):
        wa+=1
    elif(s[i]=='TLE'):
        tle+=1
    else:
        re+=1
print('AC ×',ac)
print('WA ×',wa)
print('TLE ×',tle)
print('RE ×',re)


Fixed, accepted submission:
n = int(input())
s = []
ac = 0
wa = 0
tle = 0
re = 0
for _ in range(n):
    s.append(input())
for i in range(n):
    if(s[i]=='AC'):
        ac+=1
    elif(s[i]=='WA'):
        wa+=1
    elif(s[i]=='TLE'):
        tle+=1
    else:
        re+=1
print('AC x',ac)
print('WA x',wa)
print('TLE x',tle)
print('RE x',re)
Problem:
Write a program which reads two integers a and b, and calculates the following values:    * a ÷ b: d (in integer)   * remainder of a ÷ b: r (in integer)   * a ÷ b: f (in real number)

Incorrect submission (verdict: Wrong Answer):
def division(a,b):
    print("{} {} {}".format(a // b, a % b, 3 /2))

    
tmp=list(map(int,input().split()))
division(tmp[0], tmp[1])


Fixed, accepted submission:
a, b = list(map(int, input().split()))
print('{} {} {:.5f}'.format(a // b, a % b, a / b))
Problem:
We have N sticks with negligible thickness. The length of the i-th stick is A_i.  Snuke wants to select four different sticks from these sticks and form a rectangle (including a square), using the sticks as its sides. Find the maximum possible area of the rectangle.

Incorrect submission (verdict: Wrong Answer):
from collections import Counter
N = int(input())
A = list(map(int, input().split()))

l = sorted(Counter(A).items(), key=lambda x:x[0],reverse=True)
#print(l)
if l[1][1] < 2:
  print(0)
else:
  print(l[0][0]*l[1][0])

Fixed, accepted submission:
from collections import Counter
N = int(input())
A = list(map(int, input().split()))
c = Counter(A)
l = sorted(filter(lambda x:x[1] > 1,c.items()),reverse=True)

if len(l) == 0:
  print(0)
else:
  if l[0][1] >= 4:
    print(l[0][0]**2)
  else:
    print(l[0][0]*l[1][0])
Problem:
Does \sqrt{a} + \sqrt{b} < \sqrt{c} hold?

Incorrect submission (verdict: Wrong Answer):
import math
a, b, c = map(int, input().split())
A, B, C = math.sqrt(a), math.sqrt(b), math.sqrt(c)
print(A, B, C)
if a + b < c:
    print("Yes")
else:
    print("No")


Fixed, accepted submission:
a, b, c = map(int, input().split())
if c > a+b and 4*a*b < (c-a-b)**2:
  print("Yes")
else:
  print("No")
Problem:
Write a program which reads an integer n and identifies the number of combinations of a, b, c and d (0 ≤ a, b, c, d ≤ 9) which meet the following equality:      a + b + c + d = n      For example, for n = 35, we have 4 different combinations of (a, b, c, d): (8, 9, 9, 9), (9, 8, 9, 9), (9, 9, 8, 9), and (9, 9, 9, 8).

Incorrect submission (verdict: Wrong Answer):
n=int(input())
a,b,c,d=0,0,0,0
ans=0
for i in range(10):
    c=0
    for j in range(10):
        b=0
        for f in range(10):
            a=0
            for e in range(10):
                if a+b+c+d==n:
                    ans+=1
                a+=1
            b+=1
        c+=1
    d+=1
print(ans)


Fixed, accepted submission:
while True:
    try:n=int(input())
    except:break
    ans=0
    for i in range(10):
        for j in range(10):
           for f in range(10):
                for e in range(10):
                    if i+j+f+e==n:
                        ans+=1

    print(ans)
Problem:
Iroha is very particular about numbers. There are K digits that she dislikes: D_1, D_2, ..., D_K.  She is shopping, and now paying at the cashier. Her total is N yen (the currency of Japan), thus she has to hand at least N yen to the cashier (and possibly receive the change).  However, as mentioned before, she is very particular about numbers. When she hands money to the cashier, the decimal notation of the amount must not contain any digits that she dislikes. Under this condition, she will hand the minimum amount of money.  Find the amount of money that she will hand to the cashier.

Incorrect submission (verdict: Wrong Answer):
#1000 8
#1 3 4 5 6 7 8 9

n, k = map(int, input().split())
Ds = list(map(int, input().split()))

for i in range(n, n*10+2):
  for d in Ds:
    if d in list(str(i)):
      break
  else:
    print(i)
    exit(0)

Fixed, accepted submission:
n, k = map(int, input().split())
Ds = list(map(int, input().split()))

for i in range(n, n*11):
  for d in Ds:
    if d in list(map(int, list(str(i)))):
      break
  else:
    print(i)
    exit(0)
Problem:
There are a total of A + B cats and dogs. Among them, A are known to be cats, but the remaining B are not known to be either cats or dogs.  Determine if it is possible that there are exactly X cats among these A + B animals.

Incorrect submission (verdict: Wrong Answer):
from sys import stdin
import numpy as np
a,b,c= [int(x) for x in stdin.readline().rstrip().split()]

if c-a >= b:
    print("YES")
else:
    print("NO")

Fixed, accepted submission:
from sys import stdin
import numpy as np
a,b,c= [int(x) for x in stdin.readline().rstrip().split()]

if c-a <= b and a <= c:
    print("YES")
else:
    print("NO")
Problem:
Snuke has a grid consisting of three squares numbered 1, 2 and 3. In each square, either `0` or `1` is written. The number written in Square i is s_i.  Snuke will place a marble on each square that says `1`. Find the number of squares on which Snuke will place a marble.

Incorrect submission (verdict: Wrong Answer):
count = 0
flg = 0
a = list(map(int,input().split()))

while True:
	for i in a:
		if i%2 != 0:
			flg = 1
	if flg == 0:
		a = list(map(lambda x: int(x/2), a))
		count += 1
	else:
		break
         
print(count)

Fixed, accepted submission:
count = 0
a = input()
for i in a:
  if i == '1':
    count += 1
print(count)