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()))
def factorize2(n): # 素因数分解　2次元素数リスト([素数,指数])
    i = 2
    m = 1
    table = []
    sign = -1
    while i * i <= n:
        j = 0
        while n % i == 0:
            n //= i
            j += 1
        if j != 0:
            table.append([i,j])
        if i >= 5:
            if sign < 0:
                sign = 1
                i = 6*m + sign
            else:
                m += 1
                sign = -1
                i = 6*m + sign
        elif i == 2:
            i += 1
        elif i == 3:
            i = 5
    if n > 1:
        table.append([n,1])
    return table # list
ans = 10**9
for i in range(N):
    d = factorize2(A[i])
    if d[0][0]==2:
        ans = min(ans,d[0][1])
    else:
        ans = 0
        break
print(ans)

Submission status: Accepted

Solution code:
import numpy as np

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

cnt = 0
while (a % 2).sum() == 0:
  a //= 2
  cnt+= 1

print(cnt)

Submission status: Accepted

Solution code:
def div(n):
   return n//2
def myAnswer(N:int,A:list) -> int:
   counter = 0
   while all([i%2==0 for i in A]):
      counter+=1
      A = list(map(div,A))

   return counter

def modelAnswer():
   tmp=1
def main():
   N = int(input())
   A = list(map(int,input().split()))
   print(myAnswer(N,A))

if __name__ == '__main__':
   main()

Submission status: Accepted

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


def count(x):
    ans = 0
    while True:
        if x % 2 == 0:
            ans += 1
            x //= 2
        else:
            break
    return ans


A = list(map(count, A))
print(min(A))

Submission status: Accepted

Solution code:
# abc081_b.py
n = int(input())
a = list(map(int,input().split()))
cnt = 0
end = False
while not end:
    for i in range(n):
        if a[i]%2 == 0:
            a[i] = a[i]//2
        else:
            end = True
            break
    if not end :
        cnt+=1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
number = []
count = 0
flag = False

number = list(map(int, input().split()))
while flag != True:
    tmp = []
    for n in number:
        if n % 2 == 0:
            tmp.append(n / 2)

        else:
            flag = True
            break

    if flag:
        print(count)
        break

    number = tmp
    count += 1

Submission status: Accepted

Solution code:
import collections
import sys
import numpy as np
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
MOD = 10**9+7
import itertools
import math

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

Submission status: Accepted

Solution code:
cnt = int(input())
arr = input().split()

counter = 0
shouldBreak = False
while True:
    for i in range(len(arr)):
        if int(arr[i]) % 2 == 1:
            shouldBreak = True
            break;
        arr[i] = int(arr[i])/2
    if shouldBreak:
        break
    counter += 1

print(counter)

Submission status: Accepted

Solution code:
cnt = int(input())
arr = input().split()

def is_all_even(arr):
    for val in arr:
        if int(val) % 2 == 1:
            return False
    return True

counter = 0

while is_all_even(arr):
    for i in range(len(arr)):
        arr[i] = int(arr[i])/2
    counter += 1

print(counter)

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

