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:
n=input()
kaisuu = 0
ans = 0
for i in range(1,int(n)+1):
    count = 0
    num = i
    while(num % 2 == 0):
        count = count + 1
        num /= 2
    if kaisuu < count:
        kaisuu = count
        ans = i

print(ans)

Submission status: Wrong Answer

Solution code:
def num2(n):
  ans=0
  while n%2==0:
    ans+=1
    n//=2
  return ans
N=int(input())
l=[[i,num2(i)] for i in range(1,N+1)]
l.sort(key=lambda x:x[1])

print(l[0][0])

Submission status: Wrong Answer

Solution code:
N=int(input())
ans=0
while True:
  if 2**ans>N:
    print(ans-1)
    exit()
  ans+=1

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = [i * i for i in range(1, 9)]

for i in range(len(ans)):
    if ans[i] > N:
        print(ans[i-1])
        exit(0)
print(64)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = [i * i for i in range(1, 9)]

for i in range(len(ans)):
    if ans[i] > N:
        print(ans[i] - 1)
        exit(0)
print(64)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

if N == 1:
    print(0)
elif N < 4:
    print(1)
elif N < 8:
    print(2)
elif N < 16:
    print(3)
elif N < 32:
    print(4)
elif N < 64:
    print(5)
elif N < 101:
    print(6)

Submission status: Wrong Answer

Solution code:
N = int(input())
val = 1
res = 0
while val <= N:
    val *= 2

print('val = ', val)
mod_2 = divmod(val, 2)
mod_2 = mod_2[0]
print(mod_2)

Submission status: Wrong Answer

Solution code:
N = int(input())
print(len(bin(N)[2:])-1)

Submission status: Wrong Answer

Solution code:
N = int(input())
answer = 0
max_count = 0
for val in range(N+1):
    tmp = val
    count = 0
    while (tmp % 2 == 0):
        if(tmp == 0):
            break
        tmp /= 2
        count += 1
    if(max_count < count):
        answer = val
        max_count = count

print(answer)

Submission status: Wrong Answer

