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()))
ans = 0
while all(a%2 == 0 for a in A):
    A = [a//2 for a in A]
    ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#28
import sys
N = int(input())
a = list(map(int,input().split()))
cou = 0
l = len(a)
while cou >=0:
    for i in range(l):
        if a[i]%2 !=0:
            print(cou)
            sys.exit()
        a[i] /=2
    cou +=1

Submission status: Accepted

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

import math
from functools import reduce

def gcd_list(numbers):
    return reduce(math.gcd,numbers)

cnt=0  
b=gcd_list(a)
for i in range(2**30):
  if b%2==0:
    cnt+=1
  b=b/2
  if b%2==1 or b==1/2:
    break

print(cnt)

Submission status: Accepted

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

f = True
for i in range(1, 100):
    for a in A:
        if a % 2**i != 0:
            f = False
    if not f:
        print(i-1)
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num = int(input())
data = input().split()

int_data = [int(i) for i in data]

cnt= 0

judge = True

while judge == True:
    
    for i in range(num):
        if int_data[i] % 2 == 0:
            int_data[i] = int_data[i] / 2
        else:
            judge = False
            break

    cnt += 1
    
print(cnt - 1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split(" ")))
l = len(a)
f = False
c = 0
while True:
    for i in range(0, l):
        if a[i] % 2 == 0:
            a[i] /= 2
        else:
            f = True
    if f is not True:
        c += 1
    else:
        break
print(str(c))

Submission status: Accepted

Solution code:
n=int(input())
nums=list(map(int,input().split()))
cnt=0
flag=0
while flag is 0:
    for i in range(n):
        num=nums[0]/2
        key=nums[0]%2
        if key==1:
            flag=1
            break
        else:
            del nums[0]
            nums.append(num)
    if flag==0:
        cnt+=1

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

def how_many_times_divisible(N):
    ans = 0
    while N % 2 == 0:
        N = N /2
        ans += 1
    return ans

ans = min(map(how_many_times_divisible, a))
print(ans)

Submission status: Accepted

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

print(count)

Submission status: Accepted

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

while True:
    judge = [a[i]%2 for i in range(len(a))]
    if any(judge):
        break
    else:
        a = [a[i]//2 for i in range(len(a))]
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(4100000)
import math
INF = 10**9

def main():
    n = int(input())
    A = list(map(int, input().split()))

    ans = INF
    for i in range(n):
        count = 0
        num = A[i]
        while num%2 == 0:
            count += 1
            num = num // 2
        ans = min(ans, count)
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

ans = 10**9
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())
A = map(int, input().split())
c, m = 0, 100000000000000000000
for a in A:
  while a%2==0:
    a = a//2
    c += 1
  m = min(m, c)
  c = 0
print(m)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N=int(input())
ls=[int(s) for s in input().split()]
count=0
while sum([n%2 for n in ls])==0:
  count+=1
  ls=[n//2 for n in ls]
print(count)

Submission status: Accepted

Solution code:
N=input()
N=int(N)
ls=[int(s) for s in input().split()]
flag=1
ans=0
while flag==1:
  count=0
  for i in range(N):
    if ls[i]%2==0: 
      count=count+1
  if count==N:
    ans=ans+1
    for i in range(N):
      ls[i]=ls[i]//2
  else:
    flag=flag-1
print(ans)

Submission status: Accepted

Solution code:
import sys

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

while flg == 0:
  for i in range(N):
    if A[i]%2 == 0:
      A[i] = int(A[i]/2)
    elif A[i]%2 ==1 or A[i] == 1:
      print(cnt)
      sys.exit()
  cnt += 1
print(max(0,cnt-1))

Submission status: Accepted

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

Submission status: Accepted

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

Flg = True
COUNT  = 0

while(Flg):    
    for n in A:        
        if n%2 != 0:
            Flg=False
            break
        
    if Flg:
        A =  [n / 2 for n in A]
        COUNT+=1

print(COUNT)

Submission status: Accepted

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

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

Submission status: Accepted

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

# check
cnt = 0
while len([1 for a in A if a % 2 == 0]) == len(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()))
cnt = 0
while True:
	is_odd = False
	for i in range(len(a)):
		if a[i] % 2 == 1:
			is_odd = True
			break
		else:
			a[i] /= 2
	if is_odd:
		break
	cnt += 1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

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

ans = 0

while True:
    for i in range(len(A)):
        # 2で割り切れない
        if A[i] % 2 != 0:
            print(ans)
            exit()  
        # 2で割れる
        else:
            A[i] = A[i] / 2
    ans += 1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
c = 0
t = 0
while t == 0:
  A = [num/2 for num in A]
  B = [int(num) for num in A]
  if A == B:
    c += 1
  else:
    t += 1
