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:
import numpy as np
N = int(input())
a = np.array(input().split(),dtype=np.int32)
z = 0

while (a%2==0).all():
  a//=2
  z+=1

print(z)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from fractions import gcd
n = int(input())
a = list(map(int, input().split()))
g = a[0]
for i in range(n):
  g = gcd(g, a[i])
counter = 0
while(True):
  if g % 2 != 0:
    break
  else:
    counter += 1
    g = g // 2
print(counter)

Submission status: Accepted

Solution code:
N = int(input())
aList = list(map(int, input().split()))
loopB = True
ans = 0
while loopB:
    for i in range(len(aList)):
        tmp = aList[i] % 2
        if tmp == 0:
            aList[i] = aList[i] // 2
        else:
            loopB = False

    if loopB:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
nums = list(map(int, input().split()))
ans = 0
while True:
  for idx, num in enumerate(nums):
    if num%2 != 0:
      print(ans)
      exit()
    else:
      nums[idx] = num//2
  ans += 1

Submission status: Accepted

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

Submission status: Accepted

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

cnt = 0
while True:
  li_yojo = [a % 2 for a in lis]
  if li_yojo.count(0) != N:
    break
  else:
    lis = [ a / 2 for a in lis ]
    cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
num = int(input())
if num <= 200:

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

    even_flg = True
    count = 0
    while even_flg:
        for i, n in enumerate(num_list):
            if n % 2 == 0:
                count += 1
                num_list[i] = n / 2
            else:
              	even_flg = False
    count = count / len(num_list)
    print(int(count))

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
n = int(raw_input())
a = [int(e) for e in raw_input().split()]
i = 0
while True:
  if any(e % 2 == 1 for e in a):
    break
  i += 1
  a = [e / 2 for e in a]
print i

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in a:
  ch=i
  while True:
    if ch ==0:
      break
    if ch%2 ==0:
      cnt+=1
      ch=ch/2
    else:
      break
  if cnt==0:
   ans.append(cnt)
   break
  else:
   ans.append(cnt)
   cnt=0
print(min(ans))

Submission status: Accepted

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

while(True):
    t = True
    for i in a:
        if i%2:
            t = False
    if t:
            ans += 1
            a = [int(x/2) for x in a]
    else:
        break
print(str(ans))

Submission status: Accepted

Solution code:
# coding: utf-8

n = int(input())

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

count = 0

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

Submission status: Accepted

Solution code:
import math

n = int(input())
#a = int(input())
#n,a,b = list(map(int,input().split(" ")))
#ls = list(input().split(" "))
ls = list(map(int,input().split(" ")))
#a,b = list(input().split())
#string1 = input()
#string2 = input()
#ls = [int(input()) for i in range(n)]

ans = []
for i in ls:
  tmpnum = i
  tmp = 0
  for j in range(30):
    if (tmpnum%2 == 0):
        tmpnum = tmpnum//2
        tmp += 1
  ans.append(tmp)
print(min(ans))

Submission status: Accepted

Solution code:
def is_all_even(A):
    res = True
    for a in A:
        if a%2 == 1:
            res = False
            return res
    return res


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

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

    print(answer)

Submission status: Accepted

Solution code:
_ = input()
a = [int(x) for x in input().split()]
f = lambda x : len(bin(x & -x)[2:].split('1')[-1])
print(min([f(x) for x in a]))

Submission status: Accepted

Solution code:
N=int(input())
L=list(map(int,input().split()))
counter=0
t=0
for p in range (30):
  t=0
  for i in range(N):
    if L[i]%2==0:
      t+=1
  if t==N:
    for i in range(N):
      L[i]=int(L[i]/2)
    counter+=1
print(counter)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import math

# NO, PAY-PAY
#import numpy as np
#import statistics
#from statistics import mean, median,variance,stdev

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
 
def main():
    s = inputInt()
    A = inputList()
    
    ans = -1
    for i in A:
        tmp_cont = 0
        tmp = i
        while True:
            if tmp % 2 != 0:
                break
            tmp = tmp // 2
            tmp_cont += 1
        #print("{}--{}".format(i, tmp_cont))
        if ans == -1 or ans > tmp_cont:
            ans = tmp_cont
        
    print(ans)
            	