ans = 0
flag = True
while flag:
    for a in A:
        if a % 2 != 0:
            flag = False
    if flag:
        A = [a // 2 for a in A]
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
ans = 10**10
a = list(map(int,input().split()))
for x in a:
    res = 0
    while x%2 == 0:
        x /=2
        res +=1
    
    ans = min(res,ans)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# B - Shift Only

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

# リストの要素がすべて偶数かどうか判定
while all(a % 2 == 0 for a in A):
	# リストの要素をすべて2で割る
	A = [a / 2 for a in A]
	ans += 1
	
print(ans)

Submission status: Accepted

Solution code:
import numpy as np
N,*A=map(int,open(0).read().split())
A = np.array(A)
for i in range(100000):
  if (A%2<1).all():
    A=A//2
  else:
    print(i)
    exit()

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

print(ans)

Submission status: Accepted

Solution code:
ans = 10**9 # anserの最大値は10の9乗
N =  int(input())
A = list(map(int, input().split()))
for i in A:
    p = 0
    while i % 2 == 0:
        i /= 2 # i = i/2 と同義
        p += 1
    if p < ans:
        ans = p
print(ans)

Submission status: Accepted

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

b = 0

flag = True

while flag:
    for i in range(N):
        if i != N-1:
            if int(float(A[i])) % 2 == 0:
                A[i] = str(int(float(A[i]))/2)
            else:
                flag = False
                break
        else:
            if int(float(A[i])) % 2 == 0:
                A[i] = str(int(float(A[i]))/2)
                b += 1
            else:
                flag = False
                break
print(b)

Submission status: Accepted

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


print(count)

Submission status: Accepted

Solution code:
num = int(input())
l = list(map(int, input().split()))
count=0
index = 0
flag = True

while flag:
    for elmnt in l:
        #print(elmnt)
        if elmnt%2 != 0:
            flag = False
            break
        l[index] = int(l[index]/2)
        index+=1
        count+=1
        #print(elmnt)
    #count+=1
    index = 0

print(int(count/num))

Submission status: Accepted

Solution code:
n = int(input())
ans = 10 ** 9
for a in list(map(int, input().split())):
    cnt = 0
    while a % 2 == 0:
        a //= 2
        cnt += 1
    ans = min(ans, cnt) 
print(ans)

Submission status: Accepted

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

def f(x):
    count=0
    while x%2==0:
        x/=2
        count+=1
    return count
count=min(map(f,a))
print(count)

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
A = list(map(int, input().split()))
A = np.array(A)

i = 0
while 1:
    A = A / 2
    if np.all(A.astype(np.int) == A):
        i += 1
    else:
        break
    
print(i)

Submission status: Accepted

Solution code:
# B - Shift Only
"""
import sys
import clipboard

# テストケースが複数行の場合、iOSだと一気に読み込んでしまうので
# 1行ずつ読み込むように、テキストファイルにいったんコピーする
if sys.platform == 'ios':
	sample = clipboard.get()
	file = open('input_file.txt', 'w')
	file.write(sample)
	file.close()
	sys.stdin = open('input_file.txt')
"""		
						
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:
a = int(input())
b = list(input().split())
count = 0
next = []
e = 0
while e == 0:
  i = 0
  e = 0
  next.clear()
  for i in b:
    e = int(i) % 2
    if e == 1:
      break
    else:
      add = int(i) / 2
      next.append(str(int(add)))
  if e == 0:
    b.clear()
    b.extend(next)
    count += 1
print(count)

Submission status: Accepted

Solution code:
# 配列数Nの入力
N = int(input())
# 配列の入力
in_list = list(map(int,input().split()))
odd_flg = False
cnt = 0

while(not(odd_flg)):
  for n in range(N):
    if (in_list[n]%2) != 0:
      odd_flg = True
      break
    else:
      in_list[n] = int(in_list[n]/2)
  cnt += 1

print(cnt-1)

Submission status: Accepted

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

ans = 0
flag = True

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

Submission status: Accepted

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

times = 0
while True:
    if list(filter(lambda x:x%2==0, a)) == a:
        a = list(map(lambda x: x//2, a))
        times += 1
    else:
        print(times)
        break

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

count = 0

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

print(count)

Submission status: Accepted

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

def main():
    inf = float('inf')
    N = int(readline())
    A = list(map(lambda x: format(int(x), 'b')[::-1], readline().split()))
    cnt = inf
    for a in A:
        cnt = min(a.index('1'), cnt)
    print(cnt)

    return

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:

it = [input() for i in range(2)]
n = int(it[0])
a_list = list(map(int, it[1].split()))

def main():
    print(multi_mapdev(a_list, 0))

def findodd(l):
    filtered = list(filter(lambda e:e%2 == 1, l))
    ##print(len(filtered))
    return (len(filtered) > 0)

def mapdev(l):
    return list(map(int, list(map(lambda e:e/2, l))))

def multi_mapdev(l, cnt):
    if findodd(l):
        return cnt
    else:
        return multi_mapdev(mapdev(l), cnt + 1)

main()

Submission status: Accepted

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

while True:
    for num, a in enumerate(A):
        if a % 2:
            print(cnt)
            break
        else:
            A[num] = a / 2
    if a % 2:
        break
    cnt += 1

Submission status: Accepted

Solution code:
n=input()
a=set(list(map(int,input().split())))
ans=100
for i in a:
  x=bin(i)[::-1].index('1')
  ans=x if ans>x else ans
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in range (n):
    d = 0
    c = -1
    b = a[i]
    while d == 0:
        d = b % 2
        b = b / 2
        c = c + 1

    s.append(c)

res = min(s)

print(res)

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:
import numpy as np
if __name__ == "__main__":
    N = int(input())
    line = input().rstrip().split(' ')
    line = np.array(line).astype("int")
    ans = 0
    while not (line <= 0).any():
        #print((line % 2).sum())
        if (line % 2).sum() == 0:
            ans += 1
            line = line / 2
        else:
            break
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

# xが２で何回割れるかの関数
def how_much_time_divisible(x):
    ans = 0
    
    while x % 2 == 0:
        x /= 2
        ans += 1
    return ans

# リストaの要素すべてに対して、2で何回割れるかの値に置き換えたい（ｂがその置き換わったリストである）
b = map(how_much_time_divisible, a)
# bの要素で最も小さいものが答えである
print(min(b))

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:
from fractions import gcd
N = int(input())
a = [int(x) for x in input().split()]
g = a[0]
for i in range(1,N):
  g = gcd(g,a[i])
ans = 0
while True:
  if g % 2 == 1:
    break
  ans += 1
  g= g // 2
print(ans)

Submission status: Accepted

Solution code:
import sys


def main():

    N = int(sys.stdin.readline().rstrip())
    A = list(map(int, sys.stdin.readline().rstrip().split()))
    
    cnt = 0
    exist_odd = False
    while True:
        for i in range(N):
            if A[i] % 2 != 0:
                exist_odd = True
                
        if exist_odd == True:
            break
            
        for i in range(N):
            A[i] /= 2
        cnt += 1
        
    print(cnt)
        
        
            
    
    
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys


def main():

    N = int(sys.stdin.readline().rstrip())
    A = list(map(int, input().split()))
    
    cnt = 0
    exist_odd = False
    while True:
        for i in range(N):
            if A[i] % 2 != 0:
                exist_odd = True
                
        if exist_odd == True:
            break
            
        for i in range(N):
            A[i] /= 2
        cnt += 1
        
    print(cnt)
        
        
            
    
    
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
ans = 0
while True:
    if all(map(lambda x: x % 2 == 0, A)):
        ans += 1
        A = list(map(lambda x: x/2,A))
    else:
        break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def di(n):
    count=0
    while True:
        if n%2==0:
            n=n//2
            count+=1
        else:
            return count

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

anslist=[]
for i in a:
    anslist.append(di(i))
print(min(anslist))

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 割れる回数(a):
    回数 = 0
    while a % 2 == 0:
        回数 += 1
        a = a//2
    return 回数
割れる回数のリスト = [割れる回数(a_i) for a_i in a]
答え =min(割れる回数のリスト)
print(答え)

Submission status: Accepted

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

def 割れる回数(a):
    回数 = 0
    while a % 2 == 0:
        回数 += 1
        a = a // 2
    return 回数

割れる回数のリスト = [割れる回数(a_i) for a_i in a]
答え = min(割れる回数のリスト)
print(答え)

Submission status: Accepted

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

def fun(a):
    ans = 0
    while a % 2 == 0:
        a /= 2
        ans += 1
    return ans

print(min(map(fun, a_list)))

Submission status: Accepted

Solution code:

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

l = []
ans = 0

for x in range(n):
    for _ in range(10000000):
        if a[x]%2 == 0 and a[x] > 0:
            a[x] = a[x]//2
            ans += 1
            continue
        else:
            l.append(ans)
            ans = 0
            break

print(min(l))

Submission status: Accepted

Solution code:
N = int(input())
n = list(map(int,input().split()))
ans = 0
b = True
while b:
  for j in range(N):
    if n[j] % 2 == 1:
      b = False
    n[j] /= 2
  ans += 1
print(ans-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
cnt = 99999
for i in a:
    cnt = min(cnt, len(bin(i))-bin(i).rfind("1")-1)

print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

for item in A:
    if item % 2 == 1:
        ans = 0
        break
    tmp = 0
    while item % 2 == 0:
        tmp += 1
        item //= 2
    ans = min(ans, tmp)

print(ans)

Submission status: Accepted

Solution code:
def even(A):
  for i in range(0, len(A)):
    if (A[i]%2==1):
      return False
  return True

N=int(input())
A=list(map(int, input().split()))
cnt=0
while(even(A)==True):
  cnt+=1
  for i in range(0, len(A)):
    A[i]/=2
print(cnt)

Submission status: Accepted

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

ans = 0
p = 0
                                                   
while True:
    for i in range(N):
        if S[i] % 2 == 0:
            S[i] = S[i] / 2
        else:
            p += 1
            break
    if p != 0:
        break

    ans += 1                                     
                                                                                                                                                             
print(ans)

Submission status: Accepted

Solution code:
_, *a = map(int, open(0).read().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()))
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:
import numpy as np

_ = int(input())
num_array = np.array(list(map(int, input().split())))

count = 0
while True:
    if any(num_array % 2 != 0):
        break
    num_array = num_array / 2
    count += 1
print(count)

Submission status: Accepted

Solution code:
_ = int(input())

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

count = 0
is_all_even = None 
while True:
    for num in num_list:
        if num % 2 != 0:
            is_all_even = False
            break
    if is_all_even is not None:
        break
    count += 1
    num_list = list(map(lambda x: x / 2, num_list))
print(count)

Submission status: Accepted

Solution code:
import numpy as np
n = int(input())
an = list(map(int, input().split()))

an = np.array(an)

count = 0
while True:
    if sum(an % 2 == 0) == len(an):
        an = an / 2
        count += 1
    else:
        break
print(count)

Submission status: Accepted

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

count = 0

while True:
    success = 0
    i = 0
    for num in li:
        if (num % 2) == 0:
            success += 1
    if(success == N):
        i = 0
        count += 1
        for num in li:
            li[i] = num / 2
            i += 1
    else:
        break
print(count)

Submission status: Accepted

Solution code:
a = int(input())

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

count =0 
counts=0
flag= True
new=[]

while flag==True:
  check=list
  if count>0:
    check=new
    new=[]
  for i in check:
    if i%2 != 0:
      print(count)
      flag=False
      break
    i//=2
    new.append(i)
    counts+=1
    if counts==a:
      counts=0
      count+=1
      break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
b = []
total = 0
x = 0

while 1:
    cnt = 0
    for i in a:
        if i%2==0:
            a[cnt]=i/2
            cnt += 1
        else:
            x += 1
            break
    if x!=0:
        break
    total += 1

print(total)

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
j=0
import sys
while 1:
    for i in range(n):
        if a[i]%2!=0:
            print(j)
            sys.exit()
        else:
            a[i]=a[i]/2
    j+=1

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
 
N = int(input())
a = list(map(int, input().split(" ")))
c = []
 
for i in a:
  count = 0
  while not(i % 2):
    i = int(i / 2)
    count += 1
  c.append(count)
print(min(c))

Submission status: Accepted

Solution code:
input()
arr = list(map(int, input().split()))
def beki(a):
	beki_count = 0
	for i in range(a):
		if a % 2 == 0:
			a /= 2
			beki_count += 1
		else:
			break
	return beki_count
beki_arr = []
for i in range(len(arr)):
	beki_arr.append(beki(arr[i]))
print(min(beki_arr))

Submission status: Accepted

Solution code:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n = ii()
A = iil()

ans = 30

for i in A:
    num = i
    count = 0
    while num%2 == 0:
        num //=2
        count += 1
    ans = min(ans,count)

print(ans)

Submission status: Accepted

Solution code:
# 整数の入力
N = int(input())
# スペース区切りの整数の入力 -> list
A = list(map(int, input().split()))

ret = 0
while all([a % 2 == 0 for a in A]):
  ret += 1
  A = list(map(lambda x: x / 2, A))

print(ret)

Submission status: Accepted

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

checkList = []

def checkCount(num):
    count = 0
    while(num > 0):
        if num % 2 == 0:
            num/=2
            count+=1
        else:
            break
    checkList.append(count)

for num in A:
    checkCount(num)
    
print(min(checkList))

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
ans = float('inf')
for i in A:
  ans = min(ans, len(bin(i)) - bin(i).rfind('1') - 1)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

Solution code:
import sys
import os

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    A = il()
    ans = float('inf')
    for a in A:
        if a % 2 == 0:
            cnt = 0
            while True:
                if a % 2 == 0:
                    a = a // 2
                    cnt += 1
                else:
                    break
            ans = min(ans, cnt)
        else:
            print(0)
            exit()
    else:
        print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

  else:
    ans += 1
print(ans)

Submission status: Accepted

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

number = 10000
for i in list:
  n_2 = 0
  while i%2 == 0:
    i = i /2
    n_2 = n_2 + 1
  if n_2 < number:
    number = n_2
print(number)

Submission status: Accepted

Solution code:
N = int(input())  # ここで標準入力
A = list(map(int, input().split()))
out = 0
flag = True

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

print(out)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
try:
    from typing import List
except ImportError:
    pass

MOD = 2  # type: int


def solve(N: int, A: "List[int]"):

    def f(ai: int):
        ans = 0
        while ai & 1 == 0:
            ai //= 2
            ans += 1
        return ans

    print(min(f(ai) for ai in A))


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())  # 1行目のNを取得する
s = list(map(int, input().split()))  # 複数行の数値の入力を取得
count = 0
tmpListLen = len(s)
halfList = list(filter(lambda x: x % 2 == 0, s))  # 値が偶数のものだけにフィルター

while tmpListLen == len(halfList):
    count += 1
    halfList = map(lambda x: x / 2, halfList)
    halfList = list(filter(lambda x: x % 2 == 0, halfList))
print(count)

Submission status: Accepted

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

while all(i%2==0 for i in li):
  for i in range(n):
    li[i]/=2
  cnt+=1

print(cnt)

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()))
s = 0
def calc_mod(x):
    return x%2
