Problem:


Score : 200 points

Problem Statement

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

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

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

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

Constraints

1 \leq N \leq 200

1 \leq A_i \leq 10^9

Input

Input is given from Standard Input in the following format:

N
A_1 A_2 ... A_N

Output

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

Sample Input 1

3
8 12 40

Sample Output 1

2

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

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

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

Thus, Snuke can perform the operation at most twice.

Sample Input 2

4
5 6 8 10

Sample Output 2

0

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

Sample Input 3

6
382253568 723152896 37802240 379425024 404894720 471526144

Sample Output 3

8



Sample input:
3
8 12 40


Sample output:
2

Submission status: Accepted

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

Submission status: Accepted

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

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

x = 0
while True:
    for i in range(len(l)):
        if l[i] > 0 and l[i]%2 == 0:
            l[i] /= 2
        else:
            print(x)
            exit()
    x += 1

Submission status: Accepted

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

while True:
	for i in a:
		if i%2 != 0:
			flg = 1

	if flg == 0:
		a = list(map(lambda x: int(x/2), a))
		count += 1
	else:
		break
         
print(count)

Submission status: Accepted

Solution code:
N = int(input())
numbers = [x for x in map(int, input().split())]
count = 0
on = True
while on:
  val = [x % 2 == 0 for x in numbers]
  if False in val:
    print(count)
    break
  else:
    numbers = [x//2 for x in numbers]
    count += 1

Submission status: Accepted

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

import numpy as np

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

count = 0

while(1):
    if all(1 - (l % 2)):
        count += 1
        l = l / 2
    else:
        break

print(count)

Submission status: Accepted

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

ans = 0
while len(list(filter(lambda x: x%2 == 1, a))) == 0:
    a = list(map(lambda x: int(x/2), a))
    ans += 1
print(ans)

Submission status: Accepted

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

a1 = a_list[0]

while a1 % 2 == 0:
    a1 /= 2
    count += 1

if count == 0:
    print(0)

else:
    for a in a_list:
        if a % (2 ** count) == 0:
            continue

        else:
            temp_count = 0
            while a % 2 == 0:
                a /= 2
                temp_count += 1

            count = temp_count
            if count == 0:
                break

    print(count)

Submission status: Accepted

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

Submission status: Accepted

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

d.sort()
print(d[0])

Submission status: Accepted

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

flag = True
count = 0
while flag:
	for i in range(N):
		if Alist[i] % 2 != 0:
			flag = False
			break

	if flag:
		for i in range(N):
			Alist[i] = Alist[i] / 2
		count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

print(count)

Submission status: Accepted

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

odd_flag = 0
counter = 0
while 1:
    for i in range(N-1):
        if A[i]%2 == 1:
            odd_flag=1
        A[i] //= 2

    if odd_flag == 0:counter += 1
    else: break


print(counter)

Submission status: Accepted

Solution code:
def shift(numbers) -> int:
    count = 0
    processed_numbers = numbers
    while(all([x % 2 == 0 for x in processed_numbers])):
        count += 1
        processed_numbers = [x // 2 for x in processed_numbers]
    return count

input()  # 捨てる
numbers = list(map(int, input().split()))
print(shift(numbers))

Submission status: Accepted

Solution code:
def is_even(i):
    if i % 2 == 0:
        return True
    else:
        return False

def is_all_true(values):
    for x in values:
        if x == False:
            return False

    return True

def div(values):
    ret = []
    for x in values:
        ret += [int(x / 2)]

    return ret



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

count = 0
while True:
    x = list(map(is_even, values))
    if not is_all_true(x):
        print(count)
        break

    values = div(values)
    count = count + 1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
def d_check(num):
    if num%2 != 0:
        return 0
    count = 1
    return count+ d_check(num/2)

a = [d_check(i) for i in map(int, input().split(' '))]
print(min(a))

Submission status: Accepted

Solution code:
#import numpy as np
n = int((input()))
a = list(map(int,input().split(' ')))
#print(a[0])
counter = []
#n = 3
#a = list(range(n))
for i in range(n):
  count = 0 
  #print(a)
  while a[i]%2 == 0:
      #print(a[i])
      a[i] /= 2
      count += 1
  counter.append(count)    
      
print(min(counter))

Submission status: Accepted

Solution code:
n = int(input()) 
t = [int(i) for i in input().split()] 
c = []
for i in range (n):
  a = 0
  b = t[i]
  while b%2 == 0:
    b = b/2
    a += 1
  c.append(a)
print(min(c))

Submission status: Accepted

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

Submission status: Accepted

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

input()
nums = list(map(int, input().rstrip("\n").split()))

print(min([shifts(num) for num in nums]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC081B - Shift only
from functools import reduce
from operator import or_


def main():
    # bitwise or of sequenc -> find least 1-bit
    _ = input()
    A = reduce(or_, map(int, input().rstrip().split()))
    ans = bin(A)[::-1].find("1")
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
from math import log,floor
minc = 1000000
for i in range(n):
    count = 0
    while True:
        if a[i]%2==1:
            break
        else:
            a[i]=a[i]//2
            count+=1
    minc = min(minc,count)

print(minc)

Submission status: Accepted

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

res = 0

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

Submission status: Accepted

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

num = 0
flg = True
while flg:
  for i in range(N):

    if A[i] %2 != 0:
      flg = False
      break
    else:
      A[i] //=  2
	
  if flg:
    num += 1

print(num)

Submission status: Accepted

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

def num_two(input_number):
  number = input_number
  count = 0
  while True:
    if number % 2 == 0:
      count += 1
      number = number / 2
    else:
      break
  return count

num_twos = [num_two(ai) for ai in a]
# print(num_twos)
print(min(num_twos))

Submission status: Accepted

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

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

print (ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def g_c_d(x, y):
    if y == 0:
        return x
    else:
        return g_c_d(y, x % y)


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

Submission status: Accepted

Solution code:
n = int(input())

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

j = 0
k = 0

while j == 0:
  #print(num)
  for i in range(len(num)):
    if num[i] % 2 == 0:
      num[i] = num[i] / 2
    else:
      j = 1;
      break;
  
  if j == 0:
    k += 1
      
print( k )

Submission status: Accepted

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

ret=0
flg=True
while flg:
    for i in range(N):
        if AN[i]%2!=0:
            flg=False
            break
        AN[i]//=2

    if flg:
        ret+=1

print(ret)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

kaisu = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split()))
def f(A):
    B = {0 if a%2==0 else 1 for a in A}
    if 1 in B:
        return 1
    else:
        return 0
i = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def is_even(a):
    if a%2 == 0:
        return int(a/2)
    else:
        return False

if __name__ == '__main__':
    N = int(input())
    A = [None]*N
    A = list(map(int, input().split()))
    count = 0
    A = list(map(is_even, A))
    while all(A):
        count += 1
        A = list(map(is_even, A))
    print(count)

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in A:
    p = 0
    while i % 2 == 0:
        i //= 2
        p += 1
    if p < ans:
        ans = p
print(ans)

Submission status: Accepted

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

ctr = 0
def numEvener(N,numList):
  for i in range(0,N):
    if numList[i] % 2 == 0:
      numList[i] = int(numList[i] / 2)
    else:
      numList[i] = 0
  return numList
 
flag = True
while flag:
  numList = numEvener(N,numList)
  if not 0 in numList:
  	ctr += 1
  else:
    flag = False


print(ctr)

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:
N = int(input())
a = list(map(int,input().split()))
count = 0
hantei = 1

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

Submission status: Accepted

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


m=min(L)
for i in range(30):
  if m%2==1:
    break
  else:
    m/=2
    count+=1


ans=[0 for i in range(n)]
for i in range(n):
  for j in range(count):
    if L[i]%2==0:
      L[i]=L[i]//2
      ans[i]+=1
    else:
      break
   
print(min(ans))

Submission status: Accepted

Solution code:
input_list_len = int(input())
input_list = map(int, input().split())
even_list = input_list
even_list_len = input_list_len
count = 0

while True:
    even_list = list(filter(lambda num: num % 2 == 0, even_list))
    even_list_len = len(even_list)
    if input_list_len != even_list_len:
        break
    even_list = map(lambda num: num / 2, even_list)
    count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

def iseven():
    global a
    for i in range(len(a)):
        if a[i] % 2:
            return 0
        else:
            a[i] = a[i] // 2
    else:
        return 1

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

while True:
    if iseven():
        count += 1
    else:
        break

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
As = map(int, input().split())
count = 0
while True:
    Bs = []
    for a in As:
        if a % 2 != 0:
            break
        Bs.append(a//2)
    else:
        As = Bs
        count += 1
        continue
    break
print(count)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
a = int(input())
# スペース区切りの整数の入力

b = input().split(" ")
i=1
while 1:
  flag=0
  for item in b:
    if int(item)%2**i!=0:
      #print(item)
      flag=1
  if flag==1:
    break
  i=i+1

print(i-1)

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
ans = float('inf')
for i in a:
    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()))

ans = float('inf')
for i in range(N):
    cnt = 0

    while A[i] % 2 == 0:
        A[i] /= 2
        cnt += 1    
    if ans > cnt:
        ans = cnt

print(ans)

Submission status: Accepted

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

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

print(min(ans))

Submission status: Accepted

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

Submission status: Accepted

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

counter = 0
exist_odd = 0
while 1:
  for i in range(len(A)):
    if A[i]%2 == 1:
      exist_odd = 1
    A[i] = A[i]/2
  if exist_odd == 1: break
  counter+=1

print(counter)

Submission status: Accepted

Solution code:
import sys

lines = sys.stdin.read().splitlines()
numbers = [int(v) for v in lines[1].split(" ")]
count = 0
while True:
  if all(v % 2 == 0 for v in numbers):
    count += 1
    numbers = [v / 2 for v in numbers]
  else:
    break
print(count)

Submission status: Accepted

Solution code:
from itertools import groupby
stdin = [input().split() for _ in range(2)]

def div2(x):
    b = bin(int(x))
    n = len(b)
    for i in range(n):
        if not b[n - 1 - i] == "0":
            break
    return i

res = map(div2, stdin[1])
print(min(res))

Submission status: Accepted

Solution code:
N = input()
a = list(map(int, input().split()))
     
answer = 0
flg = True
while flg:
    
    for i, m in enumerate(a):
        if m%2 == 1:
            flg = False
            break
        a[i] = m/2
    if flg:
        answer += 1

print(answer)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
import math
a = 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:
N = int(input())
A = list(map(int, input().split()))

res = 0

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

print(res)

Submission status: Accepted

Solution code:
def solve():
    a = read()
    result = think(a)
    write(result)


def read():
    n = read_int(1)[0]
    return read_int(n)


def read_int(n):
    return list(map(int, read_line().split()[:n]))


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(a):
    buf = list(a)
    count = 0
    while True:
        if all(map(lambda x: x % 2 == 0, buf)):
            count += 1
            buf = list(map(lambda x: x // 2, buf))
        else:
            break
    return count
        

def write(result):
    print(result)


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
n = int(input())
array = [int(i) for i in input().split()]
cntarray =[]
cnt = 0

for i in range(n):
  cnt = 0
  while array[i]%2 == 0:
    array[i] /= 2
    cnt +=1
  
  cntarray.append(cnt)
  
print(min(cntarray))

Submission status: Accepted

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

for num in list:
    tmp = 0
    while True:
        if num % 2 != 0:
          break
        else:
          tmp += 1
          num = num / 2
    if min_count > tmp:
        min_count = tmp  
          
print(min_count)

Submission status: Accepted

Solution code:
def main():
    _ = int(input())
    nums = [int(i) for i in input().split()]
    # nums = map(int, input().split())
    counter = 0
    loop = True
    while loop:
        for i, n in enumerate(nums):
            if n % 2 == 0:
                nums[i] = n / 2
            else:
                loop = False
                break
        if loop:
            counter += 1
    print(counter)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

cnt=0

def half(n):
    return n*(1/2)

for i in range(min(a)//2):
    
    tmp=list(filter(lambda x:x%2==0,a))
    if len(tmp)==len(a):
        a=list(map(half,a))
        cnt+=1
    else:
        break
print(cnt)

Submission status: Accepted

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

length = len(num_list)
num_list_devided = num_list
factor2 = [0]

while num_list_devided[0] % 2 == 0:
    num_list_devided[0] = num_list_devided[0] / 2
    factor2[0] += 1

for i in range(1, length):
    min_factor2 = min(factor2)
    factor2.append(0)
    for j in range(min_factor2):
        while num_list_devided[i] % 2 == 0:
            num_list_devided[i] = num_list_devided[i] / 2
            factor2[i] += 1
            
print(min(factor2))

Submission status: Accepted

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

Submission status: Accepted

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

marker = True
count = 0
num = 0

while(marker):
    for i in range(N):
        num = int(input[i])
        if num%2==1:
            marker = False
            count -= 1
            break;
        else:  
            input[i] = num/2 
    count += 1
print(count)

Submission status: Accepted

Solution code:
import fractions
import math
from functools import reduce

def gcd(numbers):
    return reduce(fractions.gcd, numbers)
    
n=int(input())
a=list(map(int, input().split()))

print(math.floor(math.log(gcd(a),2)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(raw_input())
num = [x.strip() for x in raw_input().split()]

cnt = 0
flg = 0
while flg == 0:
    for i in range(N):
        if int(num[i]) % 2 == 0:
            num[i] = int(num[i]) // 2
        else:
            flg = 1

    if flg == 0:
        cnt += 1
print cnt

Submission status: Accepted

Solution code:
#ABC 81, B - shift only
import itertools

n = int(input())
A = [int(el) for el in input().split(' ')]
count = 0
for i in itertools.count(0):
    if all([a % 2 == 0 for a in A]):
        A = [a / 2 for a in A]
        count += 1
    else:
        break
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

ans=10**9

for i in A:
  p=0
  while i%2 ==0:
    i/=2
    p+=1
  if p<ans:
    ans=p
    
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

line = sys.stdin.readline().strip()
N = int(line)
line = sys.stdin.readline().strip()
A = [int(x) for x in line.split()]

m = 2 << 31-1
for a in A:
    m = min(m, a & -a)
print(len(bin(m))-3)

Submission status: Accepted

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

line = sys.stdin.readline().strip()
N = int(line)
line = sys.stdin.readline().strip()
A = [int(x) for x in line.split()]

m = 2 << 31-1
for a in A:
    m = min(m, a & -a)
print(len(bin(m))-3)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
import math
INF = float("inf")

MOD = 2  # type: int


def solve(N: int, A: "List[int]"):
    m = INF
    for a in A:
        m = min(m, a & -a)
    print(int(math.log2(m)))
    return


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())
A = list(int(_) for _ 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:
N = int(input())
li = list(map(int, input().rstrip().split()))

counter = 0
i = 0

while li[i] % 2 == 0:
    counter += 1
    li[i] = li[i] / 2
    if i == N-1:
      i = 0
    else:
      i += 1
print(int(counter/N))

Submission status: Accepted

Solution code:
import numpy as np
N = input()
number_list = np.array(list(map(int,input().split())))
count = 0
flag = True
while flag:
    for number in number_list:
        if(number%2==1):
            flag = False
            break
        else:
            continue
    if flag:
        number_list = number_list / 2
        count += 1
print(count)

Submission status: Accepted

Solution code:
import numpy as np


def main():
    input()
    a = np.array([int(i) for i in input().split()])
    div(a, 0)


def div(a, count):
    if (a % 2 != 0).any():
        print(count)
    else:
        div(a / 2, count+1)


main()

Submission status: Accepted

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

Submission status: Accepted

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

cnt = 0

while True:
    for i in range(len(a)):
        if a[i] % 2 != 0:
            break
        elif i == len(a)-1:
            for j in range(len(a)):
                a[j] = a[j]/2
            cnt += 1
    else:
        continue
    break
    
print(cnt)

Submission status: Accepted

Solution code:
n = int(input())
s = list(map(int, input().split()))
count = 0
while True:
    flag = False
    for i in range(n):
        if s[i]%2 != 0 or s[i] == 0:
            flag = True
            break
    if flag:
        break
    for i in range(n):
        s[i] = s[i]/2
    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:
iter_num = input()
variables = input()

raw_variables = variables.split(' ')
variables = list()

for raw_variable in raw_variables:
    variables.append(int(raw_variable))


def calc(variable):
    process_count = 0
    while (variable % 2 == 0):
        process_count += 1
        variable = variable / 2
    return process_count


min_count = None

for variable in variables:
    process_count = calc(variable)
    if min_count is None:
        min_count = process_count
    if process_count < min_count:
        min_count = process_count

print(min_count)

Submission status: Accepted

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

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

print(c)

Submission status: Accepted

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

while True:
  R = [i % 2 for i in A]
  if sum(R) > 0:
    print(c)
    break
  A = [i / 2 for i in A]
  c += 1

Submission status: Accepted

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

count = 0
flug = bool(False)
#print(len(list1))
while flug == False:
  for i in range(len(list1)):
    if list1[i] % 2 != 0:
      #print("here")
      flug = bool(True)
      count = count - 1
      break
    list1[i] = int(list1[i]) / 2
  count = count + 1
print(count)

Submission status: Accepted

Solution code:
N = int(input())
A = sorted(["{:b}".format(int(x))[::-1] for x in input().split()])
print(A[-1].find("1"))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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