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
import sys

def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()

    
    array_result.append(data.split(" "))

    flg = 1

    try:


        while flg:

            data = input()

            array_temp = []

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:


        return array_result





arr_data = getinputdata()

n = int(arr_data[0][0])
arr = arr_data[1]

arr2 = list(map(int, arr))

#print(n, arr, arr2)


mycnt = 0

chkflg = True

while chkflg:

    arr_temp=[]
    for v in arr2:

        if(v % 2 == 1):

            chkflg = False

        else:

            arr_temp.append(v / 2)

    else:
        
        if chkflg:
            
            mycnt+=1
        
        arr2 = arr_temp
        
print(mycnt)

Submission status: Accepted

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

def is_all_even(l):
    le = list(filter(lambda x:x % 2 == 0, l))
    return len(l) == len(le)

while is_all_even(l):
    counter += 1
    l = [i/2 for i in l]

print(counter)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
num = 10000
for i in range(n):
    rec = 0
    j = 2
    while a[i] % j == 0:
        j *= 2
        rec += 1
        if rec >= num:
            break

    num = min(rec, num)

print(num)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding: utf-8

_ = int(input())
array = list(map(int, input().split()))
currentMinI = 30 # log_2 pow(10, 9) = 9 log_2 10 ≒ 9/0.3010 = 29.9
for n in array:
    i = 0
    while i < currentMinI and (n & (1 << i)) == 0:
        i += 1
    currentMinI = min(currentMinI, i)
print(currentMinI)

Submission status: Accepted

Solution code:
#coding: utf-8

N = int(input())
array = list(map(int, input().split()))
currentMinI = 30 # log_2 pow(10, 9) = 9 log_2 10 ≒ 9/0.3010 = 29.9
for n in array:
    i = 0
    while (n & (1 << i)) == 0:
        i += 1
    currentMinI = min(currentMinI, i)
print(currentMinI)

Submission status: Accepted

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

for i in a:
    tmp = 0
    while (i % 2 == 0 and i > 0):
        tmp += 1
        i /= 2
    
    ans = min(ans, tmp)

print(ans)

Submission status: Accepted

Solution code:
from functools import reduce

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

