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:
a = input()
a = input()
# a = '5 6 8 10'
# a = '382253568 723152896 37802240 379425024 404894720 471526144'
d = a.split()
cnt = 0
run = 1
while(run):
    for i in d:
        if(int(i)%2==1):
            run = 0
            break
    if(run):
        cnt = cnt + 1
        j = 0
        for i in d:
            d[j] = int(d[j])/2
            j = j + 1
print(cnt)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

cnt = int(input())
num_list = list(map(int, input().split()))

ans = 0
while True:
    for i in range(cnt):
        # 各数値に対して偶数か判定、奇数があればそこで終了
        if num_list[i] % 2 != 0:
            print(ans)
            exit()
        # 偶数なら操作を行う
        num_list[i] /= 2
    # 全ての数値で操作が完了したら+1
    ans += 1

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
def isOdd(n):
    return n % 2 == 1
def div2(n):
    return n // 2

res = 0
while True:
    if sum(map(isOdd, A)) > 0 or sum(A) == 0:
        print(res)
        exit()
    else:
        res += 1
        A = list(map(div2, A))

Submission status: Accepted

Solution code:
N = int(input())
A = [int(a) for a in input().split()]
n = 0
while(True):
    B = [b%2 for b in A]
    if sum(B) != 0:
        break
    else:
        A = [a//2 for a in A]
        n += 1
print(n)

Submission status: Accepted

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

c=0
while True:
    if not all([1-ai%2 for ai in a]):break
    a=[ai//2 for ai in a]
    c+=1    
print(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = [int(i) for i in input().split()]
ans = 0
flag=True
while flag:
  for a in A:
    if a%2 == 1:
      flag = False
  if not flag:
    break
   
  ans+=1
  for i in range(N):
    A[i] = A[i] // 2

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input()
a = [int(x) for x in input().split()]
count = 0
while True:
    for i in range(len(a)):
        if(a[i]%2 == 0):
            a[i] = a[i]/2
        else:
            print(count)
            exit()
    count = count + 1

Submission status: Accepted

Solution code:
n=int(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(ans)

Submission status: Accepted

Solution code:
#くじ引き

import numpy
import re
import math

def main():
	"""
	テストコード実行
	:return:
	"""
	n = input()
	a = list(map(int, input().split()))
	ans = float("inf") #無限大を挿入
	for i in a:
		# 2値で変換した際の右に並ぶ0の数が2で割ることのできる回数
		# rfindで1の値を持つ最大インデックスを求め、その分だけ引く
		# 計算した回数の最小値を求める
		ans = min(ans, len(bin(i)) - bin(i).rfind("1") - 1)
	print(round(ans))

if __name__ == '__main__':
	main()

Submission status: Accepted

Solution code:
N = int(input())
A = map(int, input().split())
counter = []
for a in A:
    count = 0
    while True:
        if a % 2 != 0:
            counter.append(count)
            break
        count += 1
        a = int(a / 2)

print(min(counter))

Submission status: Accepted

Solution code:
n = int(input())
l = list(map(int,input().split()))
k = 0
m = 0
for _ in range(100):
    for i in range(len(l)) :
        if l[i] % 2 != 0  :
            m = 10
            break
        else:
            l[i] = l[i]/2
    if m != 0 :
        break
    k += 1
print(k)

Submission status: Accepted

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

def Judge(integersList):
    for i in range(len(integersList)):
        if integersList[i]%2 == 0:
            pass
        else:
            return False
    return True

while True:
    if Judge(integers):
        for i in range(len(integers)):
            replacement = integers[i]/2
            integers[i] = replacement
        count+=1
    else:
        break

print(count)

Submission status: Accepted

Solution code:
cnt = int(input())

nums = input().split()
calc_cnt = 0

n = sum(int(x) % 2 == 0 for x in nums)

while n == cnt:
    for i in range(cnt-1):
        nums[i] = int(nums[i]) / 2
    calc_cnt += 1
    n = sum(int(x) % 2 == 0 for x in nums)
print(calc_cnt)

Submission status: Accepted

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

cnt = 0
j = 0
flag = True

while(flag):
    if(j == N-1):
        cnt = cnt + 1
        j = 0
    elif(lis[j]%2 == 1):
        flag = False
    else:
        lis[j] = lis[j]/2
    
    j = j + 1

print(cnt)

Submission status: Accepted

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



def main():
    num_ans = int(input())
    ans_list = list(map(int, input().split()))
    num_2n_list =[]
    for i in ans_list:
        num_2n_list.append(num_2n(i))
    num_2n_list.sort()
    print(num_2n_list[0])


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
A = [int(i) for i in input().split()]
count = 10**9

def cal(num):
    sum = 0
    while True:
        if num % 2 == 0:
            sum += 1
            num /= 2
        else:
            break
    return sum

for i in range(N):
    count = min(cal(A[i]), count)
print(count)

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int,input().split()))
ans=0
while 1 not in[a%2 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()))

loop = 1000000
for a in A:
    num = 0
    b = a
    while True:
        if b%2 == 0:
            num += 1
            b /= 2
        else:
            break
    loop = min(num,loop)

print(loop)

Submission status: Accepted

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

i = 0
while all(map(lambda x:x%2==0, x)):
	x= list(map(lambda x:x/2, x))
	i += 1

print(i)

Submission status: Accepted

Solution code:
# coding:utf-8


_ = input()
ans = 0

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

flag = True

while 1:
    for v in a:
        if v % 2 == 0:
            pass
        else:
            flag = False
            break
    
    if flag == False:
        break
    
    a = [i/2 for i in a]
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
charA = input().split()

A = []
for i in range(N):
    A.append(int(charA[i]))

count = -1
finalA = [0]*N
         
even = True
while(even):
    for i in range(N):
        if (A[i]%2 == 1):
            even = False
    for i in range(N):
        A[i] = A[i]/2
    count = count +1

print(count)

Submission status: Accepted

Solution code:
import numpy as np
# -*- coding: utf-8 -*-
_ = input()
arr = np.array(list(map(int, input().split())))

cnt = 0
while True:
    if ((arr / 2) == np.ceil(arr / 2)).all():
        cnt += 1
        arr = arr/2
    else:
        break
print(cnt)

Submission status: Accepted

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


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

cnt = 0
while True:
    if judge_odd():
        break
    for idx, v in enumerate(a):
        a[idx] = v // 2
    cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    n = input()
    li = list(map(int, input().split(' ')))
    ans = float('inf')

    while li != []:
        li_value = li.pop()
        cnt = 0
        while li_value % 2 != 1:
            cnt += 1
            li_value /= 2
        ans = min(ans, cnt)
    print(ans)

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    n = input()
    li = list(map(int, input().split(' ')))
    flag, cnt = True, 0

    while flag:
        for list_index in range(len(li)):
            value = li[list_index]
            if value % 2 == 0:
                li[list_index] /= 2
            else:
                flag = False
                break

        if flag:
            cnt += 1

    print(cnt)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split(' ')))
