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:


# Press the green button in the gutter to run the script.
if __name__ == '__main__':
    s = int(input())
    x = [list(map(int, input().split())) for i in range(1)]

    count = 0
    while True:
        flg = False
        for n in range(len(x[0])):
            if x[0][n] % 2 == 1:
                flg = True
                break
            x[0][n] = x[0][n] / 2
        if flg:
            break

        count = count + 1

    print(count)

Submission status: Accepted

Solution code:
# coding: utf-8

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

count = 0
imp = 0

while True:
    for i in range(0, N):
        if int(A[i]) % 2 == 1:
            imp = 1
            break

    if imp == 1:
        break

    for i in range(0, N):
        A[i] = int(A[i] / 2)
    count += 1

print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

cnt = 0
while True:
  check = sum([n % 2 for n in S])
  if check == 0:
    S = [n/2 for n in S]
    cnt += 1
  else:
    break
    
print(cnt)

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, = map(int, input().split())
ans = 0
while True:
    ok = True
    for i in range(N):
        if A[i] % 2 != 0:
            ok = False
            break
        A[i] //= 2
    if not ok:
        break
    ans += 1
print(ans)

Submission status: Accepted

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

while True:
    if len([i for i in l if i%2 == 1]) == 0:
        cnt += 1
        l = [int(s/2) for s in l]
    else:
        break

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def divide_by_two(a):
    cnt = 0
    while True:
        if a % 2 == 0:
            a //= 2
            cnt += 1
        else:
            break

    return cnt


def main():
    n = int(input())
    a_list = list(map(int, input().split()))
    ans = 10 ** 9

    for a in a_list:
        ans = min(ans, divide_by_two(a))

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int,input().split()))
ans = 0
def GCD(a,b):
    if a < b:
        a,b = b,a
    while a % b != 0:
        a,b = b, a % b
    return b
if __name__ =="__main__":
    for i in range(N-1):
       A[i+1] = GCD(A[i],A[i+1])
    while A[N-1] % 2 == 0:
        A[N-1] //= 2
        ans += 1
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

def is_all_even(nums):
    for n in nums:
        if n % 2 == 1:
            return False
    return True

ret = 0
while is_all_even(a_n):
    i = 0
    for a in a_n:
        a_n[i] = a / 2
        i += 1
    ret += 1

print(ret)

Submission status: Accepted

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

    min_two_count = 2 ** 30

    for i in range(len(a)):
        temp_two_count = 0
        while a[i] % 2 == 0:
            temp_two_count += 1
            a[i] = a[i] // 2

        if min_two_count > temp_two_count:
            min_two_count = temp_two_count

    print(min_two_count)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

l = 10**6

for i in List:
  k=0
  while i%2 == 0:
    i/=2
    if i==0: break
    k+=1
    
  l = min(k,l)

print(l)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
readline = stdin.buffer.readline
read = stdin.buffer.read
def i_input(): return int(input().rstrip())
def i_map(): return map(int, input().rstrip().split())
def i_list(): return list(i_map())

def main():
    N = i_input()
    A = i_list()
    ans = 0
    c = True
    while c:
        for i in range(N):
            if A[i] % 2 == 0 and A[i] > 0:
                A[i] //= 2
            else:
                c = False
                break
        else:
            ans += 1
    print(ans)

if __name__ == "__main__":
    main()

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:
# B - Shift only
N = int(input())
A = list(map(int,input().split()))

def div2(x):
    ans = 0
    while x%2==0:
        x //= 2
        ans += 1
    return ans

ans = 10000
for a in A:
    ans = min(ans, div2(a))
print(ans)

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:break
    A[i] //= 2 
  else:
    ans += 1
    continue   
  break  
print(ans)

Submission status: Accepted

Solution code:
from sys import stdin
n = stdin.readline().rstrip()
a = [int(x) for x in stdin.readline().rstrip().split()]
b = 0

while True:
   if all([x % 2 == 0 for x in a]):
      a = [x/2 for x in a]
      b += 1
   else:
      break