if __name__ == "__main__":
	main()

Submission status: Accepted

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

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

ans = min(map(hmtd, A))
print(ans)

Submission status: Accepted

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

count = 0
k = 0
while True:
  for i in range(N):
    if A[i]/2**k % 2 != 0:
      break
  else:
    count += 1
    k += 1
    continue
  break
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

min_a = min(a_list)
count = 0
while min_a % 2 == 0:
    min_a /= 2
    count += 1
for a in a_list:
    if a % 2 ** count != 0:
        a_count = 0
        while a % 2 == 0:
            a /= 2
            a_count += 1
        count = a_count

print(count)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

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


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

print(count)

Submission status: Accepted

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


count1 = 0
k = 0
while True:
    count2 = 0
    for i in range(N):
        if A[i]/2** k % 2 !=0:
            break
        else:
            count2 += 1
    if count2 == N:
        count1 += 1
    else:
        break
    k += 1

print(count1)

Submission status: Accepted

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

min_a = min(a_list)
count = 0
while min_a % 2 == 0:
    min_a /= 2
    count += 1
#print(count)
for a in a_list:
    if a % 2 ** count != 0:
        a_count = 0
        while a % 2 == 0:
            a /= 2
            a_count += 1
        count = a_count

print(count)

Submission status: Accepted

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


count1 = 0
k = 0
while True:
  count2 = 0
  for i in range(N):
      if A[i]/2** k % 2 !=0:
        break
      else:
        count2 += 1
  if count2 == N:
    count1 += 1
  else:
    break
  k += 1

print(count1)

Submission status: Accepted

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

answer = 0
a = True

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

print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def g_c_d(x, y):
    if x == 0:
        return y
    elif y == 0:
        return x
    else:
        return g_c_d(y, x % y)


a = int(input())
b = list(map(int, input().split()))
c = 0
for i in range(a):
    c = g_c_d(c, b[i])
d = 0
while True:
    if c % 2 == 0:
        c = c // 2
        d += 1
    else:
        break
print(d)

Submission status: Accepted

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

cn = True
cnt = 0
while cn:
    i = 0
    for a1 in a:
        if a1 % 2 == 0:
            a[i] = a1 / 2
        else:
            cn = False
            break
        if i == N-1:
            cnt += 1
            break
        else:
            i += 1
print(cnt)

Submission status: Accepted

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

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

ans = 0
new_a = A.copy()
while 1:
    new_a = [a // 2 if a % 2 == 0 else -1 for a in new_a]
    if -1 in new_a:
        print(ans)
        exit()
    ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC081-B
N = int(input())
A = list(map(int, input().split()))
ans = 0
flag = True
while True:
    if flag == False:
        break
    for k in range(len(A)):
        if flag == False:
            break
        if A[k] % 2 == 0 and k == len(A) - 1:
            A[k] /= 2
            ans += 1
        elif A[k] % 2 == 0:
            A[k] /= 2
        else:
            flag = False
print(ans)

Submission status: Accepted

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

c=0
while False not in [True if n%2==0 else False for n in nums ]:
        nums=[i/2 for i in nums]
        c+=1
print(c)

Submission status: Accepted

Solution code:
# ABC081B - Shift only
def main():
    n = int(input())
    A = set(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)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# ABC081B - Shift only
def main():
    n = int(input())
    A = set(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)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

ans = []

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

print(min(ans))

Submission status: Accepted

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

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

min_n = 10**9

 
for i in l:
  num = 0
  while num < min_n:
    if i % 2 == 0:
      i = i//2
      num += 1
    else:
      break
  min_n = num

print(min_n)

Submission status: Accepted

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

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] = 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
while True:
    isAllEven = True
    for i in range(N):
        if A[i] % 2 == 0:
            A[i] = A[i] // 2
        else:
            isAllEven = False

    if isAllEven == False:
        break;
    else:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