br = 'False'
count = 0
while True:
  count += 1
  if not (a[-1] == 0) | (br == 'True'):
    for i in range(n):
      if a[i]%2 == 1:
        br = 'True'
        count -=1
        break
      else:
        a[i] = int(a[i]/2)

  else:
    count -= 1
    break


print(count)

Submission status: Accepted

Solution code:
# coding: utf-8

# https://beta.atcoder.jp/contests/abc081/tasks/abc081_b

def even(num):
    if num % 2 == 0:
        return num / 2
    else:
        return False

if __name__ == '__main__':

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

    while True:
        new = [0 if even(i) == False or even(i) == 0 else even(i) for i in a]
        if 0 in new:
            break
        a = new
        count += 1
    print(count)

Submission status: Accepted

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

Solution code:
N = int(input())
A = [int(a) for a in input().split()]
cnt = 0
while True:
  for i in range(N):
    if A[i] % 2 == 1:
      print(cnt)
      exit(0)
    else:
      A[i] = A[i] // 2
  cnt += 1

Submission status: Accepted

Solution code:
N =input()
A = list(map(int,input().split()))
cnt=0
ans=0
wh=1
while(wh==1):
    for j in range(len(A)):
        if A[j]%2==0:
            cnt+=1
            A[j]/=2
        else: wh=0
        if (j==len(A)-1 and cnt==len(A)):
            cnt=0
            ans+=1
print(ans)

Submission status: Accepted

Solution code:
input_num = input()
input = input().split()

times = 0
i = 0
    
while True:
  if int(input[i]) % 2 == 0:
    input[i] = int(input[i]) / 2
    i += 1
    if i == int(input_num) - 1:
      i = 0
      times += 1
  else:
    break
print(times)

Submission status: Accepted

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

n = 0
while list(map(lambda x:x%(2**(n+1)),A)).count(0) == N:
    n += 1
print(n)

Submission status: Accepted

Solution code:
def check(numbers, count):
  if all([num % 2 == 0 for num in numbers]):
    numbers = [num / 2 for num in numbers]
    count += 1
    count = check(numbers, count)
  return count

