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
ng = False
while True:
  for i in range(n):
    if a[i]%2==0:
      a[i] //= 2
    else:
      ng = True
      break
  if ng:
    break
  ans += 1
print(ans)

Submission status: Accepted

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

is_even = True
count = 0

while(is_even):
    for r in t:
        if t[0] % 2 == 0:
            t.append(t[0] // 2)
            t.pop(0)
        else:
            is_even = False
            break
    else:  
        count += 1
        
print(count)

Submission status: Accepted

Solution code:
#ABC081

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


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

Submission status: Accepted

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

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

Submission status: Accepted

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

import numpy as np

A = np.array(A)

cnt = 0

while 1 not in A % 2:
    A = A / 2
    cnt += 1

print(cnt)

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:
## coding: UTF-8
N = int(input())
A = [int(x) for x in input().split()]

#print(N)
#print(A)

count = 0

def hantei(l): # listを引数とし，全て偶数かどうか判定する関数。奇数の数をカウントして返す
    odd_count = 0
    for i in range(N):
        if (l[i] % 2 == 1):
            odd_count += 1
    return odd_count # これが0なら全て偶数。1以上なら奇数が含まれている

def split(l): #リストの全要素を2で割る関数
    return [int(p / 2) for p in l]

#print(hantei(A))
#print(split(A))

while True:
    if(hantei(A) == 0):
        A = split(A)
        #print(A)
        count += 1
        #print(count)
    else:
        break

print(count)

Submission status: Accepted

Solution code:
n=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:
# 標準入力
num = int(input())
data = input().split()

# 操作回数の初期化
count = 0

while(True):
    exist_odd = False
    for i in range(num):
        if int(data[i]) % 2 != 0:
            exist_odd = True
        
    if exist_odd:
        break

    for i in range(num):
        data[i] =  int(data[i]) // 2
        
    count += 1

print(count)

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()))
ans=0
while True:
    if all(a[i]%2==0 for i in range(n)):
        a=[a[i]//2 for i in range(n)]
        ans+=1
    else:
        break
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

def EvenCheck(array):
    Even = True

    for i in array:
        if i % 2 != 0:
            Even = False

    return Even


def main():
    #N = map(int, open(0).read().split())

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

    while True:
        #print(array)
        #print(cnt)
        Check = EvenCheck(array)

        if Check == False:
            break

        cnt += 1
        for i in range(N):
            array[i] = int(array[i]/2)

    print(cnt)

main()

Submission status: Accepted

Solution code:
class Shift_only:
  def __init__(self):
    self.counter = 0
    self.even = True
  
  def result_even(self):
    return self.even
  
  def result_counter(self):
    return self.counter

  def check_even_and_division(self, num_list):
    new_num_list=[]
    for i in num_list:
      new_num_list.append(i/2)
      if i%2 !=0:
        self.even = False
    return new_num_list
  
  def add_counter(self):
    self.counter +=1
    return self.counter

  
if __name__ == '__main__' :
  N = input()
  A=list(map(int, input().split()))
  shift_only=Shift_only()
  while shift_only.result_even():
    A = shift_only.check_even_and_division(A)
    if shift_only.result_even():
      shift_only.add_counter()
  print(shift_only.result_counter())

Submission status: Accepted

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

n = int(input())
a = np.array([int(x) for x in input().split()])

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
s=[int(x) for x in input().split()]
w=2**31
for x in s:
    w=min(w,x&-x)
tot=0
while w>1:
    w=w/2
    tot=tot+1
print(tot)

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:

def shiftonly(n , al):

    ans = 0
    flag = True

    while flag:
        for i in range(n):
            if al[i] % 2 == 1:
                flag = False
                break
            else:
                al[i] = al[i] / 2
        if flag:
            ans += 1


    return ans

def main():
    n = int(input())
    al = list(map(int , input().split()))
    print(shiftonly(n , al))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

count = 0
cont = True
current = A
while cont == True:
  new = []
  for c in current:
    if (c % 2 == 0):
      new.append(c // 2)
      continue
    else:
      cont = False
      break
  if (cont == True):
    current = new
    count += 1
  else:
    break

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

loop_count = 0

while all(row % 2 == 0 for row in number_list):
    number_list = [row/2 for row in number_list]
    loop_count +=1
print(loop_count)

Submission status: Accepted

Solution code:
N = int(input())
a = [int(x) for x in input().split()]
cnt=0
Flag=True
while(Flag):
    for i in range(N):
        if a[i]%2!=0:
            Flag=False
            break
        a[i]/=2
    cnt+=1
print(cnt-1)

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
A_list = list(map(int, input().split()))
flag = True
cnt = 0
while(flag):
    for i in range(N):
        if A_list[i]%2!=0:
            flag=False
            break
        A_list[i]/=2
    cnt+=1
print(cnt-1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
low = float("inf")
for i in range(n):
    x = 0
    while True:
        if a[i] %2 == 0:
            x += 1
            a[i] /= 2
        else:
            if x < low:
                low = x
            x = 0
            break
print(low)

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

count = 0
Flag = True
while Flag:
    for i in range(N):
        #if each elem can divide with 2
        if l[i] % 2 == 0:
            l[i] = int(l[i] / 2)
        else:
            Flag = False

        # add count
        if i == N-1 and Flag == True:
            count+=1
        
print(count)

Submission status: Accepted

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

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

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 = [i / 2 for i in A]
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
Aseq=input()
Alist=Aseq.split()
A=[]
for i in range(N):
    A.append(int(Alist[i]))
a=[]
for i in range(N):
    ai=0
    while A[i]%2==0:
        ai+=1
        A[i]=A[i]/2
    a.append(ai)
b=min(a)
print(b)

Submission status: Accepted

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

count = 0

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

Submission status: Accepted

Solution code:
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
mod=10**9+7

N=I()
A=LI()

ans=0
f=1

for i in range(100):
    if f==0:
        break
    for j in range(N):
        if A[j]%2==0:
            A[j]=A[j]//2
        else:
            f=0
            break
    if f==1:
        ans+=1
    
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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


def half(_a):
    ret = list()
    for i in _a:
        if i % 2 != 0:
            return None
        else:
            ret.append(i//2)
    return ret


while True:
    a = half(a)
    if not a:
        break
    cnt += 1

print(cnt)

Submission status: Accepted

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

r = 0
a_len = len(a)
while True:
    a = [i/2 for i in a if i % 2 == 0]
    if len(a) == a_len:
        r += 1
    else:
        break
print(r)

Submission status: Accepted

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

z = 0
y = []

for i in range(n):
    x = l[i]
    for j in range(max(l)):
        if x % 2 ==0:
            z += 1
            x = int(x/2)
        else:
            y.append(z)
            z = 0
            break

#print(y)
print(min(y))

Submission status: Accepted

Solution code:
n = int(input())
l = sorted(list(map(int, input().split())))
ans = 0
i = l[0]
while i % 2 == 0:
    ans += 1
    i /= 2
for i in l[1:]:
    c = 0
    while i % 2 == 0 and c <= ans:
        c += 1
        i /= 2
    if c <= ans:
        ans = c
print(ans)

Submission status: Accepted

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

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

print(total)

Submission status: Accepted

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

div = 2
cnt = 0
FLAG = True

while (FLAG):
    
    for i in range(N):
        mod = nums[i] % div
        if (mod != 0):
            FLAG = False
            break
    
    if (FLAG):
        div *= 2
        cnt += 1

print(cnt)

Submission status: Accepted

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

sum = 0

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

print(sum)

Submission status: Accepted

Solution code:
import numpy as np

a = int(input())
b_np = np.array(list(map(int, input().split())))
ans_count = 0

while True:
  if 1 not in np.mod(b_np,2):
    b_np = b_np / 2
    ans_count += 1
  else:
    print(ans_count)
    break

Submission status: Accepted

Solution code:
import re

n = input()
a = [int(e) for e in input().split()]
ans = 10 ** 9
pat = re.compile('.*?(0*)$')

for e in a:
    ans = min(ans, len(re.match(pat, bin(e)).group(1)))

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
l = list(map(int,input().split()))
num = 0
while(True):
  odd_flag = False
  for i in l:
    if (i % 2 !=0):#奇数があったらフラグ
      odd_flag = True
  if(odd_flag):
    break
  for i in range(len(l)):
    l[i] = l[i] // 2
  num +=1
    
print(num)

Submission status: Accepted

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

Submission status: Accepted

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

ans=float('inf')
for a in A:
    aa=list(reversed(format(a,'b')))
    ai=aa.index('1')
    if ans>ai:
        ans=ai

print(ans)

Submission status: Accepted

Solution code:
input()
num_list = list(map(int, input().split()))
min_cnt = 999
for num in num_list:
  num_cnt = 0
  while True:
    if num % 2 == 1:
      if num_cnt < min_cnt: min_cnt = num_cnt
      break
    else:
      num = num / 2
      num_cnt += 1
print(min_cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    num = list(map(int, input().split()))
    counter = [0] * N
    for j in range(N):
        while num[j]%2==0:
            num[j] = num[j]/2
            counter[j] += 1
    print(min(counter))

main()

Submission status: Accepted

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

Submission status: Accepted

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

count = 0
while True:
    odd_flag = False
    for value in num:
        if value % 2 != 0:
            odd_flag = True
    if odd_flag:
        break
    count += 1
    new_num = [value / 2 for value in num]
    num = new_num
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:
input()
A = list(map(int,input().split()))
count=0

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

Submission status: Accepted

Solution code:
import numpy as np
input()
A = np.array(list(map(int, input().split())))
ans = 0
while 1 not in A % 2:
    A = A // 2
    ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

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

ans = 0; n = 2
while (a % n == 0).all():
    n *= 2
    ans += 1

print(ans)

Submission status: Accepted

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

def calc_half(x):
    return x / 2

def check_even(x):
    return x % 2

def func(x, count):
    even_res = list(map(check_even, x))
    if 1 in even_res:
        return count
    x2 = list(map(calc_half, x))
    count += 1
    return func(x2, count)

count = func(a, 0)
print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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

flg = True
cnt = 0

for j in range(100):
    for i in range(n):
        if a[i] % 2 == 1:
            flg = False

    if flg is True:
        for i in range(n):
            a[i] = int(a[i] / 2)
        cnt += 1
    else:
        break

print(cnt)

Submission status: Accepted

Solution code:
n = int(input())

li = [int(x) for x in input().split()]

count = 0
counter = 0

while True:
  for i in range(0,n):
    if li[i] % 2 == 0:
      count+=1
  if count == n:
    counter+=1
    li = [int(li[i]/2) for i in range(0,n)]
    count = 0
  else:
    break
    
print(counter)

Submission status: Accepted

Solution code:
import math

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

ans = float("inf") #ansに無限を代入

for i in a:
    ans = min(ans, len(bin(i)) - bin(i).rfind("1") - 1)
print(round(ans))

Submission status: Accepted

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

def warizan():
    for i in range(N):
        intA[i] = int(intA[i] / 2)

count=0
flg = False
while True:
    for i in range(N):
        #print(intA[i])
        if(intA[i]%2 != 0):
            flg = True
            break
    if flg:
        break
        
    warizan()
    count += 1
        
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(min(A))

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:
            dist = a[i] // 2
            if dist >= 0:
                a[i] = dist
            else:
                print(ans)
                exit()
        else:
            print(ans)
            exit()
    ans += 1

Submission status: Accepted

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

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

print(x)

Submission status: Accepted

Solution code:
N = int(input())
a = 0
nums = [int(i) for i in input().split()]
while True:
    if [i for i in nums if i %2==1]:
        break
    else:
        nums = [i//2 for i in nums]
        a+=1
        
print(a)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
numbers = list(map(int, input().split()))
k = -1
dividable = True
while dividable:
  k += 1
  for i, number in enumerate(numbers):
    if number % 2 == 0:
      numbers[i] = number / 2
    else:
      dividable = False

print(k)

Submission status: Accepted

Solution code:
input();count=0
s=set(map(int, input().split(' ')))
while all(map(lambda x:x%2==0,s)):
  s=set(map(lambda x:x/2,s))
  count+=1
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

t = 100000000000000000000000000000000000000000

for i in A:
    s = 0
    for s in range(i):
        if i % 2 == 0:
            i = i//2
            continue
        else:
            break
    if s < t:
        t = s
print(t)

Submission status: Accepted

Solution code:
from fractions import gcd
from functools import reduce


def main():
    n = int(input())
    numbers_gcd = reduce(gcd, list(map(int, input().split())))
    answer = 0
    while numbers_gcd > 0:
        if numbers_gcd % 2:
            break
        else:
            numbers_gcd //= 2
            answer += 1
    print(answer)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
a = list(map(int, input().split()))
ans = 1000
for ai in a:
    ans_i = 0
    while ai % 2 == 0:
        ai //= 2
        ans_i += 1
        if ans_i == ans:
            break
    ans = min(ans, ans_i)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8

N = input()
N = int(N)
Data = input().split(" ")
for i in range(N):
  Data[i] = int(Data[i])

LoopCount = 0
while(1):
  PerCount = 0
  tmp = [0 for i in range(N)]
  for i in range(N):
    if(Data[i] % 2 == 0):
      tmp[i] = int(Data[i]/2)
      PerCount = PerCount + 1
  if(PerCount == N):
    Data = tmp
    LoopCount = LoopCount + 1
  else:
    break
print(LoopCount)

Submission status: Accepted

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

    for a in A:
        if a % 2 == 0:
            c = 0
            while a % 2 == 0:
                a //= 2
                c += 1
            l.append(c)
        else:
            l.append(0)

    return min(l)

print(solve())

Submission status: Accepted

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

    return ans

print(solve())

Submission status: Accepted

Solution code:
n = int(input())
L = list(map(int, input().split()))
K = -1
bool1 = True

while(bool1 == True):
    K +=1
    for k in range(n):
        if L[k] %2 ==0:
            L[k] = L[k]/2

        else:
            bool1 = False
            break

print(K)

Submission status: Accepted

Solution code:
n = int(input())
L = list(map(int, input().split()))
K = -1

def main():
    bool1 = True
    global n,L,K 
    K += 1

    while(bool1 == True):
        for k in range(n):
            if L[k] %2 ==0:
                L[k] = L[k]/2

            else:
                bool1 = False
                break
        if(bool1 == True):
            main()

main()
print(K)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main(N,A):
    count = 0
    while True:
        for i in range(N):
            if A[i] % 2 != 0:
                return count
                break
            else:
                A[i] = A[i] // 2
        count +=1

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

Submission status: Accepted

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
c = 0
i = 0
 
while a[i]%2 == 0:
  if a[i]%2 ==0:
    a[i]//=2
  if i==n-1:
    c+=1
    i = 0
  i+=1
print(c)

Submission status: Accepted

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

ok = 1
ans = 0
while ok == 1:
    for i in range(n):
        if a[i] % 2 == 0:
            a[i] /= 2
            continue
        ok = 0
    if ok == 1:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
n = input()
vals = map(int, input().split())
bins = [str(bin(v)) for v in vals]
idx = -1
while True:
    if len([b for b in bins if b[idx] == "1"]) > 0:
        break
    idx -= 1
print((idx + 1) * -1)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
B = []
for a in A:
  i = 0
  while a % 2 ** i == 0:
    i += 1
  B.append(i - 1)
B.sort()
print(B[0])

Submission status: Accepted

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

while True:

    for i in range(len(a)):
        if a[i] % 2 == 0:
            a[i] = int(a[i] / 2)
        else:
            print(c)
            exit()
    c += 1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

l = int(input())
num = list(map(int, input().split()))
n = np.array(num)
c = 0
while not any(n%2):
  c += 1
  n /= 2
print(c)

Submission status: Accepted

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

counts = 0 
while all(num%2 ==0 for num in existing_list):
    length = 0
    for a in existing_list:
        division = a/2
        existing_list[length]=division
        length +=1
    counts +=1

print(counts)

Submission status: Accepted

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

Submission status: Accepted

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


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

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
count = 0
nums = [int(x) for x in input().split()]
loop = True
while loop:
  if not all ([n % 2 == 0 for n in nums]):
    loop = False
    break
    
  for i, n in enumerate(nums):
    nums[i] = n//2
  count += 1
print(count)

Submission status: Accepted

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
count=0
i=0
while a[i]%2==0:
  if a[i]%2==0:
    a[i]//=2
  if i==n-1:
    count+=1
    i=0
  i+=1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

# 線形探索で求める
# 1 個 1 個調べて、探したいものを探す
# 答えが出るまでWhileを回す
isnext = 0
ans = 0

while isnext == 0:
    for i in range(N):
        # 偶数判定
        if A[i] % 2 == 0:
            A[i] = A[i] / 2
        # 奇数判定
        if A[i] % 2 != 0:
            isnext = 1
            break
        # 一周したよ
        if i == N-1:
            ans = ans + 1

if ans == 0:
    print(ans)
else:
    print(ans+1)

Submission status: Accepted

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

count = 0
mincount = 9999
for i in range(N):
    count = 0
    while(1):
        if not A[i]%2==0:
            break
        count = count + 1
        A[i] = A[i]/2
    if mincount>count:
        mincount = count
        
print(mincount)

Submission status: Accepted

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

Submission status: Accepted

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

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

print (ans)

Submission status: Accepted

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

ope_count = 0
while True:
    even_count = len([a for a in A if a % 2 == 0])

    if even_count != N:
        print(ope_count)
        break

    A = [a / 2 for a in A]
    ope_count += 1

Submission status: Accepted

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

ans = float("inf")

for i in A:
    ans = min(ans, len(bin(i)) - bin(i).rfind("1") - 1)

print(ans)

Submission status: Accepted

Solution code:
def time(n):
  ans = 0
  while n % 2 == 0:
    n /= 2
    ans += 1
  return ans
N = int(input())
LA = list(map(int, input().split()))
ans = min(map(time, LA))
print(ans)