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 hantei(x):
    t = True
    for i in x:
        if (i % 2 != 0):
            t = False
            break
    return t


def calc_hanbun(x):
    return x // 2


if not (hantei(A)):
    print(0)
    exit()

count = 0
while True:
    if hantei(A):
        A = list(map(calc_hanbun, A))
        count += 1
    else:
        print(count)
        exit()

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
import fractions
N=int(input())
A=list(map(int, input().split()))
GCD = A[0]
for i in range(1,N):
  GCD = fractions.gcd(GCD,A[i])

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

Submission status: Accepted

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

while 1:
    #すべてが偶数か確認
    for i in range(N):
        if A[i] % 2 == 0:
            continue
        else:
            F = 1
    
    if F == 1 : break 

    for i in range(N):
        A[i] = A[i]/2
    n += 1


print(n)

Submission status: Accepted

Solution code:
import sys
import numpy as np
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    N = int(input())
    A = np.array(input().split(), np.int64)
    ans = 0
    while True:
        if np.count_nonzero(A%2==1) == 0:
            A = A//2
            ans += 1
        else:
            break
    print(ans)




if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc081/tasks/abc081_b
n = int(input())
nums = [int(i) for i in input().split()]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin

n = int(stdin.readline().rstrip())
data = stdin.readline().rstrip().split()

i=0

while True:
    for num in data:
        if int(num) % (2 ** i) > 0:
            print(i-1)
            exit(0)
    i = i + 1

Submission status: Accepted

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

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

print(num)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()
*A, = 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 = input()
*A, = map(int,input().split(" "))
cnt = 0
end = 0
while end==0:
  f = 0
  for i in A:        #A = [8, 12, 40] 
    if(i % 2 == 1):
      end=1
    A[f] = i/2
    f += 1
  cnt+= 1
cnt-=1
print(cnt)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import numpy as np

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

cnt = 0
while(True):
	A = A / 2
	if sum(A % 1) > 0:
		break

	cnt += 1
	    
print(cnt)

Submission status: Accepted

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

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

flag = True
cnt = 0
while(flag):
	for a in (A):
		if a % 2 == 1:
			flag = False
			break

	if flag:
		for i in range(N):
			A[i] = A[i] / 2
		cnt += 1
	    
print(cnt)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

n=0
while 1:

    #すべで偶数かチェック
    for i in range(N):
        if A[i]%2==0:
            continue
        else:
            F=1
    
    if F==1:break

    for i in range(N):
        A[i]=A[i]/2
    n+=1

print(n)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

Solution code:
import sys
import os
import math
import string

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, 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()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