length = input('')
numbers = [int(num) for num in (input('')).split()]
count = check(numbers, 0)
print(count)

Submission status: Accepted

Solution code:
count = int(input())
ans=0
int_list = list(map(int,input().split()))
even_list = [i for i in int_list if i%2 ==0]
if len(even_list) != count:
    print("0")
else:
    while len([i for i in even_list if i%2 ==0]) == count:
        even_list = [i/2 for i in even_list]
        ans+=1
    print(ans)

Submission status: Accepted

Solution code:
ans = 10**9
N = int(input())
a = list(map(int,input().split()))

for b in a:
    count = 0
    while b%2 == 0:
        count += 1
        b = b//2
    ans = min(ans, count)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = [int(a) for a in input().split()]
n = 0
flag = True
while flag:
  for i in range(N):
    if (A[i] % 2) == 0:
      A[i] /= 2
    else:
      flag = False
      break
  if flag:
    n += 1
print(n)

Submission status: Accepted

Solution code:
import math

ignore = input()
num = map(int,input().split())
score = []
for i in num:
    temp = i
    while i%2 == 0:
        i = i/2
    score.append(temp/i)
print(int(math.log(min(score),2)))

Submission status: Accepted

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

temp = A
counter = 0
canDevide = list(map(lambda x:x%2, temp))
while canDevide.count(0) == N:
    counter = counter + 1

    temp = list(map(lambda x: x / 2, temp))
    canDevide = list(map(lambda x:x%2, temp))
print(counter)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
count = 0
flag = True
while flag == True:
    for num in range(N):
        if A[num] % 2 == 0:
            A[num] /= 2
        else:
            flag = False
            count -= 1
            break
    count += 1
print(count)

Submission status: Accepted

Solution code:
import fractions
from functools import reduce


def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct


def reduce_gcd(numbers):
    return reduce(fractions.gcd, numbers)


def main():
    N = int(input())
    A_N = list(map(int, input().rstrip().split()))
    gcd = reduce_gcd(A_N)
    factorized = factorize(gcd)
    if factorized:
        print(factorized[0][1])
    else:
        print('0')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split(' ')))
num = [0] * N
for i, m in enumerate(A):
    cnt = 0
    while m % 2 == 0:
        m = m // 2
        cnt += 1
    num[i] = cnt
print(min(num))

Submission status: Accepted

Solution code:
N = int(input())
a = [int(i) for i in input().split()]
ans = 0
A = True
while(A):
    for i in range(N):
        if (a[i]%2 == 1):
            A = False
        else:
            a[i]= a[i]//2
    ans += 1

print(ans-1)

Submission status: Accepted

Solution code:
n=int(input())
aa=list(map(int,input().split(" ")))
#aaa=input().split()
#aa=map(int,aaa)
#これが原因ではない

j=True
i=0
while j:
    for a in aa:
        if a%2!=0:
            j=False

    if j:
        for k in range(n):
            aa[k]=aa[k]/2

        i+=1
print(i)

Submission status: Accepted

Solution code:
N = int(input())
A = [int(i) for i in input().split()]
i,counter = 0,0
divCheck = False
while True:
    i = 0
    for i in range(0,N):
        if A[i] % 2 == 0:
            A[i] /= 2
        else:
            divCheck = True
    if divCheck:
        break
    counter += 1
print(counter)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
count_a = [0 for i in range(N)]
key = max(A)
for i in range(N):
    while True:
        if A[i] % 2 != 0:
            break
        A[i] /= 2
        count_a[i] += 1
        if count_a[i] > key:
            break
    key = count_a[i]

        
print(min(count_a))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input();print(min(j.index("1") for j in (tuple(bin(int(i))[::-1]) for i in input().split())))

Submission status: Accepted

Solution code:
n = int(input())
s = [int(i) for i in input().split()]
count = 0
while True:
    tmp = []
    for i in s:
        if i % 2 == 0:
            tmp.append(i/2)
        else:
            print(count)
            exit()
    count += 1
    s = tmp[:]

Submission status: Accepted

Solution code:
def counter(x):
    #count = 0と書こうとしたが、再帰呼び出しと相性が悪かった…
    if x%2 == 0:
        return 1 + counter(x/2)
    else:
        return 0

n = int(input()) #4
a = [int(i) for i in input().split()] #[4,8,8,16]
b = [counter(i) for i in a]
print(min(b))

Submission status: Accepted

Solution code:
N=int(input())
q=10**9
for i in list(map(int,input().split())):
    s=0
    while i%2==0:
        i/=2
        s+=1
    q=min(s,q)  
