Problem:


Score : 200 points

Problem Statement

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.

Constraints

1 \leq N \leq 200

1 \leq A_i \leq 10^9

Input

Input is given from Standard Input in the following format:

N
A_1 A_2 ... A_N

Output

Print the maximum possible number of operations that Snuke can perform.

Sample Input 1

3
8 12 40

Sample Output 1

2

Initially, [8, 12, 40] are written on the blackboard.
Since all those integers are even, Snuke can perform the operation.

After the operation is performed once, [4, 6, 20] are written on the blackboard.
Since all those integers are again even, he can perform the operation.

After the operation is performed twice, [2, 3, 10] are written on the blackboard.
Now, there is an odd number 3 on the blackboard, so he cannot perform the operation any more.

Thus, Snuke can perform the operation at most twice.

Sample Input 2

4
5 6 8 10

Sample Output 2

0

Since there is an odd number 5 on the blackboard already in the beginning, Snuke cannot perform the operation at all.

Sample Input 3

6
382253568 723152896 37802240 379425024 404894720 471526144

Sample Output 3

8



Sample input:
3
8 12 40


Sample output:
2

Submission status: Accepted

Solution code:
N = int(input())  # nは入力回数
num_list =  list(map(int, input().split()))
    
count = 0
actual_count = 0
w = 0
new_list = []
while (w == 0):
    count = 0
    for i in range(N):
        a = num_list[i]
        
        b = int(a) % 2 
        if (b == 0):
            count = count + 1
    if (count == N):
            new_list =[]
            for n in range(N):
                a = num_list[n]
                b = int(a) / 2
                new_list.append(b)
            num_list = []
            for l in range(N):
                a = new_list[l]
                num_list.append(a)
                
            
            actual_count += 1
    else:
        w = 1
        
        
print(actual_count)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split()))
def X(x):
  y = 0
  while x%2==0:
    x = x/2
    y = y+1
  return y
a = [X(A[i]) for i in range(0,N)] 
  
print(min(a))

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split()))
def X(x):
  y = 0
  while x%2==0:
    x = x/2
    y = y+1
  return y
a = [X(A[i]) for i in range(0,N)] 
  
print(min(a))

Submission status: Accepted

Solution code:
n = input()
l = [int(x) for x in input().split()]
cnt = 0
while len([True for x in l if x%2==0]) == len(l):
  l = [x/2 for x in l]
  cnt += 1
print(cnt)

Submission status: Accepted

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

while True:
    if [i for i in l if i % 2 != 0]:
        break
    l = [i / 2 for i in l]
    count += 1
print(count)

Submission status: Accepted

Solution code:

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

count = 0
while True:
    if [i for i in x if i % 2 == 1]:
        break
    x = [i/2 for i in x]
    count+=1

print(count)

Submission status: Accepted

Solution code:
def notExistOdd(lst):
    for i in lst:
        if i%2==1:
            return False
    return True

n=int(input())
a=[int(i)for i in input().split()]
res=0
div=lambda x:x/2
while notExistOdd(a):
    res+=1
    a=list(map(div,a))
print(res)

Submission status: Accepted

Solution code:
n=int(input())
*a,=map(int,input().split())
c=0
while all([i%2==0 for i in a]):
    a=[j/2 for j in a]
    c+=1
print(c)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
ans = float('inf')
for a in A:
    ans = min(ans, len(bin(a)) - bin(a).rfind('1')-1)
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

nums = list(map(int,input().split(' ')))

count = 0
existOdd = True
while existOdd:
    for i in nums:
        if i%2!=0:
            existOdd = False
            break
    
    if existOdd:
        for i in range(N):
            nums[i] /= 2
        
        count+=1
    
print(count)

Submission status: Accepted

