Problem:


Score: 300 points

Problem Statement

As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.

Snuke, an employee, would like to play with this sequence.

Specifically, he would like to repeat the following operation as many times as possible:

For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3".  
Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer.

At most how many operations can be performed?

Constraints

N is an integer between 1 and 10 \ 000 (inclusive).

a_i is an integer between 1 and 1 \ 000 \ 000 \ 000 (inclusive).

Input

Input is given from Standard Input in the following format:

N
a_1 a_2 a_3 ... a_N

Output

Print the maximum number of operations that Snuke can perform.

Sample Input 1

3
5 2 4

Sample Output 1

3

The sequence is initially {5, 2, 4}. Three operations can be performed as follows:

First, multiply a_1 by 3, multiply a_2 by 3 and divide a_3 by 2. The sequence is now {15, 6, 2}.

Next, multiply a_1 by 3, divide a_2 by 2 and multiply a_3 by 3. The sequence is now {45, 3, 6}.

Finally, multiply a_1 by 3, multiply a_2 by 3 and divide a_3 by 2. The sequence is now {135, 9, 3}.

Sample Input 2

4
631 577 243 199

Sample Output 2

0

No operation can be performed since all the elements are odd. Thus, the answer is 0.

Sample Input 3

10
2184 2126 1721 1800 1024 2528 3360 1945 1280 1776

Sample Output 3

39



Sample input:
3
5 2 4


Sample output:
3

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
K = 0
breaker = 0
while True:
  if(breaker==0):
    break
  M = len(A)
  n = -1
  while True:
    n+=1
    if(n>=M):
      break
    else:
      if(A[n]%2==0):
        A[n]==A[n]//2
        K+=1
      else:
        del A[n]
        M -= 1
        if(len(A)==0):
          breaker+=1
print(K)

Submission status: Wrong Answer

Solution code:
len_list = int(input())
input_list = [int(x) for x in input().split()][:len_list-1]

n = 0

for x in input_list :
   while (x % 2) == 0 :
      x/=2
      n+=1      
print(n)

Submission status: Wrong Answer

Solution code:
def two_division(x):
  count=0
  while x%2==0:
    count+=1
    x//=2
  return count
n=int(input())
a=list(map(int,input().split()))
ans=n-1
for i in a:
  ans+=two_division(i)
print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np
N=int(input())
a=list(map(int,input().split()))
b=np.prod(a,dtype='int64')
count=0
while b%2==0:
    if b%2==1 or b==0:
        break
    b/=2
    print(b)
    count+=1
print(count)

Submission status: Wrong Answer

Solution code:
import numpy as np
N=int(input())
a=list(map(int,input().split()))
b=np.prod(a)
count=0
while b%2==0:
    if b%2==1 or b==0:
        break
    b/=2
    print(b)
    count+=1
print(count)

Submission status: Wrong Answer

Solution code:
import operator as o
import functools as f
n,*a=map(int,open(0).read().split())
#print(f.reduce(o.mul,a))
a=[s for s in a if s%2==0]
if len(a)==0:
    print(0)
    exit()
x=f.reduce(o.mul,a)
count=0
if x%8096==0:
    count+=13
    x=x//8096
if x%4048==0:
    count+=12
    x=x//4048
if x%2024==0:
    count+=11
    x=x//2024
if x%1024==0:
    count+=10
    x=x//1024
if x%512==0:
    count+=9
    x=x//512
if x%256==0:
    count+=8
    x=x//256
while True:
    if x%2==0:
        x=x//2
        count+=1
    else:
        break
print(count)

Submission status: Wrong Answer

Solution code:
int_n = int(input())

input_array = list(map(int, input().split()))

counter = 0

while True:
    templist = list(filter(lambda x: x % 2 == 0, input_array))
    if len(templist) != 0:
        max_even = max(filter(lambda x: x % 2 == 0, input_array))
        even_index = input_array.index(max_even)

        input_array = list(map(lambda x: x[1] if x[0] != even_index else x[1] / 2, enumerate(input_array)))
        print(input_array)

        counter += 1

    else:
        break

print(counter)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(i) for i in input().split()]

a = sorted(list(filter(lambda x : (x % 2) == 0, a)), reverse=True)
ans = 0
for i in a:
    ans += i / 2
print(int(ans))

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))

