Problem:


Score : 200 points

Problem Statement

Takahashi loves numbers divisible by 2.

You are given a positive integer N. Among the integers between 1 and N (inclusive), find the one that can be divisible by 2 for the most number of times. The solution is always unique.

Here, the number of times an integer can be divisible by 2, is how many times the integer can be divided by 2 without remainder.

For example,

6 can be divided by 2 once: 6 -> 3.

8 can be divided by 2 three times: 8 -> 4 -> 2 -> 1.

3 can be divided by 2 zero times.

Constraints

1 ≤ N ≤ 100

Input

Input is given from Standard Input in the following format:

N

Output

Print the answer.

Sample Input 1

7

Sample Output 1

4

4 can be divided by 2 twice, which is the most number of times among 1, 2, ..., 7.

Sample Input 2

32

Sample Output 2

32

Sample Input 3

1

Sample Output 3

1

Sample Input 4

100

Sample Output 4

64



Sample input:
7


Sample output:
4

Submission status: Wrong Answer

Solution code:
# coding: utf-8

N = int(input())

ans_cou = 1
ans_num = 1
for i in range(N + 1):
    a = i
    sum = 0
    while a % 2 == 0 and a != 0:
        sum += 1
        a = a // 2
    if sum > ans_cou:
        ans_cou = sum
        ans_num = i

print(ans_num)

Submission status: Wrong Answer

Solution code:
# coding: utf-8

N = int(input())

ans_cou = 0
ans_num = 0
for i in range(N + 1):
    a = i
    sum = 0
    while a % 2 == 0 and a != 0:
        sum += 1
        a = a // 2
    if sum > ans_cou:
        ans_cou = sum
        ans_num = i

print(ans_num)

Submission status: Wrong Answer

Solution code:
S=[1,2,4,8,16,32,64]
a=int(input())
S.append(a)
S=sorted(S)
print(S[max(S.index(a)-1,0)])

Submission status: Wrong Answer

Solution code:
def f(n):
  ret=0
  while n%2==0:
    ret+=1
    n/=2
  return ret
n=int(input())
ans=0
max_=0
for a in range(1,n+1):
  if f(a)>max_:
    max_=f(a)
    ans=a
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
result = []
for i in range(1, N + 1):
    count = 0
    flag = True
    while flag:
        i = i / 2
        if i % 2 == 0:
            count += 1
            continue
        else:
            result.append(count)
            flag = False
print(result.index(max(result))+1)

Submission status: Wrong Answer

Solution code:
n=int(input())

now=1
while True:
  if now>n:
    break
  now*=2
print(now)

Submission status: Wrong Answer

Solution code:
N = int(input())

if N >= 64:
  print(64)
elif 32 <= N < 63:
  print(32)
elif 16 <= N < 32:
  print(16)
elif 8 <= N < 16:
  print(8)
elif 4 <= N < 8:
  print(4)
elif 2 <= N < 4:
  print(2)
else:
  print(1)

Submission status: Wrong Answer

Solution code:
N = int(input())
max = 0
ans = 0

for i in reversed(range(0, N+1)):
  if i % 2 == 0:
    tmp = i
    cnt = 0
    for _ in range(N):
      if i % 2 == 0 and i != 0:
        i = i // 2
        cnt += 1
    if max < cnt:
      max = cnt
      ans = tmp
        
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

s2 = 2
c2 = 0
while True:
  if s2*2>N:
    break
  s2 *= 2
  c2 += 1

print(2*2**c2)

Submission status: Wrong Answer

Solution code:
N = int(input())

s2 = 2
s3 = 3
c2 = 0
c3 = 0
while True:
  if s2*2>N and s3*2>N:
    break
  if s2*2 < N:
    s2 *= 2
    c2 += 1
  if s3*2 <N:
    s3 *= 2
    c3 += 1

#if c2 > c3:
#  print(2*2**c2)
#else:
#  print(3*2**c3)
print(2*2**c2)

Submission status: Wrong Answer

Solution code:

n=int(input())

count=0
max=0
res=0

for nn in range(n):
    if nn %2==0:
        count+=1
        
        if count>max:
            max=count
            res=nn

            count=0
            nn=nn//2

print(res)

Submission status: Wrong Answer

Solution code:
n = int(input())

a = [2**i for i in range(7)]

for i in a:
  if i > n:
    a.remove(i)
    