Solution code:
def divide(iterable):
	return list(map((lambda x : x // 2),iterable))
    
N = int(input())
nums = list(map(int, input().split()))
count = 0
flag = 0
while 1:
  if flag == 1:
    break
  for num in nums:
    if num % 2 == 1:
      flag = 1
      break
  else:
    count += 1
    nums = divide(nums)
print(count)

Submission status: Accepted

Solution code:
N = int(input())
L = list(map(int, input().split()))
l = []
for i in L:
  l.append(format(i, 'b')[::-1].find('1'))
print(min(l))

Submission status: Accepted

Solution code:
input()
def a(n):
    return 0 if n%2 else a(n//2)+1
print(min([a(i) for i in list(map(int,input().split()))]))

Submission status: Accepted

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

cnt = 0
while all(not i % 2 for i in a):
    a = [i // 2 for i in a]
    cnt += 1
else:
    print(cnt)

Submission status: Accepted

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

cnt = 0
while not sum([i % 2 for i in a]):
    a = [i // 2 for i in a]
    cnt += 1
else:
    print(cnt)

Submission status: Accepted

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

    ans = 0
    is_even = True

    while is_even:
        list_tmp = []
        for an in a:
            if an % 2 == 0:
                list_tmp.append(an / 2)
            else:
                is_even = False
                break
        if is_even:
            a = list_tmp
            ans += 1

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

counter = 0
while True:
  hasOdd = 0
  for i in range(N):
    if A[i] % 2 == 1:
      hasOdd += 1

  if hasOdd > 0:
    break

  A = [i / 2 for i in A]
  counter += 1
print(str(counter))

Submission status: Accepted

Solution code:
def warimakuri(num):
  return format(num, 'b')[::-1].find('1')
N=int(input())
L=list(map(int,input().split()))
L=[warimakuri(i) for i in L]
print(min(L))

Submission status: Accepted

Solution code:
input();a=list(map(int,input().split()));c=0
while all(i%2==0 for i in a):
  a=[i/2 for i in a];c+=1
print(c)

Submission status: Accepted

Solution code:
input();a=list(map(int,input().split()));c=0
while all([i%2==0 for i in a]):
  a=[i/2 for i in a];c+=1
print(c)

Submission status: Accepted

Solution code:
input();a=list(map(int,input().split()));c=0
while all([i%2==0 for i in a]):
  a=[i//2 for i in a];c+=1
print(c)

Submission status: Accepted

Solution code:
input();a=list(map(int,input().split()));count=0
while all([i%2==0 for i in a]):
  a=[i//2 for i in a];count+=1
print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

ans = 1000
for i in a:
    x = 0
    while i:
        if i & 1:
            break
        else:
            x += 1
        i >>= 1
    ans = min(ans, x)
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
A = list(map(int, input().split()))
count = 0
while all(a % 2 == 0 for a in A):
    A = [a / 2 for a in A]
    count += 1
print(count)

Submission status: Accepted

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

two = [0] * n

for i in range(n):
        while a[i]%2 == 0 :
                two[i] += 1
                a[i] = a[i] / 2
print(min(two))

Submission status: Accepted

Solution code:
from typing import List

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

count = 0

def halfen(i: int)->int:
    return i >> 1

def isAllEven(l: List[int])->bool:
    for i in l:
        if(i % 2 == 1 or i == 0):
            return False
    return True

while True:
    if not isAllEven(numbers):
        break
    numbers = list(map(halfen, numbers))
    count += 1

print(count)

Submission status: Accepted

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

ans = 0

for i in range(N):
    ans_sub = 0
    while A[i]%2 == 0:
        A[i]/=2
        ans_sub += 1
    
    if i == 0:
        ans = ans_sub
    else:
        ans = min(ans_sub, ans)

print(ans)

Submission status: Accepted

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

count = 0
flag = False
while True:
    for i in range(n):
        if li[i]%2==1:
            flag = True
        li[i]/=2
    if flag:
        break
    count+=1

print(count)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
tf = True
cnt = 0
while tf == True:
    for i in range(N):
        if A[i] % 2 != 0:
            tf = False
    if tf == True:
        cnt += 1
        for i in range(N):
            A[i] //= 2
print(cnt)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
ans = 0
def check_all():
    global a,n
    for i in range(n):
        if a[i]%2!=0:
            return False
    return True
while check_all():
    ans += 1
    for i in range(n):
        a[i] //= 2
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
count = 0
while all([a % 2 == 0 for a in A]):
    A = [a / 2 for a in A]
    count += 1
print(count)

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int,input().split()))
count=0
while all( [a%2==0 for a in A]):
    A=[a/2 for a in A]
    count+=1

print(count)

Submission status: Accepted

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

ans = 0
isEven = True

while isEven:
  list_tmp = []
  for an in a:
    q, mod = divmod(an, 2)
    if mod ==0:
      list_tmp.append(q)
    else:
      isEven = False
      break;
  a = list_tmp
  ans += 1

print(ans - 1)

Submission status: Accepted

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

for i in range(n):
    cnt = 0 
    while A[i]%2 ==0 :
        cnt+= 1 
        A[i]//=2
    A[i] = cnt 
    
print(min(A))

Submission status: Accepted

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

ans = 0
isEven = True

while isEven:
  list_tmp = []
  for an in a:
    if an % 2 ==0:
      list_tmp.append(an / 2)
    else:
      isEven = False
      break;
  a = list_tmp
  ans += 1

print(ans - 1)

Submission status: Accepted

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

ans = -1
isEven = True

while isEven:
  list_tmp = []
  for an in a:
    if an % 2 ==0:
      list_tmp.append(an / 2)
    else:
      isEven = False
      break;
  a = list_tmp
  ans += 1

print(ans)

Submission status: Accepted

Solution code:
import sys

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

# ans = sys.maxsize
# for an in a:
#   cnt = 0
#   while an % 2 == 0:
#     an /= 2
#     cnt += 1
#   if cnt < ans:
#     ans = cnt

ans = 0
isEven = True

while isEven:
  list_tmp = []
  for an in a:
    if an % 2 ==0:
      list_tmp.append(an / 2)
    else:
      isEven = False
      break;
  a = list_tmp
  ans += 1

print(ans - 1)

Submission status: Accepted

Solution code:
import sys

n = int(input())
a = map(int, input().split())
ans = sys.maxsize
for an in a:
  cnt = 0
  while an % 2 == 0:
    an /= 2
    cnt += 1
  if cnt < ans:
    ans = cnt
print(ans)

Submission status: Accepted

Solution code:
import numpy as np
n = int(input())
A = list(map(int, input().split()))
A = np.array(A)
cnt = 0
while all(a % 2 == 0 for a in A):
    A = A/2
    cnt += 1
print(cnt)

Submission status: Accepted

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

res = 0
while True:
	odd = list(filter(lambda x: x % 2 == 1, As))
	if odd:
		break
	else:
		As = list(map(lambda x: x // 2, As))
		res += 1
print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

from typing import List


def main():
    N = int(input())
    args = list(map(lambda x: int(x), input().split()))
    counter = 0
    target = args
    while canDev(target):
        counter += 1
        target = dev2(target)

    print(counter)


def canDev(target: List[int]) -> bool:
    for item in target:
        if item % 2 != 0:
            return False
    return True


def dev2(target: List[int]) -> List[int]:
    return list(map(lambda x: int(x / 2), target))


if __name__ == "__main__":
    main()

Submission status: Accepted

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

count=[0]*N

for i in range(N):
  while x[i]%2==0:
    x[i]/=2
    count[i]+=1
    
print(min(count))

Submission status: Accepted

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

Submission status: Accepted

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

import math
x = A[0]
for i in range(1,N):
    x = math.gcd(x,A[i])

ans = 0
while x%2 == 0:
    x = x//2
    ans += 1

print(ans)

Submission status: Accepted

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

z = True
count = -1
while z == True:
    count += 1
    for i, j in enumerate(y):
        if j % 2 == 0:
            y[i] = j / 2
        else:
            z = False

print(count)

Submission status: Accepted

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

count = 0
flag = False

while flag==False:
  for i in range(N):
    if li[i]%2==0:
      li[i]=li[i]/2
    else:
      flag=True
        
  if flag==False:
    count+=1

print(count)

Submission status: Accepted

Solution code:
digit = int(input())
li = list(input().split(" "))
li = [int(i) for i in li]

count = 0
flag = False

while flag==False:
  for i in range(digit):
    if li[i]%2==0:
      li[i]=li[i]/2
    else:
      flag=True
        
  if flag==False:
    count+=1

print(count)

Submission status: Accepted

Solution code:
def chk_a():
    global a
    for i in range(len(a)):
        if a[i]%2==0:
            a[i]=a[i]//2
        else:
            return False
    return True

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

for i in range(10**9):
    if chk_a()==False:
        break
print(i)

Submission status: Accepted

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

cnt= 0
remaindar = list(map(lambda x:x % 2,src_list))
while (1 not in remaindar):
    src_list=list(map(lambda x:x/2,src_list))
    remaindar = list(map(lambda x:x % 2,src_list))
    cnt+=1

print(cnt)

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int,input().split()))
count = 0
while all(l[i] % 2 == 0 for i in range(n)):
    l = [l[i] / 2 for i in range(n)]
    count += 1
    
print(count)

Submission status: Accepted

Solution code:
x = int(input())
y = [int(n) for n in input().split()]

ini = 0

def search(li):
    L = len(li)
    for i in range(L):
        if li[i]%2 != 0:
            return False
        else:
            li[i] = li[i]//2
    return True


while True:
    if search(y):
        ini += 1
    else:
        break

print(ini)

Submission status: Accepted

Solution code:
N = int(input())
arrange = input().split()
split = True
count = 0

for i in range(N):
    arrange[i] = int(arrange[i])

while split:
    for i in range(N):
        if arrange[i] % 2 == 0:
            arrange[i] /= 2
        else:
            split = False
    count += 1

print(str(count - 1))

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
x = 'Y'
num = -1
while x == 'Y':
    l = []
    num += 1
    for i in a:
        if i%2 == 0:
            l.append(i//2)
        else:
            x = 'N'
            break
    a = l
print(num)

Submission status: Accepted

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

ans = 0

def func(array):
    for i in range(len(array)):
        if array[i]%2 != 0:
            return False
        else:
            array[i] = array[i]//2
    return True


while True:
    if len(A) == A.count(0):
        break
    if func(A):
        ans += 1
    else:
        break

print(ans)

Submission status: Accepted

Solution code:
def lo2(n):
    count = 0
    while n%2==0:
        n=n//2
        count+=1
    return count

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

Submission status: Accepted

Solution code:
import sys

N = int(input())
Ai = map(lambda x:int(x),input().split(" "))
 
def f(arg_list):
    even_arg_list = []
    for i in arg_list:
        if i % 2 == 0:
            even_arg_list.append(i/2)
        else:
            return False
    return even_arg_list


counter = 0
while True:
    Ai = f(Ai)
    if Ai == False:
        print(counter)
        sys.exit()
    counter+=1
    # print(Ai)

Submission status: Accepted

Solution code:

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

ans = 0

_break = False

while _break == False:
    
    for i in range(n):

        # print("i : {0}".format(i))

        # 対象が偶数
        if a_list[i] % 2 == 0 :

            a_list[i] = a_list[i] / 2

            # 最後まで回りきったら+1
            if i == n - 1 :
                ans += 1
        # 対象が奇数　→ 終了
        else :
            _break = True
            break

print(ans)

Submission status: Accepted

Solution code:
#B - Shift only
N = int(input())
A = list(map(int,input().split()))

def div_2():
    for i in range(N):
        if A[i] % 2 == 0:
            A[i] //=  2
        else :
            return False
    return A

count = 0
while True:
    if div_2() != False:
        count += 1
    else:
        break
print(count)

Submission status: Accepted

Solution code:
num = int(input())
vals = list(input().split())

ivals = []
for i in range(num):
  ival = int(vals[i])
  ivals.append(ival)

count = 0
check_flag=0

def is_odd(n):
    """ 奇数判定関数 """
    return (n%2) == 1

while check_flag==0:
  for i in range(num):
    if (ivals[i])%2 != 0:
      check_flag=1
      break
    else:
      ivals[i]=ivals[i]/2
  
  if check_flag==0:
    count+=1

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

n = ri()
li = rl()
cnt = 0
while all([i % 2 == 0 for i in li]):
    li = [i // 2 for i in li]
    cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
n=int(input())
A=list(map(int,input().split()))
cnt=0
for i in range(500000000):
  for j in range(n):
    if A[j]%2==1:
      print(cnt)
      exit();
    else:
      A[j]//=2
  cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
import math

N = int(input())
A = list(map(int, input().split()))
ans = 0
while True:
    for i in range(N):
        if A[i] % 2 == 0:
            A[i] //= 2
        else:
            print(ans)
            exit()
    ans += 1

Submission status: Accepted

Solution code:
numLength = int(input())
numList = input().split()
count = 0
flag = True
while flag:
  for i in range(numLength):
    numList[i] = int(numList[i])
    if not numList[i] % 2 == 0:
      print(count)
      flag = False
      break
    numList[i] /= 2
  count += 1

Submission status: Accepted

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

t = True
x = -1

while t == True:
  x += 1
  for i in a:
    if i%2 == 0:
      continue
    else:
      t = False
  a = list(map(lambda x:x/2, a))  

      
print(x)

Submission status: Accepted

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [list(input()) for _ in range(n)]
#a = [int(input()) for _ in range(n)]

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

def func(a):
    rtn = 0
    while a % 2 == 0:
        a //= 2
        rtn+=1
    return rtn

for i in range(n):
    a[i] = func(a[i])
print(min(a))

Submission status: Accepted

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [list(input()) for _ in range(n)]
#a = [int(input()) for _ in range(n)]

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

ans = 0
while True:
    for i in range(n):
        if (a[i] % 2 != 0):
            print(ans)
            exit()
    for i in range(n):
        a[i] //= 2
    ans += 1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
am = int(input())
arr = list(map(int,input().split()))
out = [0]*am
for i in range(am):
  while arr[i]&1 == 0:
    out[i]+=1
    arr[i]= arr[i]//2
print(min(out))

Submission status: Accepted

Solution code:
n=int(input())
a=[int(i)for i in input().split()]
d=lambda x:x/2

def devide(x,lst):
    global d
    for i in lst:
        if i%2 ==1:
            return x
    return devide(x+1,list(map(d,lst)))

print(devide(0,a))

Submission status: Accepted

Solution code:
N=input()
X=list(map(int,input().split()))
count=0
while all((x%2==0) for x in X):
  X=[x/2 for x in X]
  count+=1
print(count)

Submission status: Accepted

Solution code:
N = int(input())
ls = list(map(int,input().split()))
keta = []
ans = 'a'
j = 0
while ans == 'a':
    for i in range(N):
        if ls[i]%2 == 0:
            ls[i] = ls[i]//2
        else:
            ans = j
            break
    j += 1
print(ans)

Submission status: Accepted

Solution code:
import os, sys, math
if os.environ.get("DEBUG") is not None:
    sys.stdin = open("in.txt", "r")
rl = sys.stdin.readline

n = int(rl())
a = list(map(int, rl().split()))

ans = math.inf
for it in a:
    cnt = 0
    while it > 0 and it % 2 == 0:
        it /= 2
        cnt += 1
    ans = min(ans, cnt)
print(ans)

Submission status: Accepted

Solution code:
import os, sys
if os.environ.get("DEBUG") is not None:
    sys.stdin = open("in.txt", "r")
rl = sys.stdin.readline

n = int(rl())
a = list(map(int, rl().split()))

ans = 987654321
for it in a:
    cnt = 0
    while it > 0 and it % 2 == 0:
        it /= 2
        cnt += 1
    ans = min(ans, cnt)
print(ans)

Submission status: Accepted

Solution code:
def counter(s):
    return len(bin(s))-(bin(s).rfind("1")+1)

n = input()
a = input()
b = map(int,a.split(" "))
c = map(counter,b)
d = min(c)
print(d)

Submission status: Accepted

Solution code:

def resolve():
    import sys
    input = sys.stdin.readline
    # row = [int(x) for x in input().rstrip().split(" ")]
    # n = int(input().rstrip())
    n = int(input().rstrip())
    a_list = [int(x) for x in input().rstrip().split(" ")]

    def get_num(num, max_count):
        count = 0
        while num % 2 == 0 and count < max_count:
            num = num // 2
            count += 1
        return count

    first = True
    ans = float('inf')
    for a in a_list:
        count = get_num(a, ans)
        if ans > count:
            ans = count

    print(ans)


if __name__ == "__main__":
    resolve()

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
ans = 0
def yo(n):
    return n%2
def waru(n):
    return int(n / 2)

for i in range(200):
    B = list(map(yo, A))
    if sum(B) == 0:
        A = list(map(waru, A))
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc081/tasks/abc081_b
N = int(input())
int_list = list(map(int, input().split()))

def check_even(int_list):
    for i in int_list:
        if i % 2 == 1:
            return False
    else:
        return True

def half_list(int_list):
    return [i / 2 for i in int_list]
    
for i in range(50):
    if check_even(int_list):
        int_list = half_list(int_list)
    else:
        print(i)
        break

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
i,c=0,0
while True:
    if a[i]%2==0:
        a[i]=a[i]/2
        i=i+1
    else:
        print(c)
        break
    if i==n-1:
        i=0
        c+=1

Submission status: Accepted

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

for i in range(1,max(A)):
  a = 2 ** i
  for n in range(N):
    if A[n] % a != 0:
      flag = True
      break
  if flag:
    break
    
print(i-1)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n = input()
a = [int(s) for s in input().split()]
r = 0

def checkNum(l, c):
    for i in l:
        if (i % 2 != 0):
            return c

    c += 1
    return checkNum([j / 2 for j in l], c)

print(checkNum(a, r))

Submission status: Accepted

Solution code:
def d_2_c(n):
  a = 0
  while(n % 2 == 0):
    n = int(n/2)
    a += 1
  return a

N = input()
print(min(list(map(lambda a: d_2_c(int(a)), input().split(" ")))))

Submission status: Accepted

Solution code:
N=int(input())
a=list(map(int, input().split()))
ans = 100000000
for i in range(N):
  d = 0
  while (a[i] %2 == 0):
    d += 1
    a[i] //= 2
  ans = min(d,ans)
print(ans)

Submission status: Accepted

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

count=0
while 1:
    if sum([i%2 for i in a]) == 0:
        a = [i/2 for i in a]
        count=count+1
    else:
        print(count)
        break

Submission status: Accepted

Solution code:
import numpy as np

n = int(input())
a = np.array(list(map(int,input().split())))

count = 0
while np.all(a%2==0):
    count+=1
    a=a/2
print(count)

Submission status: Accepted

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

for i in range(n):
    count = 0
    for j in reversed(bin(a[i])):
        if j == '0':
            count+=1
        else:
            break
    a[i] = count

print(min(a))

Submission status: Accepted

Solution code:
import math 
N = int(input())
A = map(int,input().split())
B = map(bin,A)
def Y(x):
  y = len(x)-x.rfind("1")-1
  return y
C = map(Y,B)
print(min(C))

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
r = 0
while True:
    f = False
    for i, a in enumerate(A):
        if a%2 != 0:
            f = True
        A[i] = a//2
    if f: break
    r += 1
print(r)

Submission status: Accepted

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

ans = 0

while all(a%2 == 0 for a in A):
    A = [a//2 for a in A]
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int,input().split()))
MIN=10**9
for i in range(N):
  count=0
  while 1:
    if A[i] % 2 == 0:
      A[i] //= 2
    else:
      break
    count += 1
  MIN = min(MIN,count)
  if MIN==0:
    print(0)
    exit()
print(MIN)

Submission status: Accepted

Solution code:
N = int(input())
As = list(map(int,input().split()))
count = 0
while all(a%2==0 for a in As):
  As = [a/2 for a in As]
  count = count + 1
print(count)

Submission status: Accepted

Solution code:
from math import gcd
n = int(input())
a = list(map(int, input().split()))
ans = a[0]
for i in range(1, n):
    ans = gcd(ans, a[i])
cnt = 0
while ans % 2 == 0:
    ans //= 2
    cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
import sys


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

n = inint()
A = inintl()

ans = 10**6

for a in A:
    cnt = 0
    while a % 2 == 0:
        a /= 2
        cnt += 1
    if cnt < ans:
        ans = cnt

print(ans)

Submission status: Accepted

Solution code:
def dev(n):
    return int(n / 2)

N = int(input())
li = list(map(int, input().split()))
flag = True
an = 0
while True:
 for i in range(N):
    if li[i] % 2 != 0:
      flag = False
 if flag:
  li = list(map(dev, li))
  an += 1
 else:
     break
print(an)

Submission status: Accepted

Solution code:
n=int(input())
a= list(map(int, input().strip().split()))
def how_many_times_divisible(n):
	ans = 0
	while n % 2 == 0:
		n /= 2
		ans += 1
	return ans
ans = min(map(how_many_times_divisible, a))
print(ans)

Submission status: Accepted

Solution code:
import sys

read=sys.stdin.read
n, *a=map(int,read().split())

f=1
c=0
while f:
  for i,x in enumerate(a):
    if x%2:
      f=0
      break
    a[i]=x//2
  else:
    c+=1
print(c)

Submission status: Accepted

Solution code:
N=int(input())
an=list(map(int,input().split()))
n=0
while(all(a%2==0 for a in an)):
    an=[a//2 for a in an]
    n+=1
print(n)

Submission status: Accepted

Solution code:
n = int(raw_input())
ais = map(int, raw_input().split())
c = 0
while(all([(ai % 2 ==0) for ai in ais ])):
	ais = [ai/2 for ai in ais]	
	c +=1
print c

Submission status: Accepted

Solution code:
N=int(input())
a=[int(x) for x in input().split()]
b=a
t=-1
s=0
while s==0:
  for i in range(N):
    if b[i]%2!=0:
      s=1
    b[i]=b[i]/2
  t=t+1
    
print(t)

Submission status: Accepted

Solution code:
N=int(input())
a=[int(x) for x in input().split()]
b=a
t=-1
s=0
while s==0:
  for i in range(N):
    if b[i]%2!=0:
      s=1
    b[i]=b[i]/2
  t=t+1
print(t)

Submission status: Accepted

Solution code:

n=int(input())
a=list(map(int,input().split()))
def f(x):
    m=0
    while x%2==0:
        m+=1
        x=x//2
    return m
print(min(f(a[i]) for i in range(n)))

Submission status: Accepted

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

flag = True
cnt = 0
while True:
  for i in range(n):
    if a[i]%2 != 0:
      flag = False
  if flag:
    for i in range(n):
      a[i] = a[i] // 2
    cnt += 1
  else:
    print(cnt)
    break

Submission status: Accepted

Solution code:
n = input()
a = input()
a = list(map(int, a.split()))
i = 0
cont_flg = True
while cont_flg:
  if sum(list(map(lambda x: x % 2, a))) == 0:
  	i += 1
  	a = list(map(lambda x: x / 2, a))
  else:
    cont_flg = False
print(i)

Submission status: Accepted

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

def func_half(x):
    result = 0
    if x % 2 == 0:
        i = 1
        while x % (2**i) == 0:
            result = i
            i += 1
    return result

ans = 10**9
for a in A:
    buf = func_half(a)
    if buf == 0:
        ans = 0
        break
    ans = min(ans, buf)

print(ans)

Submission status: Accepted

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

count = 0
while(all(a % 2 == 0 for a in A)):
    A = [a//2 for a in A]
    count += 1
print(count)