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:
input()
a=[int(i) for i in input().split()]
cnt=0
flg=True
while flg:
  b=[]
  for i in a:
    if bin(i)[-1]=="1":
      flg=False
      break
    else:
      b.append(i>>1)
  if flg:
    cnt+=1
    a=b
print(cnt)

Submission status: Accepted

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

for i in range(100000000):
    tmp = 0
    for j in range(n):
        if a[j]%2==0:
            tmp+=1

    if tmp!=n:
        break
    else:
        cnt += 1
        for i in range(n):
            a.append(a[i]//2)
        del a[:n]

print(cnt)

Submission status: Accepted

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

cnt=0
flg=True
while flg:
  b=[]
  for i in a:
    if i%2!=0:
      flg=False
      break
    else:
      b.append(i//2)
  if flg:
    cnt+=1
    a=b
print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
t=int(input())

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

count=0
while True:
    x=[True if i%2==0 else False for i in li]
    if all(x):
        for i in range(t):
            li[i]=li[i]/2
        count+=1
    else:
        break
print(count)

Submission status: Accepted

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

while flag:
    ans = []
    for i in a:
        if i%2 == 1:
            flag = False
        else:
            ans.append(i/2)
    if len(ans) == n:
        cnt += 1
        a = ans

print(cnt)

Submission status: Accepted

Solution code:
a = int(input())
b = list(map(int,input().split()))
sum=cnt=0

for i in b[:a]:
    sum = (sum|i)

while (sum&1) == 0:
    sum=(sum>>1)
    cnt += 1

print(cnt)

Submission status: Accepted

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

while is_even:
    tmp = []
    for i in b[:a]:

        if i % 2:
            is_even=False
            break
        else:
            tmp.append(i//2)

    if is_even:
        cnt+=1
        b = tmp

print(cnt)

Submission status: Accepted

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

while all(s % 2 == 0 for s in A_i):
    count += 1
    for i in range(0, len(A_i)):
        A_i[i] = int(A_i[i] / 2)

print(count)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
ans = 0
while True:
    if [i for i in a if i %2 ==1]:
        break
    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
for i in range(31):
    for j in range(n):
        if a[j]%2==0:
            a[j]=a[j]//2
            ans+=1
        else:
            break
print(ans//n)

Submission status: Accepted

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

Submission status: Accepted

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

def prod(x):
  q=0
  for i in x:
    if i%2==1:
      return False
      break
    else:
      q=1
  if q==1:
    return True
ans=0
while prod(a):
  for i in range(n):
    a[i]=a[i]//2
  ans+=1
print(ans)

Submission status: Accepted

Solution code:
#abc081 b-shift only
n=int(input())
a=list(map(int,input().split()))
ans=0
flag=True
while True:
    for x in range(len(a)):
        if(a[x]%2==0):
            a[x]=int(a[x]/2)
        else:
            flag=False
    if flag==False:
        break
    ans+=1
print(ans)

Submission status: Accepted

Solution code:
def function(N):
    cnt=0
    while N%2==0:
        N/=2
        cnt+=1
    return cnt

N=int(input())
a=map(int, input().split())
cnt=min(map(function, a))
print(cnt)

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()
		A[i] //= 2
	ans += 1

Submission status: Accepted

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

def search_odd(n):
    if n % 2 == 1:
        return True
    else:
        return False

count=0
isOdd=False
while True:
    for i in range(0,n):
        isOdd = search_odd(list[i])
        if isOdd:
            break
        list[i] = list[i]/2
    if isOdd:
        break
    count+=1
print (count)

Submission status: Accepted

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

num_len = int(input())
num_list = list(map(int, input().split(" ")))
#print(num_list)
count = 0
while all(i % 2 == 0 for i in num_list):
    num_list =[j // 2 for j in num_list]
    count += 1
    
print(count)

Submission status: Accepted

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

mix_shift = 1000000000+10
for n in a:
    count = 0
    while n % 2 == 0:
        n //= 2
        count += 1
    mix_shift = min(count, mix_shift)
print(mix_shift)

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    A = list(map(int, input().split()))
    ans, flg = 0, 0
    tmp = []
    while True:
        for i in range(N):
            if A[i] % 2 != 0:
                flg = 1
                break
            tmp.append(A[i]/2)
        if flg:
            break
        A = tmp.copy()
        tmp.clear()
        ans += 1
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

itr = 0
flg = True
while flg:
  evens = list(map(lambda x: (x/2), evens))
  is_evens = list(map(lambda x: x.is_integer(), evens))
  if not all(is_evens):
    flg = False
    break
  itr+=1
print(itr)

Submission status: Accepted

Solution code:

N = int(input().strip())

numbers = [int(i) for i in input().strip().split(" ")]

if len(numbers) != N:
    print("invalid input data")
    exit

count = 0

def is_all_even(arr):

    for i in arr:

        if i % 2 == 1:
            return False
    
    return True

while(is_all_even(numbers)):

    numbers = [ i // 2 for i in numbers]
    count += 1

print(count)

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:
# coding: utf-8
import sys
import numpy as np


def main(argv=sys.argv):

    _ = int(input())

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

    i = 0

    while True:

        sousa = numbers % (2 ** (i + 1))

        if sum(sousa) != 0:

            break

        else:

            i += 1

    print(i)

    return 0


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

Submission status: Accepted

Solution code:
N = int(input())

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

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

Submission status: Accepted

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

while(True):
  for i in li:
    if i % 2 == 1:
      break
  else:
    count += 1
    for index, x in enumerate(li):
      li[index] = x / 2
    continue
  break

print(count)

Submission status: Accepted

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

for i in a:
	s = 0
	while i % 2 == 0:
		i = i/2
		s += 1
	l.append(s)

print(min(l))

Submission status: Accepted

Solution code:
import numpy as np

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

def check_even(A, B):
    odd_flag=0
    while odd_flag!=1:
        for i, num in enumerate(A):
            if num%2 == 1:
                odd_flag=1
                break
            elif i==len(A)-1:
                A=A/2
                B+=1
    return B

def main():
    print(check_even(A, 0))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
input()
S = [int(i) for i in input().split(" ")]
def func(arr, a=0):
    for i, j in enumerate(arr):
        if j%2 == 1:
            print(a)
            return
        else:
            arr[i] = j/2
    a += 1
    func(arr, a)
func(S)

Submission status: Accepted

Solution code:
import sys
import numpy as np 

n = int(sys.stdin.readline().rstrip())
a = np.array(sys.stdin.readline().split(), dtype=np.int64)

def main(a):
    cnt = 0
    while True:
        if np.any(a & 1):
            return cnt
        a //= 2
        cnt += 1

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

Submission status: Accepted

Solution code:
def check(st,count):
    flag = False
    new_list = []
    for i in st:
        if i % 2 == 0:
            i = i // 2
            new_list.append(i)
        else:
            flag = True
            break
    if flag:
        print(count)
        return
    else:
      count += 1
      check(new_list, count)

n = int(input())
st = list(map(int, input().split()))
count = 0
check(st, count)

Submission status: Accepted

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

Submission status: Accepted

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

flg_break = True

count = -1
while flg_break:
    count+=1
    num_tmp_list = []
    for n in num_list:
        if n % 2 != 0:
            flg_break = False
            break
        else:
            num_tmp = n / 2
            num_tmp_list.append(num_tmp)
    num_list = num_tmp_list
    

print(count)

Submission status: Accepted

Solution code:
def div_count(a):
  i= 0
  while a%2 == 0:
    a = a/2
    i+=1
  return i
N = int(input())
numbers = list(map(int,input().split()))
count=[]
for u in range(N):
  count.append(div_count(numbers[u]))
print(min(count))

Submission status: Accepted

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

count=0

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

print(count)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = input()
n = int(n)
a = input()
a = [int(i) for i in a.split()]
num = 0
length = len(a)
while True:
  a = [i//2 for i in a if i%2==0]
  if length != len(a):
    break
  num +=1
print(num)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve():
    N = int(input())
    A = list(map(int, input().split()))
    ret = 0
    
    while all(a%(2**(ret+1))==0 for a in A):
        ret += 1
    
    print(ret)
    
solve()

Submission status: Accepted

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

count = 0

while True:
    all = True
    for a in A:
        if a % 2**(count+1) != 0:
            all = False
            break
    if not all:
        break
    count += 1
print(count)

Submission status: Accepted

Solution code:
N = int(input())
a_list = list(map(int,input().split()))
counter = 0

i = 0

while True:
    i = 0
    for w in a_list:

        if a_list[i] % 2 == 1:
            
            break
        else :
            a_list[i] = w / 2
            i += 1
    if N != i:
        break
    else:
        counter += 1
print(counter)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main(n, a):
    count = 9 ** 10

    for a in a:
        c = 0
        while a % 2 == 0:
            a /= 2
            c += 1
        if c < count:
            count = c

    print(count)


if __name__ == "__main__":
    n = int(input())
    a = list(map(int, input().split()))

    main(n, a)

Submission status: Accepted

Solution code:
import sys
import numpy as np
n = int(input())
a = np.array(list(map(int, sys.stdin.readline().split())))

count = 0
while True:
    if all(a % 2 == 0):
        count += 1
        a //= 2
    else:
        break

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


def is_dividable(l):
    for i in l:
        if not i % 2 == 0:
            return False
    else:
        return True


def divide(l):
    return [i/2 for i in l]


count = 0
while is_dividable(a_n):
    a_n = divide(a_n)
    count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

cnt = 10**10
for i in range(n):
    memo = 0
    while(a[i]%2==0):
        a[i]/=2
        memo += 1
    cnt = min(memo,cnt)
print(cnt)

Submission status: Accepted

Solution code:
import math
n = int(input())
a = list(map(int, input().split()))
ans = float("inf")
for i in a:
    ans = min(ans, len(bin(i)) - bin(i).rfind("1") - 1)
print(round(ans))

Submission status: Accepted

Solution code:
N = int(input())
num = [int(i) for i in input().split()]
 
ans = 0
flag = False
for i in range(40):
    for i in range(len(num)):
        if num[i] % 2 == 0:
            num[i] //= 2
        else:
            flag = True
    if flag == False:
        ans += 1
    else:
        break
print(ans)

Submission status: Accepted

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

ans = 0
while sum(list(map(lambda x: x % 2, A))) == 0:
  A = list(map(lambda x: x / 2, A))
  #あるいはリスト内包表記でもOK(上記のmap関数内のlambda関数に比較して、1ms早い)
  #A = [i / 2 for i in A]
  ans += 1 

print(ans)

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N = INT()
A = LIST()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#input
N=int(input())
An=list(int(i) for i in input().split())
x=0
point=0
flag=True
while(flag):
  x=0
  for x in range(N):
    if x==N-1:
      point+=1

    elif An[x]%2==0:
      An[x]/=2

    else:
      flag=False
      break
print(point)

Submission status: Accepted

Solution code:
#input
N=int(input())
An=list(int(i) for i in input().split())
x=0
point=0
flag=True
while(flag):
  x=0
  for x in range(N):
    if An[x]%2==0:
      An[x]/=2
    else:
      flag=False
      break
  point+=1 
point-=1
print(point)

Submission status: Accepted

Solution code:

N = int(input())

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

cnt = 0
flag = True

while flag:
    for i in range(N):
        if num_list[i] % 2 == 1:
            flag = False
            break
        else:
            num_list[i] = num_list[i] / 2
            if i == N - 1:
                cnt += 1

print(cnt)

Submission status: Accepted

Solution code:


N = int(input())

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

cnt = 0
flag = 0

while flag == 0:
    for i in range(N):
        if num_list[i] % 2 == 1:
            flag = 1
            break
        else:
            num_list[i] = num_list[i] / 2
            if i == N - 1:
                cnt += 1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
A = [int(i) for i in input().split()]
divNo = [0] * N
for i in range(N):
  while A[i]%2 == 0:
    A[i] = A[i]/2
    divNo[i] += 1
print(min(divNo))

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
isnext = 0
# 初期化
array = [0] * N


while isnext == 0:
        array = A
        for i in range(N):
                if(array[i] % 2 == 0 and isnext == 0):
                        array[i] = int(array[i] / 2)                        
                else:
                        isnext = 1
        if isnext == 0:
                ans = ans + 1


print(ans)

Submission status: Accepted

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

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())

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

count = 0
while True:
  evens = list(filter(lambda i: i % 2 == 0, a))
  if len(evens) == len(a):
    a = list(map(lambda i: int(i/2), a))
    count += 1
  else:
    break

print(count)

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

Submission status: Accepted

Solution code:
n=int(input())
li = list(map(int,input().split()))
counter = 0
while 1:
  judge = [a%2 for a in li] 
  if sum(judge) != 0:
    break
  else:
    counter+=1
    li = [a/2 for a in li]
print(counter)

Submission status: Accepted

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

ans = 0
t=0

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

print(ans)

Submission status: Accepted

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

MOD = 2  # type: int


def solve(N: int, A: "List[int]"):
    count = 0
    def func(count, lists):
        B = []
        for n in lists:
            if n % 2 != 0:
                print(count)
                break
            else:
                B.append(n/2)
        else:
            count += 1
            func(count, B)
    
    func(count, A)

    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, A)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding:utf-8

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

def calc():
  cnt = 0
  while True:
    for i in range(len(nums)):
      num = nums[i]
      if num % 2 == 0 and num != 0:
        nums[i] = num / 2
      else:
        return cnt
    else:
      cnt += 1

print(calc())

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

for a in A:
    check = 0
    count = 0
    while check == 0:
        if a % 2 == 0:
            a = a / 2
            count += 1
        else:
            check = 1
    N.append(count)

ans = min(N)
print(ans)

Submission status: Accepted

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

cnt = [0]*n
j = 0
for i in a_int:
    m = i
    while m%2==0:
        m = m/2
        cnt[j] += 1
    j += 1
print(min(cnt))

Submission status: Accepted

Solution code:
num = int(input())

ls = list(map(int,input().split()))
cnt = 0

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

print(cnt)

Submission status: Accepted

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

n = int(input())
line = map(int , input().split())
answer = min(map(how_many , line))
             
print(answer)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

def how_many_times_divisible(n):
    times = 0
    while n % 2 == 0:
        times += 1
        n /= 2
    return times

ans = min(list(map(how_many_times_divisible, A)))
print(ans)

Submission status: Accepted

Solution code:

def numConvertHalf(numbers):
    for i in range(len(numbers)):
        numbers[i] = int(numbers[i]/2)

def checkEven(numbers):
    for i in range(len(numbers)):
        if(numbers[i] % 2 == 1):
            return False
    return True

N = int(input())
numbers = list(map(int,input().split()))
count = 0
while checkEven(numbers):
    numConvertHalf(numbers)
    count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input(); print(min(map(lambda c: bin(int(c))[::-1].index("1"), input().split())))

Submission status: Accepted

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

n = int(input())
x =map(int,input().split())
ans = min(map(kansu, x))
          
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

while c == True:
    for i in range(n):
        if l[i]%2==1:
            c = False
    if c == False:
        break
    else:
        for i in range(n):
            l[i]/=2
        ans+=1
print(ans)

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:
n = int(input())
ls_a = list(map(int, input().split()))

ls_cnt = [0] * n

for i in range(n):
    for j in range(2**10):
        if ls_a[i] % 2 == 0:
            ls_a[i] = ls_a[i] / 2
            ls_cnt[i] += 1
        else:
            break

print(min(ls_cnt))

Submission status: Accepted

Solution code:
def divide2(n):
    return int(int(n)%2)

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

N = int(input())
n_list = input().split()

flag = True
counter = 0
while flag == True:
    flag_list = list(map(divide2,n_list))
    if flag_list.count(1) == 0:
        n_list = list(map(divideT2,n_list))
        counter += 1
    else:
        flag = False

print(counter)

Submission status: Accepted

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

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

print(answer)

Submission status: Accepted

Solution code:
n = int(input())
lst = [int(i) for i in input().split()]
c = 0
while True:
    if sum([i % 2 for i in lst]) == 0:
        c += 1
        lst = [i // 2 for i in lst]
    else:
        print(c)
        quit()

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(float,input().split()))
ans = 0
Flag = False
while not Flag:
    for i in range(N):
        A[i] /= 2
        if not A[i].is_integer():
            Flag = True
            break
    else:
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num = int(input())
val = input().split()
waru = [0] * len(val)

for i in range(num):
  while True:
    v = int(val[i])
    if v % 2 == 0:
      val[i] = str(int(v / 2))
      waru[i] += 1
    else:
      break
      
min = min(waru)

print(min)