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:
import math
n = int(input())
a = list(map(int, input().split()))
l = []
ans = int(math.sqrt(max(a)))
for i in a:
    if i%2!=0:
        ans = 0
    else:
        cnt = 0
        while i%2==0:
            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 nidewareru(x):
  ans=0
  while (1):
    if x%2==0:
      x/=2
      ans+=1
    else:
      break
  return ans
    
mina=10000000
for a in A:
  mina=min(mina, nidewareru(a))
print(mina)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

cnt = 1
while 1:
    for a in As:
        if a%(2**cnt)!=0:
            break
    else:
        cnt += 1
        continue
    break
print(cnt-1)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

print(min(L))

Submission status: Accepted

Solution code:
import numpy as np

N = int(input())
A = list(map(int,input().split()))
A = np.array(A)
cnt = 0
while all(A%2==0):
    for i in range(N):
        A[i] = A[i]//2
    cnt += 1

print(cnt)

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:
            a[i] = a[i] // 2
        else:
            break
    else:
        cnt += 1
        continue
    break

print(cnt)

Submission status: Accepted

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

ans = 1000000000

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

print(ans)

Submission status: Accepted

Solution code:
import sys
#import numpy as np
import math
#from fractions import Fraction
#import itertools
from collections import deque
#import heapq
from fractions  import gcd

#input=sys.stdin.readline
n=int(input())
a=list(map(int,input().split()))
i=0
f=False
while True:
    for j in range(n):
        if (a[j]>>i)&1:
            f=True
            break
    else:
        i+=1
    if f:
        break
print(i)

Submission status: Accepted

Solution code:
n = int(input())
A = list(map(int,input().split()))
ans = 10**9
tmp = 0
for i in range(n):
  while True:
    if A[i]%2==0:
      A[i] = A[i]//2
      tmp += 1
    else:
      ans = min(ans,tmp)
      tmp = 0
      break

print(ans)

Submission status: Accepted

Solution code:
import sys
import numpy as np
from collections import Counter, deque

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n = int(input())
    A = np.array(list(map(int, input().split())))

    res = 0
    while not any(np.mod(A, 2)):
        res += 1
        A //= 2

    print(res)


if __name__ == '__main__':
    resolve()

Submission status: Accepted

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

Submission status: Accepted

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

ans = float('inf')

for i in range(n):
    if a[i]%2 == 0:
        cnt = 0
        while a[i]%2 == 0:
            a[i] //= 2
            cnt += 1
        ans = min(ans, cnt)

    else:
        print(0)
        exit()
print(ans)

Submission status: Accepted

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

ans = ""
for A in a:
  if A % 2 != 0:
    print(0)
    exit()
  cnt = 0
  while A%2==0:
    A /=2
    cnt += 1
  if ans == "" or ans > cnt: ans = cnt
print(ans)

Submission status: Accepted

Solution code:
def resolve():
  n = int(input())
  a = list(map(int, input().split()))
  ans = 1e9
  for x in a:
    tmp = 0
    while x > 1 and x % 2 == 0:
      x //= 2
      tmp += 1
    ans = min(ans, tmp)
  print(ans)
  return

if __name__ == "__main__":
  resolve()

Submission status: Accepted

Solution code:
import sys
from collections import Counter
from collections import deque
import math
import fractions
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

n=int(input())
a=lmp()
c=a[0]
for i in range(1,n):
    c=fractions.gcd(c,a[i])
ans=0
while True:
    if c%2==0:
        ans+=1
        c=c//2
    else:
      break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

res = min(map(devide, numbers))
print(res)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
i = 0 #ループ回数
m = 0 #ループ終了
while m < 1:
    i = i +1
    for j in range(N):
        if A[j] % 2 != 0:
            m = m + 1
        else:
            A[j] = A[j] / 2
print(i-1)

Submission status: Accepted

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

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

Submission status: Accepted

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