print(b)

Submission status: Accepted

Solution code:
#!/user/bin/env pypy3
import sys
from typing import List


def fast_input():
    return sys.stdin.readline()[:-1]


def is_all_even(nums: List[int]) -> bool:
    for n in nums:
        if n % 2 == 1:
            return False
    return True


def solve(n: int, nums: List[int]) -> int:
    manipulate_count = 0
    while is_all_even(nums):
        manipulate_count += 1
        nums = list(map(lambda x: int(x / 2), nums))
    return manipulate_count


def main():
    n = int(fast_input())
    a = list(map(int, fast_input().split()))
    result = solve(n, a)
    print(result)


main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

counter = 0

while True:
    even = True
    for i in a:
        if i % 2 != 0:
            even = False
            break
        else:
            even = True
    if even == False:
        break
    else:
        counter += 1
        a = list(map(lambda x: x / 2, a))

print(counter)

Submission status: Accepted

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

answer = 0
while True:
    for index in range(len(arr)):
        if arr[index] % 2 != 0:
            print(answer)
            exit()
        arr[index] //= 2
    answer += 1

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

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

ans = 10 ** 9
for v in a:
    tmp = 0
    while v % 2 == 0:
        tmp += 1
        v //= 2
    ans = min(ans, tmp)
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

count = 0
is_continue = True
while(True):
    for i in A:
        if(i % 2 != 0):
            is_continue = False
            break
        if(i == 0):
            is_continue = False
            break

    if(is_continue == False):
        break
    else:
        counter = 0
        for i in A:
            A[counter] = i/2
            counter+=1   
    count += 1    
    
print(count)

Submission status: Accepted

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

i = 0
per = True
while per == True:
    for index in range(n):
        num = a[index]
        ans = divmod(num, 2)
        if num == 0 or ans[1] != 0:
            per = False
            break
        a[index] = ans[0]
    if per == True:
        i += 1
print(i)

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


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

    ans = INF

    for x in A:
        cur = x
        score = 0
        while cur % 2 == 0:
            cur //= 2
            score += 1
        ans = min(ans, score)

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

while(True):
    T = False
    for i in range(len(a)):
        if a[i]%2 != 0:
            T=True
        else:
            a[i] = a[i] / 2

    if T:
        break

    count+=1

print(count)

Submission status: Accepted

Solution code:
def calc_num2(num):
  total = 0
  while num % 2 == 0:
    total += 1
    num = num / 2
  
  return total

num_count = input()
num_list = [int(i) for i in input().split(' ')]
ans_list = []
for num in num_list:
  ans_list.append(calc_num2(num))

print(min(ans_list))

Submission status: Accepted

Solution code:
a = int(input())
b = [int(i) for i in input().split(" ")]
count = 0
iti = 1
while iti == 1:
    for i in range(a):
        if b[i]%2 == 0:
            b[i]=b[i]//2
            iti = 1
        else :
            print(count)
            iti = 0
            break
    count = count+1

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

i = 1
while True:
    for a in A:
        if a % (2**i) == 0:
            pass
        else:
            print(i-1)
            exit()
    i += 1

Submission status: Accepted

Solution code:
N = int(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:
n = int(input())
a = list(map(int, input().split()))
c = 0
while True:
  if all(x % 2 == 0 for x in a):
    a = [x / 2 for x in a]
    c += 1
  else:
    break
print(c)

Submission status: Accepted

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

res = float('inf')

for i in A:
    cnt = 0
    while True:
        if i % 2 == 1:
            if cnt == 0:
                print(0)
                exit()
            elif cnt < res:
                res = cnt
                break
            else:
                break
        i = i // 2
        cnt += 1

print(res)

Submission status: Accepted

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

minno = 10 ** 9

for x in a:
    cheknow = 0
    while x % 2 == 0:
        x = x / 2
        cheknow += 1
    if cheknow < minno:
        minno = cheknow
print(minno)

Submission status: Accepted

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

flag = False
doit = 0
while flag == False:
    counter = 0
    for x in a:
        if x % 2 == 1:
            flag = True
        else:
            a[counter] = x / 2
            counter += 1
    doit += 1
print(doit - 1)

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]//=2
    else:
      print(ans)
      exit()
  ans+=1