print(max(a))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = 1
while a <= N:
  a *= 2
print(a/2)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 1
while ans < N:
  ans *= 2
print(ans)

Submission status: Wrong Answer

Solution code:
number = int(input())
answer_div = 0
answer=0
for i in range(1,number+1):
  count=i
  target=0
  while i%2==0:
    i=i//2
    target+=1
  if target > answer_div:
    answer=count
print(answer)

Submission status: Wrong Answer

Solution code:
number = int(input())
answer = 0
for i in range(1,number+1):
  target=0
  while i%2==0:
    i=i//2
    target+=1
  answer=max(target,answer)
print(answer)

Submission status: Wrong Answer

Solution code:
import sys

n = int(input())

div_max = 0
div = 0

for i in range(n,0,-1):
    cnt = 0
    num = i
    while num%2==0:
        num = num/2
        cnt += 1
    
    if div_max < cnt:
        div_max = cnt
        div = i

print("{}".format(div))

Submission status: Wrong Answer

Solution code:
n = int( input())

def f(a):
  r = 0
  while True:
    if a%2 == 0:
      r +=1
      a = a/2
    else:
      break
  return r

result = (0,0)
for i in range(1, n+1):
  r = f(i)
  if result[1] < r:
    result = (i,r)
print(result[0])

Submission status: Wrong Answer

Solution code:
a=int(input())
if a<2:
  print(0)
elif 2<=a<4:
  print(2)
elif 4<=a<8:
  print(4)
elif 8<=a<16:
  print(8)
elif 16<=a<32:
  print(16)
elif 32<=a<64:
  print(32)
elif 64<=a:
  print(64)

Submission status: Wrong Answer

Solution code:
a=int(input())
if a<2:
  print(0)
elif 2<=a<4:
  print(1)
elif 4<=a<8:
  print(2)
elif 8<=a<16:
  print(3)
elif 16<=a<32:
  print(4)
elif 32<=a<64:
  print(6)
elif 64<=a:
  print(7)

Submission status: Wrong Answer

Solution code:
n = int(input())
l =[]
for i in range(n):
    if i ** (1 / 2) % 1 == 0 and i ** (1 / 2) % 2 == 0:
        l.append(i)
print(max(l))

Submission status: Wrong Answer

Solution code:
n = int(input())
counter = 0
cnt = [0]*(n+1)
for i in range(1,n+1):
    j = i
    while(j%2 == 0):
        j = j/2
        counter += 1
    cnt[i] = counter
    counter = 0
max_val = max(cnt)
ans = cnt.index(max_val)
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
counter = 0
cnt = [0]*(n+1)
for i in range(1,n+1):
    j = i
    while(j%2 == 0):
        j = j/2
        counter += 1
    cnt[i] = counter
    counter = 0
max_val = max(cnt)
ans = cnt.index(max_val)
print(cnt)
print(ans)

Submission status: Wrong Answer

Solution code:
import sys

n=int(input())
if n==1:
  print(0)
  sys.exit()
result = 0
for i in range(n):
  a = n-i
  while True:
    if a % 2 == 1:
      break
    else:
      if a == 2:
        print(n-i)
        sys.exit()
      else:
        a /= 2

Submission status: Wrong Answer

Solution code:
import sys

n=int(input())
result = 0
for i in range(n):
  a = n-i
  while True:
    if a % 2 == 1:
      break
    else:
      if a == 2:
        print(n-i)
        sys.exit()
      else:
        a /= 2

Submission status: Wrong Answer

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

print(int(math.sqrt(n)) ** 2)

Submission status: Wrong Answer

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

print(int(math.sqrt(n)))

Submission status: Wrong Answer

Solution code:
n = int(input())
nums = [0, 2, 4, 8, 16, 32, 64]
maxi = 0
for i in range(len(nums)):
    if nums[i] <= n:
        maxi = nums[i]
print(maxi)

Submission status: Wrong Answer

Solution code:
n = int(input())
nums = [0, 2, 4, 8, 16, 32, 64]
maxi = 0
for i in nums:
    if i < n:
        maxi = i
print(maxi)

Submission status: Wrong Answer

Solution code:
#68B Break Number
n=int(input())
maxnum=0
maxtrial=2
while maxtrial<n:
    maxtrial*=2
print(int(maxtrial/2))

Submission status: Wrong Answer