numbers = list(map(int, input().split(" ")))
ans = []

for i in numbers:
	count = 0
	while i % 2 == 0:
		count += 1
		i = i /2
	ans.append(count)        
print(min(ans))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

input()
numbers = [int(i) for i in input().split(' ')]

operateCount = 0
while True:
  if (all(num % 2 == 0 for num in numbers)):
    numbers = [num / 2 for num in numbers]
    operateCount += 1
  else:
    break
print(operateCount)

Submission status: Accepted

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

Submission status: Accepted

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

while(flag == 0):
    for j in range(0,n):
        if(a[j] % 2 != 0):
            flag = 1
            break
        else:
            a[j] = a[j] / 2
    if(flag == 1):
        break
    else:
        count = count + 1

print(count)

Submission status: Accepted

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

while n == len([x/2 for x in a if x % 2 == 0]):
    a = [x/2 for x in a if x % 2 == 0]
    ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
data = input().split()#lines[0]つまり１行目をスペースで区切る.dataは配列
n = int(data[0])
a = input().split()
count = 0
j = 0
k = 0
flag = True
#型変換
for i in range(n):
    a[i] = int(a[i])

while flag:
    for k in range(n):
        if a[k]%2 == 0:
            a[k] = a[k]/2
        else:
            flag = False
            break
    if flag == False:
        print(j)
    j += 1

Submission status: Accepted

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

while True:
    for i in range(a):
        if b[i] % 2 != 0 or b[i] == 0:
            print(c)
            exit()
        b[i] //= 2
    c += 1

Submission status: Accepted