def calc_div(x):
    return x/2
while list(map(calc_mod, a)).count(0) == n:
    s += 1
    a = list(map(calc_div, a))
print(s)

Submission status: Accepted

Solution code:
#import itertools
#import fractions
#import numpy as np
#mod = 10**4 + 7
"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""
 
# Written by NoKnowledgeGG @YlePhan
 
#import math
#mod = 10**9+7
 
 
 
def main():
  n = int(input())
  a = list(map(int,input().split()))
  cnt = 0
  while True:
    for i in range(n):
      if a[i] % 2 == 0:
        a[i] //= 2
      else:
        print(cnt)
        exit()
    cnt += 1
  
  
if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
n = int(input())
line = list(map(int,input().split()))
box = []
for j in line:
  for i in range(31):
    if j % 2**i != 0:
      box.append(i-1)
      break
print(min(box))

Submission status: Accepted

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

Submission status: Accepted

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

while(True):
    e_nums = [n/2 for n in nums if n % 2 == 0]
#    print(nums, ":", e_nums)
    if len(nums) > len(e_nums):
        break
    cnt += 1
    nums = e_nums
print(cnt)

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
A = np.array(list(map(int, input().split())))

ans = 0
while True:
    if np.count_nonzero(A & 1) != 0:
        break
    A = A >> 1
    ans += 1
print(ans)