Submission status: Accepted

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

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

print(min(map(devisible, A)))

Submission status: Accepted

Solution code:
N = int(input())
A = input().split()
result = 0
count = False
while count == False:
    if (A == ([0] * N or ["0"] * N)): break
    for i in range(N):
        if (int(A[i]) % 2 != 0): count = True
        A[i] = int(A[i]) / 2
    if (count == True): break
    result += 1

print(result)

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

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
Alist = list(map(int, input().split()))
answer = 40
for a in Alist:
    i = 0
    while a % 2 == 0:
        a = a / 2
        i += 1
    if i < answer:
        answer = i
print(answer)

Submission status: Accepted

Solution code:
n = int(input())
print(min(bin(int(i))[::-1].find("1") for i in input().split()))

Submission status: Accepted

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

cnt = 0

while True:
    for i in range(N):
        if nums[i] % 2 == 1:
            result = "Odd"
            break
        else:
            result = "Even"
            nums[i] /= 2
    if result == "Odd": break
    cnt += 1
print(cnt)

Submission status: Accepted

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

def is_even(num_list):
  for num in num_list:
    if num % 2 != 0:
      return False
  return True

counter = 0
while(is_even(nums)):
  counter += 1
  nums = [n/2 for n in nums]
print(counter)

Submission status: Accepted

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

for i in range(n):
    if c[i]%2!=0:
        print(0)
        exit()

while f==0:
    for i in range(n):
        c[i]=c[i]/2
        if c[i]%2!=0:
            ans+=1
            print(ans)
            exit()
    ans+=1

Submission status: Accepted

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

    count += 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = 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:
#3
#8 12 40
n=int(input())
ai=list(map(int,input().split()))
b=[]
for a in ai:
  count =0
  while a%2==0 :
    count+=1
    a/=2
  b.append(count)
print(min(b))

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 /= 2
    b.append(c)
print(min(b))

Submission status: Accepted

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

# N が 2 で何回割れるか
def how_many_times(N):
    exp = 0
    while N % 2 == 0:
        N //= 2
        exp += 1
    return exp

result = min(map(how_many_times, A))
print(result)

Submission status: Accepted

Solution code:
N = input()
A = [int(x) for x in input().split()]
def cnt(x):
    i = 0
    while x%2 == 0:
        x //= 2
        i += 1
    return i
ans = min(cnt(a) for a in A)
print(ans)

Submission status: Accepted

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

# N が 2 で何回割れるか
def how_many_times(N):
    exp = 0
    while N % 2 == 0:
        N //= 2
        exp += 1
    return exp

result = min(map(how_many_times, A))
print(result)

Submission status: Accepted

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

# N が 2 で何回割れるか
def how_many_times(N):
    exp = 0
    while N % 2 == 0:
        N //= 2
        exp += 1
    return exp

result = min([how_many_times(v) for v in A])
print(result)

Submission status: Accepted

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

def how_many_times_divisible_of_two(N):
    exp = 0
    while N % 2 == 0:
        N //= 2
        exp += 1
    return exp

result = min([how_many_times_divisible_of_two(v) for v in A])
print(result)

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 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()
A = list(map(int,input().split()))
c = 0
d = -1
while c>d:
  d+=1
  for i in A:
    if i%2 == 0:
      continue
    else :
      print(c)
      break
  else :
    A=list(map(lambda x :x/2,A))
    c += 1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# vim: fileencoding=utf-8


def main():
    n = int(input())
    li = list(map(int, input().split()))
    c = 0
    end = False
    while True:
        for i in range(n):
            if li[i] % 2:
                end = True
                break
            li[i] = li[i] / 2
        if end:
            break
        else:
            c += 1
    print(c)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

