TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.   Snuke, an employee, would like to play with this sequence.  Specifically, he would like to repeat the following operation as many times as possible:                For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3".   Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer.   At most how many operations can be performed?

Submission attempts (in order):
N = int(input().strip())
 
A = map(int, input().strip().split())
 
c = 0
if all([a // 2 == 1 for a in A]):
  print(0)
else:
  binA = [bin(a) for a in A]
  for a in binA:
    if a[-1] == '1':
      continue
    for b, i in zip(a[2:], reversed(range(len(a) - 2))):
      c += int(b) * i
  print(c)

N = int(input().strip())

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

if all([a // 2 == 1 for a in A]):
  print(0)
else:
  A = [bin(a) for a in A]
  for a in A:
    if a[-1] == '1':
      continue
    for b, i in zip(a[2:], reversed(range(len(a) - 2))):
      c += int(b) * i
  print(c)

N = int(input().strip())

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

if all([a // 2 == 1 for a in A]):
  print(0)
else:
  A = [bin(a) for a in A]
  for a in A:
    if a[-1] == '1':
      continue
    for b, i in zip(a[2:], reversed(range(len(a) - 2))):
      c += int(b) * i
  print(c)

N = int(input().strip())
 
A = list(map(int, input().strip().split()))
 
c = 0
if not all([a // 2 == 1 for a in A]):
  binA = [bin(a) for a in A]
  for a in binA:
    c += len(a) - a.rindex('1') - 1
print(c)


Verdicts: Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.   Snuke, an employee, would like to play with this sequence.  Specifically, he would like to repeat the following operation as many times as possible:                For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3".   Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer.   At most how many operations can be performed?

Submission attempts (in order):
N=input()
li = list(map(int,input().split()))
cnt =0
for i in li:
    print(i, cnt)
    while i % 2 == 0:
        i =  i / 2
        cnt += 1
print(cnt)

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

for i in li:
    cnt =0
    while i % 2 == 0:
        i= i / 2
        cnt += 1
print(cnt)

N=input()
li = list(map(int,input().split()))
cnt =0
for i in li:
    while i % 2 == 0:
        i =  i / 2
        cnt += 1
print(cnt)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.   Snuke, an employee, would like to play with this sequence.  Specifically, he would like to repeat the following operation as many times as possible:                For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3".   Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer.   At most how many operations can be performed?

Submission attempts (in order):
n = int(input())
A = list(map(int, input().split()))

ans = 0
for a in A:
  tmp = format(a, "b")
  ans += len(tmp) - tmp.rfind("1") + 1
print(ans)

n = int(input())
A = list(map(int, input().split()))
print(sum(len(format(a, "b")) - format(a, "b").rfind("1")-1 for a in A))

Verdicts: Wrong Answer

Accepted
Problem: As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.   Snuke, an employee, would like to play with this sequence.  Specifically, he would like to repeat the following operation as many times as possible:                For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3".   Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer.   At most how many operations can be performed?

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

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



Verdicts: Runtime Error

Accepted
Problem: As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.   Snuke, an employee, would like to play with this sequence.  Specifically, he would like to repeat the following operation as many times as possible:                For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3".   Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer.   At most how many operations can be performed?

Submission attempts (in order):
n = int(input())
a_list = list(map(int, input().split()))
def count_2(num):
    count = 0
    while num%2 == 0:
        num /= 2
        pritn(num)
        count += 1
    return count
ans = 0
for i in range(n):
    ans += count_2(a_list[i])
print(ans)

n = int(input())
a_list = list(map(int, input().split()))
def count_2(num):
    count = 0
    while num%2 == 0:
        num /= 2
        count += 1
    return count
ans = 0
for i in range(n):
    ans += count_2(a_list[i])
print(ans)

Verdicts: Runtime Error

Accepted
Problem: As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.   Snuke, an employee, would like to play with this sequence.  Specifically, he would like to repeat the following operation as many times as possible:                For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3".   Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer.   At most how many operations can be performed?

Submission attempts (in order):
N = int(input())
A = list(map(int, input().split()))

s = 1
ans = 0
for a in A:	
	while a % 2 == 0:
		a = a // 2
		ans += 1
	print(ans)

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

s = 1
ans = 0
for a in A:	
	while a % 2 == 0:
		a = a // 2
		ans += 1
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.   Snuke, an employee, would like to play with this sequence.  Specifically, he would like to repeat the following operation as many times as possible:                For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3".   Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer.   At most how many operations can be performed?

Submission attempts (in order):
n=int(input())
a=list(map(int,input().split()))
cnt=10**9
for i in range(n):
  k=0
  while (a-1):
    if a%2==0:
      a=a//2
      k+=1
    else:break
  cnt=min(cnt,k)    
print(cnt)


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

n=int(input())
a=list(map(int,input().split()))
cnt=10**9
for i in range(n):
  k=0
  while (a[i]-1):
    if a[i]%2==0:
      a[i]=a[i]//2
      k+=1
    else:break
  cnt=min(cnt,k)    
print(cnt)


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


Verdicts: Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.   Snuke, an employee, would like to play with this sequence.  Specifically, he would like to repeat the following operation as many times as possible:                For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3".   Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer.   At most how many operations can be performed?

Submission attempts (in order):
import math
n = int(input())
a = list(map(int,input().split()))
g_c = sum([1 for i in a if i%2==0]) 
ans = 0
for i in a:
  if i%2==0:
    while(i%2==0):
      i = i//2
      ans += 1
print(c)

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

ans = 0
for i in a:
  if i%2==0:
    while(i%2==0):
      i = i//2
      ans += 1
print(ans)

Verdicts: Runtime Error

Accepted
Problem: As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.   Snuke, an employee, would like to play with this sequence.  Specifically, he would like to repeat the following operation as many times as possible:                For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3".   Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer.   At most how many operations can be performed?

Submission attempts (in order):
l=list(map(int,input().split()))
dd=[]                                                                  
for i in l: 
	if i % 2==0: 
		dd.append(i)       
cnt_lst=[]                                                             
for i in dd: 
	cnt1=0 
	while(i % 2==0): 
		i//= 2 
		cnt1+=1 
		if i %2==1: 
			cnt=cnt1 
			cnt_lst.append(cnt)             
			break 
print(sum(cnt_lst)) 


l=list(map(int,input().split()) 
dd=[]                                                                  
for i in l: 
	if i % 2==0: 
		dd.append(i)       
cnt_lst=[]                                                             
for i in dd: 
	cnt1=0 
	while(i % 2==0): 
		i//= 2 
		cnt1+=1 
		if i %2==1: 
			cnt=cnt1 
			cnt_lst.append(cnt)             
			break 
print(sum(cnt_lst)) 

n=int(input())
l=list(map(int,input().split()))
dd=[]                                                                  
for i in l: 
	if i % 2==0:
		dd.append(i)       
cnt_lst=[]                                                             
for i in dd: 
	cnt1=0 
	while(i % 2==0): 
		i//= 2 
		cnt1+=1 
		if i %2==1: 
			cnt=cnt1 
			cnt_lst.append(cnt)             
			break 
print(sum(cnt_lst)) 


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.   Snuke, an employee, would like to play with this sequence.  Specifically, he would like to repeat the following operation as many times as possible:                For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3".   Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer.   At most how many operations can be performed?

Submission attempts (in order):
n = int(input())
l = list(map(int, input().split()))

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

print(count)

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

print(count)


Verdicts: Runtime Error

Accepted
Problem: As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.   Snuke, an employee, would like to play with this sequence.  Specifically, he would like to repeat the following operation as many times as possible:                For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3".   Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer.   At most how many operations can be performed?

Submission attempts (in order):
int_n = int(input())

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

counter = 0

while True:
    templist = list(filter(lambda x: x % 2 == 0, input_array))
    if len(templist) != 0:
        max_even = max(filter(lambda x: x % 2 == 0, input_array))
        even_index = input_array.index(max_even)

        input_array = list(map(lambda x: x[1] if x[0] != even_index else x[1] / 2, enumerate(input_array)))
        print(input_array)

        counter += 1

    else:
        break

print(counter)





int_n = int(input())
li_a = list(map(int, input().split()))

answer = 0
for a in li_a:
    wk = a
    while wk % 2 == 0:
        wk = wk // 2
        answer += 1
print(answer)


Verdicts: Wrong Answer

Accepted
Problem: As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.   Snuke, an employee, would like to play with this sequence.  Specifically, he would like to repeat the following operation as many times as possible:                For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3".   Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer.   At most how many operations can be performed?

Submission attempts (in order):
N = int(input())
a = np.array(input().split()).astype(int)

sum = 0
for i in range(len(a)):
    sum += a[i]%2
print(sum)


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

sum = 0
for a_int in a:
    a_int = int(a_int)
    count = 0
    flag = 0
    while flag == 0:
        if a_int % 2 == 0:
            a_int = a_int / 2
            count += 1
        else:
            flag = 1
            break
    sum += count
print(sum)


Verdicts: Runtime Error

Accepted
Problem: As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.   Snuke, an employee, would like to play with this sequence.  Specifically, he would like to repeat the following operation as many times as possible:                For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3".   Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer.   At most how many operations can be performed?

Submission attempts (in order):
N=int(input().strip())
A=list(map(int,input().split()))
nns=[2**i for i in range(31)]
def func(n,x):
    return n%nns[x]==0
def binsearch_int(func, min_x, max_x):
    
    if func(max_x):
        return max_x
    if not func(min_x):
        return None
    left,right=min_x,max_x
    while left+1<right:
        mid=(left+right)//2
        if func(mid):
            left=mid
        else:
            right=mid
    return left
sum(binsearch_int(lambda x: func(i,x),0,int(math.log2(i))+1) for i in A)

import math
N=int(input().strip())
A=list(map(int,input().split()))
nns=[2**i for i in range(31)]
def func(n,x):
    return n%nns[x]==0
def binsearch_int(func, min_x, max_x):
    
    if func(max_x):
        return max_x
    if not func(min_x):
        return None
    left,right=min_x,max_x
    while left+1<right:
        mid=(left+right)//2
        if func(mid):
            left=mid
        else:
            right=mid
    return left
sum(binsearch_int(lambda x: func(i,x),0,int(math.log2(i))+1) for i in A)

import math
N=int(input().strip())
A=list(map(int,input().split()))
nns=[2**i for i in range(31)]
def func(n,x):
    return n%nns[x]==0
def binsearch_int(func, min_x, max_x):
    
    if func(max_x):
        return max_x
    if not func(min_x):
        return None
    left,right=min_x,max_x
    while left+1<right:
        mid=(left+right)//2
        if func(mid):
            left=mid
        else:
            right=mid
    return left
print(sum(binsearch_int(lambda x: func(i,x),0,int(math.log2(i))+1) for i in A))

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.   Snuke, an employee, would like to play with this sequence.  Specifically, he would like to repeat the following operation as many times as possible:                For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3".   Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer.   At most how many operations can be performed?

Submission attempts (in order):
N = input()
number = input()

a = number.split()
n_list=[]
count=0



for num in a:
    num = int(num)
    if num % 2 == 0:
        n_list.append(num)


if n_list != []:
    maxnum = max(n_list)
    maxnum = maxnum/2
    for num2 in n_list:
        for i in range(maxnum):
            if num2 % 2**(i+1) == 0:
                count+=1


print(count)

from math import log2

N = input()
number = input()

a = number.split()
n_list=[]
count=0



for num in a:
    num = int(num)
    if num % 2 == 0:
        n_list.append(num)


if n_list != []:
    maxnum = max(n_list)
    maxnum = log2(maxnum)
    for num2 in n_list:
        for i in range(maxnum):
            if num2 % 2**(i+1) == 0:
                count+=1


print(count)

N = input()
number = input()

a = number.split()
n_list=[]
count=0



for num in a:
    num = int(num)
    if num % 2 == 0:
        n_list.append(num)

if n_list != []:
    maxnum = max(n_list)
    for num2 in n_list:
        for i in range(len(n_list)):
            if num2 % (i+1)*2 == 0:
                count+=1


print(count)

from math import log2

N = input()
number = input()

a = number.split()
n_list=[]
count=0



for num in a:
    num = int(num)
    if num % 2 == 0:
        n_list.append(num)


if n_list != []:
    maxnum = max(n_list)
    maxnum = log2(maxnum)
    maxnum = int(maxnum)
    for num2 in n_list:
        for i in range(maxnum):
            if num2 % 2**(i+1) == 0:
                count+=1


print(count)

Verdicts: Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.   Snuke, an employee, would like to play with this sequence.  Specifically, he would like to repeat the following operation as many times as possible:                For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3".   Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer.   At most how many operations can be performed?

Submission attempts (in order):
n = int(input())
a = list(map(int,input().split()))
ans = 0
for i in a:
    while(i % 2 ==0):
        i // = 2
        ans += 1
print(ans)

n = int(input())
a = list(map(int,input().split()))
ans = 0
for i in a:
    while not i %2:
        i//= 2
        ans += 1
print(ans)

Verdicts: Runtime Error

Accepted
Problem: As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.   Snuke, an employee, would like to play with this sequence.  Specifically, he would like to repeat the following operation as many times as possible:                For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3".   Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer.   At most how many operations can be performed?

Submission attempts (in order):
n = int(input())
l = list(map(int, input().split()))

ans = 0
flag = 1
i = 1
while flag:
  y = 2**i
  m = list(map(lambda x: x%y, l))
  print(m)
  if 0 in m:
    ans += m.count(0)
    i += 1
  else:
    flag = 0
print(ans)

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


Verdicts: Wrong Answer

Accepted
Problem: As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.   Snuke, an employee, would like to play with this sequence.  Specifically, he would like to repeat the following operation as many times as possible:                For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3".   Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer.   At most how many operations can be performed?

Submission attempts (in order):
N = int(input())
A = list(map(int, input().split()))

A = sorted(A)
A = [i for i in A if i % 2 == 0]

a = 0
cnt = 0


while True:
    A = [i / 2 for i in A]
    a += 1
    print(A)
    cnt += a*len([i for i in A if i % 2 == 1])

    if len([i for i in A if i > 1]) == 0:
        break
    A = [i for i in A if i % 2 == 0]
print(cnt)


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

A = sorted(A)
A = [i for i in A if i % 2 == 0]

a = 0
cnt = 0


while True:
    A = [i / 2 for i in A]
    a += 1
    cnt += a*len([i for i in A if i % 2 == 1])

    if len([i for i in A if i > 1]) == 0:
        break
    A = [i for i in A if i % 2 == 0]
print(cnt)


Verdicts: Wrong Answer

Accepted
Problem: As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.   Snuke, an employee, would like to play with this sequence.  Specifically, he would like to repeat the following operation as many times as possible:                For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3".   Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer.   At most how many operations can be performed?

Submission attempts (in order):
n = int(input())
a_list = list(map(int, input().split()))
count = 0
print(a_list)
for a in a_list:
    while True:
        if a % 2 == 0:
            a = a//2
            count += 1
        else:
            break
print(count)

n = int(input())
a_list = list(map(int, input().split()))
count = 0
for a in a_list:
    while True:
        if a % 2 == 0:
            a = a//2
            count += 1
        else:
            break
print(count)

Verdicts: Wrong Answer

Accepted
Problem: As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.   Snuke, an employee, would like to play with this sequence.  Specifically, he would like to repeat the following operation as many times as possible:                For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3".   Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer.   At most how many operations can be performed?

Submission attempts (in order):
num = int(input())
lis = map(int,input().split())

ans = 0
for number in lis:
    while number%2 == 0:
        number /= 2
        ans += 1

num = int(input())
lis = map(int,input().split())

ans = 0
for number in lis:
    while number%2 == 0:
        number /= 2
        ans += 1
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.   Snuke, an employee, would like to play with this sequence.  Specifically, he would like to repeat the following operation as many times as possible:                For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3".   Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer.   At most how many operations can be performed?

Submission attempts (in order):
N = int(input())
nums = list(map(int, input().split()))


def renew(arr):
    res = []
    changed = False
    for i in arr:
        if not i & 1 and not changed:
            res.append(int(i / 2))
            changed = True
        else:
            res.append(i * 3)
    if changed:
        return res
    else:
        return []


count = 0
cs = renew(nums)
print(cs)
while len(cs) > 0:
    count += 1
    cs = renew(cs)


print(count)

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


count = 0
for i in nums:
    w = i
    while not w & 1:
        w = int(w / 2)
        count += 1

print(count)

Verdicts: Runtime Error

Accepted
Problem: As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.   Snuke, an employee, would like to play with this sequence.  Specifically, he would like to repeat the following operation as many times as possible:                For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3".   Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer.   At most how many operations can be performed?

Submission attempts (in order):
from collections import deque
from collections import namedtuple

N = int(input())
A = [int(i) for i in input().split()]
Prog = namedtuple("Prog","p,c")
d = deque([(deque(A),0)])
ans = 0
while(len(d)>0):
    tmp = d.pop()
    tmp2 = deque()
    for i in gen(tmp[0]):
        tmp2.appendleft(i.p)
    tmp2.pop()
    if len(tmp2) < 1:
        if ans < tmp[1]:
            ans = tmp[1]
    else:
        for i in tmp2:
            d.appendleft((i,tmp[1]+1))
print(ans)

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

d = deque(A)
c = 0
while(len(d)>0):
    tmp = d.pop()
    if tmp%2==0:
        c+=1
        d.append(tmp//2)
print(c)

from collections import deque
N = int(input())
A = [int(i) for i in input().split()]

d = deque(A)
c = 0
while(len(d)>0):
    tmp = d.pop()
    if tmp%2==0:
        c+=1
        d.append(tmp//2)
print(c)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.   Snuke, an employee, would like to play with this sequence.  Specifically, he would like to repeat the following operation as many times as possible:                For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3".   Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer.   At most how many operations can be performed?

Submission attempts (in order):
N = int(input())
inp2 = input()
a = inp2.split()
count = 0
for i in range(int(N)):
	b = int(a[i])
	flag = True
	while flag:
		c = b/2
		if c.isinstance(c,int):
			count+=1
		else:
			flag = False

print(count) 

N = int(input())
inp2 = int(input())
a = inp2.split()
count = 0
for i in range(int(N)):
	b = int(a[i])
	flag = True
	while flag:
		c = b/2
		if c.isinstance(c,int):
			count+=1
		else:
			flag = False

print(count) 

N = int(input())
inp2 = input()
a = inp2.split()
count = 0
for i in range(int(N)):
	b = int(a[i])
	flag = True
	c = b
	while flag:
		c = c/2
		if c.is_integer():
			count+=1
		else:
			flag = False

print(count) 

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.   Snuke, an employee, would like to play with this sequence.  Specifically, he would like to repeat the following operation as many times as possible:                For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3".   Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer.   At most how many operations can be performed?

Submission attempts (in order):
def solve(N, As):
    def f(n):
        c = 0
        while n % 2 == 0:
            c += 1
            n //= 2
        return c
    return sum([f(a) for a in As])


if __name__ == "__main__":
    N = int(input())
    As = list(map(int, input().split(" ")))
    print(solve(N))


def solve(N, As):
    def f(n):
        c = 0
        while n % 2 == 0:
            c += 1
            n //= 2
        return c
    return sum([f(a) for a in As])


if __name__ == "__main__":
    N = int(input())
    As = list(map(int, input().split(" ")))
    print(solve(N, As))


Verdicts: Runtime Error

Accepted
Problem: As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.   Snuke, an employee, would like to play with this sequence.  Specifically, he would like to repeat the following operation as many times as possible:                For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3".   Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer.   At most how many operations can be performed?

Submission attempts (in order):
N = input()
nums = list(map(int, input().split()))
cnt = 0
for i in range(0,n-1):
    taisyouN = nums[i]
    while taisyouN %2 == 0:
        taisyouN = taisyouN/2
        cnt = cnt+1
print(cnt)

N = input()
nums = list(map(int, input().split()))
cnt = 0
cntlst = []
for i in range (0,N-1):
    taisyouN = nums[i]
    while taisyouN %2 == 0:
        taisyouN = taisyouN/2
        cnt = cnt+1
print(cnt)

N = int(input())
nums = list(map(int, input().split()))
cnt = 0
cntlst = []
for i in range(0,N):
    taisyouN = nums[i]
    while taisyouN %2 == 0:
        taisyouN = taisyouN/2
        cnt = cnt+1
    cntlst.append(cnt)
    cnt = 0
print(sum(cntlst))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.   Snuke, an employee, would like to play with this sequence.  Specifically, he would like to repeat the following operation as many times as possible:                For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3".   Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer.   At most how many operations can be performed?

Submission attempts (in order):
n = int(input())
a = list(map(int, input().split()))
b = []
cnt = 0

for x in a:
    if x % 2 == 0:
        b.append(x)
print(b)
for j in range(len(b)):
    while(b[j] % 2 == 0):
        cnt += 1
        b[j] /= 2

print(cnt)


n = int(input())
a = list(map(int, input().split()))
b = []
cnt = 0

for x in a:
    if x % 2 == 0:
        b.append(x)

for j in range(len(b)):
    while(b[j] % 2 == 0):
        cnt += 1
        b[j] /= 2

print(cnt)


Verdicts: Wrong Answer

Accepted
Problem: As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.   Snuke, an employee, would like to play with this sequence.  Specifically, he would like to repeat the following operation as many times as possible:                For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3".   Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer.   At most how many operations can be performed?

Submission attempts (in order):
#100c
def check_number_of_devide_by_2(n):

    count = 0
    while n%2==0:
        count += 1
        n = n/2
    
    return count

N = int(input())

#100c
def check_number_of_devide_by_2(n):

    count = 0
    while n%2==0:
        count += 1
        n = n/2
    
    return count

N = int(input())

list_a = [check_number_of_devide_by_2(i) for i in list(map(int, input().split()))]


print(sum(list_a))

Verdicts: Wrong Answer

Accepted
Problem: As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.   Snuke, an employee, would like to play with this sequence.  Specifically, he would like to repeat the following operation as many times as possible:                For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3".   Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer.   At most how many operations can be performed?

Submission attempts (in order):
# ABC100 C "*3 or /2"

import numpy
N = int(input())
a = numpy.array(list(map(int, input().split())))
# a.sort(reversed = False)
a.sort()
a = a[::-1]

print(a)
count = 1

if all(elem % 2 !=0 for elem in a) == True:
    ans = 0
else:
    while True:
        if all(elem % 2 !=0 for elem in a) == True:
            ans = count -1
            break
        else:
            for ind in range(N):
                if a[ind] % 2 ==0:
                    i = ind
                    break
            a[i] = a[i]/2
           # print(i,a[i])
            a[:i] = a[:i]*3
            a[i+1:] = a[i+1:]*3
            #print(count, a)
            a.sort()
            a = a[::-1]
            count += 1
        
print(ans)

import numpy
N = int(input())
a = numpy.array(list(map(int, input().split())))
count = 0

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

Verdicts: Wrong Answer

Accepted
Problem: As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.   Snuke, an employee, would like to play with this sequence.  Specifically, he would like to repeat the following operation as many times as possible:                For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3".   Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer.   At most how many operations can be performed?

Submission attempts (in order):
n = map(int,input().split())
lis = list(map(int,input().split()))
ans = 0
def f(x):
 if x%2:
  return 0
 else:
  return f(x//2)+1
for i in range(n):
 ans += f(lis[i])
print(ans)

n = map(int,input().split())
lis = list(map(int,input().split()))
ans = 0
def f(x):
 if x%2:
  return(0)
 else:
  return(f(x//2)+1)
for i in range(n):
 ans += f(lis[i])
print(ans)

n = int(input())
lis = list(map(int,input().split()))
ans = 0
def f(x):
 if x%2:
  return(0)
 else:
  return(f(x//2)+1)
for i in range(n):
 ans += f(lis[i])
print(ans)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.   Snuke, an employee, would like to play with this sequence.  Specifically, he would like to repeat the following operation as many times as possible:                For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3".   Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer.   At most how many operations can be performed?

Submission attempts (in order):
n = int(input())
x = [int(x) for x in input().split()]

cnt=0

for i in range(n):
	if x[i]%2==0:
		cnt+=1
		i+=-1

print(cnt)

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

cnt=0
i=1

while i<n+1:
	if x[i-1]%2==0:
		x[i-1]=x[i-1]/2
		cnt+=1
		i+=-1
	i+=1

print(cnt)

Verdicts: Wrong Answer

Accepted
Problem: As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.   Snuke, an employee, would like to play with this sequence.  Specifically, he would like to repeat the following operation as many times as possible:                For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3".   Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer.   At most how many operations can be performed?

Submission attempts (in order):
n = int(input())
a = list(map(int, input().split()))


count = 0
i=0
while(i <= len(a)):
    if a[i] % 2 == 0:
        count += 1
        a[i] = int(a[i] // 2)
        continue
    else:
        i += 1

print(count)

count = 0
i=0
while(i < len(a)):
    if a[i] % 2 == 0:
        count += 1
        a[i] = int(a[i] // 2)
        continue
    else:
        i += 1

print(count)        

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


count = 0



while(True):
    even_count = 0
    even_index = 0
    for i in range(len(i)):
        if a[i] % 2 == 0:
            even_index = i
            even_count += 1

    if even_count >= 2:
        count += 1
        a[even_index] = int(a[even_index] / 2)
    else:
        break

print(count)

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


count = 0
i = 0
while(i < len(a)):
    print(i)
    if a[i] % 2 == 0:
        count += 1
        a[i] = int(a[i] // 2)
        continue
    else:
        i += 1

print(count)

    N = int(input())
    a_li = list(map(int,input().split()))
     
    count = 0
    for i in a_li:
        while i % 2 == 0:
            cnt += 1
            i //= 2
            if i % 2 != 0:
                break
     
    print(count)

N = int(input())
a_li = list(map(int,input().split()))
         
cnt = 0
for i in a_li:
    while i % 2 == 0:
        cnt += 1
        i //= 2
        if i % 2 != 0:
            break
        
print(cnt)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.   Snuke, an employee, would like to play with this sequence.  Specifically, he would like to repeat the following operation as many times as possible:                For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3".   Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer.   At most how many operations can be performed?

Submission attempts (in order):
N = int(input())
a = [int(i) for i in input().split()]

counter = 0
for i in range(N):
    A = a[i]
    while 2 * 2 <= A:
        while A % 2 == 0:
            A /= 2
            counter += 1
        break
print(int(counter))


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

counter = 0
for i in range(N):
    A = a[i]
    while 2 * 2 <= A:
        while A % 2 == 0:
            A /= 2
            counter += 1
        break
print(int(counter))


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

counter = 0
for i in range(N):
    A = a[i]
    while 2 * 2 <= A:
        while A % 2 == 0:
            A = A/2
            counter += 1
        break
print(counter)


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

counter = 0
for i in range(N):
    A = a[i]
    # while 2 * 2 <= A:
    while A % 2 == 0:
        A /= 2
        counter += 1
        # break
print(int(counter))


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.   Snuke, an employee, would like to play with this sequence.  Specifically, he would like to repeat the following operation as many times as possible:                For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3".   Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer.   At most how many operations can be performed?

Submission attempts (in order):
def resolve():
    N = int(input())
    a = list(map(int, input().split()))
    ans = 0
    for i in a:
        ans += prime_factorize(i).count(2)

    print(ans)

    return

resolve()

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

def resolve():
    N = int(input())
    a = list(map(int, input().split()))
    ans = 0
    for i in a:
        ans += prime_factorize(i).count(2)

    print(ans)

    return

resolve()

Verdicts: Runtime Error

Accepted
Problem: As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.   Snuke, an employee, would like to play with this sequence.  Specifically, he would like to repeat the following operation as many times as possible:                For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3".   Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer.   At most how many operations can be performed?

Submission attempts (in order):
n = int(input())
l = list(map(int,input().split()))
count = 0
for i in l:
  while i % 2 == 0:
    count += 1
    i // 2
print(count)

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


Verdicts: Time Limit Exceeded

Accepted
Problem: As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.   Snuke, an employee, would like to play with this sequence.  Specifically, he would like to repeat the following operation as many times as possible:                For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3".   Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer.   At most how many operations can be performed?

Submission attempts (in order):
N = int(input())
a = [int(input()) for i in range(N) ]
count = 0
for i in range(N):
	for j in range(len(a)):
 		if a[j] % 2 == 0:
    		count += 1
            a[j] /= 2
print(count)

N = int(input())
a = list(map(int, input().split()))
count = 0
for i in range(N):
  for n in a:
    if n % 2 == 0:
      count += 1
      n /= 2
print(count)

N = int(input())
a = [int(input()) for i in range(N) ]
count = 0
for i in range(N):
	for n in a:
 		if n % 2 == 0:
    		count += 1
            n /= 2
print(count)

N = int(input())
a = list(map(int, input().split()))
count = 0
for i in range(N):
	for j in range(N):
		if a[j] % 2 == 0:
			count += 1
			a[j] /= 2
	print(a)
print(count)

N = int(input())
a = list(map(int, input().split()))
ans = 0
for i in range(N):
  odd = 0
  if a[i] % 2 != 0:
    odd += 1
  else:
    ans += 1
  if odd == len(a):
    break
print(ans)

N = int(input())
a = list(map(int, input().split()))
count = 0
for i in range(N):
	for n in a:
 		if n % 2 == 0:
    		count += 1
            n /= 2
print(count)

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

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.   Snuke, an employee, would like to play with this sequence.  Specifically, he would like to repeat the following operation as many times as possible:                For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3".   Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer.   At most how many operations can be performed?

Submission attempts (in order):
i=input;i()
i(sum([len(bin(a&-a))-3 for a in map(int,i().split())]))


input()
print(sum([len(bin(a&-a))-3 for a in map(int,input().split())]))


Verdicts: Runtime Error

Accepted
Problem: As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.   Snuke, an employee, would like to play with this sequence.  Specifically, he would like to repeat the following operation as many times as possible:                For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3".   Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer.   At most how many operations can be performed?

Submission attempts (in order):
n=int(input())
a=list(map(int,input().split()))
cnt=0
for i in range(n):
  if a[i]%2==0:
    while a[i]%2==0:
      cnt+=1
      a[i]//2
print(cnt)

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


Verdicts: Time Limit Exceeded

Accepted
Problem: As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.   Snuke, an employee, would like to play with this sequence.  Specifically, he would like to repeat the following operation as many times as possible:                For every i satisfying 1 \leq i \leq N, perform one of the following: "divide a_i by 2" and "multiply a_i by 3".   Here, choosing "multiply a_i by 3" for every i is not allowed, and the value of a_i after the operation must be an integer.   At most how many operations can be performed?

Submission attempts (in order):
n=int(input())

a=list(map(int,input().split()))
b=[]

for i in range(n):
  cnt=1
  while (a[i])%(2**cnt)==0:
    cnt+=1
  b.append(cnt-1)

b.sort()
print(n*b[-1])

n=int(input())

a=list(map(int,input().split()))
b=[]
sum=0

for i in range(n):
  cnt=1
  while (a[i])%(2**cnt)==0:
    cnt+=1
  b.append(cnt-1)

for i in range(n):
  sum=sum+b[i]
  
print(sum)

Verdicts: Wrong Answer

Accepted