Solution code:
N = int(input())
count = 0
for i in range(N):
    c = 2**count
    if c > N:
        print(c//2)
        exit()
    else:
        count +=1

Submission status: Wrong Answer

Solution code:
N = int(input())
count = 0
for i in range(N):
    c = 2*count
    if c > N:
        print(c//2)
        exit()
    else:
        count +=1

Submission status: Wrong Answer

Solution code:
N = int(input())
count = 0
for i in range(N):
    c = 2*count
    if c > N:
        print(c//2)
        exit()
    else:
        count +=1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
count = 0
for i in range(N):
    c = 2*count
    if c > N:
        print(c/2)
        exit()
    else:
        count +=1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = int(input())


for i in range(a):
    if(2**i>a):
        print(2**(i-1))
        break

Submission status: Wrong Answer

Solution code:
a = int(input())


for i in range(a):
    if(2**i>=a):
        print(2**(i))
        break

Submission status: Wrong Answer

Solution code:
n = int(input())

n_arr = []
a = 1
while a <= 100:
  n_arr.append(a)
  a *= 2

n_arr.append(n)
n_arr.sort()
index = n_arr.index(n)
if n == 1:
  print(1)
else:
  print(n_arr[index - 1])

Submission status: Wrong Answer

Solution code:
n = int(input())

n_arr = []
a = 1
while a <= 100:
  n_arr.append(a)
  a *= 2

n_arr.append(n)
n_arr.sort()
index = n_arr.index(n)
print(n_arr[index - 1])

Submission status: Wrong Answer

Solution code:
n = int(input())
_max = 0
out = 0
for i in range(1, n + 1):
    count = 0
    _i = i
    while _i > 0 and _i % 2 == 0:
        count += 1
        _i //= 2
    if count > _max:
        out = i
        _max = max(_max, count)
print(out)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
x = 1
while N >= 2**x:
  x = x+1
  
print(2 ** x)

Submission status: Wrong Answer

Solution code:
N = int(input())

list_n = [2**i for i in range(7)]
c = 0
for i in list_n:
    if i < N:
        c=i

print(c)

Submission status: Wrong Answer

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

print(n // 2)

Submission status: Wrong Answer

Solution code:
n = int(input())

result = 0
while n % 2 == 0:
    n //= 2
    result += 1

print(result)

Submission status: Wrong Answer

Solution code:
N=int(input())
cnt=1
a=2
while a<=N:
    a*=2
    if a<=N:
        cnt+=1
if N==1:
    print(0)
else:
    print(2**cnt)

Submission status: Wrong Answer

Solution code:
N=int(input())
cnt=1
a=2
while a<=N:
    a*=2
    if a<=N:
        cnt+=1
if N==1:
    print(0)
else:
    print(cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())
max_div = [1, 1]
for n in range(2, N + 1):
    div = [n, 0]
    while n % 2 == 0:
        n //= 2
        div[1] += 1
    if div[1] > max_div[1]:
        max_div = div
print(max_div[0])

Submission status: Wrong Answer

Solution code:
N = int(input())
max_div = [1, 1]
for n in range(2, N + 1):
    div = [n, 0]
    while n % 2 == 0:
        n //= 2
        div[1] += 1
    if div[1] > max_div[1]:
        max_div = div
print(max_div[0])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
r = 0
for i in range(1, N+1):
    for n, v in enumerate((2, 4, 6, 8, 16, 32, 64)):
        if i % v == 0:
            r = max(r, n)
print(2**r)

Submission status: Wrong Answer

Solution code:
n = int(input())
max_num = 0
ans = 0

for i in range(1, n):
    count = 0
    num = i

    while(num % 2 == 0):
        count += 1
        num >>= 1

    if count > max_num:
        max_num = count
        ans = i

print(ans)

Submission status: Wrong Answer

Solution code:
a = int(input())
if a == 1:
    print(1)
elif a == 2 and a == 3:
    print(2)
elif a >= 4 and a <= 7:
    print(4)
elif a >= 8 and a <= 15:
    print(8)
elif a >= 16 and a <= 31:
    print(16)
elif a >= 32 and a <= 63:
    print(32)
else:
    print(64)

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 1

while ans < n:
    ans *= 2

print( ans // 2 )

Submission status: Wrong Answer

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

for i in range(6):
    if 2**i <= n and n < 2**(i+1):
        print(2**i)
        break

Submission status: Wrong Answer

Solution code:
n = int(input())
print(n.bit_length() - 1)

Submission status: Wrong Answer

Solution code:
n = int(input())

dp = [999999]*(n+1)

for i in range(n+1):
    t = i
    dp[i] = 0
    while t > 1:
        t = int(t/2)
        dp[i] += 1

print(dp.index(max(dp)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 0
count = 0
best = 0

for i in range(n, 0, -1):
    count = 0
    x = i
    while True:
        if x % 2 == 0:
            count += 1
            x = x / 2
        else:
            break
    if count > best:
        best = count
        ans = i

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 0
count = 0
best = 0

for i in range(n, 0, -1):
    count = 0
    x = i
    while True:
        if x % 2 == 0:
            count += 1
            x = x / 2
        else:
            break
    if count > best:
        best = count
        ans = i
    if count == 0:
        ans = i

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
ct = 0
max_ct = 0
now = 0
max_num = 0
for i in range(1, n+1):
    now = i
    while (i % 2 == 0):
        i = i / 2
        ct += 1
    if max_ct < ct:
        max_ct = ct
        max_num = now
    ct = 0

print(max_num)

Submission status: Wrong Answer

Solution code:
N = int(input())

a = 0
		
while N%(2**a)==0:
	a += 1

b = 2**(a-1)

print(b)

Submission status: Wrong Answer

Solution code:
l = int(input())
bits = [2, 4, 8, 16, 32, 64]
for i in range(6):
  s = l - bits[i]
  if(s < 0):
    print(bits[i - 1])
    break

Submission status: Wrong Answer

Solution code:
N = int(input())
num = 1
while num<=N:
  num*=2
print(0 if N==1 else num//2)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
ind = 0
for i in range(2,N+1,2):
    num = 0
    tmp = i
    while tmp%2 == 0:
        tmp = tmp//2
        num += 1
    if ind < num:
        ind = num
        ans = i
print(ans)

Submission status: Wrong Answer

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

for i in range(1, 9):
    if 2**i <= N:
        num = 2**i
print(num)

Submission status: Wrong Answer

Solution code:
N = int(input())
num = [i for i in range(N) if i % 2 ==0][-1]
print(num)

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = 1
while N > 0:
  N = N // 2
  ans = ans * 2

print(ans)

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<= 100:
    print (64)

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(8)
elif N<64:
    print(32)  
elif N<= 100:
    print (64)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = raw_input()
n = int(s)
dp = [0 for _ in range(n+1)]
dp[0] = 0
dp[1] = 0
maxl, num = 1, 1
for i in range(2, n+1):
    if i % 2 == 1:
        dp[i] = 0
    else:
        dp[i] = dp[i/2] + 1
        if dp[i] > maxl:
            maxl = dp[i]
            num = i
print num

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n, a = int(raw_input()), 2
while a < n:
    a <<= 1
print a >> 1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
if N <=2:
    print(2)
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)
else:
    print(64)

Submission status: Wrong Answer

Solution code:
# input
N = int(input())

a = 0
ans = 1

for i in range(N):
    j = i
    temp = 0
    while j:
        if j % 2 == 0:
            temp += 1
            j = j // 2
        else:
            break
    if temp > a:
        a = temp
        ans = i

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(1, N+1):
    now_count = bin(i)[::-1].index("1")
    if now_count > count:
        count = now_count
        result = i

print(result)

Submission status: Wrong Answer

Solution code:
n = int(input())
if n>=64:
    print('64')
elif n >= 32:
    print('32')
elif n >= 16:
    print('16')
elif n >= 8:
    print('8')
elif n >=4:
    print('4')
elif n >= 2:
    print('2')
else :
    print('0')

Submission status: Wrong Answer

Solution code:
a=int(input())
k=0
x=0
while x<a:
  x=2**k
  k+=1
print(int(x/2))

Submission status: Wrong Answer

Solution code:
a=int(input())
k=0
x=0
while x<a:
  x=2**k
  k+=1
print(x/2)

Submission status: Wrong Answer

Solution code:
a=int(input())
k=0
x=0
while x<a:
  x=2**k
  k+=1
print(x)

Submission status: Wrong Answer

Solution code:
n = int(input())
lst = [1,2,4,8,16,32,64,128]

for i in range(len(lst)):
    if n <= lst[i]:
        print(lst[i-1])
        break

Submission status: Wrong Answer

Solution code:
n = int(input())
lst = [1,2,4,8,16,32,64]

for i in range(7):
    if n <= lst[i]:
        print(lst[i-1])
        break

Submission status: Wrong Answer

Solution code:
N = int(input())
power = [2,4,8,16,32,64]
print(max([i if i <= N else N for i in power]))

Submission status: Wrong Answer

Solution code:
N = int(input())

now = 1
while(True):
    if now>N:
        print(now/2)
        break
    else:
        now *= 2

Submission status: Wrong Answer

Solution code:
n = int(input())
listn = list(range(1,n+1))

def n2(n):
    counter = 0
    while n % 2 == 0:
        n = n / 2
        counter += 1
    return counter

lists_n2 = list(map(n2, listn))
print(max(lists_n2))

Submission status: Wrong Answer

Solution code:
import math
import sys

def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()

    
    array_result.append(data.split(" "))

    flg = 1

    try:


        while flg:

            data = input()

            array_temp = []

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:


        return array_result





arr_data = getinputdata()

n = int(arr_data[0][0])


maxdata=0


seq=0

for v in range(1,1+n):
    
#    print(v)
    
    vtemp=v
    cnt=0
    while(vtemp%2==0):
#        
    
        cnt+=1
#        print(v,vtemp,cnt,maxdata)
        vtemp=vtemp/2
    
    else:   
        
#        print(maxdata,cnt,v)
        if maxdata<cnt:

            maxdata=cnt
            seq=v

        

print(seq)

Submission status: Wrong Answer

Solution code:
N = int(input())
N2 = [64,32,16,8,4,2]
for i in range(len(N2)):
    if N2[i] <=N:
        print(N2[i])
        break

Submission status: Wrong Answer

Solution code:
N = int(input())
N2 = [64,32,16,8,4,2]
for i in range(len(N2)):
	if N2[i] <=N:
		print(N2[i])
		break

Submission status: Wrong Answer

Solution code:
L=[1,2,4,8,16,32,64]
l=0
N=int(input())
while l < len(L):
    if N < L[l]:
        print(L[l-1])
        break
    else:
        l += 1

Submission status: Wrong Answer

Solution code:
i = int(input())
j = sorted([2 ** x for x in range(7)] + [i])
print(j[j.index(i) - 1])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(x)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
for i in range(7):
  if 2**i < N and 2**i > N:
    print(2**i)
    break

Submission status: Wrong Answer

Solution code:
n = int(input())
pow = n
ans = 0
while 2**pow > n:
    if pow < 0:
        break
    else:
        pow-=1

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

def cnt(a):
    if a == 1:
        return 0
    return 1 + cnt(a//2)

res, maxcount = 0, 0
for a in range(1, n + 1):
    if maxcount < cnt(a):
        maxcount, res = cnt(a), a
print(res)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
li=[2,4,8,16,32,64,128]
n=int(input())
for i in li:
    if n<i:
        print(li.index(i))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

if N == 1:
    print(0)
else:
    ans = 2
    while ans * 2 <= N:
        ans *= 2
    print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

maxnum = 2

for i in range(8):
    if maxnum > n:
        print(maxnum/2)
        break
    maxnum*=2

Submission status: Wrong Answer

Solution code:
n = int(input())

maxnum = 2

for i in range(8):
  if maxnum > n:
    print(maxnum/2)
    break
  maxnum*=2

Submission status: Wrong Answer

Solution code:
n = int(input())
a = 2
while True:
    if(a * 2 > n):
        break
    a *= 2
print(a)

Submission status: Wrong Answer

Solution code:
if __name__ == "__main__":
    N = int(input())
    if N <= 1:
        print (1)
        exit()

    res_cnt = 0
    res = 0
    for x in range(N + 1):
        cnt = 0
        y = x
        while (y > 1):
            if y % 2 == 0:
                y //= 2
                cnt += 1
            else:
                break
        if cnt > res_cnt:
            res = x
    print (res)

Submission status: Wrong Answer

Solution code:
if __name__ == "__main__":
    N = int(input())
    if N <= 1:
        print (0)
        exit()

    res_cnt = 0
    res = 0
    for x in range(N + 1):
        cnt = 0
        y = x
        while (y > 1):
            if y % 2 == 0:
                y //= 2
                cnt += 1
            else:
                break
        if cnt > res_cnt:
            res = x
    print (res)

Submission status: Wrong Answer

Solution code:
import sys

N = int(input())
l = list(range(1,7))
k = l[::-1]

if N == 1:
    print(0)
    sys.exit()

for i in k:
    if N >= (2**i):
        print(2**i)
        sys.exit()

Submission status: Wrong Answer

Solution code:
import sys

N = int(input())
l = list(range(1,6))
k = l[::-1]

for i in k:
    if N >= (2**i):
        print(2**i)
        sys.exit()

Submission status: Wrong Answer

Solution code:
import sys

N = int(input())
l = list(range(1,7))
k = l[::-1]

for i in k:
    if N >= (2**i):
        print(2**i)
        sys.exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
x=[]
for i in range(200):
    x.append(0)
for i in range(200):
    ori=i
    while ori!=0:
        if ori%2==0:
            ori=ori/2
            x[i]+=1
        else:
            break
maxi=0
maxv=0
for i in range(200):
    if maxv<x[i] and i<N+1:
        maxv=x[i]
        maxi=i
print(maxi)

Submission status: Wrong Answer

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

while n > 2:
    n //= 2
    c += 1

print(2**c)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(2)
if 1==a:
    print(a)
else:
    while b<100:
        b=b*2
        if(a<b)and(a>=b/2):
            print (b/2)

Submission status: Wrong Answer

Solution code:
a=int(input())
if 1==a:
    print(a)
else:
    while 0!=a%2:
        a=a-1
        if 0==a%3:
            a=a-1
    print(a)

Submission status: Wrong Answer

Solution code:
a=int(input())
if 1==a:
    print(a)
else:
    while 0!=a%2:
        a=a-1
    print(a)

Submission status: Wrong Answer

Solution code:
import sys
N=int(input())
s=0
for i in range(6):
  if N%2!=0:
    print(2**s)
    sys.exit()
  s+=1
  N=N//2

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
max=-1
ans=1
for i in range(1,n):
	temp=i
	kount=0
	while temp%2==0 :
		temp/=2
		kount+=1
	if kount>max:
		max=kount
		ans=i
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

num=2


for i in range(1, N+1):
    if num*2 > N:
        print(num)
        break
    else:
        num = num*2

Submission status: Wrong Answer

Solution code:
N = int(input())

num=1


for i in range(1, N):
    if num*2 > N:
        print(num)
        break
    else:
        num = num*2

Submission status: Wrong Answer

Solution code:
n = int(input())
lst = [1, 2, 4, 8, 16, 32, 64]
lst.append(n)
lst.sort()
num = lst.index(n)
if num == num -1:
    print(num)
else:
    print(lst[num-1])

Submission status: Wrong Answer

Solution code:
n = int(input())
lst = [1, 2, 4, 8, 16, 32, 64]
lst.append(n)
lst.sort()
num = lst.index(n) - 1
print(lst[num])

Submission status: Wrong Answer

Solution code:
N = int(input())

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

for i, x in enumerate(li, 1):
    if N < li[len(li)-i]:
        print(li[len(li)-i-1])
        break
    else:
        continue

Submission status: Wrong Answer

Solution code:
n = int(input())
count = 0
for i in range(1, n):
    if n > pow(2, i):
        count = count + 1
    else:
        break
print(pow(2,count))

Submission status: Wrong Answer

Solution code:
inp = int(input())
count = 0
serch = 0


for i in range(1,inp + 1):
	a = i
	j = 1
	while j <= i:
		if a % 2 != 0:
			if j - 1 > count:
				count = j - 1
				serch = i
			break
		a = a / 2
		j += 1


print(serch)

Submission status: Wrong Answer

Solution code:
x=int(input(""))
k=0
while(pow(2,k)<=x):
  k+=1
print(k)

Submission status: Wrong Answer

Solution code:
n = int(input().strip())
while True:
 if n & (n-1) == 0:
  print(n)
  break
 n += 1

Submission status: Wrong Answer

Solution code:
s = int(input())
ans = 0

while(True):
    s = s//2
    ans += 1
    if s <= 1:
        break

print(2**ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
arr = [i for i in range(1, N + 1)]
# N == len(arr)
nums = N*[0]
for j in range(N):
    target = arr[j]
    num = 0
    while target % 2 == 0:
        num += 1
        target /= 2
    nums[j] = num

print(nums)

max = 0
for k in range(N):
    if nums[k] > max:
        max_index = k
        max = nums[k]
    elif N == 1:
        max_index=0
 
print(arr[max_index])

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys

n = int(sys.stdin.readline())

x = 2
while x <= n:
	x *= 2

if n < 2:
	print (str(n))

print (str(int(x/2)))

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Here your code !
import sys

s = int(input())

count=1

if(s % 2 == 1):
    print("0")
    sys.exit()

while count < s:
    count = count * 2

count = count / 2

print(int(count))

Submission status: Wrong Answer

Solution code:
s = int(input())

count=1

while count < s:
    count = count * 2

count = count / 2

print(int(count))

Submission status: Wrong Answer

Solution code:
N = int(input())

result = 0
while N / 2 > 1.0:
    N /= 2
    result += 1
print(2**result)

Submission status: Wrong Answer

Solution code:
a = int(input())
temp = [0]*(a+1)
for i in range(a,0,-1):
    b = i
    while b%2 ==0:
        temp[i] += 1
        b = b//2
if temp.index(max(temp))==0:
    print(1)
else:temp.index(max(temp))

Submission status: Wrong Answer

Solution code:
a = int(input())
temp = [0]*(a+1)
for i in range(a,0,-1):
    b = i
    while b%2 ==0:
        temp[i] += 1
        b = b//2
print(temp.index(max(temp)))

Submission status: Wrong Answer

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

n = int(raw_input())
max = 0

for i in range(1, n+1):
	tmp = countdiv(i)
	if tmp > max:
		max = tmp

print max

Submission status: Wrong Answer

Solution code:
n = int(raw_input())
cnt = 0

while n % 2 == 0:
	cnt += 1
	n = n / 2

print cnt

Submission status: Wrong Answer

Solution code:
N = int(input())


if 64 < N :
  print (64)
elif 31 < N:
  print (32)
elif 15 < N:
  print (16)
elif 7 < N:
  print (8)
elif 3 < N:
  print (4)
elif 1 < N:
  print (2)
else :
  print (1)

Submission status: Wrong Answer

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

for i in range(N,0,-1):
    s = i
    c=0
    while (i % 2 == 0) :
        i /= 2
        c += 1
    if score < c:
        score = c
        ans = s
    #カウントが更新されたらスコア配列に格納
print(ans)

Submission status: Wrong Answer

Solution code:
use = int(input())

if use <= 1:
    print(0)
elif use <= 3:
    print(1)
elif use <= 7:
    print(4)
elif use <= 15:
    print(8)
elif use <= 31:
    print(16)
elif use <= 63:
    print(32)
elif use >= 64:
    print(64)

Submission status: Wrong Answer

Solution code:
import logging
logging.basicConfig(level=logging.CRITICAL,format=' %(asctime)s - %(levelname)s - %(message)s')

def power(n):
    i = 1
    logging.info('func start')
    while n > 0:
        i *= 2
        n -= 1
        logging.debug('i = {}, n = {}'.format(i,n))
    logging.info('func end')
    return i

i = 0
n = int(input())
logging.info('in loop')
while power(i+1) < n:
    i = i + 1
    logging.debug('i = {}, pow(i) = {}'.format(i,power(i)))

logging.info('out loop')
print(power(i ))

Submission status: Wrong Answer

Solution code:
use = int(input())

if use < 4:
    print(1)
elif use < 8:
    print(4)
elif use < 16:
    print(8)
elif use < 32:
    print(16)
elif use < 64:
    print(32)
else:
    print(64)

Submission status: Wrong Answer

Solution code:
N=int(input())
count=0
a=int(N/2)
if(N%2==0):
  count +=1
  while(a%2!=1):
   count +=1
   a=int(a/2)
else:
 count =0
print(count)

Submission status: Wrong Answer

Solution code:
def power(n):
    i = 1
    while n > 0:
        i *= 2
        n -= 1
    return i

i = 0
n = int(input())
while power(i+1) < n:
    i = i + 1

print(power(i ))

Submission status: Wrong Answer

Solution code:
use = int(input())

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

Submission status: Wrong Answer

Solution code:
N=int(input())
count=0
a=int(N/2)
if(N%2==0):
  count +=1
  while(a%2!=1):
   count +=1
   a=int(a/2)
else:
 count =0
print(count)

Submission status: Wrong Answer

Solution code:
div = int(input())
for i in range(8):
    if not (2 ** i)-1 < div:
        print(2**i)
        break

Submission status: Wrong Answer

Solution code:
use = int(input())

if use <= 1:
    best_number = 0
    maximum = 0
    t = 0

    for i in range(2,use+1,2):
        n = i
        while n % 2 == 0:
            n /= 2
            t += 1

        if t > maximum:
            maximum = t
            best_number = i
        t = 0
        
    print(best_number)
else: print(1)

Submission status: Wrong Answer

Solution code:
use = int(input())

best_number = 0
maximum = 0
t = 0

for i in range(2,use+1,2):
    n = i
    while n % 2 == 0:
        n /= 2
        t += 1

    if t > maximum:
        maximum = t
        best_number = i
    t = 0
    
print(best_number)

Submission status: Wrong Answer

Solution code:
n = int(input())

for p in range(n):
  i = 2 ** p
  if i > n:
    break
print(i//2)

Submission status: Wrong Answer

Solution code:
n = int(input())

for p in range(n):
  i = 2 ** p
  if i > n:
    break
print(i)

Submission status: Wrong Answer

Solution code:
n=int(input())
t=[2,4,8,16,32,64]
c=0
if n==0:print("0")
elif n==1:print("1")
elif n>64:print("64")
else:
    for i in t:
        if n < i:
            print(t[c-1])
            break
        c=c+1

Submission status: Wrong Answer

Solution code:
div = int(input())
for i in range(8):
    if 2 ** i >= div:
        print(2**i)
        break

Submission status: Wrong Answer

Solution code:
div = int(input())
for i in range(7):
    if 2 ** i >= div:
        print(i)
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8

n = input()
m = 0

for i in range(1, n+1):
    c = 0
    while True:
        if i % 2 == 0:
            i = i / 2
            c += 1
        else:
            if m < c:
                m = c
            break

print m

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [64,32,16,8,4,2]
if N<2:
    print(0)
else:
    for i in A:
        if N >= i:
            break
    print(i)

Submission status: Wrong Answer

Solution code:
maxNum = int(input())
favNum = 0
max2 = 0

for i in range(1,maxNum+1):
    currNum = i
    j = 0
    while(1):
        if currNum % 2 == 1:
            break
        else:
            currNum = currNum/2
            j += 1
    if max2 < j:
        max2 = j 
        favNum = i

print(favNum)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
maxNum = int(7)
favNum = 0
max2 = 0

for i in range(1,maxNum):
    currNum = i
    j = 0
    while(1):
        if currNum % 2 == 1:
            break
        else:
            currNum = currNum/2
            j += 1
    if max2 < j:
        max2 = j 
        favNum = i

print(favNum)

Submission status: Wrong Answer

Solution code:
n = int(input())
s = 0
for i in range(1,8):
    if 2 ** i > n:
        pass
    else:
        s = 2 ** i
 
print(s)

Submission status: Wrong Answer

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

for i in range(1,8):
    if 2 ** i >= n:
        pass
    else:
        s = 2 ** i
 
print(s)

Submission status: Wrong Answer

Solution code:
n = int(input())
 
for i in range(1,8):
    s = 0
    if 2 ** i >= n:
        pass
    else:
        s = 2 ** i
 
print(s)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=1
while a > b:
    b = b * 2
print(b/2)