Solution code:
N=int(input())
max_num=[0,0]
for i in range(1,N+1):#1以上7以下
  num=0
  init_i=i
  while i%2==0:#偶数のあいだは
    i=i/2
    num+=1
  #print(init_i,num)
  if num>max_num[1]:
    max_num[0]=init_i
    max_num[1]=num
print(max_num[0])

Submission status: Wrong Answer

Solution code:
n=int(input())

maxx=0
maxn=0
for i in range(1,n+1):
  tmp=i
  cnt=0
  while 1:
    if tmp%2==0:
      tmp=tmp//2
      cnt+=1
    else:
      break
  if cnt > maxx:
    maxn=i
    maxx=cnt

print(maxn)

Submission status: Wrong Answer

Solution code:
n=int(input())

maxx=0
maxn=0
for i in range(1,n+1):
  tmp=i
  cnt=0
  while 1:
    if tmp%2==0:
      tmp=tmp//2
      cnt+=1
    else:
      break
  if cnt > maxx:
    maxn=tmp
print(maxn)

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=1
for i in range(7):
    if 2**i < n:ans=2**i
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
i_list = []
for i in range(0, n + 1, 2):
    i_list.append(i)
print(max(i_list))

Submission status: Wrong Answer

Solution code:
n = int(input())
n_dict = {}
count = 0
for i in range(1,n + 1):
    tmp = i
    while i % 2 == 0:        
        i = i/2
        count += 1
    n_dict[tmp] = count
print(max(n_dict, key=n_dict.get))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
n = int(input())

tmp = 0
ans = 0
for i in range(1, n + 1):
    tmp2 = 0
    while True:
        if i % 2 == 1:
            break
        else:
            i /= 2
            tmp2 += 1
    if tmp2 > tmp:
        tmp = tmp2
        ans = i * pow(2, tmp2)
print(int(ans))

"""
count = []
for i in range(1,n + 1):
    count.append([0, i])

for i in range(n):
    tmp = 0
    while True:
        if count[i][1] == 2 ** tmp:
            count[i][0] = tmp
            break
        elif count[i][1] > 2 ** tmp:
            tmp += 1
        else:
            break

count.sort()
print(count[n - 1][1])
"""

Submission status: Wrong Answer

Solution code:
n = int(input())

for i in range(7):
  if 2 ** i <= n:
    print(2 ** i)
  else:
    pass

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 64
 
if ans > N:
    ans /= 2
    
print(int(ans))

Submission status: Wrong Answer

Solution code:
N = int(input())
ans =[]
for i in range(1,N):
    if(2**i <100):
        ans.append(2**i)
    else:break
if N == 1:print(1)
if N == 2:print(2)
for i,j in enumerate(ans):
    if N < j:
        print(2**i)
        break

Submission status: Wrong Answer

Solution code:
n = int(input())
if n < 2 ** 1:
    print(0)
elif n < 2 ** 2:
    print(2 ** 1)
elif n < 2 ** 3:
    print(2 ** 2)
elif n < 2 ** 4:
    print(2 ** 3)
elif n < 2 ** 5:
    print(2 ** 4)
elif n < 2 ** 6:
    print(2 ** 5)
elif n <= 100:
    print(2 ** 6)

Submission status: Wrong Answer

Solution code:
n = int(input())

if n < 2 ** 2:
    print(2 ** 1)
elif n < 2 ** 3:
    print(2 ** 2)
elif n < 2 ** 4:
    print(2 ** 3)
elif n < 2 ** 5:
    print(2 ** 4)
elif n < 2 ** 6:
    print(2 ** 5)
elif n <= 100:
    print(2 ** 6)

Submission status: Wrong Answer

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

import copy

ans = 0
ans_c = 0

for i in reversed(range(n)):
    check = copy.copy(i)
    div = 0
    count = 0

    while div == 0:
        div = (i % 2)
        i = i // 2
        if div == 0:
            count += 1
        if i == 0:
            break
    if ans_c < count:
        ans = check
        ans_c = count
        
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
c = 0
a = 0
while a == 0:
    a = (n % 2)
    if a == 0:
        c += 1
    n = (n/2)
print(c)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=1
while A<N:
    A*=2