print(count)

Submission status: Accepted

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

print(count)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
size = int(input())
nums = [int(s) for s in input().split()]

count = 0
checked = False

while True:
  for i in range(size):
    t = nums[i]
    if t % 2 == 1:
      checked = True
      break;
    nums[i] = t/2
  if checked:
    break
  count = count + 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# 2020-08-27, Thu

n = int(input())
lis = list(map(int, input().split()))
ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
number = int(input())
target_list = input().split()

loopFlg = True
loopCnt = 0

while loopFlg == True:
  for i in range(number):
    if int(target_list[i])%2 == 1:
      loopFlg = False
    target_list[i] = str(int(target_list[i])//2)

  if loopFlg == True:
  	loopCnt += 1

print(loopCnt)

Submission status: Accepted

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

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

Submission status: Accepted

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

g = A[0]
for i in range(N):
  g = math.gcd(g,A[i])

cnt = 0
while g % 2 == 0:
  g = g//2
  cnt += 1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(n)

Submission status: Accepted

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

ans=0
while True:
  for i in l:
    if i%2!=0:
      print(ans)
      exit()
  ans+=1
  l=[i/2 for i in l]

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

# 操作回数
counter = 0

# 操作が行えなくなるまで操作を行う
while True:
    # // 操作が行えるかどうかを判定する
    can_do = True
    for i in range(N):
        if A[i] % 2 == 1:
            can_do = False

    # 操作を行えないならば、ループを打ち切る
    if not can_do:
        break

    # 操作を行えるならば、操作を行う
    for i in range(N):
        A[i] //= 2

    # 操作回数をカウントする
    counter += 1

print(counter)

Submission status: Accepted

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

Submission status: Accepted

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

while(can):
    for i in range(len(A)):
        if(A[i] % 2 != 0):
            can = False
        else:
            A[i] = A[i] / 2
    if(can):
        count+=1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

def count(k):
  p=0
  while k % 2**p==0:
    p+=1
  return p-1
	
for i in range(N):
  s.append(count(a[i]))

print(min(s))

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

Submission status: Accepted

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

res = 0
while True:
  #check
  if len(list([i for i in A if i % 2 != 0])) == 0:
    res += 1
  else:
  	break
  #2でわる
  A = [i // 2 for i in A]

  
print(res)

Submission status: Accepted

Solution code:
# coding = utf-8
n=input("")
a=input("")
a=a.split(" ")
a=[int(s) for s in a]
a.sort()
base=100000
n=1
for num in a:
    while num%2**n==0:
        n=n+1
    n=n-1
    if n < base:
        base=n
print(base)

Submission status: Accepted

Solution code:
n=int(input())  
A=list(map(int, input().split()))
a=[]
for i in range(n):
  for j in range(10**9):
    if A[i]%(2**(j+1))!=0:
      a.append(j)
      break 
print(min(a))

Submission status: Accepted

Solution code:
import numpy as np
                                              
N = int(input())
A = np.array(list(map(int, input().split())))
i = 0
while True:
    if np.any(A % 2 == 1):
        break
    A = A / 2
    i += 1
print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int,input().split()))
M=int((max(A)**0.5)//1)
c=0
for i in range(M):
    for j in range(N):
        if A[j]%2==0:
            A[j]=int(A[j]//2)
            c+=1
        elif A[j]%2!=0:
            break
print(c//N)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(min(A))

Submission status: Accepted

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

w = 0

while True:
    v = 0
    for i in range(n):
        if val2[i] % 2 == 1:
            v = 1
    if v ==1:
        break
    if v ==0:
        for i in range(n):
            val2[i] = val2[i]/2
        w += 1

print(w)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
num = [int(x) for x in input().split()]
count = 0
a = 0

while(a==0):
    nl = []
    sl = []
    for i in num:
        if i %2 ==0:
            nl.append(i/2)
        else:
            sl.append(i)
    if sl == []:
        num =nl
        count += 1
    else:
        a = 1

print(count)