Problem:


Score : 200 points

Problem Statement

There are N positive integers written on a blackboard: A_1, ..., A_N.

Snuke can perform the following operation when all integers on the blackboard are even:

Replace each integer X on the blackboard by X divided by 2.

Find the maximum possible number of operations that Snuke can perform.

Constraints

1 \leq N \leq 200

1 \leq A_i \leq 10^9

Input

Input is given from Standard Input in the following format:

N
A_1 A_2 ... A_N

Output

Print the maximum possible number of operations that Snuke can perform.

Sample Input 1

3
8 12 40

Sample Output 1

2

Initially, [8, 12, 40] are written on the blackboard.
Since all those integers are even, Snuke can perform the operation.

After the operation is performed once, [4, 6, 20] are written on the blackboard.
Since all those integers are again even, he can perform the operation.

After the operation is performed twice, [2, 3, 10] are written on the blackboard.
Now, there is an odd number 3 on the blackboard, so he cannot perform the operation any more.

Thus, Snuke can perform the operation at most twice.

Sample Input 2

4
5 6 8 10

Sample Output 2

0

Since there is an odd number 5 on the blackboard already in the beginning, Snuke cannot perform the operation at all.

Sample Input 3

6
382253568 723152896 37802240 379425024 404894720 471526144

Sample Output 3

8



Sample input:
3
8 12 40


Sample output:
2

Submission status: Accepted

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

for i in range(0,200):
    c=[x%2 for x in l]
    if c==[0 for x in range(0,a)]:
        l=[x/2 for x in l]
    else:
        break
    
print(i)

Submission status: Accepted

Solution code:
mylist = []
for i in range(0, 2):
    val = input()
    if ' ' in val:
        mylist.append(val)
a = list((map (int,mylist[0].split(' '))))

