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

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

print(min(ans))

Submission status: Accepted

Solution code:
from collections import defaultdict

def check(a, pre):
    ans = 0
    while a % 2 == 0:
        ans += 1
        a //= 2
        if ans == pre:
            break
    return ans


def main():
    num = int(input())
    data = list(map(int, input().split()))

    ans = check(data[0], 10 ** 10)
    for i in range(1, num):
        ans = min(ans, check(data[i], ans))
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

ans = [0]*N

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

print(min(ans))

Submission status: Accepted

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

n_operation = 0
while True:
  new_A_list = []
  for A in A_list:
    if A % 2:
      print(n_operation)
      exit()
    else:
      new_A_list.append(A // 2)
  # Update
  A_list = new_A_list
  n_operation += 1

Submission status: Accepted

Solution code:
N = int(input())
L = [int(i) for i in input().split()]
ct = 0
i = 0
while(i <= N):
  if i == N:
    ct += 1
    i = 0
  elif L[i] % 2 == 0:
    L[i] //= 2
    i += 1
  else:
    print(ct)
    break

Submission status: Accepted

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

    ans = min(ans, ans_i)

print(ans)

Submission status: Accepted

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

print(count - 1)

Submission status: Accepted

Solution code:

N = input()

lst_A = input().split()

ans = 0

flag = True

for i in range(len(lst_A)):
    lst_A[i] = int(lst_A[i])

while 1:
    for i in range(len(lst_A)):
        W = lst_A[i] % 2
        if W == 1:
            flag = False
            break

    if flag == False:
        break

    for i in range(len(lst_A)):
        lst_A[i] = lst_A[i] / 2

    ans += 1

print(ans)

Submission status: Accepted

Solution code:
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:
int(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())
A = [int(i) for i in input().split()]
cnt = 0    
flag = 1

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

def check(li):
    for i in li:
        if i%2 != 0:
            return 0
        else:
            continue
    return 1
    
flag = check(A)
while flag == 1:
    A = list(map(calc_half, A))
    cnt += 1
    flag = check(A)
print(cnt)

Submission status: Accepted

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

def d(a, c):
    for index, item in enumerate(a):
        if item % 2 == 0:
            a[index] = int(item / 2)
        else:
            return c
    c += 1
    return d(a, c)

print(d(a, c))

Submission status: Accepted

Solution code:
import copy
n=int(input())
a=input().split(" ")
count = 0
t=True
while t:
  b=[]
  for j in a:
    if int(j)%2 == 0:
      b.append(int(j)/2)
    elif int(j)<2:
      t=False
    else:
      t=False
  if t==False:
    break
  count = count+1
  a=copy.deepcopy(b)
print(count)

Submission status: Accepted

Solution code:
import sys

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

Submission status: Accepted

Solution code:
N = int(input())
A = [int(i) for i in 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()))
counter = 0
flag = True

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

Submission status: Accepted

Solution code:
import numpy as np

N = int(input())
num_list = np.array(list(map(int, input().split())))
count = 0
    
while(True):
    if any(num_list % 2 == 1):
            print(count)
            break
    else:
        num_list= num_list / 2
        count += 1

Submission status: Accepted

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

Submission status: Accepted

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

while len([i for i in a if i % 2 == 0]) == n :
    a = [i / 2  for i in a ]
    inc +=1

print(inc)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
_ = input()
data_list = [int(e) for e in input().split()]
cnt = 0
end_flag = False
for i in range(10000):
    for i in range(len(data_list)):
        if data_list[i] % 2 == 0:
            data_list[i] /= 2
        else:
            end_flag = True
            break
    if end_flag == True:
        break
    else:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