cnt = 0
flag = 1
while flag:
    for i in range(n):
        a = A.pop(0)
        if a % 2 != 0:
            flag = 0
            break
        else:
            A.append(a // 2)
    else:
        cnt += 1
    
print(cnt)

Submission status: Accepted

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

def count_time(a):
  c = 0
  while a % 2 == 0:
    c += 1
    a //= 2
  return c

ans = 10**10
for a in A:
  ans = min(ans, count_time(a))

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

ans = min(map(divide_number,numbers))
print(ans)

Submission status: Accepted

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

for i in range(10**10):
  for j in range(n):
    if a[j]%2 != 0:
      print(count)
      exit()
    else:
      a[j] = a[j]//2
  count += 1

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

## Library

import sys
from fractions import gcd
import math
from math import ceil,floor
import collections

## input

# n=int(input())
# A,B,C,D=map(int, input().split())
# string = input()
# list = list(map(int, input().split()))

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

## Logic

ans = 0
while True:
    for i in range(0,N):
        if A[i]%2==1:
            print(ans)
            sys.exit()
        else:
            A[i]=A[i]//2
            if i==N-1:
                ans+=1

Submission status: Accepted

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

while flg:
    for i in range(N):
        if A[i] % 2 == 0:
            A[i] = A[i] // 2
            cnt += 1
    if cnt == N:
        total += 1
    else:
        flg = False
    cnt = 0
print(total)

Submission status: Accepted

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

def div(n):
    return int(n / 2)

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

r = 0
flag = False
while (True):
    for x in A:
        if x % 2 == 1:
            flag = True
            break

    if (flag):
        break

    r += 1
    A = list(map(div, A))    
    
print(r)

Submission status: Accepted

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


#all 全ての要素がTrueならTrue
while all(a % 2 == 0 for a in li):
    li = [ a / 2 for a in li]
    count += 1
# a,b = map(int, input().split())
print(count)

Submission status: Accepted

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


input()
print(min(map(f, input().split())))

Submission status: Accepted

Solution code:
#prep
n = int(input())
m = list(map(int, input().split())) #initial values
asmt = [0]*n
cnt = 0

#assessment 
while True:
    a = list(map(lambda x: x*(1/2)**(cnt+1), m))
    for i in range(n):
        asmt[i] = a[i].is_integer() 
        
    if all(asmt) == False:
        break 
    else: cnt = cnt+1

print(cnt)

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

Submission status: Accepted

Solution code:
n = int(input())

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

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

print(c)

Submission status: Accepted

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

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

ans = min(map(calc, A))

print(ans)

Submission status: Accepted

Solution code:
from math import log2

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

res = 10**9
for v in a:
    cnt = 0
    while v % 2 == 0:
        v /= 2
        cnt += 1
    res = min(cnt, res)
print(res)

Submission status: Accepted

Solution code:
n=int(input())
a = list(map(int,input().split()))
t=0
while all((i%2==0 for i in a)):  #iはaの数を試行する

    a=[i/2 for i in a]  
    #iはaの数なので，それを/2して，aに格納する
    t += 1

print(t)

Submission status: Accepted

Solution code:
N = int(input())

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

print(min(b))

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:
            break
        A[i] = int (A[i] / 2)
    else:
        count = count + 1
        continue
    break

print(count)

Submission status: Accepted

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

while (True):
    exist_odd = False
    for i in range(N):
        if (A_list[i] % 2) != 0:
            exist_odd = True

    if exist_odd:
        break
    
    for i in range(N):
        A_list[i] = A_list[i] / 2

    count = count + 1

print(count)

Submission status: Accepted

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

ans = 10**9
for num in A:
    count = 0
    for _ in range(ans):
        if num % 2 == 1:
            break
        num /= 2
        count += 1
    ans = min(ans,count)
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
As = [int(c) for c in input().split()]
counter = 0


while True:
    for i in range(N):
        if As[i] % 2 != 0:
            break
        As[i] = int(As[i] / 2)
    else:
        counter += 1
        continue
    break

print(counter)

Submission status: Accepted

Solution code:
N = int(input())
A = [int(i) for i in input().split()]
import fractions
from functools import reduce

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

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)
tmp =gcd_list(A)
for i in range(100):
    if tmp == 2**i:
        print(i)
        break

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = []
A = input().split()
f = False
for i in range(n):
    a.append(int(A[i]))
    if int(A[i]) % 2 != 0:
        f = True
ans = 0

if f:
    print(ans)
else:
    while True:
        #print (a)
        for i in range(len(a)):
            nx = int(a[i])
            if nx % 2 != 0:
                f = True
            a[i] = nx / 2
        if f:
            #print (a)
            break
        else:
            ans += 1
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
a=[int(i) for i in input().split()]
b=[]
ans=0
ok=False
while True:
    for i in a:
        if i%2!=0:
            print(ans)
            ok=True
            break
        else:
            b.append(i//2)
    if ok:
        break
    ans+=1
    a=b
    b=[]

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**7)

import numpy as np

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

c = 0

def div(a):
    global c
    for i in a:
        if i%2==1:
            print(c)
            sys.exit()
    ll = list(map(lambda x : x/2, a))
    c += 1
    div(ll)

div(a)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**7)

import numpy as np

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

c = 0

def div(a):
    global c
    for i in a:
        if i%2==1:
            print(c)
            sys.exit()

    ll = list(map(lambda x : x/2, a))
    c += 1
    div(ll)

div(a)

Submission status: Accepted

Solution code:
a = int(input(""))
b = input("").split(" ")
c = 0
d = []