print(q)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
cnt = 0
flag = True

def calc_half(n):
    return n / 2

while flag:
    for i in a:
        if i % 2 == 1:
            flag = False
    if flag:
        a = list(map(calc_half, a))
        cnt += 1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(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: Accepted

Solution code:
N = int(input())
listA =input().split(' ')
count = 0
for i in range(len(listA)):
    listA[i]=int(listA[i])

flag = False
while True:
    for i in listA:
        if int(i)%2!=0:
            flag=True

    if flag==True:
        break


    for j in range(N):
        listA[j] = int(listA[j])/2
    count+=1

print(count)

Submission status: Accepted

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
t = 1
while a[0]%(t*2)==0:
    t *= 2
for k in range(1,n):
    while a[k]%t != 0:
        t = t//2
r = 0
while t != 1:
    t = t//2
    r += 1
print(r)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
flag = False
ans = 0
while not flag:
    for i in range(n):
        if a[i]%2 == 0:
            a[i] = a[i]//2
        else:
            flag = True
            break
    if not flag:
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
a = list(map(int, input().split()))
ans=[]
for x in a:
    t=0
    k=0
    while(t==0):
        if x%2==0:
            k+=1
            x=x//2
        else:
            t=1
    ans.append(k)

print(min(ans))

Submission status: Accepted

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

count = 0
flag = 1

while flag == 1:
    for i in range(len(nums)):
        x = nums[i]%2
        if x == 0:
            nums[i] = nums[i]/2
            continue
        else:
            flag = 0
            break
    if flag == 1:
        count = count+1

print(count)

Submission status: Accepted

Solution code:
N = int(input())
alines = input().split(' ')
#num = [int(x) for x in alines]
num = list(map(int, alines))
c = -1

while 0 not in num:
	c += 1
	num = list(map(lambda x: x/2 if x%2 == 0 else 0, num))

print(c)

Submission status: Accepted

Solution code:
N = int(input())
A_list = list(map(int, input().split(' ')))
assert len(A_list) == N

count = 0
while sum([A % 2 for A in A_list]) == 0:
    count += 1
    A_list = [A // 2 for A in A_list]

print(count)

Submission status: Accepted

Solution code:
input()
numbers = list(map(lambda x: int(x), input().split(" ")))

min = -1
for number in numbers:
    count = 0
    while number%2 == 0:
        count += 1
        number /= 2
    if count < min or min == -1:
        min = count
print(min)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input()
def f(n,c=0):
    while n&1==0:
        n>>=1
        c+=1
    return c
print(min([f(n)for n in map(int,input().split())]))

Submission status: Accepted

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

i=0
while(True):
    if len(list(filter(lambda x:x%2==1,A)))>0:
        break
    else:
        A = list(map(lambda x:x//2,A))
        i+=1
        
print(i)

Submission status: Accepted

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

x = int(input())
y = map(int,input().split())
z = min(map(abe,y))
print(z)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
min = 30
for i in a:
        j=0
        while i%2==0:
                i/=2
                j+=1
        if j < min:
                min=j
print(min)

Submission status: Accepted

Solution code:
n = int(input())

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

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

Submission status: Accepted

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

count = 0

b = []

for i in range(len(a)):
    b.append(a[i] % 2)
    
c = []

for i in range(len(a)):
    c.append(0)
    
while b == c:
    count = count + 1
    for i in range(len(a)):
        if a[i] % 2 ==1:
            break
        else:
            dd = a[i]
            a[i] = dd /2
    b.clear()
    for i in range(len(a)):
        b.append(a[i] % 2)
print(count)

Submission status: Accepted

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

while f:
    ans += 1
    for k in range(N):
        if A[k]%2 == 0:
            A[k]//=2
        else:
            f = 0

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
A = [int(i) for i in input().split()]
B = [0]*N
for i in range(N):
    while A[i] % 2 == 0:
        B[i] += 1
        A[i] /= 2

print(min(B))

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split()))
c = 0
while 1:
    if list(map(lambda x: x%2, A)) == [0 for _ in range(N)]:
        A = list(map(lambda x: x//2, A))
        c += 1
    else:
        break
print(c)

Submission status: Accepted

Solution code:
_ = input()
nums = list(map(int, input().split()))
count = 0
while all(map(lambda x: x % 2 == 0, nums)):
    count += 1
    nums = list(map(lambda x: x / 2, nums))
print(count)

Submission status: Accepted

Solution code:
input()

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

f1 = lambda x: x % 2 == 1
f2 = lambda x: x // 2

count = 0

while True:
    if any(map(f1, A)):
        break
    A = list(map(f2, A))
    count += 1

print(count)

Submission status: Accepted

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

def cnt(li, c):
    arr = []
    for i in li:
        arr.append(i/2)
        if i%2!=0: return c
    return cnt(arr, c+1)

print(cnt(a,0))

Submission status: Accepted

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

count = 0
is_succses = True

while is_succses:
	count += 1
	for i, x in enumerate(ls):
		if x % 2 == 0:
			is_succses = True
			ls[i] = int(x / 2)
		else:
			is_succses = False
			break

print(count - 1)

Submission status: Accepted

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

Solution code:
number_of_list = int(input())
lists = map(int, input().split())

def n2(n):
    counter = 0
    while n % 2 == 0:
        n = n / 2
        counter += 1
    return counter

lists_n2 = list(map(n2, lists))
print(min(lists_n2))

Submission status: Accepted

Solution code:
import sys

s_args = sys.stdin.read().splitlines()

#n = int(s_args[0])
a = [int(s_a) for s_a in s_args[1].split(' ')]

lsb = [ai & -ai for ai in a]
#print(lsb)
print(min(lsb).bit_length() - 1)

Submission status: Accepted

Solution code:
def judgeeven(lst):
	m = len(lst)
	for i in range(0, m):
		if lst[i] % 2 != 0: return False
	
	return True

n = int(raw_input())
inpt = map(int, raw_input().split())
cnt = 0

while judgeeven(inpt):
	for i in range(0, n):
		inpt[i] = inpt[i] / 2
	cnt = cnt + 1

print cnt

Submission status: Accepted

Solution code:
n=int(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 = 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()))
ans = 30
for i in range(N):
  cnt = 0
  while A[i] % 2 == 0:
    A[i] /= 2
    cnt += 1
  ans = min(ans, cnt)
print(ans)

Submission status: Accepted

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

    while True:
        for i in range(N):
            if A[i]%2==1:
                return count
            else:
                A[i] = A[i]/2
        count += 1

if __name__ == '__main__':
    print(main())

Submission status: Accepted

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

count = 0
while True:
    b = list(map(lambda x: x % 2, a))
    if 1 in b:
        break
    a = list(map(lambda x: x // 2, a))
    count += 1
print(count)

Submission status: Accepted

Solution code:
from math import log2;from fractions import gcd;from functools import reduce;input();print(int(log2(reduce((lambda x, y: gcd(x, y)), [int(s) for s in input().split(" ")] + [2 ** 31]))))

Submission status: Accepted

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

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

Submission status: Accepted

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

x=[]

for i in array:
    count = 0
    while i%2==0:
        i=i/2
        count = count +1
    x.append(count)
print(min(x))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

n = int(input())
nums = [int(x) for x in input().split()]
count = -1
flag = 0
while(True):
    count += 1
    for i in range(n):
        if nums[i] % 2 == 0:
            nums[i] = nums[i] / 2
            #print(nums[i])
        else:
            flag = 1
    if flag == 1:
        break
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

result = 0

while True:
    temp_a = []
    for num in a:
        if num%2 == 0:
            temp_a.append(num//2)
    if len(temp_a) != n:
        break
    a = temp_a
    result += 1

print(result)

Submission status: Accepted

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

while True:
    for idx, num in enumerate(nums):
        if num % 2 == 0:
            num //= 2
            nums[idx] = num
        else:
            print(cnt)
            exit()
    cnt += 1

Submission status: Accepted

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


if __name__ == '__main__':
    _ = int(input())
    n_list = [int(n) for n in input().split()]

    count = 0
    while True:
        if judge_even():
            count += 1
        else:
            break

    print(count)

Submission status: Accepted

Solution code:
a=input()
a=int(a)
l=list(map(int,input().split(" ")))
m=100
for i in l:
  temp=i
  for j in range(40):
    if temp%2==0:
      temp/=2
    else:
      if j<m:
        m=j
      break
print(m)

Submission status: Accepted

Solution code:

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

even_nums = list(filter(lambda x: x % 2 == 0, nums))

divide_num = 0
while len(even_nums) == n:
    even_nums = list(map(lambda x: x / 2, even_nums))
    divide_num+=1
    even_nums = list(filter(lambda x: x % 2 == 0, even_nums))

print(divide_num)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

cnt = ''
for idx in range(0,len(ls)):
    buf = 0
    while ls[idx] % 2 ==0:
        ls[idx] /= 2
        buf += 1
    if cnt == '' or  buf < cnt:
        cnt = buf
print(cnt)