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())
A = list(map(int,input().split()))
cnt=0

while True:
    if all([i%2 == 0 for i in A]):
        A = list(map(lambda x: x // 2, A))
        cnt = cnt + 1
    else:
        break;

print(cnt)

Submission status: Accepted

Solution code:
def devide(number, count):
  if number%2==0:
    count += 1
    return devide(number/2, count)
  else:
    return count

length = int(input())
str_arr = input().split(' ')
numbers = [int(s) for s in str_arr]

counts = [0 for s in str_arr]
for i in range(len(numbers)):
  counts[i] = devide(numbers[i], 0)

print(min(counts))

Submission status: Accepted

Solution code:
import numpy as np

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

ans = 0
while(all(A%2==0)):
    A = A/2
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
def check(values):
  for i, value in enumerate(values):
    if (value == 0) or ((value % 2) == 1):
      return False, values
    else:
      values[i] = value / 2
  return True, values


num = int(input())
values = list(map(int, input().split()))

cnt = 0
while True:
  flg, values = check(values)
  if not flg:
    break
  cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
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:
import numpy as np

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

ans = 0
while(all(A%2==0)):
    A = A/2
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
N=input()
A=[int(a) for a in input().split()]
c=0
while all(aa%2==0 for aa in A):
        c+=1
        A=[int(aaa/2) for aaa in A]
print(c)

Submission status: Accepted

Solution code:
N=input()
A=[int(a) for a in input().split()]
c=0
while True:
    if any(aa%2==1 for aa in A):
        break
    else:
        c+=1
        A=[int(aaa/2) for aaa in A]
print(c)

Submission status: Accepted

Solution code:
for_num = int(input())
nums = input()
nums = nums.split()

count = 0
Tf = True
while Tf:
    count += 1
    for i in range(0,for_num):
        num = int(nums[i])
        if num%2 == 0:
            nums[i] = int(num/2)
            Tf = True
        else:
            Tf = False
            break
print(count-1)

Submission status: Accepted

Solution code:
#Shift Only
N = int(input())
A = list(map(int,input().split()))
n = 0
judge = 1
for i in range(40):
    if judge == 1:
        for i in range(N):
            if A[i] % 2 == 0:
                A[i] = A[i] // 2
            else:
                judge = 0
        if judge == 1:
            n += 1
    else:
        break
print(n)

Submission status: Accepted

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


ans = float("inf")
for a in al:
    point = 0
    while True:
        if a % 2 == 0:
            point += 1
            a = a // 2
        else:
            break
    if ans > point:
        ans = point

print(ans)

Submission status: Accepted

Solution code:
dbflag=0
def debug(*args):
	if dbflag: print(*args)

result = 0

N =  input() 
N=int(N)

#A =  map(int,input() .split())
A = [int(i) for i in input().split(' ')]

flag= 1

while flag:
	for i in range(len(A)):
		debug(i, A[i])
		if A[i] %2 == 0:
			A[i] = A[i] //2
		else:
			flag = 0
			break
		
	if flag:
		result += 1

print(result)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

while(True):
    for i in range(len(A)):
        s += A[i]%2
    
    if s != 0:
        break
    else:
        A = list(map(lambda x:x/2,A))
        count +=1

print(count)

Submission status: Accepted

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

import numpy
import scipy

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

c = 0
flg = False
while True:
    #print(A)
    for i, a in enumerate(A):
        if a%2 == 0:
            A[i] /= 2
            #pass
        else:
            flg = True
            break
    if flg:
        break
    c += 1
print(c)

Submission status: Accepted

Solution code:
n = int(input())
an = list(map(int, input().split())) #map object is iterable
ans = 0
flg = 0

while not flg :
    for i, v in enumerate(an):
        if v % 2 == 0:
            v = int(v / 2)
            an[i] = v
            if i == len(an)-1:
                ans +=1
        else:
            flg = 1
            break

print(ans)

Submission status: Accepted

Solution code:

N = int(input())
s = list(map(int, input().split()))
a=[0]*N#N個の要素の配列
total=0

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

while 1==1:
 b=0
 for i in range(N):
  if a[i]%2==0:
        a[i]=a[i]/2
        b+=1
 if b==N:
  total+=1
 else: 
  break

print(total)

Submission status: Accepted

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

cou = []
for i in range(N):
    cc = 0
    while True:
        if x[i] % 2 == 0:
            x[i] /= 2
            cc+=1
        else:
            cou.append(cc) 
            break   
print(min(cou))

Submission status: Accepted

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

ans = 0
flag = 0
for i in range(40):
    for i in range(len(A)):
        if A[i] % 2 == 0:
            A[i] //= 2
        else:
            flag = 1
    if flag == 0:
        ans += 1
    else:
        break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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


ans = float('inf')
for a in A:
    cnt = 0
    while a % 2 == 0:
        a //= 2
        cnt += 1
    ans = min(ans,cnt)
print(ans)

Submission status: Accepted

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

N = input()
print(min(map(test, map(int, input().split()))))

Submission status: Accepted

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

count = 0
ans = 0

while True:
	mo = list(map(lambda x: x % 2, A))
	if 1 in mo:
		ans = count
		break
	else:
		A = list(map(lambda x:x/2,A))
		count += 1

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
ans = 0
while a[0] > 1:
        for i in range(n):
                if a[i] % 2 != 0:
                        break
                else:
                        a[i] /= 2
        else:
                ans += 1
                continue
        break;

print(ans)

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:
import numpy as np

N=int(input())
A=np.asarray(list(map(int,input().split(" "))))
c=0 # カウンタ

while (A%2==0).all(): # 全て2の倍数の場合
    A=A//2 # 2で割る
    c+=1 # カウンタをインクリメント

print(c)

Submission status: Accepted

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

res = []
for a in aa:
    cnt = 0
    while a % 2 == 0:
        cnt += 1
        a = a/2
    res.append(cnt)

print(min(res))

Submission status: Accepted

Solution code:
n = int(input())
b = [int(i) for i in input().split()]
count = 0
ju = True
while(ju):
    for i in range(n):
        if b[i]%2 !=0:
            ju = False
            break
        b[i] = b[i]/2 
    if ju:
        count +=1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
a,b=list(map(int,input().split())),[]
for i in range(n):
    c=0
    while True:
        if a[i]//2==a[i]/2:
            a[i]//=2
            c+=1
        else:
            b.append(c)
            break
print(min(b))

Submission status: Accepted

Solution code:
import numpy as np

N = int(input())
data = np.array([int(i) for i in input().split()])


cout = 0
while 1:
    index = np.where(data%2 == 0)
    data_even = data[index]
    if len(data_even) == len(data):
        cout += 1
        data = data_even / 2
    else:
        break


print(cout)

Submission status: Accepted

Solution code:
N = int(input())
l = [i for i in map(int,input().split())]
 
iter = -1
while len(l) >= N:
    l = [i/2 for i in l if i % 2 == 0]
    iter += 1
 
print(iter)

Submission status: Accepted

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

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):
    for i in range(n):
        A[i]=A[i]/2
    ans+=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def is_all_even(ary, n):
    for i in range(n):
        if ary[i] % 2 == 1:
            return False
    return True

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

while is_all_even(A, N):
    for i in range(N):
        A[i] //= 2
    count += 1

print(count)

Submission status: Accepted

Solution code:
import numpy as np

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

while np.all(A%2 == 0):
  A = A/2
  ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

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

while np.all(A%2 == 0):
  A = A/2
  ans += 1

print(ans)

Submission status: Accepted

Solution code:
import numpy as np

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

while np.sum(A%2 == 0) == N:
  A = A/2
  ans += 1
  if np.sum(A == 0) > 0:
    break
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
count=[0]*n
flag=1
for j in range(1,30):
  for i in range(len(a)):
    if a[i]%(2**j)==0:
      count[i]+=1
      i/=2
    else:
      break  
print(min(count))

Submission status: Accepted

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

result = []
for i in A:
  r = 0
  while i %2 == 0 :
    i = i/2
    r += 1
  result.append(r)

print(min(result))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n=int(input())
cou = 0

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

while sum([i%2 for i in a_list]) == 0:
    a_list = [i/2 for i in a_list]
    cou += 1
print(cou)

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
arr =  np.array([int(i) for i in input().split()])

count = 0
while(True):
    exits_odd = False
    for i in range(N):
        if arr[i] % 2 != 0:
            exits_odd = True
        else:
            continue
    if exits_odd:
        break
    else:
        count += 1
        arr = arr / 2


print(count)

Submission status: Accepted

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

count = 0
while(True):
    exits_odd = False
    for i in range(N):
        if arr[i] % 2 != 0:
            exits_odd = True
        else:
            continue
    if exits_odd:
        break
    else:
        count += 1
        for i in range(N):
            arr[i] = arr[i] / 2


print(count)

Submission status: Accepted

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

def calc_divtwo(n):
    return n / 2

count = 0

while (all([x%2 == 0 for x in input_a]))&(all([x != 0 for x in input_a])):
    count +=1
    input_a = list(map(calc_divtwo, input_a))
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

Solution code:
# coding: utf-8
num = int(input())
input_list = input().split()
list = []
for one in input_list:
    list.append(int(one))

count = 0
out = True
lists = [list]
while out:
    new_list = []
    for one in lists[count]:
        div = one % 2
        if div != 0:
            out = False
            break
        new_list.append(one/2)
    lists.append(new_list)
    if out:
        count = count + 1
print(count)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
ans = 0
for i in range(10**9):
    x=0
    for j in range(N):
        tmp = 0
        if A[j] % 2 == 0:
            A[j] /= 2
            x = j
        else:
            x = j
            break
    if A[x] % 2 == 0:
        ans += 1
    else:
        if x == (N-1):
            ans += 1
            print(ans)
            exit()
        print(ans)
        exit()

Submission status: Accepted

Solution code:
n = int(input())
a_list = list(map(int, input().split()))
ans = 0
while True:
  if [i for i in a_list if i % 2 == 1]:
      break
  a_list = list(map(lambda x:x/2 , a_list))
  ans += 1
print(ans)

Submission status: Accepted

Solution code:
from sys import stdin

n = int(stdin.readline().rstrip())

mi = 10**6
li = list(map(int,stdin.readline().rstrip().split()))
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

for i in li:
    lin = prime_factorize(i)
    mi = min(mi,lin.count(2))

print(mi)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")

def main():
    n = input()
    aa = list(map(int, input().split()))
    ans = 0
    b = 2
    while 1:
        for a in aa:
            if a % b:
                print(ans)
                exit()
        ans += 1
        b *= 2

main()

Submission status: Accepted

Solution code:
x=int(input())
x_lst=list(map(int,input().split()))
count = 0
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

if x==1:
    print(x[0])
else:
    element = gcd(x_lst[0], x_lst[1])
    if x==2:print(element)
    else:
        for i in range(2,x):
            element=gcd(element,x_lst[i])
while element % 2 == 0:
  element = element / 2
  count += 1
print(count)

Submission status: Accepted

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

ans = 0
while all(map(lambda x: x % 2 == 0, a)):
  ans += 1
  a = [ai // 2 for ai in a]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def calc(list_, len_list):
    def check_even():
        for l in list_:
            if l % 2 == 1:
                return False
        return True
    def half():
        for i in range(len_list):
            list_[i] //= 2

    counter = 0
    while True:
        if check_even():
            half()
            counter += 1
        else:
            print(counter)
            break

N = int(input())
A = [int(a) for a in input().split(" ")]
calc(A, N)

Submission status: Accepted

Solution code:
#081b
import collections

N = int(input())
A_list = [int(e) for e in input().split()]

#https://note.nkmk.me/python-prime-factorization/
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

counted_list = [prime_factorize(A*2).count(2)-1 for A in A_list] #1だと空リストになるので*2の下駄をはかせて、-1で脱がす
print(min(counted_list))

Submission status: Accepted

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

n = int(input())
a = map(int, input().split())
ans = min(map(how_many_times_divisible, a))

print(ans)

Submission status: Accepted

Solution code:
def division_nankai_2(n):
  answer = 0
  while n % 2 == 0:
    answer += 1
    n = n // 2
  return answer
 
total = int(input())
div = []
numbers = map(int, input().split())
for i in numbers:
  div.append(division_nankai_2(i))
print(min(div))

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int,input().split()))
 
