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:
from sys import stdin


def main():
    N = int(stdin.readline().rstrip())
    As = [int(x) for x in stdin.readline().rstrip().split()]
    count = 0
    while True:
        As = [x // 2 for x in As if x % 2 == 0]
        if len(As) == N:
            count += 1
            continue
        break
    print(count)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import numpy as np
s = input()
arr = list(map(int, input().split()))
count = 0
while True:
  if all(map(lambda x: x%2==0, arr)):
    arr = [i/2 for i in arr]
    count += 1
  else:
    break  
print(count)

Submission status: Accepted

Solution code:
def main():
    _ = int(input())
    A = map(int, input().split())
    ans = float('INF')
    for a in A:
        c = 0
        while a % 2 == 0:
            a //= 2
            c += 1
        ans = min(ans, c)
    print(ans)


main()

Submission status: Accepted

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

cnt = 0

while True:
    flag = False
    for i in A:
        if i % 2 != 0:
            flag = True
    
    if flag:
        break

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
tar_len = input()
targets = map(int, input().split())

def how_many_times_divisible(elem):
    count = 0
    while True:
        if elem % 2 != 0: break
        count += 1
        elem = elem / 2
    return count

count = min(map(how_many_times_divisible, targets))
print(count)

Submission status: Accepted

Solution code:
tar_len = input()
targets = list(map(int, input().split()))

count = 0

while True:
    exist_odd = False
    for target in targets:
        if target%2 != 0:
            exist_odd = True
    if exist_odd: break
    count += 1
    targets = list(map(lambda x: x/2, targets))
    
print(count)

Submission status: Accepted

Solution code:
n = int(input())
num_list = [int(x) for x in input().split()]
cnt = 0
flag = False
while flag != True:
    for i in num_list:
        if i % 2 != 0:
            flag = True
        
    if flag:
        print(cnt)
        break
    
    for j in range(len(num_list)):
        num_list[j] = num_list[j] / 2
    
    cnt+=1

Submission status: Accepted

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

exec_count = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(res)

Submission status: Accepted

Solution code:
import sys

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

count = 0
while True:
    for val in a:
        if val%2 != 0:
            print(count)
            sys.exit()

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

    count += 1

print(count)

Submission status: Accepted

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

cnt = 0

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

print(cnt)

Submission status: Accepted

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

T = True
cnt = 0

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

print(cnt)

Submission status: Accepted

Solution code:
import numpy as np

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

count = 0
while np.all(num_list % 2 == 0):
    count += 1
    num_list = num_list / 2

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
flg = True
cnt = 0
while 1:
    for val in A:
        if val % 2 != 0:
            flg = False
    if flg:
        A = list(map(lambda x: x // 2, A))
        cnt += 1
    else:
        print(cnt)
        exit()

Submission status: Accepted

Solution code:
_,t=open(0);n=eval(t.replace(' ','|'));print(len(bin(n&-n))-3)

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

Submission status: Accepted

Solution code:
# ABC081B - Shift only
num = int(input())
lst = list(map(int, input().split()))
count = 0

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

print(count)

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
D=0
k=1
while k>=0:
 for i in range(n):
  if a[i]%2**k==0:
    D+=1
 if D==n:
    k+=1
    D=0
 else:
  print(k-1)
  break

Submission status: Accepted

Solution code:
import numpy as np

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

ans = 0

while not np.any(B%2):
    B //= 2
    ans += 1
    
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#
# abc081 b
#
n = int(input())
a = list(map(int, input().split()))
r = [0] * n

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

print(min(r))

Submission status: Accepted

Solution code:
N = int(input());
A = [int(a) for a in input().split()]
r = 0;
while (r < 100):
    if (not all([a % 2 == 0 for a in A])):
        break;
    A = [a / 2 for a in A]
    r += 1
print(r)

Submission status: Accepted

Solution code:
n = int(input())
idx = list(map(int, input().split()))
result, temp = 0, idx
while True:
    if sum([i % 2 == 0 for i in temp]) == n:
        temp = [i / 2 for i in temp]
    else:
        break
    result += 1
print(result)

Submission status: Accepted

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


if __name__ == "__main__":
  main()

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
num = 0
for i in range(len(A)):
    num = num | A[i]
cnt = 0
for i in range(50):
    if not (num >> i) & 1:
        cnt += 1
    else:
        break
print(cnt)

Submission status: Accepted

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

ans=0
for i in range(30):
    a=[a[j]/2 for j in range(n) if a[j]%2==0]
    ans+=1
    if len(a)!=n:
        break

print(ans-1)

Submission status: Accepted

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

i = 0; count = 0
while True:
        
    if A[i] % 2 > 0:
        break

    elif i < (N-1):
        A[i] = int(A[i] / 2)
        i+=1    
    else:
        A[i] = int(A[i] / 2)
        i=0
        count+=1
        
print(count)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
def a(x):
    count = 0
    while x % 2 == 0:
        x /= 2
        count += 1
    return count

b = int(input(""))
c = map(int, input("").split())
d = min(map(a, c))
print(d)

Submission status: Accepted

Solution code:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def cnt0(n):
    return 0 if n&1 else 1 + cnt0(n//2)

def solve():
    n = f()
    a = f()

    min0 = int(1e9)

    for i in a:
        min0 = min(min0, cnt0(i))
    
    print(min0)

solve()

Submission status: Accepted

Solution code:
from functools import reduce
from operator import or_

N=int(input())
a=reduce(or_, map(int, input().split()))

c = 0
while (a >> c) & 1 == 0:
	c += 1

print(c)

Submission status: Accepted

Solution code:
data = [input() for x in range(0, 2, 1)]

num = [int(x) for x in data[1].split(" ")]

flag = 0
cnt = 0

while flag == 0:
  
  #偶数かチェック:
  for i in range(0, len(num), 1):
    if num[i] %2 == 0:
      pass
    else:
      flag = 1
      
  if flag == 1: break
        
 #置換
  for i in range(0, len(num), 1):
    num[i] = num[i] / 2
      
  cnt += 1
    
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

def main():
    N = int(input())
    A = [int(_) for _ in input().split()]

    t = 0
    while True:
        for i in range(N):
            if A[i] % 2 == 0:
                A[i] //= 2
            else:
                print(t)
                sys.exit()
        t += 1

main()

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    a = [int(x) for x in input().split()]

    min = 1000000000
    for idx in range(0, len(a)):
        count = 0
        while(a[idx] % 2 == 0):
            a[idx] /= 2
            count += 1

        if count < min:
            min = count

    print(min)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

count = -1
flag = True

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

        else:
            flag = False
            break



print(count)

Submission status: Accepted

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

count=-1
while len(A)==N:
    count+=1
    for i in range(N):
        if A[i]%2==0:
            A[i]=A[i]/2
        else:
            A.remove(A[i])
            break
print(count)

Submission status: Accepted

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

count=-1
while len(A)==N:
    count+=1
    for i in range(N):
        if A[i]%2==0:
            A[i]=A[i]/2
        else:
            A.remove(A[i])
            break
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

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

cnt = 0
while True:
    for i in range(len(A)):
        if A[i] % 2 != 0:
            break #forから抜ける
    else:
        A = [a/2 for a in A]
        cnt += 1
        continue
    break #whileから抜ける

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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


count = 0

def div(l):
    for i in range(len(l)):
        l[i] = l[i]/2

    return l

def checkOdd(l):
    for num in l:
        if num % 2 == 1:
            return True

    return False


while 1:
    if checkOdd(l) == True:
        break

    l = div(l)
    count = count + 1


print(count)

Submission status: Accepted

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

flg = False
cnt = 0

while True :

    for num in a :
        if int(num) % 2 == 0:
            pass
        else :
            flg = True
            break
    if flg == True :
        break

    for num in range(n) :
        a[num] = a[num] / 2

    cnt += 1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input()
A = list(map(int, input().split()))
flag = True
cnt = 0

for j in range(999999):
  for i in A:
    if i % 2 != 0:
      flag = False
  if flag:
    A = [a/2 for a in A]
    cnt += 1
  else:
    break
print(cnt)

Submission status: Accepted

Solution code:
input()

A = list(map(int, input().split(" ")))
B = 0

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

print(B)

Submission status: Accepted

Solution code:
input()

A = list(map(int, input().split(" ")))
B = 0

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

Submission status: Accepted

Solution code:
input()

import numpy as np
A = np.array(list(map(int, input().split(" "))))
a = 0

while np.sum(A%2) == 0:
  A = A/2
  a = a + 1

print(a)

Submission status: Accepted

Solution code:
n = input()
a = list(map(int, input().split()))
c = 0
def han(a):
    b = list(map(lambda x: x % 2, a))
    c = 0
    for i in b:
        if i == 0:
            c += 1
        else:
            c -= 1
    if c == len(b):return 1
    else: return 0

while True:
    if han(a) == 1:
        a = list(map(lambda x: x / 2, a))
        c += 1
    if han(a) == 0: 
        break
        c = 0

print(c)

Submission status: Accepted

Solution code:
# 整数の入力
n = input()
n = int(n)

# いくつあるかわからないときのスペース区切りの整数の入力
nums = input().split()
nums = list(map(int,nums))

#　n個の長さの0のリストを作る。
l = [0] * n


i = 0
for i in range(0,n):
	ans = 0
	check = nums[i]
	while check % 2 == 0:
		check = check / 2
		ans = ans + 1
		#print(check)
	l[i] = ans

#print (l)

print(min(l))

Submission status: Accepted

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

while True:
    for i in range(n):
        if A[i] % (2 ** j) != 0:
            break
    else:
        j += 1
        cnt += 1
        continue
    break
print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
ans = []
for a in A:
    cnt = 0
    while (a > 0) and (~a & 1):
        a >>= 1
        cnt += 1
    ans.append(cnt)
print(min(ans))

Submission status: Accepted

Solution code:
import numpy as np

x = int(input())
y = input().split()
y = [int(i) for i in y]
y = np.array(y)
count = 0
while sum([y[i] % 2 for i in range(len(y))]) == 0:
    y = y/2
    count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans - 1)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    A = [int(s) for s in input().split()]
    ans = 10**9
    for i in range(N):
        cnt = 0
        while A[i] % 2 == 0:
            A[i] = A[i] >> 1
            cnt+=1
        ans = min(ans, cnt)

    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
cnt=0
b=1
N=int(input())
A=input().split()

A=[int(A[j]) for j in range(N)]

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

Submission status: Accepted

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

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

Submission status: Accepted

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

if ans % 2 == 1 :
    print(0)
else :
    cnt = 0
    while ans/2 == int(ans/2) :
        ans /= 2
        cnt += 1
    print(cnt)

Submission status: Accepted

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

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

Submission status: Accepted

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

def half(n,z):
	existodd = 0
	count = 0
	while True: 
		for i in z:
			if i % 2 != 0:
				existodd = 1

		if existodd:
			print(count)
			break
		
		for i in range(n):		
			z[i] /= 2
		
		count += 1
	
half(n,z)

Submission status: Accepted

Solution code:
# /usr/bin/python
# -*- coding: utf-8 -*-
import sys
import math



def dev(an):
  ret = 0
  while True:
    for i in range(len(an)):
      if an[i]&1 == 1 or an[i] < 2:
        return ret
      else:
        an[i] //= 2
    ret += 1
    

if __name__ == "__main__":
  input()
  An = list(map(int, input().split()))  
  print(dev(An))

Submission status: Accepted

Solution code:
n = int(input())
as_ = (int(i) for i in input().split())
pow2s = [len(bin(i)) - bin(i).rfind('1') - 1 for i in as_]
print(min(pow2s))

Submission status: Accepted

Solution code:
def calc(x):
    res = 0
    while x % 2 == 0:
        x //= 2
        res += 1
    return res

N = int(input())
A = list(map(int,input().split()))
ans = 100
for a in A:
    ans = min(ans,calc(a))
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def counter(r):
  cnt=0
  while r%2==0:
    r=int(r/2)
    cnt+=1
  return cnt

n=input()
a =map(int,input().split())
cnt=min(map(counter,a))
print(cnt)

Submission status: Accepted

Solution code:
N = int(input())
A = [int(x) for x in input().split()]
flag = True
i=-1
while(flag):
    i+=1
    for ind,x in enumerate(A):
        if(x%2 == 0):
            A[ind]//=2
        else:
            flag = False
            break

print(i)

Submission status: Accepted

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

breakFlg = False
for ans in range(1,32):
    for i,a in enumerate(A):
        if a%2:
            ans -=1
            breakFlg = True
            break
        else:
            A[i] //= 2
    if breakFlg:
        break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

print(cnt)

Submission status: Accepted

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

min_2_factor = 30
for a in a_list:
	a_2_factor = 0
	current_a = a
	while True:
		if current_a % 2 == 0:
			a_2_factor += 1
		else:
			min_2_factor = min(min_2_factor, a_2_factor)
			break
		current_a = current_a / 2
	# print(a, a_2_factor)

print(min_2_factor)

Submission status: Accepted

Solution code:
N = int(input()) #1行目のNを取得する
A = list(map(int, input().split()))

count = 0
while all(elem % 2 == 0 for elem in A) :
    A = list(map(lambda x: x // 2, A))
    count = count + 1

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = float('inf')
for i in a:
  tmp_ans = 0
  while i%2 == 0:
    i = i//2
    tmp_ans += 1
  ans = min(ans,tmp_ans)
print(ans)

Submission status: Accepted

Solution code:
N=int(input())

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

t=0

j=int()
while all(i%2==0 for i in A):
    A=[i/2 for i in A]
    t=t+1
    
print(t)

Submission status: Accepted

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

def div2(a):
    global gc
    for i in range(n):
        if a[i] % 2:
            break
    else:
        gc += 1
        div2(list(map(lambda x: x // 2, a)))
    return gc

print(div2(a))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

def main():
    N = input()
    A = [int(a) for a in input().split()]
    print(counter(A))

def counter(A):
    count = -1
    judge = True
    while judge:
        A_ = []
        for a in A:
            if a%2 == 1:
                judge = False
                break
            else:
                A_.append(int(a/2))
        count += 1
        A = A_
    return count

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
N = int(input())		#Nを入力


if 1 > N or N > 200:
	print('Nは1~200の範囲で指定してください')
	exit()

a = input()			#Aを入力
A = a.split()		#入力をスペースで区切って配列化


if len(A) != N:	#入力の数とNが合わなかったらだめ
	print('N個だけ数を入力してください')
	exit()

for i in A:
	if int(i) < 1 or int(i) > 10**9:
		print('Aは1~10^9の範囲で入力してください')
		exit()

count = []
for i in range(0, N):
	x = int(A[i])
	count.append(0)
	while x%2 == 0:	#
		count[i]+=1
		x /= 2
print(min(count))

Submission status: Accepted

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

min = 10000000
for i in range(N):
    c = 0
    while A[i] % 2 == 0:
        c += 1
        A[i] //= 2
    if  c < min:
        min = c
print(min)

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
cnt=[]
for i in range(n):
    for j in range(10000):
        if a[i]%2 == 0:
            a[i]=a[i]/2
        else:
            cnt.append(j)

cnt.sort()
print(cnt[0])

Submission status: Accepted

Solution code:
from itertools import takewhile
from functools import reduce

data_num = int(input())
data_list = [int(num) for num in input().split(' ')]

combine_data = reduce(lambda x, y: x | y, data_list)

results = takewhile(lambda x: x == '0', bin(combine_data)[::-1])

print(len(list(results)))

Submission status: Accepted

Solution code:
from itertools import takewhile

data_num = int(input())
data_list = [bin(int(num)) for num in input().split(' ')]

results = [takewhile(lambda x: x == '0', data[::-1]) for data in data_list]

print(min([len(list(result)) for result in results]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import numpy
def shift_only(data, num):
    count = 0
    while True:
        if detect_even(data, num):
            count += 1
            data = data / 2
        else:
            break
    return count

# input ... array
def detect_even(data, num):
    if (data % 2 == 0).sum() == num:
        return True
    else:
        return False

if __name__ == "__main__":
    input = sys.stdin.readline
    size = int(input())
    data = numpy.array(list(map(int, input().split())))
    print(shift_only(data, size))

Submission status: Accepted

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

n=int(input())
a=map(int,input().split())
cnt=min(map(counter,a))
print(cnt)

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    values = list(map(int, input().split()))
    count = None
    for x in values:
        temp_count = 0
        while x % 2 == 0:
            x /= 2
            temp_count += 1
        count = temp_count if count == None else min(count, temp_count)


    print(count)

def canBeDevide(values, num):
    return all(x % 2 == 0 for x in values)








main()

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    values = list(map(int, input().split()))
    count = 0
    while canBeDevide(values, 2):
        count += 1
        values = list(map(lambda x: x / 2, values))

    print(count)

def canBeDevide(values, num):
    return all(x % 2 == 0 for x in values)








main()

Submission status: Accepted

Solution code:
N = 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:
# -*- coding:utf-8 -*-

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input()
s=list(map(int,input().split()))
bl = 0
for i in s:
  bl |= i
print(len(bin(bl&-bl))-3)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
a = list(map(int, input().split()))
max = 10**9
for i in a:
    c = 0
    if i % 2 == 0:
        while i % 2 == 0:
            i = i/2
            c += 1
    if c < max:
        max = c
        
print(max)

Submission status: Accepted

Solution code:
# 標準入力
## Nの入力受付
N = int(input())
## Aの入力受付
A = input().split()
for i in range(N):
    A[i] = int(A[i])


count=0
flag = True
# 2で割り切れる間回す
while flag:
    for i in range(N):
        d = A[i] % 2
        if d != 0:
            flag = False
        else:
            A[i] = A[i]/2
    if flag:
        count+=1
print(count)