cnt = 0
while reduce(lambda x, y: x and y, [n % 2 == 0 for n in A]):
    A = [n // 2 for n in A]
    cnt += 1

print(cnt)

Submission status: Accepted

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

def devide_recursive(a, count):
    for number in a:
        if number % 2 != 0:
            return count
    count += 1
    return devide_recursive(list(map(lambda x: x / 2, a)), count)

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

    count = devide_recursive(a, 0)
    print(count)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

def discriminant(n):
    count=0
    while n%2==0:
        n//=2
        count+=1
    return count

for i in range(N):
    nums[i]=discriminant(nums[i])

print(min(nums))

Submission status: Accepted

Solution code:
import math
num = int(input())
s = list(map(int, input().split()))
ans = float('inf')

for i in s:
    ans = min(ans, len(bin(i)) - bin(i).rfind("1") - 1)
print(round(ans))

Submission status: Accepted

Solution code:
num = int(input())
s = input().rstrip().split(' ')
s = [ int(x) for x in s]
count = 0
key = True

while key:
    for i in range(num):
        if( s[i] % 2 == 0):
            s[i] = s[i] // 2
        else:
            key = False

    if key:
        count += 1

print(count)

Submission status: Accepted

Solution code:
num = int(input())
s = input().rstrip().split(' ')
count = 0
key = True

while key:
    for i in range(num):
        s[i] = int(s[i])
        if( s[i] % 2 == 0):
            s[i] = s[i] // 2
        else:
            key = False

    count += 1

print(count - 1)

Submission status: Accepted

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

Submission status: Accepted

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

    m = min(m,num)
print(m)

Submission status: Accepted

Solution code:
import numpy as np
l = int(input())
a = [ np.int(x) for x in input().split() ]
a = np.array(a, dtype = 'int32')
ans = 0
while True:
    b =  a / 2
    c = a // 2
    if (b - c).any():
        break
    else:
        a = b
        ans += 1
print(ans)

Submission status: Accepted

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

def inOdd(lst):
    flag = False
    for i in range(len(lst)):
        if lst[i]%2!=0:
            flag = True
            break
    return flag

count = 0
while True:
    if inOdd(A):
        break
    for i in range(len(A)):
        A[i] /= 2
    count += 1
print(count)

Submission status: Accepted

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

candidate = 0
end = 0
while end == 0:
    for A_i in A:
        if (A_i/2**(candidate))%2 != 0:
            end = 1
            break
    else:
        candidate += 1
print(candidate)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
ans = 30
count = 0
line = list(map(int, input().split(" ")))
for i in range(0, len(line)):
    count = 0
    while line[i] % 2 == 0:
        line[i] = line[i] / 2
        count += 1
    ans = min(ans, count)
print(ans)

Submission status: Accepted

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

while x == 0:
    for i in range(n):
        if l[i] % 2 == 0:
            x += 1
            l[i] = (l[i]/2)
        else:
            x = -1
    if x == n:
        a += 1
        x = 0

print("{}".format(a))

Submission status: Accepted

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

count = 0
has_odd = False
while True:
    for i, num in enumerate(board):
        if num % 2 == 0:
            board[i] //= 2
        else:
            has_odd = True
    if has_odd:
        break
    count += 1

print(count)

Submission status: Accepted

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

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().strip()

n = ni()
a = na()
ans = 0
flag = 1
while flag:
    for i in range(len(a)):
        if a[i] % 2 == 0:
            pass
        else:
            flag = 0
        a[i] = a[i]/2
    if flag:
        ans += 1
print(ans)

Submission status: Accepted

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

end = 0
count = 0

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(raw_input())
l = map(int, raw_input().split())
shift = 1
while all(n % (1 << shift) == 0 for n in l):
  shift += 1
print shift - 1

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
input();a=0
b=list(map(int,input().split()))
while 1:
    for x in b:
        if x>>a&1:
            print(a)
            exit()
    a+=1

Submission status: Accepted

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

# AtCoder Beginner Contest
# Problem B


def count_operation(numbers):
    is_even = True
    count = 0

    while is_even is True:
        elements = divided_by(2 ** (count + 1), numbers)

        if elements.count(0) == number_count:
            count += 1
        else:
            is_even = False
    return count


def divided_by(number, numbers):
    return [element % number for element in numbers]


if __name__ == '__main__':
    number_count = int(input())
    numbers = list(map(int, input().split()))

    result = count_operation(numbers)
    print(result)

Submission status: Accepted

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

Submission status: Accepted

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

i = 0
while True:
    for j in A:
        if j % 2**(i+1) != 0:
            print(i)
            exit()
    i += 1

Submission status: Accepted

Solution code:
input();n=eval(input().replace(' ','|'));print((n&-n).bit_length()-1)

Submission status: Accepted

Solution code:
input()
n = eval(input().replace(' ', '|'))
for i in range(201):
    if n & 1 << i:
        print(i)
        break

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import functools
import fractions
import math

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

mod=functools.reduce(fractions.gcd,A)

if mod%2!=0:
    print('0')
    exit()
else:
    print(int(math.log2(mod)))

Submission status: Accepted

Solution code:
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(10000)

# Debug output
def chkprint(*args):
    names = {id(v):k for k,v in inspect.currentframe().f_back.f_locals.items()}
    print(', '.join(names.get(id(arg),'???')+' = '+repr(arg) for arg in args))

# Binary converter
def to_bin(x):
    return bin(x)[2:]

# Set 2 dimension list
def dim2input(N):
    li = []
    for _ in range(N):
        li.append(list(map(int, input())))
    return li

""" input template
S = input()
N = int(input())
L = list(map(int, input().split()))
a, b = list(map(int, input().split()))
SL = list(input())
"""

# --------------------------------------------

dp = None

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

    op = 0

    while True:
        for a in A:
            if a % 2 != 0:
                print(op)
                return

        A = list(map(lambda a:a//2, A))
        op += 1

main()

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
N = int(input())
A = list(map(int, input().rstrip().split()))
cnt = 0
perfect = 0
while perfect == 0:
    for i in range(N):
        if A[i] % 2:
            perfect = 1
        else:
            A[i] //= 2
    if perfect == 0:
        cnt += 1
print(cnt)

Submission status: Accepted

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

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] & 1:
    print(cnt)
    __import__("sys").exit(0)
  a[i] //= 2
 cnt += 1

Submission status: Accepted

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

import sys

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

while(True):
    for i in range(len(A)):
        if A[i] % 2 == 1:
            print(count)
            sys.exit()
        A[i] /= 2
    count += 1

Submission status: Accepted

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

import sys
import numpy as np

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

while(True):
    for i in range(len(A)):
        if A[i] % 2 == 1:
            print(count)
            sys.exit()
        A[i] /= 2
    count += 1

Submission status: Accepted

Solution code:

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

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

        B.append(count)

    print (min(B))

if __name__ == "__main__":
    # global stime
    # stime = time.clock()
    main()

Submission status: Accepted

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

Submission status: Accepted

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

def solve(a):
  ans=0
  while True:
    for i in range(N):
      if A[i]%2==1:
        return ans
      else:
        A[i]/=2
    ans+=1

print(solve(A))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

import sys

n = raw_input().split()[0]
al = [int(e) for e in raw_input().split()]

p = 0
for ai in al:
    p |= ai

n = 0
while True:
    if p & 1:
        break
    p >>= 1
    n += 1

sys.stdout.write('%d\n' % n)
sys.stdout.flush()

Submission status: Accepted

Solution code:
n = input()
 
a = [int(i) for i in input().split()]
 
max = 1000000000
for i in a:
    sum = 0
    while(i % 2 == 0):
        i /= 2
        sum += 1
    
    if(max > sum):
        max = sum
 
print(max)

Submission status: Accepted

Solution code:
n = input()

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

max = 1000000000
for i in a:
    sum = 0
    while(i % 2 == 0):
        i /= 2
        sum += 1
    
    if(max > sum):
        max = sum

print(max)

Submission status: Accepted

Solution code:
num = int(input())
num_list = [int(i) for i in input().split()]
count = 1
Flag = True

while True:
    for i in range(num):
        if num_list[i] % (2 ** count) != 0:
            Flag = False
            break
    if Flag == False:
        break
    count += 1

print(count - 1)

Submission status: Accepted

Solution code:
n=int(input())
ans=min(map(lambda x:bin(int(x))[::-1].index('1'),input().split()))
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
https://beta.atcoder.jp/contests/abc081/tasks/abc081_b

"""
import sys
from sys import stdin
input = stdin.readline


def solve(A):
    ans = 0
    divisor = 2

    while True:
        for a in A:
            if a % divisor != 0:
                return ans
        divisor *= 2
        ans += 1


def main(args):
    N = int(input())
    A = [int(x) for x in input().split()]
    ans = solve(A)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

Solution code:
n = int(input())
m = list(map(int,input().split()))
ans = []
cou = 0

for i in range(n):
  while m[i] % 2 == 0:
    m[i] = m[i] / 2
    cou += 1
  ans.append(cou)
  cou = 0
print(min(ans))

Submission status: Accepted

Solution code:
n = int(input())
m = list(map(int,input().split()))
ans = []
cou = 0

for i in range(n):
  while m[i] % 2 == 0:
    m[i] = m[i] / 2
    cou += 1
  ans.append(cou)
  cou = 0
print(min(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
numbers =map(int,input().split())
ans = 10000
for i in numbers:
  count = 0
  while i % 2 == 0:
    i /= 2
    count += 1
  ans = min(ans,count)

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N=int(input())
A = list(map(int,input().split(' ')))
power=0
trig=0
while power <31 and trig==0:
    p = int(2**power)
    for a in A:
        if int(int(a/p)%2)==1 and trig==0:
            print(int(power))
            trig=1
            break
    power+=1

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
A = map(int, input().split())
ans = 9999
for a in A:
    k = 0
    while a % 2 == 0:
        a /= 2
        k += 1
    ans = min(ans, k)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()
a = map(int, raw_input().split())
def f():
    ans = 0
    while True:
        for i in range(N):
            if a[i] % (2**ans) != 0:
                return ans-1
        ans += 1
print f()

Submission status: Accepted

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

Submission status: Accepted

Solution code:


def divide(n):
    m = 0
    count = -1
    while m ==0:
        n, m = divmod(n, 2)
        count += 1
    return count

def foo(xs):
    possible = 31
    # 2 ^ 30 = 2 ^ (10 * 3) =  (2^10) ^ 3 ~ (10^3) ^ 3 = 10^ 9
    for x in xs:
        possible = min(possible, divide(x))
        if possible == 0:
            return 0
    return possible

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

Submission status: Accepted

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

x = 0
y = 0
for k in range(1000000000):
    for i,j in enumerate(A_list):
        if j%2 ==1:
            y += 1
        A_list[i] = j/2
    if y ==0:
        x +=1
    else:
        break
print(x)

Submission status: Accepted

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

ans = 0
for i in range(30):
  if [j for j in al if j % 2 == 1]:
    ans = i
    break
  al = [j//2 for j in al]

print(ans)

Submission status: Accepted

Solution code:
import numpy as np
import pdb

def main():
    N = int(raw_input())
    myarray = np.array(raw_input().split(' ')).astype(int)
    answer = process(myarray)
    print answer

def process(myarray):
    turn = 0
    possible = True
    while(possible):
        possible =  (np.sum(np.mod(myarray, 2)) == 0)
        if possible:
            turn += 1
            myarray = myarray / 2

    return turn

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
a = [int(x) for x in input().split()]
c = 0
while len([x for x in a if x % 2 == 1]) == 0:
    a = [x // 2 for x in a]
    c += 1
print(c)

Submission status: Accepted

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

def half(n):
    return n / 2

def check_odd(n):
    if n % 2 != 0:
        return False
    else:
        return True
flg = list(map(check_odd,arr))

while False not in flg:
    arr = list(map(half,arr))
    flg = list(map(check_odd,arr))
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
import math

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

while n >= 0:
    for a in A:
        if a%2 == 1:
            print(n)
            d += 1
            break
    if d > 0:
        break
    A = [a/2 for a in A] #Aを2で割る
    n += 1

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(j)

Submission status: Accepted

Solution code:
# B - Shift only
# coding: utf-8

N = int(raw_input())
A = map(int, raw_input().split())
result = 0

while True:
  flug = 0
  for i in range(N):
    if A[i] %2 == 1 : flug = 1
    A[i] = A[i] / 2
  if flug == 1 :break
  result += 1

print result

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n = input()
x = list(map(int, input().split()))

cnt = 0

while True:
    s = sum(list(map(lambda elem: elem % 2, x)))
    if s != 0:
        break
    cnt += 1
    x = list(map(lambda elem: elem // 2, x))

print(cnt)

Submission status: Accepted

Solution code:
N=int(input())

xs=map(int, input().split())

def count(a):
    if a % 2 == 0:
        return 1 + count(a // 2)
    else:
        return 0;

print(min(map(count, xs)))

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
def test(x):
    count=0
    while x%2==0:
        count+=1
        x/=2
    return count
ans=min(map(test,a))
print(ans)

Submission status: Accepted

Solution code:
N=input()
S=map(int,input().split())
sum=0
for num in S:
  sum=sum|num

for i in range(200):
  if sum>>i&1==1:
    print(i)
    break

Submission status: Accepted

Solution code:

def isEven(s):
    for i in s:
        if(i%2==0):
            continue
        else:
            return False
    return True

n=int(input())
a=list(map(int, input().split()))
c=0
while isEven(a):
    for i in range(n):
        a[i]=a[i]/2
    c+=1

print(c)

Submission status: Accepted

Solution code:
def kisu(s,num):
    for n in range(len(s)):
        if s[n]%2 == 1:
            return s,num,1
        s[n] = s[n]/2
    return s,num+1,0

n = int(input())
check = 0
num = 0
a = list(map(int,input().split()))
while check == 0:
    a,num,check = kisu(a,num)
print(num)

Submission status: Accepted

Solution code:
#最小の2 ** Xを求める
import  math

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

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

min = math.log2(10**9)


for i in range(N):
    k = divide_by_two(line_number[i], 0)
    
    if k <= min:
        min = k
        
print(min)

Submission status: Accepted

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

Submission status: Accepted

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

ans=a[0]
for i in range(1,n):
    ans = fractions.gcd(ans,a[i])

count = 0

while ans % 2 ==0:
    count +=1
    ans = ans //2
    
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

def func(x):
    ret = 0
    while x % 2 == 0:
        ret += 1
        x /= 2
    return ret

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

Submission status: Accepted

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

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

Submission status: Accepted

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

print(count)

Submission status: Accepted

Solution code:
def pow(n):
	if n%2==1:
		return 0
	return 1+pow(n/2)


input()
print(min([pow(int(x)) for x in input().split()]))

Submission status: Accepted

Solution code:
N = input()
A = list(map(int, input().split(' ')))
finish = False
can = 0
A_len = len(A)

while not finish:
    for num, soe in zip(A, range(A_len)):
        if num % 2 == 0:
            A[soe] = num / 2
        else:
            finish = True
    if finish:
        break
    can += 1

print(can)

Submission status: Accepted

Solution code:
N=int(input())
A=[int(i) for i in input().split()]
ans=999999
for num in A:
        time=0
        while num%2==0:
                time+=1
                num=int(num/2)
        ans=min(ans,time)
print(ans)

Submission status: Accepted

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


for i in range(n):
    ans.append(0)
    while a[i] % 2 == 0 and a[i] != 0:
        ans[i] += 1
        a[i] = a[i]//2
    
print(min(ans))

Submission status: Accepted

Solution code:
input()
a = map(int, raw_input().split())
print max(j for j in range(32) if all(i % 2 ** j == 0 for i in a))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 20 11:39:53 2017

"""

def judge(AList, result):
    
    AList_by2 = []
    
    for A in AList:
        if A % 2 == 1:
            return result
        else:
            AList_by2.append(A/2)
    
    result += 1
    return judge(AList_by2, result)
        
    
    

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

print(judge(AList,0))