flg=1
count=0
while True:
    for i in A: #全て偶数か確かめる
        if i%2==1:
            flg=0
            break

    if flg==1:
        for i in range(N):
            A[i]=A[i]//2
        count+=1
    else:
        break
print(count)

Submission status: Accepted

Solution code:
def examB():
    N = I()
    A = LI()
    cur = -1
    flag=True
    while(flag):
        for i in range(N):
            if A[i]%2==1:
                flag = False
                break
            A[i]=A[i]//2
        cur +=1
    print(cur)

import sys,copy,bisect,itertools
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examB()

Submission status: Accepted

Solution code:

N = int(input())

numbers = list(map(int, input().split()))
counter = 0

while all(number % 2 == 0 for number in numbers):
    numbers = [number / 2 for number in numbers]
    counter += 1

print(counter)

Submission status: Accepted

Solution code:
def main():
    _ = input()
    li = list(map(int, input().split()))

    cnt = 0
    while True:
        if 1 in [x % 2 for x in li]:
            break
        else:
            cnt += 1
            li = [x // 2 for x in li]
    print(cnt)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = input()
li = list(map(int, input().split()))
 
cnt = 0
while True:
  if 1 in [x % 2 for x in li]:
    break
  else:
    cnt += 1
    li = [x // 2 for x in li]
print(cnt)

Submission status: Accepted

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

    num_of_operation = 0
    is_dividable = True

    while True:
        for num in li:
            if num % 2 != 0:
                is_dividable = False
                break

        if not is_dividable:
            break

        for i in range(N):
            li[i] //= 2
        num_of_operation += 1

    print(num_of_operation)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

max_trial = 99999999
for a in A:
    trial = 0
    while a % 2 == 0:
        trial += 1
        a /= 2
        
    max_trial = min(max_trial, trial)

print(max_trial)

Submission status: Accepted

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


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

print(a)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
As = input().split()
As = [int(A) for A in As]
count = 0
terminate = False
for _ in range(100):
    new_As = []
    for A in As:
        if A % 2 == 1:
            terminate == True
            break
        else:
            new_As.append(int(A/2))
    if len(new_As) == len(As):
        As = new_As
        count += 1
    else:
        break
print(count)

Submission status: Accepted

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

counter = 0

while all(number % 2 == 0 for number in numbers):
    numbers = [number / 2 for number in numbers]
    counter += 1

print(counter)

Submission status: Accepted

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

c = 0

while True:
  f = False
  for i in a:
    if i % 2 == 1:
      f = True
  if f == True:
    break

  for index, i in enumerate(a):
    a[index] /= 2

  c += 1

print(c)

Submission status: Accepted

Solution code:
N= int(input())
A =[int(x) for x in input().split()]
answer=float('inf')
for i in range(N):
  cut=len(bin(A[i]))-bin(A[i]).rfind('1')-1
  answer=min(answer,cut)
print(answer)

Submission status: Accepted

Solution code:
def divide_all(a):
    success = True
    for i, n in enumerate(a):
        if n % 2 != 0:
            success = False
            break
        a[i] = n / 2
    if success is False:
        return (a, False)
    return (a, True)

n = int(input())
a = list(map(int, input().split()))
c = 0
while True:
    a, r = divide_all(a)
    if r is False:
        break
    c += 1


print(c)

Submission status: Accepted

Solution code:
import numpy as np
# Me


def f():
    i = int(input())
    nums = np.array(list(map(int, input().split())))
    # nums = [int(x) for x in input().split()]
    c = 0
    while True:
        if any(nums % 2 == 1):
            break
        c += 1
        nums = nums / 2
    print(c)


f()


# Other

Submission status: Accepted

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

while judge==True:
    A=[int(i/2) if i%2==0 else i/2 for i in A]
    for j in A:
        if isinstance(j,int)==False:
            judge=False
            break
    count=count+1
print(count-1)

Submission status: Accepted

Solution code:

a = input()
b = input()
count = int(a)
num = []

for k in range(count):
    num.append(int(b.split()[k]))

result = 0
division = True
while division:
    div = 0
    for i in range(count):
        if num[i]%2 == 0:
            div += 1
    if div == count:
        for j in range(count):
            num.append(num.pop(0)/2)
        result += 1
    else:
        division = False

print(result)

Submission status: Accepted

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

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

Submission status: Accepted

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

while True:
    flg=True
    for i in A:
        if i%2==1:
            flg=False
            break
    
    if flg:
        A=[i//2 for i in A]
        ans+=1
    else:
        break
print(ans)

Submission status: Accepted

Solution code:
# ABC 081: B – Shift only
n = int(input())
a = [int(s) for s in input().split()]
can_divided = True
number_of_operations = 0

while can_divided:
    for i in range(len(a)):
        if a[i] % 2 != 0:
            can_divided = False
            break
        else:
            a[i] //= 2
    else:
        number_of_operations += 1

print(number_of_operations)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
n=int(input())
a=list(map(int,input().split()))
ans=0
for j in range(1000):
    for i in range(n):
        if a[i]%2==0:
            a[i]=a[i]//2
        else:
            break
        if i==n-1:
            ans+=1
print(ans)

Submission status: Accepted

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

ans = 10**5
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:
N = int(input())

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

def div_cnt(n):
  cnt = 0
  while n % 2 == 0:
    n /= 2
    cnt += 1
  return cnt

print(min(map(div_cnt,A)))

Submission status: Accepted

Solution code:
length = input()
number_list = []

for i in input().split():
    number_list.append(int(i))

count = -1
number = 0
is_ok = True

while is_ok:
    for i in number_list:
        if i % 2 != 0:
            is_ok = False
            break
        number_list[number] = i / 2
        number += 1
    count += 1
    number = 0

print(count)

Submission status: Accepted

Solution code:
import sys

import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


def main():
    N = int(readline())
    A = list(map(int, readline().split()))
    A = np.array(A)

    f = 0
    cnt = 0
    for _ in range(10**9):
        f = np.max(np.mod(A, 2))
        if f == 1:
            break
        A[:] = A[:]/2
        cnt += 1

    print(cnt)


main()

Submission status: Accepted

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

k = float('inf')

for i in range(n):
    j = 0
    while aa[i] % 2 == 0:
        aa[i] = aa[i]/2
        j += 1
    k = min(j, k)

print(k)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()) )
swt = 1
ans = 0
while swt == 1:
    for i, num in enumerate(a):
        if num % 2 == 1 or num == 1:
            swt = 0
            break
        else:
            a[i] = num // 2
    if swt == 1:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split()))