print(c)

Submission status: Accepted

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

for n in range(A[-1]//2):
  for a in A:
    if a%2 == 1:
      print(ans)
      exit()
  for n in range(N):
    A[n] = A[n]/2
  ans+=1
  
print(ans)

Submission status: Accepted

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

res = float('inf')
for v in a:
    cnt = 0
    while v % 2 == 0:
        v //= 2
        cnt += 1
    res = min(res, cnt)

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

#count  = 3
#num_list =[8,12,40]

output = 0
stop_flag = 0

while 1:
    for num in num_list:
        if((num % 2) == 1 ):
            stop_flag = 1
    if stop_flag == 0:
        output += 1
    
    num_list = list(map(lambda x: x/2,num_list))

    if stop_flag == 1:
        break
    
print(output)

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:
            break
    else:
        ans += 1
        continue
    break
print(ans)

Submission status: Accepted

Solution code:
def resolve():
    '''
    code here
    '''
    N = int(input())
    As = [int(item) for item in input().split()]

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

if __name__ == "__main__":
    resolve()

Submission status: Accepted

Solution code:
def actual(N, A):
    count = 0
    while True:
        is_all_even = all([a % 2 == 0 for a in A])

        if is_all_even:
            A = [a // 2 for a in A]
            count += 1
        else:
            return count

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

print(actual(N, A))

Submission status: Accepted

Solution code:
def check_pow_2(a,cnt):
  if a % 2 == 1:
    return cnt
  else:
    return check_pow_2(a/2,cnt) + 1

n = int(input())
a_lst = map(int, input().split())
min_ope = float("inf")
for a in a_lst:
  min_ope = min(min_ope, check_pow_2(a,0))
if min_ope == float("inf"):
  min_ope = 0
print(min_ope)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# Your code here!
n=int(input())

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

for i in range(n):
    num=a_list[i]
    count=0
    while True:
        if num%2==0:
            num//=2
            count+=1
        else:
            break
    count_list.append(count)

#print(count_list)   
print(min(count_list))

Submission status: Accepted

Solution code:
N = int ( input () )
l = input().split()
s = []
for i in range (N):
    a = int ( l[i] )
    o = 0
    while True:
        b = a%2
        if b == 0:
            a = a/2
            o += 1
        else:
            s.append (o)
            break
print ( min (s) )

Submission status: Accepted

Solution code:
# B Shift only

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

ans = len(format(10**9, "b"))-1
for ai in a:
  for i in range(len(format(ai, "b"))):
    if (ai >> i) & 1 and ans > i:
      ans = i
print(ans)

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
N = int(input())
A = [int(i) for i in input().split()]
print(min([min(bin(i)[::-1].index("1"), len(bin(i))-2) for i in A]))

Submission status: Accepted

Solution code:

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

Submission status: Accepted

Solution code:
N = int(input())
A = [int(i) if int(i)%2==0 else 1 for i in input().split()]

count = 0
while(not(1 in A)):
    A = [i/2 if (i/2)%2==0 else 1 for i in A]
    count += 1
    
print(count)

Submission status: Accepted

Solution code:
n = int(input())
int_list = list(map(int,(input().split())))
count = 0
for i in range(30):
    for i in range(len(int_list)):
        
        if int_list[i] % 2 == 0 :
            int_list[i] = int_list[i]/2
        else:
            int_list = []
            break      
    if len(int_list) == n :
        count += 1
    else: 
        break
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8

N = int(input())
A = input().split()

count = 0
count_a = 0
flag = 0

while flag == 0:

    for i in A:
        if int(i) % 2 == 0:
            count += 1

    if count == N:
        count_a += 1
        count = 0
        for i in range(N):
            A[i] = int(A[i]) // 2
    else:
        flag = 1

print(count_a)

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=[]
cnt=0
for i in range(30):
    for l in range(n):
        if a[l]%2==0:
            b.append(a[l]//2)
    if len(b)==n:
        a=b
        b=[]
        cnt+=1
    else:
        break
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,*a = map(int,open(0).read().split())
c=10**9
for i in a:
  t=0
  while ~i>>t & 1:
    t+=1
  c = min(c, t)
print(c)

Submission status: Accepted

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

ans = 0
while True:
    for a in A:
        if a%2 != 0:
            print(ans)
            exit(0)
    ans += 1
    A = list(map(lambda x:x//2, A))

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    next_numbers = [int(x) for x in input().split(" ")]
    count = 0
    while True:
        next_numbers = [x/2 for x in next_numbers if x % 2 == 0]
        if len(next_numbers) != N:
            print(count)
            break
        count += 1


if __name__ == '__main__':
    main()

Submission status: Accepted

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

check = True
num = 0
while check:
    for a_i in a:
        if a_i % (2 ** (num + 1)) != 0:
            check = False
            break
    if check:
        num += 1

print(num)

Submission status: Accepted

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

mc = 10**9
for a in A:
    i = 0
    while True:
        if (a>>i)&1 == 0:
            i += 1
        else:
            break
    mc = min(mc, i)
print(mc)

Submission status: Accepted

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

first_flg = 0
ans_num=0
def ans(calc_list):
    b = []
    for i in calc_list:
        if i%2 != 0:
            return 'stop'
        else:
            b.append(int(i/2))
    return b

while True:
    if 0 == first_flg:
        first_flg = 1
        output = ans(a)
    else:
        output = ans(output)

    if output == 'stop':
        break
    else:
        ans_num+=1
        
print(ans_num)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n = int(input())
a = list(map(int,input().split()))

cnt = 0
flg = True

while flg == True:
    for i in range(len(a)):
        if a[i] % 2 == 1:
            flg = False
        a[i] /= 2

    if flg:
        cnt += 1 

print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import numpy as np
N=int(input())
A=np.array(input().split(),dtype=np.int32)
ans=0
while (A%2==0).all():
    A//=2
    ans+=1
print(ans)

Submission status: Accepted

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

N=int(input())
A=map(int,input().split())
ans=10**9
for a in A:
    ans=min(ans,f(a))
print(ans)

Submission status: Accepted

Solution code:
###==================================================
### import
#import bisect
#from collections import Counter, deque, defaultdict
#from copy import deepcopy
#from functools import reduce, lru_cache
#from heapq import heappush, heappop
#import itertools
#import math
#import string
import sys
### stdin
def input(): return sys.stdin.readline().rstrip()
def iIn(): return int(input())
def iInM(): return map(int, input().split())
def iInM1(): return map(int1, input().split())
def iInLH(): return list(map(int, input().split()))
def iInLH1(): return list(map(int1, input().split()))
def iInLV(n): return [iIn() for _ in range(n)]
def iInLV1(n): return [iIn()-1 for _ in range(n)]
def iInLD(n): return [iInLH() for _ in range(n)]
def iInLD1(n): return [iInLH1() for _ in range(n)]
def sInLH(): return list(input().split())
def sInLV(n): return [input().rstrip('\n') for _ in range(n)]
def sInLD(n): return [sInLH() for _ in range(n)]
### stdout
def OutH(lst, deli=' '): print(deli.join(map(str, lst)))
def OutV(lst): print('\n'.join(map(str, lst)))
### setting
sys.setrecursionlimit(10 ** 6)
### utils
int1 = lambda x: int(x) - 1
### constants
INF = int(1e9)
MOD = 1000000007
dx = (-1, 0, 1, 0)
dy = (0, -1, 0, 1)
###---------------------------------------------------

def cnt_two(n):
  if n % 2 == 1:
    return 0
  else:
    return 1 + cnt_two(n // 2)

N = iIn()
A = iInLH()

ans = INF
for i in range(N):
  cnt = cnt_two(A[i])
  ans = min(ans, cnt)
  
print(ans)

Submission status: Accepted

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

def func(x):
  s = 0
  while(True):
    for (i, j) in enumerate(x):
      if j % 2 == 1:
        return s
      x[i] = j / 2
    s = s + 1

print(func(x))

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 = list(map(lambda x: int(x/2), a))
    cnt += 1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

m=99
for i in A:
  tmpi = i
  c = 0
  while True:
    if tmpi % 2== 0:
      tmpi//=2
      c+=1
    else:
      break
  m = min(c,m)
  if m == 0:
    break
print(m)

Submission status: Accepted

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

Submission status: Accepted

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


def cal(value):
    return value / 2


def odd_even_cal(value):
    return value % 2


flug, counter = -1, 0
while flug < 0:
    if 1 in list(map(odd_even_cal, array)) or 0 in array:
        flug = 1
        break
    counter += 1
    array = list(map(cal, array))

print(counter)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
def f(x):
  x=int(x)
  cnt=0
  while x%2==0:
    cnt+=1
    x=x//2
  return cnt
a=list(map(f,input().split()))
print(min(a))

Submission status: Accepted

Solution code:
def calc_div2(n):
    return n/2

count = 0
flag = 0
n_num = input()
data_list = list(map(int, input().split()))

while flag == 0:
    for data in data_list:
        if data%2 != 0:
            flag = 1
            break
    if flag == 0:
        data_list = list(map(calc_div2, data_list))
        count+=1
print( count )

Submission status: Accepted

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

Submission status: Accepted

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

while all(i % 2 == 0 for i in a):
    a = list(map(lambda x: int(x/2), a))
    cnt += 1

print(cnt)

Submission status: Accepted

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

target_list = [int(s) for s in in_list]
max_num = max([s%2 for s in target_list])

counter = 0
while max_num==0:
    target_list = [int(s)/2 for s in target_list]
    max_num = max([s%2 for s in target_list])
    counter += 1

print(counter)

Submission status: Accepted

Solution code:
n, *a = map(int, open(0).read().split())

from functools import reduce

e = reduce(lambda x,y:x|y, a, 0)

print((e^(e-1)).bit_length()-1)

Submission status: Accepted

Solution code:
n=eval([*open(0)][1].replace(*' |'))
print(len(bin(n&-n))-3)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
#
# Author: Tetsuya Ishikawa <tiskw111@gmail.com>
# Date  : June 30, 2020
##################################################### SOURCE START #####################################################

N = int(input().strip())
As = list(map(int, input().strip().split()))

count = 0

while True:

    if all(a % 2 == 0 for a in As):
        count += 1
        As = [a // 2 for a in As]
    else:
        break

print(count)

##################################################### SOURCE FINISH ####################################################
# vim: expandtab tabstop=4 shiftwidth=4 fdm=marker

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

cnt = 0

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

while True:
    for i in range(N):
        b += [a[i]%2]
    if b.count(0)== N:
        a = list(map(lambda x:x//2,a))
        c += 1
        b = []
    else:
        break
print(str(c))

Submission status: Accepted

Solution code:
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 resolve():
    input()
    A = list(map(int,input().split()))
    count=0
    while len(list(filter(lambda x: x%2==1,A)))==0:
        count+=1
        A =list(map(lambda x:x//2,A))
    print(count)
resolve()

Submission status: Accepted

Solution code:
import math
n = int(input())
a_li = [int(w) for w in input().split()]

ans = 10**9
for a in a_li:
    # t = 0
    # while a % 2 == 0:
    #     a //= 2
    #     t += 1

    t = math.log2(a & -a)
    ans = min(ans, t)

print(int(ans))

Submission status: Accepted

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

c_list=[]
for i in list:
    count=0
    while True:
            
        if i%2==0:
            i=i/2
            count+=1
        else:
            break
    c_list.append(count)

    
print(min(c_list))

Submission status: Accepted

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

count = 0
flg=True

for i in range(N):
    if A[i]%2==1:
        flg=False
while flg:
    count +=1
    for i in range(N):
        a,b = divmod(A[i],2)
        A[i] = a
        if b != 0:
            count -= 1
            flg=False
            break
print(count)

Submission status: Accepted

Solution code:
N=int(input())
Y=10**100

A=list(map(int,input().split()))
for a in A:
    H=0
    while a%2==0:
        a//=2
        H+=1
    Y=min(Y,H)
print(Y)

Submission status: Accepted

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

import math
from collections import Counter

def prime_count(n):
    prime_count = Counter()
    for i in range(2, math.ceil(math.sqrt(n))+1):
        while n % i == 0:
            n /= i
            prime_count[i] += 1
    if n > 1:
        prime_count[int(n)] += 1
    return prime_count


ans = float('inf')

for a in A:
    c = prime_count(a)[2]
    ans = min(ans, c)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

number = list(map(int,input().split()))
count = 0
total = 0
K = True
while K:
  for i in number:
    if i%2==0:
      count+=1
    else:
      K = False
    if count ==n:
      count = 0
      total +=1
      number = [i / 2 for i in number] 

print(total)

Submission status: Accepted

Solution code:
n=int(input())
k=map(int,input().split())
k = list(k)
co=0
wa=0
while True:
    for i in range(n):
        if k[i]%2==0:
            co+=1
    k=[nu//2 for nu in k]
    
    if co != n:
        break
    wa+=1
    co=0
print(wa)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
count = 0
# whileは終わるまで続ける構文
while all(a % 2 == 0 for a in A):
  A = [a/2 for a in A]
  count += 1
print(count)

Submission status: Accepted

Solution code:
a=int(input())
b=list(map(int,input().split()))
sum=0
break_loop=False
while True:
    for i in range(a):
        if b[i]%2!=0:
            break_loop=True
            break
        else:
            continue
    if break_loop==True:
        break
    b=list(map(lambda x:x/2,b))
    #print(b)
    sum+=1
print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

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

# n = input()
# list = [input() for i in range(N)

# list = [[i for i in range(N)] for _ in range(M)]

import sys
input = sys.stdin.readline

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


def IsAllEven(L, n):
    for i in range(len(L)):
        if L[i] % (2**n) != 0:
            return False
    return True


i = 0
while True:
    i += 1
    if not IsAllEven(list_A, i):
        break
print(i-1)