cnt = 0
while True:
    map (int,a)
    if all(map(lambda x: x % 2 == 0, a)) == False:
        break
    a = list(map(lambda x:x//2,a))
    cnt +=1
print (cnt)

Submission status: Accepted

Solution code:
first=int(input())
number=input().split()
numbers=[int(n) for n in number]
 
count=0
 
if all(a % 2 ==0 for a in numbers):
    count+=1
else:
    pass
 
answer=[m/2 for m in numbers]
 
while all(n % 2 ==0 for n in answer):
    count+=1
    answer=[m/2 for m in answer] 
 
print(count)

Submission status: Accepted

Solution code:
w = input()
a = input()
l = [int(x) for x in a.split()]
c = 0
while True:
  for i, v in enumerate(l):
    if v % 2 == 0:
      l[i] = v / 2
    else:
      break
  else:
    c += 1
    continue
  break
print(c)

Submission status: Accepted

Solution code:
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations, accumulate
import sys
import bisect
import string
import math
import time


def I(): return int(input())


def MI(): return map(int, input().split())


def S(): return input()


def MS(): return map(str, input().split())


def LI(): return [int(i) for i in input().split()]


def LI_(): return [int(i)-1 for i in input().split()]


def StoI(): return [ord(i)-97 for i in input()]


def ItoS(nn): return chr(nn+97)


def input(): return sys.stdin.readline().rstrip()


def show(*inp, end='\n'):
    if show_flg:
        print(*inp, end=end)


def print_matrix(mat):
    for i in range(len(mat)):
        print(*mat[i])


YNL = {False: 'No', True: 'Yes'}
YNU = {False: 'NO', True: 'YES'}
MOD = 10**9+7
inf = float('inf')
IINF = 10**10
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
# sys.setrecursionlimit(10**6)
nums = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']


# show_flg = True
show_flg = False


def factorization(n):
    if n <= 1:
        return []

    ret = []
    while n > 2 and n % 2 == 0:
        ret.append(2)
        n //= 2
    i = 3
    while i <= math.sqrt(n):
        if n % i == 0:
            ret.append(i)
            n //= i
        else:
            i += 2
    ret.append(n)
    return ret


def main():
    N = I()
    A = LI()
    ans = 10 ** 19

    for i in range(N):
        ret = factorization(A[i])
        num = len([i for i in ret if i == 2])
        ans = min(num, ans)

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N=int(input())
An=list(map(int, input().rstrip().split()))
cnt=0
while True:
    if len(list(filter(lambda a:(a+1)%2, An))) < len(An):
        break
    An=list(map(lambda a:int(a/2), An))
    cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
N = int(input())
l = list(map(int, input().split()))
even = True
ans = 0
while even == True:
  for i, j in enumerate(l):
    if j%2==0:
      l[i] /= 2
    else:
      even = False
  if even == True:
    ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def check(X):
    for i in range(len(X)):
        if X[i] % 2 != 0:
            return False
        X[i] /= 2
    return True

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

Submission status: Accepted

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

NGflag = 0
count = 0

while True:
    for i in range(a):
        if li[i] % 2 == 0:
            li[i] = li[i] / 2 

        else:
            NGflag = 1

    if NGflag == 1:
        break
    else:
        count = count + 1

print(count)

Submission status: Accepted

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


def is_even(n: int) -> bool:
    if n % 2 == 0:
        return True
    else:
        return False


def div_by_2(n: int) -> int:
    return n // 2


ans = 0
while all(map(is_even, A)):
    ans += 1
    A = list(map(div_by_2, A))
print(ans)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

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

count = []

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

Submission status: Accepted

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

print(ret)

Submission status: Accepted

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


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

    cnt = 0
    while True:

        is_exist_odd = False
        for _a in a:
            if _a % 2 == 1:
                is_exist_odd = True
                break

        if is_exist_odd:
            break

        a = list(map(lambda _a: _a / 2, a))
        cnt += 1

    print(cnt)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
numbers = list(map(int, input().split()))
count = [0]*n

for i in range(n):
  while True:
    if numbers[i]%2 == 1:
  	  break
    numbers[i] = numbers[i]/2
    count[i] += 1
  
print(min(count))

Submission status: Accepted

Solution code:
N = int(input())
nums = [int(n) for n in input().split(" ")]

i = 0
def atcode(nums):
    global i
    for n in nums:
        if n%2==0:
            pass
        elif n==0:
            return i
        else:
            return i
    nums = [n/2 for n in nums]
    i += 1
    return atcode(nums)

print(atcode(nums))

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:
n = input()
a = list(map(int, input().split()))
 
def how_many_times(x):
    n=0
    while x%2==0:
        x=x//2
        n+=1
    return n
 
print(min(map(how_many_times, a)))

Submission status: Accepted

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


cnt = -1
tmp = True
while tmp:
    cnt += 1
    for i in range(n):
        if a[i] % 2 == 0:
            a[i] = a[i] // 2
        else:
            tmp = False

print(cnt)

Submission status: Accepted

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

numbers = []
for i in list:
    j = 1
    while j > 0:
        if i % 2**j == 0:
            j = j + 1
        else:
            break
    t = j - 1
    numbers.append(t)
    
print(min(numbers))

Submission status: Accepted

Solution code:
input();print(min(len(str(bin(i&-i)))for i in map(int,input().split()))-3)

Submission status: Accepted

Solution code:
input();print(min((int(x)&-int(x)).bit_length()for x in input().split())-1)

Submission status: Accepted

Solution code:
input()
a=min(list(map(lambda x:int(x)&-int(x),input().split())))
i=0
while a:a//=2;i+=1
print(i-1)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding:utf-8
import sys
def main():
    n = int(input())
    h = list(map(int, input().split()))
    count = 0
    loop = 0

    #各数字が偶数であるかを判定する
    while True:
        if h[loop] % 2 != 0:
            print(count)
            sys.exit()
        loop = loop + 1
        #最後の数を判定したら
        if loop == len(h):
            h = list(map( lambda x:x/2, h))
            count = count + 1
            loop = 0

if __name__ == '__main__' :
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

print(min(B)) if min(B) > 0 else print(0)

Submission status: Accepted

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

counter = 0
while all(a%2==0 for a in A):
    A = list(a/2 for a in A)
    counter += 1

print(counter)

Submission status: Accepted

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

odd_flag = False
count = 0
while True:
    for i, j in enumerate(A):
        if j % 2 == 1:
            odd_flag = True
            break
        A[i] = j / 2
    if not odd_flag:
        count += 1
    else:
        break
        
print(count)

Submission status: Accepted

Solution code:
# Author: cr4zjh0bp
# Created: Thu Mar 12 20:24:34 UTC 2020
import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni = lambda: int(ns())
nin = lambda y: [ni() for _ in range(y)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda y: [na() for _ in range(y)]
nf = lambda: float(ns())
nfn = lambda y: [nf() for _ in range(y)]
nfa = lambda: list(map(float, stdin.readline().split()))
nfan = lambda y: [nfa() for _ in range(y)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda y: [ns() for _ in range(y)]
ncl = lambda y: [list(ns()) for _ in range(y)]
nas = lambda: stdin.readline().split()

N = ni()
a = na()

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

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):
    A = [a/2 for a in A]
    count += 1

print(count)

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


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


for i in a:
    if i%2 == 1:
        print(0)
        exit()

l = []
for i in a:
    l.append(factorization(i))

ans = 10 ** 9
for i in l:
    if i[0][0] == 2:
        ans = min(i[0][1], ans)

print(ans)

Submission status: Accepted

Solution code:
def divide_2(t):
  global now
  now = 0
  for i in range(10**5):
    if t%2 == 1:
      return now
      break
    else:
      t = t//2
      now += 1
now = 0
N = int(input())
A = list(map(int,input().split()))
k = []
for i in range(N):
  k.append(divide_2(A[i]))
print(min(k))

Submission status: Accepted

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

cnt =0

while True:
    if [i for i in A if i%2 == 1]:
        break
    A = [i/2 for i in A if i%2 ==0]
    cnt += 1

print(cnt)

Submission status: Accepted

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

while True:
    exist_odd = False

    for i in range(n):
        if input_list[i] % 2 != 0:
            exist_odd = True

    if exist_odd:
        break

    for i in range(n):
        input_list[i] /= 2

    count += 1

print(count)

Submission status: Accepted

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

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

flag = False
count = 0
while True:
    # 偶数チェック
    for i in input_list:
        if i % 2 != 0:
            flag = True
            break

    if flag:
        break

    # リスト内を÷2
    count += 1
    input_list = list(map(cal_division, input_list))

print(count)

Submission status: Accepted

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

c = -1
falg = True
while falg:
    a_t = []
    c = c + 1
    for i in a:
        if i % 2 == 1:
            falg = False
            break
        a_t.append(i / 2)
    a = a_t

print(c)

Submission status: Accepted

Solution code:
# import bisect
# import copy
# import fractions
# import math
import numpy as np
# from collections import Counter, deque
# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product

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

    cnt=0
    while all(i%2==0 for i in A):
        A = A//2
        cnt+=1
    print(cnt)



resolve()

Submission status: Accepted

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

div_count = 0
while True:
  includesOdd = False in [x % 2 == 0 for x in nums]
  if includesOdd:
    break
  nums = [x / 2 for x in nums]
  div_count += 1
print(div_count)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
print(-(int(input())>0)+next(filter(lambda x:any(map(lambda y:y%(2**x[1])>0,x[0])),zip([list(map(int,input().split()))]*99,range(99))))[1])

Submission status: Accepted

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

# リストを受け取り、すべてが偶数かどうかチェックする
def is_even(a):
    for i in a:
        if i % 2 != 0:
            return False
    return True

# リストを受け取り、すべてを÷2したリストを返却する
def divided_list(a):
    tmp_list = []
    for k in a:
        tmp_list.append(int(k / 2))
    return tmp_list

# リストを受け取り、すべてが偶数であればすべてを÷2したリストを返却し、それ以外の場合はFalseを返却する
def aaa(a):
    if is_even(l):
        return divided_list(l)
    else:
        return False

count = 0
while aaa(l):
    count += 1
    l = aaa(l)

print(count)

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:
def main():
    N = int(input())
    A = list(map(int, input().split()))
    cnt = 0
    while True:
        for i in range(N):
            if A[i] % 2:
                print(cnt)
                exit()
            A[i] /= 2
        cnt += 1


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import re
firststr = int(input())
ary = input().split()
counter = 0
breaker = 0
while 1:
    for index , elm in enumerate(ary):
        elmnum= int(elm)
        if elmnum%2 is 0:
            tmp = elmnum / 2
            elm = int(tmp)
            ary[index] = elm
            continue
        else:
            breaker = True
            break
    if breaker is True:
        break
    counter+=1

print(counter)

Submission status: Accepted

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


while True:
	for j in range(n):
		if List[j]%2 != 0:
			break
		List[j] /= 2

	else:
		result += 1
		continue
	break
  
print(result)

Submission status: Accepted

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


for i in range(200):
	for j in range(n):
		if List[j]%2 != 0:
			break
		List[j] /= 2

	else:
		result += 1
		continue
	break
  
print(result)

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:
def count_two(n):
  count = 0
  while n % 2 == 0:
    count += 1
    n //= 2
  return count

def main():
  input()
  ary = list(map(int, input().split()))
  ans = 128
  for v in ary:
    ans = min(ans, count_two(v))

  print(str(ans))

if __name__ == '__main__':
  main()

Submission status: Accepted

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

ans=99
ansb=0
t=0
for i in range(x):
	ansb=0
	t=y[i]
	while t%2==0:
		ansb=ansb+1
		t=t/2
	if ans>ansb:
		ans=ansb
print(ans)

Submission status: Accepted

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

while flg:
    for i in range(N):
        if A[i] % 2:
            flg = False
            break
        else:
            A[i] >>= 1

    if flg:
        ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())#3
lst=list(map(int,input().split()))#[8,12,40]
time=0
while True:
  for i in lst:#[8,12,40]
    if i%2!=0:
      break
  else:
    time+=1
    lst=[int(i/2) for i in lst]
    continue
  print(time)
  break

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:
N = int(input())
A = list(map(int, input().split()))
cout = 0
while all(a % 2 == 0 for a in A):
  A = [a/2 for a in A]
  cout += 1
print(cout)

Submission status: Accepted

Solution code:
def culEv (i, c = 0):
  if i % 2 == 0:
    c = c + 1
    c = culEv(i / 2, c)
  return c

s = [input() for i in range(2)]
n = int(s[0])
l = [int(i) for i in s[1].split()]
c = []
for i in l:
  if i % 2 != 0:
    c.append(0)
    break
  c.append(culEv(i))
print (min(c))

Submission status: Accepted

Solution code:
def divisible(n):
    ans = 0
    while n % 2 == 0:
        n /= 2
        ans +=1
    return ans
# 整数の入力
N = int(input())
# スペース区切りの整数の入力 リスト
A = list(map(int, input().split()))

ans = min(map(divisible,A))
print(ans)

Submission status: Accepted

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

C = []

for a in A:
    cnt = 0
    while a % 2 == 0:
        a /= 2
        cnt += 1
    else:
        C.append(cnt)

print(min(C))

Submission status: Accepted

Solution code:
def how_many(n):
  ans = 0
  while n % 2 == 0:
    n /= 2
    ans += 1
  return ans
 
n = int(input())
li = map(int, input().split())

ans = min(map(how_many, li))

print(ans)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

Solution code:
import sys
Row = input()
List = [int(j) for j in input().split()]
for i in range(len(List)):
    ans = List[i] % 2
    if ans == 1:
        print(0)
        sys.exit()

count = 0
flg = 0
while flg == 0:
    count = count + 1
    for j in range(len(List)):
        List[j] = List[j] / 2
        if List[j]%2:
            flg = 1
            break
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

count = 0

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

Submission status: Accepted

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

count = 0
S = []

def action(q):
    global count
    if q % 2 == 0:
        count += 1
        action(q/2)
    else:
        S.append(count)
        count = 0

for i in range(n):
    action(a[i])

print(min(S))

Submission status: Accepted

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

    res = 0
    while True:
        exist_odd = False
        for num in arr:
            if num % 2 != 0:
                exist_odd = True

        if exist_odd:
            break

        arr = list(map(lambda x: int(x/2), arr))
        res += 1

    print(res)

resolve()

Submission status: Accepted

Solution code:
# 線形探索
# 与えられた数字を一気に2で割るとしたとき、何回まで整数のままで割れますか、という考え方
# 2進数の1/2倍は右論理シフトになるだけ
# 2進数での右の0の個数(=はじめに1が出てくる数から1を引いた数)が2で割れる回数に等しい

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

Submission status: Accepted

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

flg = False
cnt = 0
while(True):
    for i, num in enumerate(a):
        if num%2 == 0:
            a[i] = int(num/2)
        else:
            flg = True
    if flg:
        break
    cnt += 1

print(cnt)

Submission status: Accepted

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

flg = False
cnt = 0
while(True):
    i = 0
    for num in a:
        # get_odd_even = lambda x: x if (x%2)==0 else 0
        if num%2 == 0:
            a[i] = int(num/2)
        else:
            flg = True
        i += 1
    if flg:
        break
    cnt += 1

print(cnt)

Submission status: Accepted

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

count = 0
while all(map(lambda x: x % 2**(count+1) == 0, nums)):
	count += 1

print(count)

Submission status: Accepted

Solution code:
N = int(input())
num = list(map(int,input().split()))
a=0
for i in range(N):
    b = 0
    if(num[i]%2 == 1):
        a = 0
        break
        
    while(num[i]%2==0):
        b += 1
        num[i] //= 2
        
    if(a==0 or a>b):
        a=b
print(a)

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

Submission status: Accepted

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

n = int(input())
a = list(map(int, input().split()))
ans = min(map(shift_only, a))
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

B = []
for i in A:
    cnt = 0
    while i%2 == 0:
        if i%2 == 0:
            cnt += 1
            i = i/2
    B.append(cnt)
print(min(B))

Submission status: Accepted

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

b=[]
for i in a:
    k=0
    while i%2==0:
        k+=1
        i/=2
    b.append(k)

print(min(b))

Submission status: Accepted

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

while True:
    for i in range(n):
        if a[i] % 2 != 0:
            check = 1
    if check == 0:
        a = list(map(lambda a: a / 2, a))
        cnt += 1
    else:
        break
print(cnt)

# 合計をただ割ると n = 2 a = 6, 6 の時と n = 3 a = 4, 4, 4 の時の答えが同じになっちゃう
# lambdaでlist割り算

Submission status: Accepted

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

N = int(input())
nums = [int(i) for i in input().split()]
flag = True
cnt = 0
while flag == True:
    flag = evenChecker(nums)
    if not flag :
        break
    cnt += 1
    nums = [i/2 for i in nums]

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8

def div2count(num:int):
    count = 0
    while num % 2 == 0:
        count += 1
        num = int(num/2)
    return count


n = int(input().rstrip())
ans = min([div2count(int(i)) for i in input().rstrip().split(" ")])

print(ans)

Submission status: Accepted

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

ansList = [len(bin(x)) - bin(x).rfind('1') -1 for x in list]

print(min(ansList))

Submission status: Accepted

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

is_even = True
loop_count = 0
while (is_even):
    for r in a:
        if a[0] % 2 == 0:
            a.append((a[0] // 2))
            a.pop(0)
        else:
            is_even = False
            break
    else:
        loop_count += 1
print(loop_count)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N = input()
A = map(int, input().split())
A = list(A)
count = 0
flag = True

while flag:
    l = []
    for element in A:
        if element%2 == 1:
            flag = False
            count -= 1
            break
        l.append(element/2)
    A = l
    count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
abcetc=input()
abli=abcetc.split()
abli=[int(s) for s in abli]
ctr=0
while all(i%2==0 for i in abli):
    for i in range(0,N):
        abli[i]=abli[i]/2
    ctr+=1
print(ctr)

Submission status: Accepted

Solution code:
n = int(input())
s = list(map(int, input().split()))
ln = []
for i in range(n):
    for j in range(1, s[i] // 2 + 1):
        if s[i] % (2 ** j) == 0 and s[i] % (2 ** (j + 1)) != 0:
            ln.append(j)
            break
        elif s[i] % 2 == 1:
            ln.append(0)
            break
print(min(ln))

Submission status: Accepted

Solution code:
import numpy as np

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

res = 0
count = 0
while res==0:
  res += (A%2).sum()
  A = A/2
  count += 1
print(int(count-1))

Submission status: Accepted

Solution code:
s=[[int(j) for j in input().split()] for i in range(2)]
N=s[0]
A=s[1]
accN=0
number=0
flag=1
while flag==1:
    for i in A:
        if i % 2==0:
            accN+=1
    if accN==N[0]:
        number+=1
        accN=0
        for i in range(N[0]):
            A[i]=A[i]/2
        
    else:
        flag=0
print(number)

Submission status: Accepted

Solution code:
n = input()
A = [int(x) for x in input().split()]
ans = float('inf')

for a in A:
    ans = min(ans, len(bin(a)) - bin(a).rfind('1') -1 )

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
list = [int(x)  for x in input().split()]
ans = float('inf')
for a in list:
    ans = min(ans, len(bin(a))-bin(a).rfind('1')-1 )
print(ans)

Submission status: Accepted

Solution code:
import numpy as np
n = input()
a = np.array([int(x) for x in input().split()])
count = 0
x = 0

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


print(count)