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())
b=[]
a = input().split()
for i in range(n):
    num = 0
    while int(a[i]) % 2 == 0:
        a[i] = int(a[i]) / 2
        num += 1
    else:
        b.append(num)
print(min(b))

Submission status: Accepted

Solution code:
def bsf(x):
    k = 0
    while x&1 == 0:
        k += 1
        x >>= 1
    return k

n = input()
print(min(list(map(bsf,map(int,input().split())))))

Submission status: Accepted

Solution code:
def check_even(a_list):
    flag = True
    for i, a in enumerate(a_list):
        if a%2 == 1:
            flag = False
            break
        a_list[i] = a//2
    return a_list, flag


def main():
    n = int(input())
    a_list = [int(a) for a in input().split()]

    cnt = 0
    while True:
        a_list, flag = check_even(a_list)
        if not flag:
            break
        cnt += 1

    print(cnt)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
def sr(n):
    ans = 0
    while n & 1 == 0:
        n >>= 1
        ans += 1
    return ans

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
N = int(input())
A = list(map(int, input().split()))
ans = 0
while not list(filter(lambda x: x % 2 == 1, A)):
    A = list(map(lambda x: x / 2, A))
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8


def x():
    n = input()
    a = map(int, raw_input().split())
    c = 0
    while True:
        for i in range(0, n):
            if a[i] % 2 == 0:
                a[i] /= 2
            else:
                return c
        c += 1

print x()