Solution code:
n=int(input())
A=[int(x) for x in input().split()]
B=[2]*n
ans=0
while all(a%2==0 for a in A):
  A=[x//y for (x, y) in zip(A, B)]
  ans+=1
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
A=[int(x) for x in input().split()]
B = [2] * n
ans=0
while all(a%2==0 for a in A):
  A = [x // y for (x, y) in zip(A, B)]
  ans+=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import fractions
N=int(input())
s = list( map(int , input().split()) )
ans = s[0]
count = 0
for i in range(1,N):
 ans = fractions.gcd(ans,s[i])
while i < pow(10,9):
 if ans%2 == 0:
  count +=1
  ans = ans/2
 else:
  break
print(count)

Submission status: Accepted

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

for i in range(100):
  for j in range(n):
    if a[j] %2 == 0:
      a[j] = a[j]//2
    else:
      print(i)
      sys.exit()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

N = int(input())
nplis = np.array([int(i) for i in input().split() if int(i) % 2 == 0])


cnt = 0

if(len(nplis) != N):
    print(0)
else:
    while(len(nplis) == N):
        nplis = nplis/2
        nplis = np.array([int(i) for i in nplis if int(i) % 2 == 0])
        cnt += 1
    
    print(cnt)

Submission status: Accepted

Solution code:
a=int(input())
b=[int(j) for j in input().split()]
c=True
d=0
while c==True:
  for i in range(len(b)):
    if b[i]%2!=0:
      c=False
    else :
      b[i]=b[i]//2
  if c==True:
    d+=1
    
print(d)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n = int(input())
a = list(map(int, input().split()))
count = []
for i in range(n):
    count.append(0)
    while a[i] % 2 == 0:
        a[i] = 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

def is_even(x):
    return x%2==0

while True:
    if all(map(is_even, A)):
        A = list(map(lambda x:x//2, A))
        ans += 1
    else: break

print(ans)

Submission status: Accepted

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

m = 99999999999999999999
for a in aas:
    c = 0
    while a % 2 == 0:
        c += 1
        a = a // 2
    if c < m:
        m = c
print(m)

Submission status: Accepted

Solution code:
def smaller(x, y):
	if x < y:
		return x
	return y

def div2(n):
	cnt = 0
	m = n
	while m % 2 == 0:
		cnt += 1
		m //= 2
	return cnt

N = int(input())
A = list(map(int, input().split()))
min = 5000000000000000
for i in range(0, N):
	min = smaller(min, div2(A[i]))
print(min)

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

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

ans = 10 ** 9
for i in range(n):
    tmp_ans = 0
    while a[i] % 2 ==0:
        tmp_ans += 1
        a[i] = a[i] // 2

    ans = min(ans, tmp_ans)

print(ans)

Submission status: Accepted

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

b = [int(e) for e in input().split()]
count=0
flag=0

#print(b[0])

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

print(count)

Submission status: Accepted

Solution code:
n = input()
a = input().split()
an = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if len(a) < n:
    n = len(a)

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

Submission status: Accepted

Solution code:
import numpy as np
n = int(input())
a=list(map(int,input().split()))
a_np = np.asarray(a)
cnt=0
frag = True
while frag:
    if np.all(a_np%2 == 0):
        a_np = a_np / 2
        cnt +=  1
    else:
        frag = False
print(cnt)

Submission status: Accepted

Solution code:
import sys


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

cnt = 0
while True:
    for i in range(0, size):
        if nums[i] % 2 == 0:
            nums[i] = nums[i] / 2
        else:
            print(cnt)
            sys.exit()
            
    # 一周回ったらカウントアップ
    cnt += 1

# まず来ないはずだけど、念のため
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0
check = [2**i for i in range(1, 50)]
for i in range(49):
    for x in A:
        if x % check[i] != 0:
            break
    else:
        ans = i + 1
print(ans)

Submission status: Accepted

Solution code:
N=input()
a=list(map(int,input().split()))
i=0
count=-1
b=[]
c=True
while c:
    i=0
    count+=1
    while i<int(N):
        if a[i]%2!=0:
            c=False
            break
        else:
            a[i]=a[i]/2
            i+=1
print(int(count))

Submission status: Accepted

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

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

Submission status: Accepted

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

shiftOnly()

Submission status: Accepted

Solution code:
a = int(input())
b = [3]
b = list(map(int, input().split()))
all_count = 0
k = 0
while(1):
    count = 0
    for x in range(a):
        if(b[x] % 2 == 0):
            count = count + 1
        else:
            k = 1
    if(a == count):
        for x in range(a):
            b[x] = b[x] / 2
    if(k == 1):
        break
    all_count += 1
print(all_count)

Submission status: Accepted

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

min_div2count = 10 ** 12
for a in A:
	count = 0
	while 0 == a % 2:
		a //= 2
		count += 1
	min_div2count = min(min_div2count, count)

print(min_div2count)

Submission status: Accepted

Solution code:
import numpy as np
input()
x = np.array(input().split(),dtype=np.int32)

answer = 0
while (x%2==0).all():
  x //= 2
  answer += 1
print(answer)

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

def dev2(n):
    cnt = 0
    while True:
        if n % 2 != 0:
            return cnt
        cnt += 1
        n //= 2

ans = dev2(A[0])
for i in range(1, N):
    ans = min(ans, dev2(A[i]))
    if ans == 0:
        break

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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())
a_list = list(map(int, input().split()))
cnt = 0
even = True

while(even):
    for i in range(n):
        if a_list[i] % 2 != 0:
            even = False
            break
        else:
          a_list[i] /= 2
    cnt += 1

print(cnt - 1)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

N = int(input())
arr = list(map(int, input().split()))
ctr = 0

while True:
    for i in range(N):
        if arr[i] % 2 != 0:
            print(ctr)
            exit()
        else:
            continue
    else:
        arr = list(map(lambda x: x // 2, arr))
        ctr += 1

Submission status: Accepted

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

Submission status: Accepted

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

cnt = 0
while True:
    flg  = False

    for a in A:
        if (a % 2 != 0):
            flg = True
            break
    else:
        cnt += 1
        A = list(map(lambda x : x // 2, A))
    
    if (flg == True):
        break

print(cnt)

Submission status: Accepted

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

for num in a:
	if (num % 2) != 0:
		e = False


while e:
	for i in range(len(a)):
		if (a[i] % 2) == 1:
			e = False
		else:
			a[i] /= 2
	if e:
		count += 1


print(count)

Submission status: Accepted

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