for i in range(a):
	c = 0
	while (int(b[i]) % 2 == 0):
		b[i] = int(b[i]) / 2
		c += 1
	d.append(c)
print(min(d))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

count = 0
flag = True

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

Submission status: Accepted

Solution code:

n = int(input())

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

c = 0


def func(num: int, array: [int], count) -> int:
    for i in range(num):
        if i + 1 != num:
            if array[i] % 2 == 0:
                array[i] = array[i] / 2
                continue
            else:
                break
        else:
            if array[i] % 2 == 0:
                count += 1
                array[i] = array[i] / 2
                count = func(num, array, count)
    return count


print(func(n, a, c))

Submission status: Accepted

Solution code:
input()
print(min(map(lambda a: int(a) & (-int(a)), input().split())).bit_length() - 1)

Submission status: Accepted

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

count = 0
finished = False
while True:
    for index, value in enumerate(num):
        if value % 2 == 0:
            num[index] = value / 2
        else:
            finished = True
            break
    if finished:
        break
    else:
        count += 1
print(count)

Submission status: Accepted

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

count = 0
finished = False
while True:
    for index, value in enumerate(numbers):
        if value % 2 == 0:
            numbers[index] = value / 2
        else:
            finished = True
            break
    if finished:
        break
    else:
        count += 1
print(count)

Submission status: Accepted

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

div_a = 2
count = 0
while 1 :
    flag = 0
    for a_i in A :
        if a_i % div_a != 0 :
            flag = 1
    if flag == 1 :
        break
    else :
        div_a = div_a * 2
        count = count + 1
print(count)

Submission status: Accepted

Solution code:
"""
N = list(map(int,input().split()))
S = [str(input()) for _ in range(N)]
S = [list(map(int,list(input()))) for _ in range(h)] 
print(*S,sep="")
"""

import sys
sys.setrecursionlimit(10**6)
input = lambda: sys.stdin.readline().rstrip()

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

count = 0

while True:
    for _ in range(n):
        if a[_]%2==0:
            a[_]//=2
        else:
            break
    else:
        count+=1
        continue
    break
print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
import sys

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

cnt = 1

if np.any(a%2==1):
    print(0)
    sys.exit()

while True:
    a2 = a % 2**cnt
    if np.all(a2==0):
        cnt += 1
        continue
    else:
        print(cnt-1)
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = input()
b = input().split(' ')
nums=[int(i) for i in b]
divide_count=0
while True:
  for index,num in enumerate(nums):
    if int(num)%2==1:
      print(divide_count)
      exit()
    else:
      nums[index]=num/2
  divide_count +=1

Submission status: Accepted

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

def func(i, c):
    return func(i // 2, c + 1) if i % 2 == 0 else c

print(min([func(i, 0) for i in A]))

Submission status: Accepted

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

Submission status: Accepted

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

count = 0
flag = True

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

print(count)

Submission status: Accepted

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

count = 0
flag = True

while flag:
    for i in range(n):
        if a[i] % 2 != 0:
            flag = False

    if flag == False:
        break

    for i in range(n):
        a[i] //= 2
    count = count + 1
print(count)

Submission status: Accepted

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

flag = True
cnt = 0
n = len(A)
while flag:
    for i in range(n):
        if A[i]%2 == 0:
            A[i]/=2
        else:
            print(cnt)
            exit()
    cnt += 1

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n = int(readline())
a = [int(x) for x in readline().split()]
ans = float('inf')
for x in a:
    ans = min(ans, len(bin(x)) - bin(x).rfind('1') - 1)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

Solution code:
# For taking integer inputs.
def inp():
    return(int(input()))


# For taking List inputs.
def inlist():
    return(list(map(int, input().split())))


# For taking string inputs. Actually it returns a List of Characters, instead of a string, which is easier to use in Python, because in Python, Strings are Immutable.
def instr():
    s = input()
    return(list(s[:len(s)]))


# For taking space seperated integer variable inputs.
def invr():
    return(map(int, input().split()))


N = inp()
A = inlist()

s = sum(A)
c = 0
f = True
while f:
    for i in range(N):
        if A[i] % 2 != 0:
            f = False
            break
        A[i] = A[i] // 2
    if not f:
        break
    c += 1
print(c)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
#from math import gcd
import bisect
from collections import defaultdict
from collections import deque
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT######
def Yes(): print("Yes"); return
def No(): print("No"); return

#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

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

#####MakeDivisors######
def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#####BitCount#####
def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#####ChangeBase#####
def Base_10_to_n(X, n):
  if X//n:
    return Base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def Base_n_to_10(X, n):
  return sum(int(str(X)[-i])*n**i for i in range(len(str(X))))

#####IntLog#####
def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count

#############
# Main Code #
#############

N = inputI()
print( min(int_log((x&(-x)),2) for x in inputIL() ))