Submission status: Accepted

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

    ans = 0
    while True:
        odd_count = [a for a in A if a % 2 != 0]
        if len(odd_count) >= 1:
            break

        ans += 1
        A = [a // 2 for a in A]

    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def solve():
    N = int(input())
    A = list(map(int, input().split()))
    ans = 0
    while True:
        if all([x % 2 == 0 for x in A]):
            ans += 1
            A = list(map((lambda x: x//2), A))
        else:
            print(ans)
            return
    
solve()

Submission status: Accepted

Solution code:
def div(x):
    c = 0
    while not x % 2:
        x /= 2
        c += 1
    return c


N = int(input())
print(min([div(a) for a in map(int, input().split(' '))]))

Submission status: Accepted

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

while True:
    odd = True
    for i in a:
        if i % 2 != 0:
            odd = False
            break

    if odd:
        for i in range(len(a)):
            a[i] = a[i] / 2
        count += 1
        continue
    else:
        break

print(count)

Submission status: Accepted

Solution code:
import math
N = int(input())
A = [int(a) for a in input().split()]
ct = 0

def dim2(n):
    if n%2 == 0:
        return dim2(n/2)+1
    else:
        return 0

B = [dim2(a) for a in A]
print(min(B))

Submission status: Accepted

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

min=32

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(lambda x: int(x), input().split()))

count = 0
i = 2
while True:
    if len(a) == len(list(filter(lambda x: x%i==0, a))):
        count += 1
        i *= 2
    else:
        print(count)
        break

Submission status: Accepted

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

ans = 0

while True:
    if all(map(lambda x: x%2 == 0, A)):
        ans += 1
        A = list(map(lambda x: x // 2, A))
    else:
        break
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 14 22:24:31 2017

@author: Kanoh
"""
import numpy as np
N = int(raw_input())#標準入力
A = raw_input()#標準入力
A_split=A.split(" ")
A_int=np.zeros((N))

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

counter=0
checker=0
while 1 :
    for i in range(N):
        if((A_int[i]%2)!=1) and((A_int[i])>1):
            A_int[i]=A_int[i]/2
        else:
            checker=1
    if(checker==1):
        break
    else:
        counter=counter+1
    
print counter

Submission status: Accepted

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

def main():
    count = 0
    nums = A
    end = False
    while not end:
        for i in range(N):
            dm = divmod(nums[i], 2)
            if dm[1] != 0: # dm[1] is remainder
                end = True
                break
            nums[i] = dm[0] # dm[0] is quotient
        else:
            count += 1
    print(count)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#ABC081B
import sys

n=int(raw_input())
a=map(int,raw_input().split())
res=float('inf')
for x in a:
 temp=0
 while x%2==0:
  temp+=1
  x/=2
 res=min(temp,res)
print res

Submission status: Accepted

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

    count = -1
    flag = True
    while flag:
        count = count +1
        for i in A:
            if i%2!=0:
                flag = False
        if flag: A = [i/2 for i in A]
    print(str(count))

main()

Submission status: Accepted

Solution code:
n = input()
xs = input().split(' ')
xs = [int(x) for x in xs]
xs = set(xs)
xs = list(xs)
xs.sort()
a = [x for x in xs if x % 2 == 1]
if len(a) > 0:
    print(0)
else:
    m = 10 ** 9
    for x, y in zip(xs[:-1], xs[1:]):
        q = y - x
        if q < m:
            m = q
    if m > xs[0]:
        m = xs[0]
    count = 0
    while m % 2 == 0:
        count += 1
        m = m / 2
    print(count)

Submission status: Accepted

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

counter, i = 0, 0
new_list = []
while(True):
    if list[i] % 2 != 0:
        print(counter)
        break
    else:
        new_list.append(list[i] / 2)
        i += 1

    if i == n:
        list.clear()
        for e in new_list:
            list.append(e)
        new_list.clear()
        counter += 1
        i = 0

Submission status: Accepted

Solution code:
N = int(input())
a = input().split(' ')
c = 0


def check(a):
    global c

    for i in a:
        if int(i) % 2 == 1:
            return
    for i in a:
        a[a.index(i)] = int(i)/2
        if int(i)/2 == 1:
            c += 1
            return
    c += 1
    check(a)


check(a)
print(c)

Submission status: Accepted

Solution code:
_ = input()
a = map(int, raw_input().strip().split())
minNum = 999
for num in a:
    if bin(num)[2:][::-1].index('1') < minNum:
        minNum = bin(num)[2:][::-1].index('1') 
print minNum

Submission status: Accepted

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

count=0
success=True
while True:
    for i in range(N):
        if A[i]%2==1:
            success=False
            break
        else:
            A[i]=int(A[i]/2)
    if success==False:
        break
    count+=1
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding:utf-8 -*-
n = int(input())
a = list(map(int, input().split()))
ans = []
for tmp in range(len(a)):
    b = a[tmp]
    c = 0
    while True:
        if b%2 != 0:
            ans.append(c)
            break
        else:
            b /= 2
            c += 1
print(min(ans))

Submission status: Accepted

Solution code:
import numpy as np
N = list(input())
a = list(map(int,input().split()))

for i in range(1,31):
  b = np.array([n/2 if n%2==0 else 0 for n in a])
  a = b
  if 0 in list(b):
    print(i-1)
    exit()

Submission status: Accepted

Solution code:
n = int(input())
A = [int(a) for a in input().strip().split()]
    
c = 0
while True:
    A = [a/2 for a in A if a % 2 == 0]
    if len(A) < n:
        break
    else:
        c+=1
    
print(c)

Submission status: Accepted

Solution code:
n=int(input())
i=0
num=input().split()
t=True
while t==True:
  for j in range(n):
    if int(num[j])%2==1:
      t=False
      break
    else:
      num[j]=int(num[j])/2
  i += 1
print(i-1)

Submission status: Accepted

Solution code:
# coding: utf-8

# 入力
n = int(input())
s = [int(i) for i in input().split()]

# 奇数判定関数
def check(s):
    for i in s:
        if i % 2 != 0:
            return False
    return True

# リストの数値を 2 で割る関数
def calc(s):
    for i in range(n):
        s[i] = s[i] / 2
    return s

# カウント
count = 0
while True:
    if check(s):
        s = calc(s)
        count += 1
    else:
        break

# 出力
print(count)

Submission status: Accepted

Solution code:
from functools import reduce
from operator import or_

n = int(input())
x = reduce(or_, map(int, input().split()), 0)
print((x & -x).bit_length() - 1)

Submission status: Accepted

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

print(min(b))

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**15
mod = 10**9+7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def M(n): return ModInt(n)
def MI(): return M(I())


def main():
    n = I()
    a = LI()
    r = inf
    for c in a:
        tr = 0
        while c%2 == 0:
            c/=2
            tr+=1
        if tr < r:
            r = tr
    return r



print(main())

Submission status: Accepted

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

for x in xrange(30):
    if [y for y in F if y%(2 ** (x + 1))]:
        break

print x

Submission status: Accepted

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

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

print ans

Submission status: Accepted

Solution code:
#AtcoderABC081 #2

def div(A,N):
	for n in range(N):
		A[n] = A[n]//2

N = int(input())
A = list(map(int, input().split(' ')))
f = 1
cnt = 0
ans = 0

while True:
	for a in A:
		if(a%2 == 0): cnt += 1
	if cnt == N: 
		div(A,N)
		ans += 1
		cnt = 0
	else: break

print(ans)

Submission status: Accepted

Solution code:
def gusu(N,A):
    t=0
    for i in range(0,N):
        if(int(A[i])%2==1):
            t=1

    if(t==1):
        return 0
    else:
        return 1

N=int(input())

A_input = input()
A = A_input.split()

flag=0
while(1):
    if(gusu(N,A)==1):
        flag+=1
        for j in range(0,N):
            A[j]=int(A[j])/2
    else:
        break

print(flag)

Submission status: Accepted

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

count = 0
sw = 1

while sw==1:
	sw = 0
	tmp = 0
	for i in range(N):
		tmp = tmp + A[i]%2
	if tmp == 0:
		A = list(map(lambda x:x/2,A))
		count = count + 1
		sw = 1
	else:
		break

print(count)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

def even_count(array,num):
    count = 0
    for i in range(num):
        if array[i]%2 == 0:
            count += 1
    return(count)

num = int(input())
a = [int(i) for i in input().split()]
count = 0
even = 0
while True:
    even = even_count(a,num)
    if even != num:
        break
    else:
        a = list(map(lambda x:x/2, a))
        count += 1
    even = 0

print(count)

Submission status: Accepted

Solution code:
import sys
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt, ceil, floor
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache, reduce
from operator import xor
INF = float("inf")
sys.setrecursionlimit(10**7)

# 4近傍（右, 下, 左, 上）
dy = [0, -1, 0, 1]
dx = [1, 0, -1, 0]


def inside(y: int, x: int, H: int, W: int) -> bool: return 0 <= y < H and 0 <= x < W


def main():
    N = int(input())
    A = list(map(int, input().split()))
    for ans in count(0):
        for i in range(N):
            if A[i] % 2 != 0:
                print(ans)
                return
            else:
                A[i] //= 2


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def b_shift_only(N, A):
    def is_even(lst):
        # リストの要素がすべて偶数か？
        for x in lst:
            if x % 2 == 1:
                return False
        return True
    a = A[:]
    count = 0
    # 奇数が要素に現れるまで要素を2で割る
    while is_even(a):
        a = [x // 2 for x in a]
        count += 1
    return count

N = int(input())
A = [int(i) for i in input().split()]
print(b_shift_only(N, A))

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 != 0:
            print(count)
            quit()
        else:
            a[i] = a[i] / 2
    count += 1

Submission status: Accepted

Solution code:
N = int(input())

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

Ans = 0

but = 0

while (True):
	for i in range(N):
		if A[i] % 2 == 1:
			but = 1
		else:
			A[i] /= 2
	if but == 1:
		break
		
	Ans += 1
	
print(Ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def f(x):
  x=int(x)
  res = 0
  while x % 2 == 0:
    x //= 2
    res += 1
  return res
input()
print(min(map(f,input().split())))

Submission status: Accepted

Solution code:
N = int(input())
P = list(map(int,input().split()))
S = []
a = 0
p = 0
s = 0
while True:
    
    for i in range(N):
        if P[i] % 2 == 1:
            s = 1
        else:
            P[i] = P[i] / 2
    if s == 1:
        break
    a += 1

print(a)

Submission status: Accepted

Solution code:
C=int(input())
D=list(map(int,input().split()))
S=0
flag=0
while(flag==0):
	for I in range(C):
		if D[I]%2==0:
			D[I]/=2
			if I==(C-1):
				S+=1
		else:
			flag=1
			break	
print(S)

Submission status: Accepted

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

count = 10000000000000
for Ai in A:
	buff = 0
	while Ai % 2 == 0:
		Ai = Ai / 2
		buff += 1
	count = min(buff, count)
print(count)

Submission status: Accepted

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

for i in range(n):
	a = 0
	while num[i] % 2 ==0:
		num[i] = num[i] / 2
		a+=1
	y.append(a)

print(min(y))

Submission status: Accepted

Solution code:
import numpy as np

n = int(input())
a = list(map(int, input().split()))
z = np.ones(n) * 2
count = 0

for i in range(1000000000) :
  b = filter(lambda x: x%2 == 1, a)
  if len(list(b)) >= 1 :
    break
  else :
    a = a / z
    count += 1

print (count)

Submission status: Accepted

Solution code:
N = int(input())
lis = list(map(int,input().split()))
min = 100
for item in lis:
    i = item
    count = 0
    while (i % 2) == 0:
        count += 1
        i /= 2
    if min > count:
        min = count
print (min)

Submission status: Accepted

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

def all_devided_2(A):
#	print(A)
	for i in range(len(A)):
		if A[i] % 2 != 0:
			return False
	return True

res = 0
while all_devided_2(A) == True:
	res += 1
	for i in range(len(A)):
		A[i] //= 2;

print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
raw_input()
t=map(int, raw_input().split(" "))
count=0

while True:
    flag=True
    for i in t:
        if i % 2 != 0:
            flag=False
    if not flag:
        break
    else:
        t = [x / 2 for x in t]
        count+=1
        
print count

Submission status: Accepted

Solution code:
N=int(input())
AS=map(int,input().split())
tw=[]
for num in AS:
    cnt=0
    while num%2==0:
        num/=2
        cnt+=1
        if num==1:
            break
    tw.append(cnt)
print(min(tw))

Submission status: Accepted

Solution code:
i = int(input()); 
j = input();
list = j.split(" ", i-1)
for y in list:
  y = int(y)
results = [0]*i
for x in range(0,i):
  while (int(list[x]) % 2 == 0):
    if (int(list[x]) % 2 == 0):
      list[x] = int(list[x]) /2 
      results[x] += 1
print(min(results))

Submission status: Accepted

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

    cnt = []
    apnd = cnt.append
    for i in A:
        if i & 1:
            print(0)
            return
        else:
            j = 0
            x = i
            while 1:
                x = x // 2
                j += 1
                if x & 1:
                    apnd(j)
                    break
    print(min(cnt))

main()

Submission status: Accepted

Solution code:
N = int(input())
hoge = True
fuga = True
count = 0

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

for i in range(N - 1):
    if l[i] % 2 == 1:
        hoge = False
        break

while True:
    if hoge == False:
        break
    for j in range(N):
        if l[j] % 2 == 1:
            fuga = False
            break
        l[j] = l[j] / 2
    if fuga == False:
        break
    count += 1

if hoge == False:
    print(0)
else:
    print(count)

Submission status: Accepted

Solution code:
N = input()
A = input().split()

total = 0
judge = 0
while judge == 0:
    li = []
    for a in A:
        if int(a) % 2 == 0:
            li.append(int(a)//2)
        else:
            judge = 1
    if judge == 0:
        total += 1
    A = li

print(total)

Submission status: Accepted

Solution code:
n = input()
b = [int(x) for x in input().split()]
c = 0
flg = True
while flg:
    for i,x in enumerate(b):
        if x!=0 and x%2 != 0:
            flg=False
            break
        b[i] = int(x/2)
    c += 1
print(c-1)

Submission status: Accepted

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

ans=0
flag=0
while True:
    for i in range(N):
        if(a[i]%2 == 1):
            flag=1
    if flag == 1:
        break
    ans = ans+1

    for i in range(N):
        a[i] = a[i]/2

print(ans)

Submission status: Accepted

Solution code:
import numpy as np

s=input()
ar=np.array(list(map(int,input().split())))

i=0
while(np.all(ar%2==0)):
    i+=1
    ar//=2
print(i)

Submission status: Accepted

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

def h():
    m = 0
    while True:
        for i in range(n):
            if a_l[i]%2 == 1: return m
            a_l[i] = a_l[i]/2

        m += 1

print(h())

Submission status: Accepted

Solution code:
nb = int(input())
l = list(map(int,input().split()))
ret = 0
while (True):
   for i in range(len(l)):
      if l[i]%2 == 1:
         break
      l[i] //= 2
   else:
      ret += 1
      continue
   break
print(ret)

Submission status: Accepted

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


flg = True
for i in range(N):
    if int(list[i])%2 == 1:
        flg = False
count = 0
while flg:
    x = 0
    for x in range(N):
        if int(list[x])%2 == 1:
            flg = False
            break
        else:
            list[x] = str(int(list[x])//2)
    if flg:
        count +=1
print(count)

Submission status: Accepted

Solution code:

def re_into(nums, count, list_size):
    numbers = []
    for i in nums:
        if i % 2 == 0:
            numbers.append(i // 2)

    if len(numbers) == list_size:
        count += 1
        re_into(numbers, count, list_size)
    else:
        print(count)


n = input()
nums = list(map(int, input().split()))
l = len(nums)

re_into(nums, 0, l)

Submission status: Accepted

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

def gcd( x, y ):
    while y != 0:
        x, y = y, x%y
    return x

Z = A[0]

for i in range(N):
    Z = gcd(Z ,A[i])

flag = 0
i = 0

while flag == 0:
    if Z % pow(2,i) == 0:
        i += 1
    else :
        flag = 1

print(i-1)

Submission status: Accepted

Solution code:
def main():
    N = int( input() )
    A = [int(i) for i in input().split()]
    
    b_flag = False
    n_div = 0
    while True:
        for a in A:
#            print(a % 2)
            if(a % 2 != 0):
                b_flag = True
            
        if(b_flag):
            break
        else:
            A = [i / 2 for i in A]
            n_div += 1
    print(n_div)
    
    
if __name__=="__main__":
    main()

Submission status: Accepted

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

n = int(input())
data = input()
a = data.split(" ")
count = 0
sum = 0
i = 0
while i < n:
    if int(a[i])%2==0:
        a[i]=int(a[i])/2
        count+=1
        if count%n==0:
            sum+=1
        i += 1
    else:break
    if i==n:i -= n
    
print(sum)

Submission status: Accepted

Solution code:
import sys

DBG_FLAG = 1

def pdbg(str):
    if(DBG_FLAG == 1):
        sys.stdout.flush()
        print str

def max_num(num):
    if(num % 2):
        return 0
    else:
        return 1 + max_num(num / 2)

# get num
N = int(raw_input())
array = map(int, raw_input().split())

#pdbg(N)
#pdbg(array)

min = 1
num = 0

ans = []

for item in array:
    ans.append(max_num(item))

ans.sort()

print ans[0]

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
data = input().split()
data = data[:N]

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

count = 0
while(1):
	for i in range(N):
		if(data[i] % 2 != 0):
			print(count)
			exit()
		else:
			data[i] /= 2
	count += 1

Submission status: Accepted

Solution code:
#!/user/bin/python
# coding: UTF-8

N = int(input())
A = input().split()
l = len(A)
n = 0

for i in range(l):
    A[i] = int(A[i])

def check(list):
    leng = len(list)
    for j in range(leng):
        if list[j] % 2 == 1:
            return 1
    return 0

while check(A) == 0:
    for s in range(l):
        A[s] = A[s] / 2
    n += 1

print(n)

Submission status: Accepted

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

while all([j % 2 == 0 for j in nums]):
    
    count += 1
    nums = [int(x) // 2 for x in nums]
    
print(count)

Submission status: Accepted

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

count = 0
while all([x % 2 == 0 for x in A]):
    A = [x >> 1 for x in A]
    count += 1

print(count)

Submission status: Accepted

Solution code:
N = int(input())
A = [int(i) for i in input().split(' ')]
for i in range(10**9):
 if sum([i%2 for i in A])>0:
  print(i)
  break
 else: A = [i/2 for i in A]

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int,input().split()))
count=[0 for i in range(N)]

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

print(min(count))

Submission status: Accepted

Solution code:
import numpy as np

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

count = 0
while 1:
    if np.count_nonzero(A % 2) == 0:
        count += 1
        A = A // 2
    else:
        break

print(count)

Submission status: Accepted

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

for i in range(0,35):
	k = 2 << i
	B = list(map(lambda x:x%k,A))
	if B.count(0) != N:
		print(i)
		exit(0)

Submission status: Accepted

Solution code:
n = int(raw_input())
ans = 100
x = map(int,raw_input().split(" "))
for a in x:
  a = bin(a)
  a = a[a.rfind("1"):]
  a = len(a)
  if ans > (a-1):
    ans = a-1
print ans

Submission status: Accepted

Solution code:
# coding:utf-8
N = int(input())
inp = list(map(int, input().split()))

def gusuka(date):
    for i in range(N):
        if date[i]%2!=0:
            return False
    return True

count = 0
if gusuka(inp):
    count += 1
    while True:
        for i in range(N):
            inp[i] = inp[i]/2
        if gusuka(inp):
            count += 1
        else:
            break

print(count)

Submission status: Accepted

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

while check:
    for a in A:
        if a%2 == 1:
            check = False
            print(ans)
            break
    else:
        ans += 1
        for i in range(N):
            A[i] = A[i] // 2

Submission status: Accepted

Solution code:
def gcm(a,b):
  while b:
    a,b=b,a%b
  return a
n = input()
a = [int(x) for x in [i for i in input().split()]]
r=-1
for i in a:
  if r==-1:
    r=i
    continue
  r=gcm(r,i)
x=0
while r!=1:
  if r%2!=0:
    x=-1
    break
  r/=2
  x+=1
  
print(x)

Submission status: Accepted

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

for j in range(1000):
    count_are=0
    for i in range(n):
        if a[i]%2==0:
            count_are=count_are+1
    if count_are==n:
        count=count+1
        for i in range(n):
            a[i]=a[i]/2
    else:
        break

print(count)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
N=int(input())
a1=input().split()
A = [int(i) for i in a1]
x = [0 for i in range(N)]
for i in range(N):
    for j in range(30):
        if A[i]%2 == 0:
            A[i]= A[i]/2
            x[i] = x[i]+1
print(min(x))

Submission status: Accepted

Solution code:
n = int(input())
number = list(map(int,input().split()))
ans = []
cou = 0
s = 0
for i in range(n):
  while number[s]%2 == 0:
    cou = cou +1
    number[s] = number[s]/2
  else:
    ans.append(cou)
    cou = 0
    s = s+1
print(min(ans))

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
m = 10000000000
for i in range(N):
    cnt = 0
    temp = A[i]
    while temp % 2 == 0:
        temp = temp / 2
        cnt += 1
    if m > cnt:
        m = cnt
print(m)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#AtcoderABC081 #2

def div(A,N):
	for n in range(N):
		A[n] = A[n]//2

N = int(input())
A = list(map(int, input().split(' ')))
f = 1
cnt = 0
ans = 0

while True:
	for a in A:
		if(a%2 == 0): cnt += 1
	if cnt == N: 
		div(A,N)
		ans += 1
		cnt = 0
	else: break

print(ans)

Submission status: Accepted

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

res = 0
end = False
buf = a[:]
while True:
  for i,v in enumerate(buf):
    if v % 2 == 0:
      buf[i] = v // 2
    else:
      end = True
      break
  if not end:
    res += 1
  else:
    break

print(res)

Submission status: Accepted

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

print count

Submission status: Accepted

Solution code:
def judge(L):
    for l in L:
        if l % 2:
            return False

    return True

def solve():
  N = int(input())
  A = list(map(int, input().split(" ")))

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

  print(cnt)


solve()

Submission status: Accepted

Solution code:
if __name__=="__main__":
    count = 0
    idx = int(input())
    n = list(map(int,input().split(" ")))
    while True:
        for i in range(idx):
            if n[i]|1==n[i]:
                print(count)
                exit()
            else:
                n[i]=n[i]>>1
        count+=1

Submission status: Accepted

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

"""abc081_b"""

import sys
import pprint
import re

import itertools
pp = pprint.PrettyPrinter(indent=2)

def main():
    """Main function."""
    n = int(input())
    as_ = list(map(int, input().split(' ')))

    count = 0
    while True:
        odds = list(filter(lambda x: x % 2 != 0, as_))
        if odds:
            break
        else:
            count += 1
            as_ = list(map(lambda x: x >> 1, as_))

    print(count)

if __name__ == '__main__':
    sys.exit(main())

Submission status: Accepted

Solution code:
import sys
s=input()
a=[]
a=map(int,raw_input().split())

cnt=0
while True:
	for ind,i in enumerate(a):
		if i%2==1:
			print cnt
			sys.exit()
		else:
			a[ind]=i/2
	else:
		cnt+=1

Submission status: Accepted

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


def test(n, a):
    count = 0
    while(True):
        for i in range(n):
            a[i] = int(a[i])
            if a[i]%2 == 0:
                a[i] /= 2
                if i == n-1:
                    count += 1
            else:
                return count
    return count

if __name__ == "__main__":
    n = int(input())
    a = input().split(" ")
    print(test(n, a))