ans = 0
for a in A:
  tmp = format(a, "b")
  ans += len(tmp) - tmp.rfind("1") + 1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))

r = 0
for aa in a:
  j = 0
  while aa // (2 ** j) == 0:
    j += 1
  r += j
print(r)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))

r = 0
for aa in a:
  j = 0
  while aa // (2 ** j) == 0:
    j += 1
  r += j-1
print(r)

Submission status: Wrong Answer

Solution code:
import sys
array =[]
for line in sys.stdin.readlines():
    array.append(line.rstrip())
box =list()
for i in range(len(array[0].split(" "))):
    box.append(int(array[1].split(" ")[i]))
count =0
for j in range(len(box)):
    while(True):
        if box[j]%2==0:
            count+=1
            box[j]=box[j]//2
        else:
            break;
print(count)

Submission status: Wrong Answer

Solution code:
N=int(input())
a=list(map(int,input().split()))
b=0
for i in range(N):
    for j in range(1,30):
        if a[i]%(2**j)!=0:
            b+=j-1
            break
print(b)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))

s = 1
ans = 0
for a in A:	
	while a % 2 == 0:
		a = a // 2
		ans += 1
	print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
k = 0
for i in range(len(A)):
  for j in range(1,15):
    if (A[i] % 2**j == 0 and A[i] % 2**(j+1) == 1):
      k += j
print(k)

Submission status: Wrong Answer

Solution code:
n=int(input())

a=list(map(int,input().split()))
b=[]

for i in range(n):
  cnt=1
  while (a[i])%(2**cnt)==0:
    cnt+=1
  b.append(cnt-1)

b.sort()
print(n*b[-1])

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
A = list(map(int, input().split(" ")))


B = [math.log2(i) for i in A]

tmp = 0
for i in range(N):
    if B[i] % 1 == 0:
        tmp += B[i]
print(tmp)

Submission status: Wrong Answer

Solution code:
def getinputdata():

    array_result = []    
    array_result.append(input().split(" "))

    flg = True

    try:
        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = True

            else:

                flg = False
    finally:

        return array_result

arr_data = getinputdata()

n= int(arr_data[0][0])

arr=[int(arr_data[1][x]) for x in range(n)]

cnt=0
chkflg=True

while chkflg:

    if any(x % 4 == 0 for x in arr):

        val=max(list(filter(lambda x : x%4 ==0, arr)))        
        idx=arr.index(val)
        
        for i in range(n):
            
            if i==idx:
                arr[i]//=2                
            else:
                arr[i]*=3
            cnt+=1
        
    else:
        chkflg=False

print(cnt)

Submission status: Wrong Answer

Solution code:
v=map(int,input().split())
v=sorted(v)[::-1]
c=0
cnt=0
while 1:
    while 1:
        if v[c]%2:break
        cnt+=1
        v[c]/=2
    c+=1 
    if c>=len(v):break
print(cnt)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))