print(A//2)

Submission status: Wrong Answer

Solution code:
N = int(input())

max_count = 0
ans = 0

def div2(x, count):
    x, mod = divmod(x, 2)
    if mod != 0:
        return count
    else:
        if x == 1:
            return count+1
        return div2(x, count+1)
for x in range(1, N+1):
    count = div2(x, 0)
    
    if count > max_count:
        max_count = count
        ans = x
    
print(ans)

Submission status: Wrong Answer

Solution code:
#ABC068

n = int(input())
i = 0
while 2 ** (i+1) < n:
    i += 1
    
print(2 ** i)

Submission status: Wrong Answer

Solution code:
n = int(input())
max_count = 0
max_elem = ''
for i in range(1, n+1):
    j = i
    j_count = 0
    while j%2 == 0:
        j = j / 2
        j_count = j_count+1
    if max_count < j_count:
        max_count = j_count
        max_elem = str(i)
print(max_elem)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 1
while ans < n:
  ans *= 2
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
count = 0
max = 0
for i in range(1, n+1):
    while(i%2 ==0):
        i = i/2
        count +=1
    if(max < count):
        max = count
        count = 0
print(2**max)

Submission status: Wrong Answer

Solution code:
n = input()
for i in range(6):
    if 2**i <= int(n) and 2**(i+1) > int(n):
        print(2**i)

Submission status: Wrong Answer

Solution code:
n = int(input())

a = [2**i for i in range(7)]
print(a)
print(max([x for x in a if x <= n]))

Submission status: Wrong Answer

Solution code:
n = int(input())
ans, cnt = 0, 0
for i in range(1, n+1):
    k = i
    t = 0
    while k != 0:
        if k%2 == 0:
            k /=2
            t += 1
        else:
            break    
    if t > cnt:
        ans = i
        cnt = t
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
print(n if n%2 == 0 or n==1 else n-1)

Submission status: Wrong Answer

Solution code:
n=int(input())

def f(i):
  c=0
  while i>1:
    if i%2==0:
      c=c+1
      i=int(i/2)
    else:
      break
  return c

t=0
a=0
for i in range(n):
  fa=f(i+1)
  if t<fa:
    t=fa
    a=i+1

print(a)

Submission status: Wrong Answer

Solution code:
N = int(input())
i = 0
while 2 ** i <= N:
  i += 1
print(i - 1)

Submission status: Wrong Answer

Solution code:
N = int(input())
i = 0

while 2**i < N:
  i += 1

print(2**(i-1))

Submission status: Wrong Answer

Solution code:
N = int(input())
i = 0
while (2 ** i) < N:
    i += 1
print(2 ** (i - 1))

Submission status: Wrong Answer

Solution code:
def breaknumbeer(n):

    ans = 1

    while ans <= n:
        ans *= 2

    return (ans / 2)

def main():
    n = int(input())
    print(breaknumbeer(n))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def breaknumbeer(n):

    ans = 1

    while ans < n:
        ans *= 2

    return ans

def main():
    n = int(input())
    print(breaknumbeer(n))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())
r = 1
while r < n:
  r *= 2

print(int(r/2))

Submission status: Wrong Answer

Solution code:
n = int(input())

r = 1
while r <= n:
  r *= 2
print(r)

Submission status: Wrong Answer

Solution code:
N=int(input())
i=0
while 2**i<N:
  i+=1

  
if 2**i==N:
  print(i)
else:
  print(i-1)

Submission status: Wrong Answer

Solution code:
n = input()
print("ABC"+n)

Submission status: Wrong Answer

Solution code:
N = int(input())
cnt_max = 0
num_max = 1
for i in range(1,N):
  cnt = 0
  num = i
  while True:
    if i%2 == 0:
        i = i/2
        cnt += 1
    else:
      break
  if cnt_max < cnt:
    cnt_max = cnt
    num_max = num
print(int(num_max))

Submission status: Wrong Answer

Solution code:
N = int(input())
cnt_max = 0
num_max = 0
for i in range(1,N+1):
  cnt = 0
  num = i
  while True:
    if i%2 == 0:
        i = i/2
        cnt += 1
    else:
      break
  if cnt_max < cnt:
    cnt_max = cnt
    num_max = num
print(int(num_max))

Submission status: Wrong Answer

Solution code:
N = int(input())
cnt_max = 0
num_max = 0
for i in range(1,N):
  cnt = 0
  num = i
  while True:
    if i%2 == 0:
        i = i/2
        cnt += 1
    else:
      break
  if cnt_max < cnt:
    cnt_max = cnt
    num_max = num