N = int(input())
s = list(map(int,input().split()))
count = 0
while(1):
    for x in range(N):
        if s[x]%2!=0:
            print(count)
            exit()
    count += 1
    s = [x//2 for x in s]

Submission status: Accepted

Solution code:
def is_even(list):
    ans = True
    for i in list:
        if i % 2 != 0:
            ans = False
            break
    return ans            

def devide(list):
    ans = 0
    if is_even(list):
        next_list = [i/2 for i in list]
        ans = devide(next_list)
        ans = ans + 1
    return ans


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

answer = devide(list)

print(answer)

Submission status: Accepted

Solution code:
n = int(input())
a = 10 ** 9
for b in map(int,input().split()):
    i = 0
    c = int(b)
    while c // 2 == c / 2:
        i = i + 1
        c = c/2
    if i < a:
        a = i

print(a)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
str = input()
N = int(str)

A = []
str = input().split()
for i in range(N):
    A.append(int(str[i]))

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

print(cnt)

Submission status: Accepted

Solution code:

n = int(input())
num = [ int(v) for v in input().split() ]
def pow_2(m):
	t = 0
	while m % 2 == 0:
		m //= 2
		t += 1
	return t


num = [ pow_2(i) for i in num ]
print(min(num))

Submission status: Accepted

Solution code:
import numpy as np

length = int(input())
nums = np.array(list(map(int, input().split())))
count = 0
while (nums % 2 == 0).all():
    count += 1
    nums = nums // 2

print(count)

Submission status: Accepted

Solution code:
import sys
def recurcive(n,length,result):
    tmp=[]
    for _ in range(length):
        if n[_]%2==0:
            tmp.append(int(n[_]/2))
            #c+=1
        else:
            print(result)
            sys.exit()
            #return result
    #print(tmp)
    result+=1
    #print("result=",result)
    recurcive(tmp,length,result)

    

length=int(input())
n=list(map(int,input().split(" ")))
recurcive(n,length,0)

Submission status: Accepted

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

#A内のaすべてが偶数の場合
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 = float('inf')

for i in range(N):
    count = 0

    while A[i] % 2 == 0:
        A[i] /= 2
        count += 1

    if res > count:
        res = count

print(res)

Submission status: Accepted

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

count = 0
flg = True

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

Submission status: Accepted

Solution code:
n=int(input())
l=list(map(int,input().split()))
c=0
while True:
  l1=[]
  for item in l:
    if item%2==0:
      l1.append(item/2)
  if len(l1)==n:
    l=l1
    c+=1
  else:
    break
print(c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n = int(input())
an = list(map(int, input().split()))
count = 0
while True:
	amari = list(map(lambda x: x % 2, an))
	an = list(map(lambda x: x / 2, an))
	if 1 in amari:
		break
	else:
		count += 1
print(count)

Submission status: Accepted

Solution code:
import sys
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def MI(): return map(int, sys.stdin.readline().split())
def II(): return int(sys.stdin.readline())


n = II()
a = LI()
cnt = 0
while all(num % 2 == 0 for num in a):
    cnt += 1
    a = list(map(lambda x: x // 2, a))
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
ans = 10**9
a = int(input())
b = list(map(int,input().split()))
for i in b:
  num = 0
  while i%2 == 0:
    i //= 2
    num += 1
  if num < ans:
    ans = num
print(ans)

Submission status: Accepted

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

for i in range(N):
    number = A[i]
    multiplier = 0
    while True:
        if number % 2 == 0:
            multiplier += 1
            number /= 2
        else:
            break
    multiplier_list.append(multiplier)
print(min(multiplier_list))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
N=int(stdin.readline().rstrip())
data=[int(x) for x in stdin.readline().rstrip().split()]
ans=[]
for i in data:
    cnt = 0
    while i % 2 == 0:
        i = i / 2
        cnt += 1
    ans.append(cnt)
print(min(ans))

Submission status: Accepted

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

ans_list=[]
for j in range(n):
    m=0
    while a[j]%2==0:
        m+=1
        a[j]=a[j]//2
    ans_list.append(m)
ans_list.sort()
print(ans_list[0])

Submission status: Accepted

Solution code:
n = input()
list = [int(x) for x in input().split()]
count = 0
while True:
    for num in list:
        if not num % 2 == 0:
            print(count)
            break
    else:
        list = [x/2 for x in list]
        count += 1
        continue
    break

Submission status: Accepted

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

while True:
    if (any([x % 2 for x in A])):
        break

    A = [x / 2 for x in A]
    count+=1

print(count)

Submission status: Accepted

Solution code:
n = int(input())
result = 0
for a in input().strip().split():
    result |= int(a)
count = 0
while result:
    if result & 1 == 1:
        print(count)
        break
    result >>= 1
    count += 1

Submission status: Accepted

Solution code:
_,*a=map(int,open(0).read().split());c=-1
while all(a):c+=1;*a,=map(lambda x:(x//2)*(x%2<1),a)
print(c)

Submission status: Accepted

Solution code:
n=int(input())
a= [int(x) for x in input().split()]
ans=0
ng=0
while ng==0:
	for i in range(len(a)):
		if a[i]%2!=0:
			ng=1
			break
	if ng==0:
		for i in range(len(a)):
			a[i]/=2
		ans+=1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input()
n=eval(input().replace(' ','|'))
print(len(bin(n&-n))-3)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

count = 0
flg = 0

while flg == 0:
  for i in range(row):
    if number[i] % 2 == 1:
    	flg = 1
    	break
    else:
      number[i] = number[i] / 2
  count += 1

print(count-1)

Submission status: Accepted

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

for x in range(n):
    count=0
    while a[x]%2==0:
        a[x]=int(a[x]/2)
        count=count+1
    countlist.append(count)

print(min(countlist))

Submission status: Accepted

Solution code:
def pdw(n):
    i=2
    t=[]
    ta = t.append
    while i*i<=n:
        while n%i==0:
            n//=i
            ta(i)
        i+=1
    if n>1:ta(n)
    return t.count(2)
N = int(input())
print(min([pdw(c) for c in list(map(int,input().split()))]))

Submission status: Accepted

Solution code:
count = 0
n = int(input())

def judge(a):
    ans = True
    for ai in a:
        if ai % 2 != 0:
            ans = False
            break
    return ans

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

while judge(a):
    for (i, ai) in enumerate(a):
        a[i] = ai / 2
    count += 1

print(count)

Submission status: Accepted

Solution code:
count = 0
n = int(input())

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

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

print (count)

Submission status: Accepted

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

count1 = 0
flag1 = False

while flag1 == False:
    for index in range(num1):
        if list1[index] % 2 == 0:
            list1[index] = list1[index]/2
            if index == num1-1:
                    count1+=1
        else:
            flag1 = True
            break

print(str(count1))

Submission status: Accepted

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

ans = 30
cnt = 0
for i in range(N):
    p = A[i]
    while p % 2 == 0 and cnt < ans:
        p = p / 2
        cnt += 1
    else:
        ans = cnt
        cnt = 0
print(ans)

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

def includeOdd(l):
    ans = False
    for i in range(n):
        if l[i] % 2 == 1:
            ans = True
    return ans


while True:
    if includeOdd(li):
        break
    li = [x / 2 for x in li]
    count += 1
    
print(count)

Submission status: Accepted

Solution code:
import sys

num = input()
n_list = list(int(i) for i in input().split())
count = 0

while True:
  for index, n in enumerate(n_list):
    if n % 2 == 1:
      print(count)
      sys.exit()
    n_list[index] = n / 2
  count += 1

Submission status: Accepted

Solution code:
from sys import stdin

N = int(stdin.readline().rstrip())
list = [int(x) for x in stdin.readline().rstrip().split()]

result = -1
flag = 1
while(flag == 1):
  for i in range(0, N):
    if(list[i]%2==0):
      list[i] = list[i] / 2
    else:
      flag = 0
  result += 1

print(result)

Submission status: Accepted

Solution code:
def count_two_div(num: int):
    count = 0
    while True:
        if num % 2 == 0:
            count += 1
            num /= 2
        else:
            break
    return count


if __name__ == '__main__':
    n = int(input())
    c = list(map(int, input().split()))
    div_count_list = list(map(count_two_div, c))
    print(min(div_count_list))

Submission status: Accepted

Solution code:
n = int(input())
a = [int(x) for x in input().split()]
l = []
def wari(b):
    count = 0
    while b % 2 == 0:
        count = count + 1
        b = b / 2
    return count
for i in range(n):
    x = a[i]
    ans = wari(x)
    l.append(ans)
print(min(l))

Submission status: Accepted

Solution code:
#Shift only
x = int(input())
y = input()
z = y.split(" ")
black = [int(s) for s in z]
cnt = 0
count = 0
while True:
    for i in range(x):
        if(black[i] % 2 == 0):
            cnt += 1
    if(cnt == x):
        cnt = 0
        count += 1
        for i in range(x):
            black[i] = black[i] / 2
    else:
        print(count)
        break

Submission status: Accepted

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

# カウンタ
c=0

# ループ脱出フラグ
f=False

while True:
  # 各整数を割る
  for i in range(len(l)):
    if l[i]%2==0:
      l[i]//=2
    else:
      # 割り切れない数があった場合はフラグを立てる
      f=True
      break
  # カウンタを加算
  c+=1

  # フラグが立ったらループ終了
  # カウンタを一回多く加算しているので減らす
  if f:
    c-=1
    break

# 出力
print(c)

Submission status: Accepted

Solution code:
N = int(input())
a = [int(x) for x in input().split()]
b = 0
while len(list(filter(lambda i : i % 2 != 0, list(a)))) == 0 :
    a = list(map(lambda x: x/2, a))
    b += 1
print(b)

Submission status: Accepted

Solution code:
n = int(input())
li = input().split()
li = [int(s) for s in li]
l=len(li)

count = 0
flag = 1

while True:
    if flag == 1:
        for n in range(l):
            if li[n]%2 == 0:
                li[n] /= 2
            else:
                flag -= 1
                break
        if flag == 1:
            count += 1
                    
    elif flag == 0:
        break
        
print(count)

Submission status: Accepted

Solution code:
def is_all_even(seq):
    for i in seq:
        if i % 2 != 0:
            return False
    return True


N = int(input())
A = [int(s) for s in input().split()]

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

Submission status: Accepted

Solution code:
def is_even_all(nums):
    """
    偶数判定
    :param nums:Int型のList
    :return: 判定結果(Boolean型)
    """
    for i in nums:
        if i % 2 != 0:
            return False

    return True


def divide_by_2(num):
    """
    :param num: 数値(Int型)
    :return: 計算結果
    """
    return int(num / 2)


input()

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

# 操作回数
operate_count = 0
can_operate = is_even_all(num_list)

while can_operate:
    operate_count += 1
    num_list = list(map(divide_by_2, num_list))

    can_operate = is_even_all(num_list)

print(operate_count)

Submission status: Accepted

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

Submission status: Accepted

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

answer = 0
isExsistOdd = False

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

print(answer)

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 = input()
num = [int(i) for i in input().split()]
count = 0
end=False
while(True):
	div = []
	for i in num:
		if(i % 2 == 0):
			div.append(i/2)
		else:
			print(count)
			end = True
			break
	if(end == True):
		break
	num = div
	count = count + 1

Submission status: Accepted

Solution code:
def Count(n):
  cnt=0
  while n%2==0:
    cnt+=1;n/=2;
  return cnt

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

ans=100
for i in a:
  ans=min(ans,Count(i))
print(ans)

Submission status: Accepted

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

min = 10**9
for a in A:
  s = bin(a)
  for k in range(len(s)):
    if s[-k]=='1':
      temp_min = k-1
      break
  if temp_min < min:
    min = temp_min
    
print("{}".format(min))

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
n = input()
v = list(input().split())

cnt = 0
flg = True
while flg:
  for i in range(len(v)):
    if int(v[i]) %2 == 0:
      pass
    else:
      flg = False
    v[i] = int(v[i])/2
  cnt = cnt + 1

print(cnt - 1)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

Solution code:
N = int(input())

a = input().split()

A = [int(s) for s in a]   #strのリストをintのリストに変換


Time = 0
i = 0


while i < N:
	if A[i] % 2 == 0:
		i += 1

		if i == N:
			for j in range(N):
				A[j] = A[j] / 2
			
			Time += 1
			i = 0

	elif A[i] % 2 == 1:
		break

	
	

print(Time)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
lis = list(map(int,input().split()))
y = 0
while True:
    x = 0
    for i,v in enumerate(lis):
        j = v/2
        lis[i] = j
        if j.is_integer():
            x += 1
    if not x == n:
        break
    y += 1

print(y)

Submission status: Accepted

Solution code:
_ = input()
l = list(map(int,input().split()))
mn = 99999
for i in l:
  count = 0
  while True:
    if i %2 ==0:
      count +=1
      i = int(i/ 2)
    else:
      break
  if mn > count:
    mn = count
print(mn)

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    A = [int(_) for _ in input().split(" ")]

    counter = 0
    loop_flag = True

    while loop_flag:
        num_counter = 0
        for i in range(N):
            if A[i]%2 == 0:
                A[i] = A[i]/2
                num_counter += 1
            else:
                loop_flag = False

        if num_counter == N:
            counter += 1

    print(counter)

main()

Submission status: Accepted

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

A = np.array(A)

cnt = 0

while True:
    if (A%2).sum() == 0:
        A = A/2
        cnt += 1
    else:
        break
print(cnt)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
num = 0
while 1:
  A2 = list(map(lambda x: x%2, A))
  if A2.count(1):print(num);break
  num += 1
  A = list(map(lambda x: x>>1, A))

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    N = int(input())
    A = list(map(int, input().split()))

    answer = 0
    for i in range(max(A)):
        is_all_even = True
        for a in A:
            if a % 2 != 0:
                is_all_even = False
                break
        if is_all_even == True:
            answer += 1
            A = list(map(lambda x:int(x / 2), A))
        else:
            break
    print(answer)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin

N = int(input())
A = [int(x) for x in stdin.readline().rstrip().split()]

cnt = 0

for a in A :
    if a % 2 != 0 :
        break
    else:
        c = 0
        while a % 2 == 0 :
            c = c + 1
            a = a / 2
        
        if cnt == 0 or cnt > c :
            cnt = c
    

print(int(cnt))

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
A = np.array(list(map(int, input().split())))
cnt = 0
flg = True
while flg:
    if np.all(A % 2 == 0):
        cnt += 1
        A = A / 2
    else:
        flg = False
print(cnt)

Submission status: Accepted

Solution code:
N = int(input())
x = list(map(int, input().split()))
mn_lst = []
for i in x:
    cnt = 0
    while i % 2 == 0:
        cnt += 1
        i >>= 1
    mn_lst.append(cnt)
    
print(min(mn_lst))

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int,input().split()))
ans = 0
for i in range(1,30):
    count = 0 
    for j in a: 
        if j%2**i == 0:
            count += 1
    if count == n:
        ans +=1  
print(ans)

Submission status: Accepted

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

ans = 10**10

for i in range(N):
    a = 0
    while True:
        if A[i] % 2 != 0:
            break
        A[i] /= 2
        a += 1
    ans = min(a,ans)
print(ans)

Submission status: Accepted

Solution code:
# B - Shift only
N = int(input())
data = list(map(int, input().split()))

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

ans = min(list(map(div, data)))
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split(' ')))
cnt = 0
while sum(x%2==0 for x in a) == n:
    a = list(map(lambda x: x / 2 if x % 2 == 0 else x, a))
    cnt += 1
print(cnt)

Submission status: Accepted

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

def div_num(n):
  ans = 0
  while n % 2 == 0:
    n /= 2
    ans += 1
  return ans

answer = min(list(map(div_num, a)))
print(answer)

Submission status: Accepted

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

answer = 0
while True:
  for i in A:
    if i % 2 != 0:
      break
  else:
    answer += 1
    A = [int(a/2) for a in A]
    continue
  break

print(int(answer))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
x=0
for i in a:
    x = x|i
x=bin(x)
cnt = 0
while(1):
    if x[-1-cnt] == '0':
        cnt += 1
    else:
        break
print(cnt)

Submission status: Accepted

Solution code:
N = input()
data = list(map(lambda x :int(x),input().strip().split()))
data.sort()
tmp = data[0]
cnt =0
while tmp >1:
    if sum(list(map(lambda x:x%(2**(cnt+1)), data))) >= 1:break
    tmp//=2
    cnt+=1
print(cnt)

Submission status: Accepted

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

i = 0
count = -1
flg = True
while flg:
	count += 1
	for i in range(N):
		if A[i]%2 == 1:
			flg = False
		A[i] = A[i]/2
		i += 1

print(count)

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

Submission status: Accepted

Solution code:
def ipt(N=0,switch=0):
    if N == 0:
        return list(map(int,input().split()))
    else:
        if switch==0:
            return [list(map(int,input().split())) for _ in range(N)]
        else:
            return [int(input()) for _ in range(N)]

N=int(input())
A=ipt()
min=4**9
for i in range(N):
    cnt=0
    while(A[i]%2==0):
        A[i] = A[i]//2
        cnt += 1
    if min > cnt:
        min=cnt
print(min)

Submission status: Accepted

Solution code:
import sys
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)