count = 0
i = 0
while(i < len(a)):
    print(i)
    if a[i] % 2 == 0:
        count += 1
        a[i] = int(a[i] // 2)
        continue
    else:
        i += 1

print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
ans = 0
for i in range(N):
  odd = 0
  if a[i] % 2 != 0:
    odd += 1
  else:
    ans += 1
  if odd == len(a):
    break
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
list = map(int, input().split())

cnt = 1
for i in list:
    if i % 2 == 0:
        cnt *= 2
cnt -= 1
print(cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
count = 0
for i in range(N):
	for j in range(N):
		if a[j] % 2 == 0:
			count += 1
			a[j] /= 2
	print(a)
print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
count = 0
for i in range(N):
  for n in a:
    if n % 2 == 0:
      count += 1
      n /= 2
print(count)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

N = int(input())
A = map(int, input().strip().split())

L = [2 ** i for i in range(1, 30)]

result = 0
for ai in A:
  if ai % 2 != 0:
    continue
  for i, l in enumerate(L):
    if ai % l != 0:
      result += i
      break
print(result)

Submission status: Wrong Answer

Solution code:
N = int(input())
line = input().split(' ')
A = [int(element) for element in line]

output = 0
for a in A:
    # print('a:', a)
    while a % 2 == 0 and a != 0:
        output += 1
        a = a // 2
        # print(a)
print('output:', output)

Submission status: Wrong Answer

Solution code:
print(sum(list(map(lambda n: len(bin(n)) - len(bin(n).rstrip("0")), list(map(int, input().split()))))))

Submission status: Wrong Answer

Solution code:
n = int(input())
aas = list(map(int, input().split()))

r = 0
i = 1

print(aas)
while True:
  f = False
  for a in aas:
    if a%2**i == 0:
      r += 1
      f = True
  if not f:
    break
  i += 1
print(r)

Submission status: Wrong Answer

Solution code:
import math
n = input()
a = list(map(int, input().split()))
ans = float("inf")
for i in a:
    ans = min(ans, len(bin(i)) - bin(i).rfind("1") - 1)
print(round(ans))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [int(i) for i in input().split()]

counter = 0
for i in range(N):
    A = a[i]
    while 2 * 2 <= A:
        while A % 2 == 0:
            A /= 2
            counter += 1
        break
print(int(counter))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [int(i) for i in input().split()]

counter = 0
for i in range(N):
    A = a[i]
    while 2 * 2 <= A:
        while A % 2 == 0:
            A = A/2
            counter += 1
        break
print(counter)

Submission status: Wrong Answer

Solution code:
def xx(x: int):
    """
    2で何回割れるのか
    """
    counter = 0
    while True:
        x_, _ = divmod(x, 2)
        if x_ == 0:
            return counter
        x, counter = x_, counter + 1

n = int(input())
ns =  list(map(int, input().split()))

evens = list()
for n in ns:
    if n % 2 == 0:
        evens.append(n)
res = 0
for e in evens:
    res += xx(e)
print(res)

Submission status: Wrong Answer

Solution code:
def xx(x: int):
    """
    2で何回割れるのか
    """
    counter = 0
    while True:
        x_, _ = divmod(x, 2)
        if x_ == 0:
            return counter
        x, counter = x_, counter + 1

ns =  list(map(int, input().split()))
evens = list()
for n in ns:
    if n % 2 == 0:
        evens.append(n)
res = 0
for e in evens:
    res += xx(e)
print(res)

Submission status: Wrong Answer

Solution code:
import math
n=int(input())
n=list(map(int,input().split()))

count=0
for i in n:
    count+=int(math.log(i,2))

print(count)

Submission status: Wrong Answer

Solution code:
import numpy as np

N = map(int, raw_input().split())
a = np.array( [] )
a = np.append(a,map(int, raw_input().split()))

prod = a.prod()
out  = 0

while prod%2 == 0:
    prod = prod/2
    out = out +1

print out

Submission status: Wrong Answer

Solution code:
import math

N = int(input())
a_list = list(map(int, input().split()))
cnt = 0
for a in a_list:
    if a % 2 == 0:
        cnt += int(math.log2(a))
print(cnt)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = input().split()
for i in range(n):
    a[i] = int(a[i])
a0 = []
for _ in range(n):
    i = 0
    x = a[_]
    while 1:
        if x % 2 == 0:
            x = x / 2
            i += 1
        else:
            break
    a0.append(i)
# print(a0)

i = 0
amax = 1000000000
_ = 0
while 1:
    if max(a0) == 0:
        break
    elif max(a) > amax:
        break
    i += 1
    while 1:
        if _ >= n:
            _ = 0
            break
        if a0[_] > 0:
            a0[_] -= 1
            if _ >= n:
                _ = 0
            break
        _ += 1
    # print(a0)
    for _1 in range(n):
        if _1 != _:
            if a[_1] * 3 > amax:
                if a0[_1] > 0:
                    a[_1] /= 2
                    a0[_1] -= 1
                else:
                    break
            else:
                a[_1] *= 3
        else:
            a[_1] /= 2

print(i)

Submission status: Wrong Answer

Solution code:
n = int(input())

even = 0
max_num = 0

s = list(map(int,list(input().rstrip().split())))

for i in range(n):
  if(s[i]%2 == 0):
    even += 1
    if(max_num < s[i]):
      max_num = s[i]


count = 0
while even >= 1:
  if(max_num % 2 == 1):
    break
  else:
    count += 1
    max_num = int(max_num/2)

if(even == 0):
  print(0)
else:
  print(max(even,count)*count - 1)

Submission status: Wrong Answer

Solution code:
n = int(input().rstrip())
a = [int(temp) for temp in input().rstrip().split(" ")]

count = 0

while True:

    a.sort()

    is_success = True

    div_flag = False
    for i in range(n-1, -1, -1):
        if div_flag == False and a[i] % 2 == 0:
            a[i] = int(a[i] / 2)
            div_flag = True
        else:
            a[i] = int(a[i] * 3)

        # (MAX < a[i] * 3 and a[i] % 2 != 0)
        if div_flag == False and i == n-1:
            is_success = False

    if is_success:
        count += 1
    else:
        break


print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
count = 0
what = 0
ans = 0

while n > count:
    ans += 1
    if a[count]%2 == 1:
        a[count] *= 3
        what += 1
    else:
        a[count] /= 2
    count += 1
    if what == n:
        print(0)
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
counter = 0
check = [2]
e = 2
while 2**e <= 10000:
	check.append(2**e)
	e += 1
for i in range(n):
	if a[i]%2 == 0:
		for k in range(len(check)):
			if a[i]%check[k] == 0:
				counter += 1
			else:
				break
print(counter)

Submission status: Wrong Answer

Solution code:
import sys

sys.stdin.readline()
a = list(map(int, sys.stdin.readline().split()))

cnt = 0
while True:
    a.sort(reverse=True)
    flag = True
    for i, v in enumerate(a):
        if flag and v % 2 == 0:
            a[i] //= 2
            flag = False
        elif a[i] * 3 > 1000000000:
            if a[i] % 2 == 0:
                a[i] //= 2
            else:
                break
        else:
            a[i] *= 3
    if flag:
        break
    cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
# -*- coding:utf-8 -*-
def check(num):
    if num%2:
        return 0
    else:
        return 1

def process(num):
    if num == 2:
        return num*3
    else:
        return int(num/2)

if __name__ == "__main__":
    n = int(input())
    a = [ tmp for tmp in list(map(int, input().split())) if check(tmp) ]
    ans = 0
    while(len(a)):
        a = [ tmp for tmp in list(map(process, a)) if check(tmp) ]
        ans += 1
    print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
count = 0
ans = 0

while n > count:
    ans += 1
    if a[count]%2 == 1:
        a[count] *= 3
    else:
        a[count] /= 2
    count += 1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

even = 0
max_num = 0

s = list(map(int,list(input().rstrip().split())))

for i in range(n):
  if(s[i]%2 == 0):
    even += 1
    if(max_num < s[i]):
      max_num = s[i]


count = 0
while even >= 1:
  if(max_num % 2 == 1):
    break
  else:
    count += 1
    max_num = int(max_num/2)

if(even == 0):
  print(0)
else:
  print(even*count - 1)

Submission status: Wrong Answer

Solution code:
# input 
n = map(int, input())
a = map(int, input().split(" "))

# make list 
curlist = list(a)

# du recurse
def sunukeList(curlist, cnt) :
    reslist = []
    flg_div2 = 0
    flg_did3 = 0

    for i in curlist :    
        # if divisible by two then divide
        if i%2 == 0 and flg_div2 == 0: 
            reslist.append(int(i/2))
            flg_div2 = 1
        else :
            reslist.append(i*3)
            flg_did3 = 1

    if flg_div2 == 0 :
        print(cnt)
    else :
        sunukeList(reslist, cnt + 1)
        
# calc
sunukeList(curlist, 0)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
counter = 0
check = [2,4,8,16,32,64,128,256,512,1024,2048,4096,8192]
for i in range(n):
	if a[i]%2 == 0:
		for k in range(len(check)):
			if a[i]%check[k] == 0:
				counter += 1
print(counter)

Submission status: Wrong Answer

Solution code:
N=input()
li = list(map(int,input().split()))
cnt =0
for i in li:
    print(i, cnt)
    while i % 2 == 0:
        i =  i / 2
        cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
N = input()
number = input()

a = number.split()
n_list=[]
count=0



for num in a:
    num = int(num)
    if num % 2 == 0:
        n_list.append(num)

if n_list != []:
    maxnum = max(n_list)
    for num2 in n_list:
        for i in range(len(n_list)):
            if num2 % (i+1)*2 == 0:
                count+=1


print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
line = input()
list_str = line.split()
list = []

for i in list_str:
    i = int(i)
    if i%2 == 0:
        list.append(i)

cc = 0
for r in list:
    while r > 1:
        r = r / 2
        cc = cc + 1

print(cc)

Submission status: Wrong Answer

Solution code:
N=input()
li = list(map(int,input().split()))

for i in li:
    cnt =0
    while i % 2 == 0:
        i= i / 2
        cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
N = input()
a = list(map(int, input().split()))
counter = 0

for val in a:
  if val%2 != 0:
    counter+=1

print(counter)

Submission status: Wrong Answer

Solution code:
import math
N=int(input())
arr=[int(a) for a in input().split()]
ans=0
for i in range(N):
   ans=ans+int(math.log2(arr[i]))

print(ans)

Submission status: Wrong Answer

Solution code:
def insu2(n):
    if n == 0:
        return 0

    counter = 0
    flag = 0
    while(flag == 0):
        flag = n % 2
        if flag == 0:
            counter += 1
            n = n / 2
        else:
            break
    return counter

ip = input().split()
usdata = []
c_sum = 0

for i in ip:
    usdata.append(int(i))

for i in usdata:
    add = insu2(i)
    c_sum += add

print(c_sum)

Submission status: Wrong Answer

Solution code:
n = int(input())
a_list = list(map(int, input().split()))

ans = 0
for i in range(1, 21):
    s = len([x for x in a_list if x % (2**i) == 0])
    if s == 0:
        break
    ans += s

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a_list = list(map(int, input().split()))

ans = 0
for i in range(1, 21):
    s = len([x for x in a_list if x % (2**i) == 0])
    if s == 0:
        break
    ans += s
    print(ans)

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input().strip())
 
A = list(map(int, input().strip().split()))
 
c = 0
if not all([a // 2 == 1 for a in A]):
  binA = [bin(a) for a in A]
  for a in binA:
    if a[-1] == '1':
      continue
    for b, i in zip(a[2:], reversed(range(len(a) - 2))):
      c += int(b) * i
  print(c)

Submission status: Wrong Answer

Solution code:
N = int(input())
tmp = input()
tmp = tmp.split()
a = []
for i in tmp:
    a.append(int(i))

count = 0

while True:
    flag = 0
    for i in range(len(a)):
        if a[i] % 2 == 0:
            a[i] //= 2
        else:
            a[i] *= 3
            flag += 1
    count += 1
    if flag == len(a):
        break
print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
A = input().split()
print(A)

count = 0
for i in range(len(A)):
    while(int(A[i]) % 2 == 0):
        count += 1
        A[i] = int(A[i])/2
print(count)

Submission status: Wrong Answer

Solution code:
count = input()
raw_number = input().split()
even = 0
odd = 0

for i in range(int(count)):
    if int(raw_number[i]) % 2 == 0:
        even = even + 1
    else:
        pass

print(pow(2,even) - 1)

Submission status: Wrong Answer

Solution code:
N = int(input())
List = input()
import re

Shift = re.split(" ",List)
Ctr = 1
Wlist = []


while True:
    if Ctr > N:
        break
    Xn = 1
    while True:
        DW = int(Shift[Ctr-1])
        if DW % (2*Xn) != 0:
            break
        else:
            Xn += 1
    Wlist.append(Xn-1)
    Ctr += 1

print(sum(Wlist))

Submission status: Wrong Answer

Solution code:
array_length = int(input())
input_line = input().split()

array_int = list(map(int, input_line))
array_bin = list(map(bin, array_int))
array_bin_str = list(map(str, array_bin))

array_dividable = []

for i in range(0, array_length):
    if array_int[i] == 0:
        array_dividable.append(0)
    else:
        target_line = array_bin_str[i]
        count_dividable = 0
        for j in range(1, len(target_line)):
            target_char = target_line[-j]
            if target_char == '1':
                break
            elif target_char == 'b':
                break
            else:
                count_dividable += 1

        array_dividable.append(count_dividable)

if sum(array_dividable) == 0:
    print(str(array_length - 1))
else:
    print(str(array_length))

Submission status: Wrong Answer

Solution code:
N = int(input().strip())
 
A = map(int, input().strip().split())
 
c = 0
if all([a // 2 == 1 for a in A]):
  print(0)
else:
  binA = [bin(a) for a in A]
  for a in binA:
    if a[-1] == '1':
      continue
    for b, i in zip(a[2:], reversed(range(len(a) - 2))):
      c += int(b) * i
  print(c)

Submission status: Wrong Answer

Solution code:
import math
N=int(input().strip())
A=list(map(int,input().split()))
nns=[2**i for i in range(31)]
def func(n,x):
    return n%nns[x]==0
def binsearch_int(func, min_x, max_x):
    """func(x) == Trueとなる最大のxを返す
    """
    if func(max_x):
        return max_x
    if not func(min_x):
        return None
    left,right=min_x,max_x
    while left+1<right:
        mid=(left+right)//2
        if func(mid):
            left=mid
        else:
            right=mid
    return left
sum(binsearch_int(lambda x: func(i,x),0,int(math.log2(i))+1) for i in A)

Submission status: Wrong Answer

Solution code:
N = int(input())

a = [int(i) for i in input().split()]

count = []
for i in range(len(a)):
    if a[i] % 2 == 0:
        count.append(a[i]//2)
'''
if len(count) == len(a):
    print(sum(count)-min(count))
else:
    print(sum(count))
'''

print(sum(count))

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
a = list(map(int,input().split()))
ans = 0
a = np.array(a)
while a.size > 0:
    a = a[a%2 == 0]
    ans += len(a)
    a = a//2
    print(a)
    print(ans)
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [int(i) for i in input().split()]
b = [i for i in a if i % 2 == 0]

for i in range(len(b)) :
    b[i] /= 2.0

print(int(sum(b)))

Submission status: Wrong Answer

Solution code:
n = int(input())
f = lambda x: 0 if x % 2 > 0 else 1 + f(x // 2)
print((f(int(x)) for x in input().split()))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
b = []
cnt = 0

for x in a:
    if x % 2 == 0:
        b.append(x)
print(b)
for j in range(len(b)):
    while(b[j] % 2 == 0):
        cnt += 1
        b[j] /= 2

print(cnt)

Submission status: Wrong Answer

Solution code:
n = int(input())

a = list(map(int, input().split()))

count = 0

for i in range(n):
    if a[i] % 2 == 0:
        count += a[i] // 2

print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
counter = 0
check = [2,4,8,16,32,64,128,256,512,1024,2048,4096,8192]
for i in range(n):
	if a[i]%2 == 0:
		for k in range(len(check)):
			if a[i]%check[k] == 0:
				counter += 1
			else:
				break
print(counter)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = [int(x) for x in input().split()]
s = 0
for i in range(n):
  while l[i]%2==1:
    l[i] = l[i]//2
    s += 1
print(s)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
a = list(map(int,input().split()))
ans = 0
for i in range(10**9):
    a.sort(reverse=True)
    cnt = 0
    for j in range(N):
        if a[j]%2 == 0 and cnt == 0:
            a[j] //= 2
            cnt = 1
        else:
            a[j] *= 3
    if cnt == 0:
        print(ans)
        exit()
    else:
        ans +=1

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(map(int,input().split()))
S = 1
ans=0

for i in range(N):
  S = S*A[i]
  
while S%2 == 0:
  ans += 1
  S = S//2
  
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=list(map(int,input().split()))
p = 1
cnt = 0
for i in a:
        p*=i
while p % 2 == 0:
        p //=2
        cnt +=1
print(cnt)

Submission status: Time Limit Exceeded

Solution code:
#!/usr/bin/env python3
import sys
def input():
    return sys.stdin.readline()[:-1]

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])
    if arr==[]:
        arr.append([n, 1])
    return arr

def main():
    N = int(input())
    a = list(map(int, input().split()))

    ans = 0
    for i in a:
        arr = factorization(i)
        for j in range(len(arr)):
            if arr[j][0] == 2:
                ans += arr[j][1]
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
def pfact(m):
	pf = {}
	for i in range(2,int(m**0.5)+1):
		while m%i == 0:
			pf[i] = pf.get(i,0) + 1
			m //= i
	if m>1 : pf[m]=1
	return pf

n = int(input())
a = list(map(int,input().split()))
ans = 0
for j in a:
	targ = pfact(j)
	ans += targ.get(2, 0)
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = sorted(list(map(int, input().split())))

ans = 0
flag = True
while flag:
  flag = False
  for i in range(n-1, -1, -1):
    if not flag and a[i]%2 == 0:
      flag = True
      ans += 1
      a[i] //= 2
    else: a[i] *= 3
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
a = list(map(int, input().split()))

fi_flg = False
res = 0
while fi_flg is False:
  twice_flg = False
  for i in range(N):
    if a[i] % 2 == 0:
      if twice_flg is False:
        a[i] = int(a[i]/2)
        twice_flg = True
        break
 
  if twice_flg is False:
    fi_flg = True
  else:
    res += 1

print(res)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
a = list(map(int, input().split()))

fi_flg = False
res = 0
while fi_flg is False:
  twice_flg = False
  for i in range(N):
    if a[i] % 2 == 0:
      if twice_flg is False:
        a[i] = int(a[i]/2)
        twice_flg = True
 
  if twice_flg is False:
    fi_flg = True
  else:
    res += 1

print(res)

Submission status: Time Limit Exceeded

Solution code:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate, product # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入g
import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n = I()
A = readInts()
abc = 1
for v in A:
    abc *= v
ans = 0
while abc % 2 == 0:
    ans += 1
    abc//=2
print(ans)

Submission status: Time Limit Exceeded

Solution code:
# ABC100 C "*3 or /2"

import numpy
N = int(input())
a = numpy.array(list(map(int, input().split())))
# a.sort(reversed = False)
a.sort()
a = a[::-1]

count = 1

if all(elem % 2 !=0 for elem in a) == True:
    ans = 0
else:
    while True:
        if all(elem % 2 !=0 for elem in a) == True:
            ans = count -1
            break
        else:
            for ind in range(N):
                if a[ind] % 2 ==0:
                    i = ind
                    break
            a[i] = a[i]/2
            a[:i] = a[:i]*3
            a[i+1:] = a[i+1:]*3
            a.sort()
            a = a[::-1]
            count += 1
        
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(map(int,input().split()))
cnt = 0

for i in range(N):
  while A[i]%2 == 0:
    cnt += 1

print(cnt)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int,input().split()))

ans = 0
while any(aa % 2 == 0 for aa in a):
  a.sort(reverse=True)
  odd = False
  for i in range(n):
    if a[i] % 2== 0 and odd == False:
      odd = True
      index = i
    if a[i] % 2 == 0 and i == index:
      a[i] /= 2
    elif a[i] % 2!= 0 or a[i] % 2 == 0 and odd ==False:
      a[i] *= 3
  ans += 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
List = list(map(int, input().split()))
res = 0
flagWhile = True
flagManip = True
while flagWhile:
  for i in range(N):
    if flagManip:
      if List[i] % 2 == 0:
        List[i] = List[i] //2
        flagManip = False
        pass
    List[i] = List[i] * 3
  if flagManip:
    flagWhile = False
  flagManip = True
  if flagWhile:
    res += 1
print(res)

Submission status: Time Limit Exceeded

Solution code:
# AtCoder Beginner Contest 100
# C - *3 or /2

N=int(input())
A=list(map(int,input().split()))

count=0

A=[ a for a in A if a%2==0 ]

while len(A)>0:
    _A=[]
    for a in A:
        if a==max(A):
            _a=a//2
            if _a%2==0:
                _A.append(_a)
            else:
                pass
        else:
            if a%2==0:
                _a=a*3
                _A.append(_a)
            else :
                pass
    count+=1
    A=_A
    # print(A)
    # print(_A)

print(count)

Submission status: Time Limit Exceeded

Solution code:
# AtCoder Beginner Contest 100
# C - *3 or /2

N=int(input())
A=list(map(int,input().split()))

count=0

A=[ a for a in A if a%2==0 ]

while len(A)>0:

    _A=[]
    for a in A:
        if a==max(A):
            _a=a//2
            _A.append(_a)
        else:
            _a=a*3
            _A.append(_a)
    count+=1
    A=[ _a for _a in _A if _a%2==0 ]
    # print(A)
    # print(_A)


print(count)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
A = list(map(int, input().split()))

ans = 0
waru = 0
cnt = 0

while True:
    for i in range(n):
        if A[i] % 2 == 0:
            if waru == 1:
                A[i] *= 3
            else:
                A[i] //= 2
                waru = 1
        else:
            A[i] *= 3
    if waru == 0:
        print(ans)
        exit()
    else:
        ans += 1
    waru = 0