print(int(num_max))

Submission status: Wrong Answer

Solution code:
try:
    N = int(input())
    cnt = 0
    for i in range(N):
        if N%2 == 0:
            cnt += 1
            N = (N/2)
    print(cnt)
except EOFError:
    pass

Submission status: Wrong Answer

Solution code:
n = int(input())
list_2 = [64, 32, 16, 8, 4, 2, 1]
for i in list_2:
  if n - i > 0:
    print(i)
    break

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(n):
  m = 2**i
  if m > n:
    print(m//2)
    exit(0)

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(n):
  m = 2**i
  if m > n:
    print(m//2)

Submission status: Wrong Answer

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

n = int(input())
count_cal = []

for i in range(1, n+1):
	count_cal.append(devide(i))

MAX = count_cal[0]

for k in range(len(count_cal)):
	if MAX <= count_cal[k]:
		MAX = count_cal[k]
		ans = k

print(count_cal)
print(ans + 1)

Submission status: Wrong Answer

Solution code:
n=int(input())

#今の答え候補　とりあえず2は2で1回割れる
ans = 2
tmp_max = 1

for i in range(2,n+1):
    # iを何回2で割れるか？
    flag = True
    tmp_cnt = 0
    tmp_i = i
    while(flag):
        if tmp_i%2==0:
            tmp_cnt += 1
            tmp_i=int(tmp_i/2)
        else:
            flag = False
    if tmp_cnt > tmp_max:
        tmp_max = tmp_cnt
        ans = i
        
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
max_cnt = 0
res = 0
for i in range(n,0,-1):
    cnt = 0
    nn = i
    while nn % 2 == 0:
        nn = nn / 2
        cnt += 1
    if cnt > max_cnt:
        max_cnt = cnt
        res = i
print(res)

Submission status: Wrong Answer

Solution code:
n=int(input())
from numpy import log
print(int(log(n)/log(2)))

Submission status: Wrong Answer

Solution code:
a = int(input())

print(len(str(bin(int(a))))-3)

Submission status: Wrong Answer

Solution code:
n=int(input())
i=0
ans=0
while n>ans:
    i+=1
    ans=2**i
print(ans//2)

Submission status: Wrong Answer

Solution code:
"""
author : halo2halo
date : 29, Jan, 2020
"""

import sys
import itertools

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(readline())

ans=1
while N>ans:
    ans*=2
    
print(ans)

Submission status: Wrong Answer

Solution code:
suuji = int(input())
cntmax = 0
cnt = 0
dst = 1
for i in range(suuji):
    for c in range(1, 1000):
        bit = (2**c)-1
        if i & bit != 0:
            cnt = c
            break
    if cntmax < cnt - 1:
        cntmax = cnt - 1
        dst = i
print(dst)

Submission status: Wrong Answer

Solution code:
n=int(input())
king=int(0)
ans=int(0)
for i in range(1,n+1):
    a=i
    count=int(0)
    while a:
        if a%2==0:
            a/=2
            count+=1
        
        else:
            break

    if king<count:
        king=count
        ans=i

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
k = 0
while 1:
  if k**2 > N:
    break
  ans = k**2
  k += 1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
count = 0
for i in range(1,N+1):
  k = i
  while k % 2 == 0:
    k /= 2
    count += 1
print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
count = 0

while N % 2 == 0:
  N / 2
  count += 1
print(count)

Submission status: Wrong Answer

Solution code:
suuji = int(input())
srclist = [1, 2, 4, 8, 16, 32, 64, 128]
dst = 0
for i in range(len(srclist)):
    if srclist[i] > suuji:
        break
# print(srclist[i-1])
cntmax = 0
dst = 1
for i in range(suuji):
    for cnt in range(1, 1000):
        bit = (2**cnt)-1
        if i & bit != 0:
            break
    if cntmax < cnt - 1:
        cntmax = cnt - 1
        dst = i
print(dst)

Submission status: Wrong Answer

Solution code:
suuji = int(input())
srclist = [1, 2, 4, 8, 16, 32, 64, 128]
dst = 0
for i in range(len(srclist)):
    if srclist[i] > suuji:
        break
cntmax = 0
dst = 1
for i in range(suuji):
    for cnt in range(1, 1000):
        bit = 2**cnt-1
        if i & bit != 0:
            break
    if cntmax < cnt - 1:
        cntmax = cnt - 1
        dst = i
print(dst)

Submission status: Wrong Answer

Solution code:
suuji = int(input())
cntmax = 0
dst = 1
for i in range(suuji):
    for cnt in range(1, 1000):
        bit = 2**cnt-1
        if i & bit != 0:
            break
    if cntmax < cnt - 1:
        cntmax = cnt - 1
        dst = i
print(dst)

Submission status: Wrong Answer

Solution code:
suuji = int(input())
cntmax = 0
dst = 1
for i in range(suuji):
    suu = i
    for cnt in range(1, 1000):
        bit = 2**cnt-1
        if suu & bit != 0:
            break
    if cntmax < cnt:
        cntmax = cnt
        dst = i
print(dst)

Submission status: Wrong Answer

Solution code:
N = int(input())


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


print(max([two(i + 1) for i in range(N)]))

Submission status: Wrong Answer

Solution code:
n = int(input())
b = len(bin(n))
print(2**(b-1))

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
a = math.floor(math.log(N, 2))
print(a)

Submission status: Wrong Answer

Solution code:
N = int(input())
numbers = [2, 4, 8, 16, 32, 64]
answer = 0
for number in numbers:
    answer = number
    if number > N:
        break
if answer == 2:
    print(1)
elif answer == 4:
    print(2)
elif answer == 8:
    print(3)
elif answer == 16:
    print(4)
elif answer == 32:
    print(5)
elif answer == 64:
    print(6)

Submission status: Wrong Answer

Solution code:
n = int(input())
m = 1
while m <= n:
  m = m * 2
print(m / 2)

Submission status: Wrong Answer

Solution code:
n = int(input())
max2 = 0
maxi = 0
for i in range(1, n+1):
  m = 0
  k = i
  while k % 2 == 0:
    m += 1
    k = k / 2
  if max2 < m:
    max2 = m
    maxi = i
print(maxi)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
N = int(input())
ans = 1
while ans < N:
    if ans*2 < N:
        ans *= 2
    else:
        break
print(ans)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
N = int(input())
ans = 0
t_cnt = 0
for i in range(1, N+1):
    tmp = i
    cnt = 0
    while tmp % 2 == 0:
        tmp //= 2
        cnt += 1
    if t_cnt < cnt:
        ans = tmp * 2 ** cnt
        t_cnt = cnt
print(ans)

Submission status: Wrong Answer

Solution code:
# Problem https://atcoder.jp/contests/abc068/tasks/abc068_b
# Python 2nd Try


def solver(givenNumber):
    answer = 0
    for j in range(0, givenNumber):
        counter = 0
        baseNumber = j + 1
        while True:
            if baseNumber % 2 == 0:
                counter = counter + 1
                baseNumber = baseNumber / 2
            else:
                break
        if answer <= counter:
            counter = answer
    return answer


if __name__ == "__main__":
    N = int(input())
    print(solver(N))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=0
for i in range(7):
    if 2**i > n:
        break
print(2**(i-1))

Submission status: Wrong Answer

Solution code:
N = int(input())
for i in range(N):
  if 2**i <= N:
    pass
  else:
    print(2**(i-1))
    break

Submission status: Wrong Answer

Solution code:
N = int(input())
for i in range(N):
  if 2**i < N:
    pass
  else:
    print(2**(i-1))
    break

Submission status: Wrong Answer

Solution code:
N = int(input())
maxdiv = 0
ans = 0
for i in range(1, N + 1):
    d = i
    count = 0
    while d & 1 == 0:
        d >>= 1
        count += 1
    if count > maxdiv:
        ans = i
        maxdiv = count
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
maxdiv = 0
for i in range(1, N + 1):
    d = i
    count = 0
    while d & 1 == 0:
        d >>= 1
        count += 1
    maxdiv = max(maxdiv, count)
print(maxdiv)

Submission status: Wrong Answer

Solution code:
N = int(input())
maxdiv = 0
for i in range(1, N + 1):
    d = i
    count = 0
    while d & 1 == 0:
        d >>= 1
        count += 1
    maxdiv = max(maxdiv, count)
print(count)

Submission status: Wrong Answer

Solution code:
def divisible(n):
 ans = 0
 while n%2 == 0:
  n /= 2
  ans += 1
 return ans
 
N = int(input())
 
b = 0

c = 0
 
for i in range(1,N+1):
    if(divisible(i) > b):
      b = divisible(i)
      c = i
    
print(c)

Submission status: Wrong Answer

Solution code:
def divisible(n):
 ans = 0
 while n%2 == 0:
  n /= 2
  ans += 1
 return ans
 
N = int(input())
 
b = 0

c = 0
 
for i in range(1,N):
    if(divisible(i) > b):
      b = divisible(i)
      c = i
    
print(c)

Submission status: Wrong Answer

Solution code:
N=int(input())
if N<=2:
  print(0)
elif N<4:
  print(2)
elif N<8:
  print(4)
elif N<16:
  print(8)
elif N<32:
  print(16)
elif N<64:
  print(32)
elif N<128:
  print(64)

Submission status: Wrong Answer

Solution code:
N=int(input())
tmp=1
flag=True
while flag:
  tmp=tmp*2
  print(tmp)
  if tmp>=N:
    flag=False
print(int(tmp/2))

Submission status: Wrong Answer

Solution code:
s = input()
print(s[0] + str(len(s[1:-1])) + s[-1])

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
for i in range(n):
  if i**2<=n:
    ans = i**2
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
N = int(input())
counta = 0
ans = 0
def hantei(i) :
    count = 0
    while True :
        if i % 2 == 0 :
            count+=1
            i = i // 2
        else :
            break
    return count
for i in range(1,N+1) :
    k = hantei(i)
    if k > counta :
        ans = i
        counta = k
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
L = []
j = 0
for i in range(n):
    s = list(bin(i+1)[2:])[::-1]
    cnt = 0
    while j <=n-1:
        if s[j] == "0":
            cnt +=1
            j +=1
            #print(j,cnt)
        elif s[j] == "1":
            L.append(cnt)
            cnt=0
            break
    j =0
print(max(L))

Submission status: Wrong Answer

Solution code:
N=int(input())
max=0
for i in range(7):
  x=2**i
  if x<=N:
      max=2**i
print(x)

Submission status: Wrong Answer

Solution code:
N=int(input())
for i in range(7):
  x=2**i
  if x<=N:
      max=2**i
print(x)

Submission status: Wrong Answer

Solution code:
N = int(input())

m = 0
max_cnt = 0
for i in range(2, N+1, 2):
    cnt = 0
    tmp = i
    while tmp % 2 == 0:
        cnt += 1
        tmp /= 2
    if cnt > max_cnt:
        max_cnt = cnt
        m = i
print(m)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=0
if n<=2:
    print(n)
elif n<4:
    print(2)
else:
    for i in range(n//2):
        if 2**a<=n:
            a+=1
        else:
            break
    print(2*(a-1))

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

N = int(input())
ans = [0, -1]
for i in range(1, N + 1):
    cnt = 0
    while i % 2 == 0:
        cnt += 1
        i //= 2
    if cnt > ans[1]:
        ans = [i, cnt]
print(ans[0])

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

N = int(input())
ans = -1
for i in range(1, N + 1):
    cnt = 0
    while i % 2 == 0:
        cnt += 1
        i //= 2
    ans = max(ans, cnt)
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

cont = 0
cont_list = [1]

for i in range(2, n+1, 2):
    while i % 2 == 0:
        i //= 2
        cont += 1
    cont_list.append(cont)
    cont = 0

if n == 0:
    print(0)
elif max(cont_list) == 1:
    print(1)
else:
    print(2**(max(cont_list)))

Submission status: Wrong Answer

Solution code:
n = int(input())

cont = 0
cont_list = [1]

for i in range(2, n+1, 2):
    while i % 2 == 0:
        i //= 2
        cont += 1
    cont_list.append(cont)
    cont = 0

if max(cont_list) == 1:
    print(1)
else:
    print(2**(max(cont_list)))

Submission status: Wrong Answer

Solution code:
n=int(input())
i=1
if n==1:
  print(1)
else:
  while n>2*i:
  	i+=1
  print(2*i-1)

Submission status: Wrong Answer

Solution code:
n=int(input())
i=1
if n==1:
  print(1)
else:
  while n>2*i:
  	i+=1
  print(2*i)

Submission status: Wrong Answer

Solution code:
count=0
n=int(input())
while n%2==0:
  n=n/2
  count+=1
print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())

if n==1:
    print(0)
else:
    for i in range(7):
        if 2**i<=n<2**(i+1):
            print(2**i)

Submission status: Wrong Answer

Solution code:
N = int(input())
even_A = list(range(1, N+1, 2))
dic = {}
for a in even_A:
  x = a
  cnt = 0
  while x%2 == 0:
    x /= 2
    cnt += 1
  dic[a] = cnt

ans = sorted(dic.items(), key=lambda x:x[1])[-1]

print(ans[0])

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 1
for i in range(1,n):
    if i ** 2 > n:
        break
    else:
        ans = i ** 2
print(ans)

Submission status: Wrong Answer

Solution code:
s=int(input())

counts = 1
ans = 1

for i in range(s + 1):
  k = i
  count = 0
  while(True):
    if i % 2 == 1 or i == 0:
      break

    i = i / 2
    count += 1
  
  if counts < count:
    counts = count
    ans = k

print(ans)

Submission status: Wrong Answer

Solution code:
s=int(input())

counts = 1
ans = 0

for i in range(s + 1):
  k = i
  count = 0
  while(True):
    if i % 2 == 1 or i == 0:
      break

    i = i / 2
    count += 1
  
  if counts < count:
    counts = count
    ans = k

print(ans)

Submission status: Wrong Answer

Solution code:
s=int(input())

counts = 0
ans = 0

for i in range(s + 1):
  k = i
  count = 0
  while(True):
    if i % 2 == 1 or i == 0:
      break

    i = i / 2
    count += 1
  
  if counts < count:
    counts = count
    ans = k

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 0

while n % 2 == 0:
  ans += 1
  n = n/2
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 0

while n % 2 == 0:
  ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
i = 1
while i * 2 < n : i *= 2
print(i)

Submission status: Wrong Answer

Solution code:
N = int(input())

n = 1
i = 1
while n <= N:
    i += 1
    n = 2 ** i
print(2 ** (i - 1))

Submission status: Wrong Answer

Solution code:
n = int(input())
count = 0
while 2 ** count <= n:
  count += 1
print(count - 1)

Submission status: Wrong Answer

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

answer = 1
for i in range(1,n+1):
  if i == 1:
    continue
  temp = math.log2(i)
  if temp >= math.log2(answer):
    answer = i

print(answer)

Submission status: Wrong Answer

Solution code:
a=int(input())
saiko=0
for i in range(1,a+1):
  count=0
  for j in range(1,i+1):
    if j%2==0:
      count+=1
print(max(saiko,count))

Submission status: Wrong Answer

Solution code:
N=int(input())
ans=0
for i in range(N):
    if 2**i>N:
        print(2**(i-1))
        break

Submission status: Wrong Answer

Solution code:
N=int(input())
ans=1
for i in range(N):
    if 2**i>N:
        print(2**(i-1))
        break

Submission status: Wrong Answer

Solution code:
n = int(input())

count = 0
while True:
    if n % 2 == 0:
        n /= 2
        count += 1
    else:
        break

print(count)

Submission status: Wrong Answer

Solution code:
n=int(input())
print(len(bin(n))-3)

Submission status: Wrong Answer

Solution code:
a=int(input())
c=0
while a%2==0:
  a=a/2
  c+=1
print(c)

Submission status: Wrong Answer

Solution code:
a=int(input())
c=0
for i in range(7):
  if a%2==0:
    c+=1
    a=a//2
print(c)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
for i in range(1, N+1):
    i_ans = 0
    while i % 2:
        i_ans += 1
        i = i//2
    ans = max(ans, i_ans)
print(pow(2, ans))

Submission status: Wrong Answer

Solution code:
N=int(input())
i=0
while 2**i<N:
  i+=1
print(i)

Submission status: Wrong Answer

Solution code:
N=int(input())
i=0
while True:
  if 2**i>=N:
    print(2**i)
    break
  i+=1

Submission status: Wrong Answer

Solution code:
N=int(input())
if N==1:
  print(1)
else:
  i=2
  while True:
    if i>=N:
      print(i)
      break
    i*=2

Submission status: Wrong Answer

Solution code:
l = list()
n = int(input())
original_list = list(range(1,n+1))
for x in original_list:
      ans = 0
      while x % 2 == 0:
        x = x / 2
        ans = ans + 1
      l.append(ans)
print(max(l))