MOD = 10 ** 9 + 7


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

    N = ii()
    A = il()
    ret = 0
    while all(a % 2 == 0 for a in A):
        A = [a//2 for a in A]
        ret += 1
    print(ret)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

a = int(input())

# 文字列の入力
s = input()

a = s.split(" ")
d = []
for b in a:
    d.append(int(b))

#print(d)

ans=0

while(1):
    c=1
    flg=0
    for b in d:
        if b%2==1:
            flg=1
    if flg==0:
        ans=ans+1
    else:
        break
    for i in range(len(d)):
        d[i]=d[i]/2

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
flag = False
for k in range(5*10**8):
    for i in range(N):
        if A[i]%2==1:
            flag = True
            print(k)
            break
        A[i] = A[i]/2
    if flag:
        break

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
is_even = list(map(lambda x:x%2==0, a))
counter = 0
while is_even.count(False) == 0:
    a = list(map(lambda x:x/2, a))
    counter+=1
    is_even = list(map(lambda x:x%2==0, a))

print(counter)

Submission status: Accepted

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

def shiki(x):
    cnt=0
    while x%2==0:
        cnt+=1
        x/=2
    return cnt

for i in range(n):
    ans=min(ans,shiki(a[i]))

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

count = 0

while True:
    exist_odd = False

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

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = 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:
def db2(value):
    result=0
    while value%2==0:
        value/=2
        result+=1
    return result

n,*l=open(0).read().split()
print (min(list(db2(int(x)) for x in l)))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
A=[int(i) for i in 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:
intLen = input()
intList = list(map(int, input().split()))
count = 0

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

            

if '__main__' == __name__:
    resolve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def is_all_even(li):
    for x in li:
        if x % 2 != 0:
            return False

    return True


def all_div_2(li):
    for i in range(len(li)):
        li[i] /= 2

    return li


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

while is_all_even(a):
    a = all_div_2(a)
    cnt += 1

print(cnt)

Submission status: Accepted

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


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

counter = -1
flag = 0
while flag == 0:
    for i in A:
        if (i%2 == 0):
            continue
        else:
            flag = 1
    counter += 1
    A = [i//2 for i in A]

print(counter)

Submission status: Accepted

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

res = 1000
for a in A:
    cnt = 0
    while a%2 == 0:
        a = (a//2)
        cnt += 1
    res = min(res, cnt)
print(res)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
icase=0
if icase==0:
    import sys
    n=int(input())
    a=list(map(int,input().split()))
    for i in range(40):
        for ii in range(n):
            aii=a[ii]
            a[ii]=aii//2
            if aii%2==1:
                print(i)
                sys.exit()

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
count = 0
    
while "e" not in A:
    A = [x//2 if x%2 == 0 else "e" for x in A]
    count += 1

print(count - 1)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
count = 0
    
while "a" not in A:
    A = [x//2 if x%2 == 0 else "a" for x in A]
    count += 1

print(count - 1)

Submission status: Accepted

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

n=0
t=0
while 1:
    #すべて偶数かチェック
    for i in range(N):
        if A[i]%2 !=0:
            t=1
    
    if t==1:break

    for i in range(N):
        A[i]=A[i]/2
    n+=1
print(n)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
num = int(input())
line = list(map(int,input().split()))
count = True
count_num = 0
while count:
    for i in range(num):
        if line[i] % 2 != 0:
            count = False
    if count:
        for i in range(num):
            line[i] /= 2
    count_num += 1
print(count_num-1)

Submission status: Accepted

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

counter=0 #答え（初期化）


while True:
    flag_cando=1 #操作可能フラグ
    for i in range(N):
        if A[i]%2!=0: #奇数
            flag_cando=0
            break
    if flag_cando==0:
        break
    else: #奇数のものが無かったら
        #全ての数値を2で割る
        for i in range(N):
            A[i]=int(A[i]/2)
        #操作カウントを増やす
        counter+=1

print(counter)

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split(' ')))
flg = True
b = 2
cnt=0
while flg:
    for i in range(n):
        if(a[i]%b!=0):
            flg=False
            break
    if not(flg):
        break
    b*=2
    cnt+=1
print(cnt)
#print(b)

Submission status: Accepted

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

res = 10**9
for a in al:
    c = 0
    while a%2==0:
        a //= 2
        c += 1
    res = min(res, c)
print(res)

Submission status: Accepted

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

cntDiv = 0
for i in range(10**10):
  cnt =0
  for j in range(n):
    if a[j]%2==0:
      a[j] = a[j]/2
      cnt += 1
  if cnt != n:
    break
  else:
    cntDiv +=1
    continue
print(cntDiv)

Submission status: Accepted

Solution code:
# solution
import io

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

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
    ans = min(cnt, ans)

print(ans)

Submission status: Accepted

Solution code:
import sys
N = int(input())
A = list(map(int, input().split()))
ans = 0
for i in range(1000):
    for i in range(len(A)):
        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=list(map(int, input().split()))

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

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
 
count = 0
while True:
  A, mod = zip(*[divmod(a, 2) for a in A])
  if sum(mod) > 0:
    break
  count += 1
print(count)

Submission status: Accepted

Solution code:

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

while err == 0:
    count = 0
    for nom in l:
        if nom % 2 == 1:
            err = 1
            count += 1
        else:
            l[count] = nom / 2
            count += 1
    if err == 0:
        total += 1
print(total)

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

Solution code:
s = int,input()
i = list(map(int,input().split()))
err = 0
total = 0

while err == 0:
    count = 0
    for nom in i:
        if nom % 2 == 1:
            err = 1
            count += 1
        else:
            i[count] = nom / 2
            count += 1
    if err == 0:
        total += 1

print(total)

Submission status: Accepted

Solution code:
s = int,input()
i = list(map(int,input().split()))
err = 0
total = 0
while err == 0:
    count = 0
    for nom in i:
        if nom % 2 == 1:
            err = 1
            count += 1
        else:
            i[count] = nom / 2
            count += 1
    if err == 0:
        total += 1
print(total)

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 = [one // 2 for one in A]
    ans += 1

print(ans)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
# from math import factorial,sqrt,ceil,gcd
# from itertools import permutations as permus
# from collections import deque,Counter
# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

import numpy as np
# from scipy.sparse.csgraph import shortest_path, dijkstra, floyd_warshall, bellman_ford, johnson
# from scipy.sparse import csr_matrix

# strlist = "abcdefghijklmnopqrstuvwxyz"
N = int(input())
arrA = np.array(input().split(),dtype=np.int64)

def check():
    temp = arrA % 2
    if 1 in temp:
        return False
    return True

ans = 0
while check():
    arrA = arrA // 2
    ans += 1

print(ans)
# print(*ans)   # unpackして出力。間にスペースが入る
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する
# print("{:.10f}".format(ans))
# print("{:0=10d}".format(ans))

Submission status: Accepted

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

while True:
    Ajudge = []
    for i in range(N):
        Alista = Alist[i]
        Ajudge.append(Alista % 2)
    if Ajudge.count(0) != N:
        break
    else:
        Alist = list(map(lambda x:x / 2, Alist))
        counter += 1

print(counter)

Submission status: Accepted

Solution code:
import math
def main():
    N = int(input())
    A = [int(a) for a in input().split()]
    M = math.floor(math.log2(max(A)))
    count = 0
    for _ in range(M):
        success = True
        for i in range(N):
            if A[i] % 2 == 0:
                A[i] /= 2
            else:
                success = False
                break
        if success == False:
            break
        count += 1
    print(count)
main()

Submission status: Accepted

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

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = input()
Aa = A.split()
base = int(Aa[0])
times = N+1
y = 0
while base%2 == 0:
  y += 1
  base /= 2

if y != 0:
  for i in Aa[1:times]:
    i = int(i)
    x = 0
    while i%2 == 0:
      x += 1
      i /= 2
    if y >= x:
      y = x
        
print(y)

Submission status: Accepted

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

def devide2(n):
    return n / 2

ans = 0
while True:
    a = list(map(devide2, a))
    if all([n.is_integer() for n in a]):
        ans += 1
    else:
        break

print(ans)

Submission status: Accepted

Solution code:
import sys
import os
import math

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, 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()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

MOD = 10 ** 9 + 7


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

    N = ii()
    A = il()
    ret = 0
    while all([n % 2 == 0 for n in A]):
        ret += 1
        A = [a // 2 for a in A]
    print(ret)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def sunukee(a):
    num = 0
    for i in range(len(a)):
        if (a[i] % 2) == 0:
            num += 1
        #2で割れるか確かめる
    if num == len(a):
        return True
    else:
        return False
def sunuke(a):
    for i in range(len(a)):
        a[i] = a[i]/2
    return a
n = int(input())
a = list(map(int, input().split()))
s = 0
while sunukee(a):
    a = sunuke(a)
    s += 1
print(s)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(func(N,A))

Submission status: Accepted

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

def count_howmany_divide(val):
  result = 0

  while(True):
    if val % 2 != 0:
      break
    else:
      val /= 2
      result += 1

  return result
    

a_i_divided = list(map(count_howmany_divide, a_i))

print(min(a_i_divided))

Submission status: Accepted

Solution code:
def are_even(data):
    return all([i % 2 == 0 for i in data])

N = input()
data = list(map(int, input().split()))
count = 0
while are_even(data):
    data = [i/2 for i in data]
    count += 1
print(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 == 1:
            print(ans)
            exit()
        
        a[i] /= 2
    ans += 1

Submission status: Accepted

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

for a in A:
    i = 0
    while True:
        if a % 2 == 0:
            i += 1
            a = a // 2
        else:
            break
    count.append(i)

print(min(count))

Submission status: Accepted

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

j = 0
l = len(A)

while 1:
    count = 0
    for i in A:
        if i % 2 == 0:
            count += 1

    if count == l:
        j += 1
        for i in range(l):
            A[i] = A[i] // 2
    else:
        break

print(j)

Submission status: Accepted

Solution code:
def howmanytimes(j):
  counter=0
  while j%2==0:
    j/=2
    counter+=1
  return counter

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

Submission status: Accepted

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

M = 10 ** 7
for num in A:
    cnt = 0
    while num % 2 == 0:
        num //= 2
        cnt += 1
    M = min(cnt, M)
print(M)

Submission status: Accepted

Solution code:
# ABC 081: B – Shift only
n = int(input())
a = [int(s) for s in input().split()]

m = 0
canDivided = True

while canDivided:
    for i in range(len(a)):
        if a[i] % 2 == 0:
            a[i] //= 2
        else:
            canDivided = False
            break
    else:
        m += 1

print(m)

Submission status: Accepted

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

count = 0

divide_two_num = []
for i in A:
    n = 0
    while i > 1:
        if i % 2 == 0:
            i //= 2
            n += 1
        else:
            break
    divide_two_num += [n]

print(min(divide_two_num))

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())
data = list(map(int,input().split())) 
flg = 0 
ct = 0
while flg ==0:
    ct += 1
   # print(data)
    for i in range(n):
        if data[0]%2 == 0:
           
            data.append(data[0]//2)
            del data[0]
        else:
            flg = 1
            break
print(ct-1)

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int,input().split()))
mini=100100100100
for i in range(N):
  a=A[i]
  c=0
  while a%2==0:
    a//=2
    c+=1
  if mini>c:
    mini=c
print(mini)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input()) 
b=0
flag=0
i = list(map(int, input().split()))

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

Submission status: Accepted

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

sub = (10 ** 9) + 1
for i in range(n):
    ans = 0
    while a[i] % 2 == 0 and a[i] != 0:
        a[i] = a[i] // 2
        ans += 1
    sub = min(ans, sub)
    
print(sub)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int,input().split()))
count=0
while True:
    if[i for i in A if i%2==1]:
        break
    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()))
A=[]
for i in range(n):
    x=0
    for j in range(10**5):
        if a[i]%2==0:
            a[i]//=2
            x+=1
        if a[i]%2!=0:
            A.append(x)
            break
print(min(A))

Submission status: Accepted

Solution code:
def f(a):
    a = int(a)
    ans = 0
    while a%2==0:
        a //= 2
        ans += 1
    return ans

_ = input()
A = map(f, input().split())
print(min(A))