ans = 10**8
for a in A:
    cnt = 0
    while True:
        if a%2 == 0:
            a /= 2
            cnt += 1
        else:
            if cnt < ans:
                ans = cnt
            break
print(ans)

Submission status: Accepted

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

while end_flg == 0:
    for i in range(N):
        if(A[i]%2 == 0):
            A[i] = A[i]//2
        else:
            end_flg = 1
            break

    count+=1

print(count-1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
黒板に N 個の正の整数 A1,…,AN が書かれています。
すぬけ君は，黒板に書かれている整数がすべて偶数であるとき，次の操作を行うことができます。

'黒板に書かれている整数すべてを，2で割ったものに置き換える。'
すぬけ君は最大で何回操作を行うことができるかを求めてください。
"""

N = int(input())
A = list(map(int, input().split()))
count = 0
all_even = True

while True:
    if all_even == False:#奇数があったらbreak
        break
    else:
        for i in range(N): #奇数になっていないか調べる
            if A[i] % 2 != 0:
                all_even = False
                break
        else:
            for i in range(N):#すべて偶数の時は2でわる
                A[i] /= 2
            count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int,input().split()))
M=0
for k in range(100):
    for i in range(N):
        if A[i]%(2**k)==0:
            M=k
        else:
            break
    else:
        M+=1
if M==0:
    print(0)
else:
    print(M-1)