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: Runtime Error

Solution code:
n = input()
queue1 = list(range(1,n+1))
queue2 = list(range(1,n+1))
count = [0] * n
for i in range(n):
  while queue1[i] % 2 == 0:
    count[i] += 1
    queue1[i] /= 2
print(queue2[max(count)])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())

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

print(max([x for x in a if x <= n]))

Submission status: Runtime Error

Solution code:
A = int(input())
i = 0
while (2 ** i) <= A:
    if (2 ** i) = A:
        print(A)
        break
    else:
        i += 1
print(2 ** (i - 1))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
ans = 1
for i in range(10):
  if ans < n:
    ans *= 2
  elif ans > n:
    print(ans //= 2)
    exit()
  else:
    print(ans)
    exit()

Submission status: Runtime Error

Solution code:
N = int(input())
a = [N-2**i for i in range(0,7) if N-2**i > 0]
min_index = a.index(min(a))
print(2**min_index)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
n = int(input())
a = 1
wihle(1):
  if a<=n:
    a*=2
  else:
    print(a//2)
    exit()

Submission status: Runtime Error

Solution code:
#coding:utf-8
n = int(input())
two = [1, 2, 4, 8, 16, 32, 64]
ans = 0

for i in two:
    if  two <= n:
        ans = two

print(ans)

Submission status: Runtime Error

Solution code:
ソースコード 

Copy
Copy
def divisible(n):
    ans = 0
    while n%2 == 0:
        n /=2
        ans +=1
    return ans
 
N = int(input())
 
b = 0
 
for i in range(N):
    if(divisible(i) > b):
      b = divisible(i)
      ans = i
    
print(max(ans))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
"""import sys
input = sys.stdin.readline"""
n=int(input())
if n==32:
    print(32)
    exit()
cntm=0
for i in range(1,n+1):
    a=i
    cnt=0
    while a%2==0:
        a//=2
        cnt+=1
    if cntm<cnt:
        ans=i
        cntm=cnt
print(ans)

Submission status: Runtime Error

Solution code:
"""import sys
input = sys.stdin.readline"""
n=int(input())
cntm=0
for i in range(1,n+1):
    a=i
    cnt=0
    while a%2==0:
        a//=2
        cnt+=1
    if cntm<cnt:
        ans=i
        cntm=cnt
print(ans)

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline
n=int(input())
cntm=0
for i in range(1,n+1):
    a=i
    cnt=0
    while a%2==0:
        a//=2
        cnt+=1
    if cntm<cnt:
        ans=i
        cntm=cnt
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())

cont = 0
cont_list = [1]
cont_num =[]

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


if max(cont_list) == 1:
    print(1)
else:
    print(cont_num[cont_list.index(max(cont_list))])

Submission status: Runtime Error

Solution code:
n = int(input())

ans = 1
whille ans*2 <= n:
    ans *= 2
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())

ans = 1
whille ans*2 <= n:
    ans += 2
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
even_A = list(range(2, 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: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b,c = map(int,input().split()) 
if b-a == c-b:
	print('YES')
else:
	print('NO')

Submission status: Runtime Error

Solution code:
n=int(input())
ln=[0]*n
for a  in range(n):
    if a %2 ==0:
        ln[a-1}=a//2
    else:
        ln[a-1]=0
print(max(ln))

Submission status: Runtime Error

Solution code:
N = int(input())

ans = 1
for i in range(8):
  if(n >= 2 ** i):
    ans = 2 ** i
print(ans)

Submission status: Runtime Error

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

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

print(answer)

Submission status: Runtime Error

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

if n%2 == 0:
  print(math.log2(n))
else:
  print(math.log2(n-1))

Submission status: Runtime Error

Solution code:
n = int(input())

count1 = 0

for i in range(1,n):
  a = i%2
  b = i/2
  count = 1
  while a ==0:
    a = b%2
    b = b/2
    count += 1
  if count > count1:
    count1 = count
    max_num = i
print(max_num)

Submission status: Runtime Error

Solution code:
ln=[n for n in range(int(input()))]
cnt=[0]*n
for n in ln:
    while n%2==0:
        cnt[n-1]+=1
print((max(cnt)).index()+1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
l = list()
n = int(input())
original_list = list(range(1,n))

for x in original_list:
      ans = 0
      while x % 2 == 0:
        x = x / 2
        ans = ans + 1
      l.append(ans)
 
print(max(l))

Submission status: Runtime Error

Solution code:
a=[2**i for i in range(7)]
import bisect
n=int(input())
s=bisect.bisect_left(a,n)
if n==a[s]:
    print(n)
    exit()
print(a[s-1])

Submission status: Runtime Error

Solution code:
N = int(input())
# res = [x for x in range(1, N + 1)]
result = {}
# for i in res:
for i in range(1, N + 1):
    result[i] = 0
    tmp = i
    while True:
        if tmp % 2 == 0:
            tmp = tmp / 2
            result[i] += 1
        else:
            break
print(sorted(result.items(), key=lambda x: -x[1])[0][0]

Submission status: Runtime Error

Solution code:
N = int(input())
res = [x for x in range(1, N + 1)]
result = {}
i = 0
for i in res:
    result[i] = 0
    tmp = i
    while True:
        if tmp % 2 == 0:
            tmp = tmp / 2
            result[i] += 1
        else:
            break
print(sorted(result.items(), key=lambda x: -x[1])[0][0]

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())
a=0
for i in 100:
  if a<n:
    a=2^(i+1)
print(2^(i-1))

Submission status: Runtime Error

Solution code:
N=int(input())
print(2**len(bin(N)-3))

Submission status: Runtime Error

Solution code:
N=int(input())
while i<N+1:
    count(i)=o
    if i%2==0:
        count(i)+=1
    else:
        break
if count(a)=max(count(i)):
    print(a)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N=int(input())
if N<2:
    x=1
elif N<4:
    x=2
elif N<8:
    x=4
elif N<16:
    x=8
elif n<32:
    x=16
elif n<64:
    x=32
else:
    x=64
print(x)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
ans = 0
for i in range(1,N+1):
    counter = 0
    real_number = i
    while i %2 == 0:
        i //= 2
        counter += 1
    if counter > ans:
        ans = counter
        ans_number = real_number
print(ans_number)

Submission status: Runtime Error

Solution code:
n = int(input())


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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())

max=0
for i in range(1,n+1):
    count=0
    x=i
    while i%2 == 0:
        count +=1
        i /=2
        
    if count > max:
        max=count
        ans=x
        
print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())

for i in (1,n):
  if 2**i>n
    print(2**(i-1))

Submission status: Runtime Error

Solution code:
n=input()
l=list(range(1,n))
m=0
def c(n):
  return n/2
while any(i%2==0 for i in l):
       l=map(c,l)
       m+=1
print(2**m)

Submission status: Runtime Error

Solution code:
n=input()
l=list(range(1,n))
m=0
while any(i%2==0 for i in l):
       l=[i/2 for i in l]
       m+=1
print(2**m)

Submission status: Runtime Error

Solution code:
n=input()
l=range(1,n)
m=0
while any(i%2==0 for i in l):
       l=[i/2 for i in l]
       m+=1
print(2**m)

Submission status: Runtime Error

Solution code:
n=input()
l=range(1,n)
m=0
while any(i&2==0 for i in l):
       l=[i/2 for i in l]
       m+=1
print(2**m)

Submission status: Runtime Error

Solution code:
n=input()
l=(range(n+1))[1:]
while any(i%2==0 for i in l):
  l=[i/2 i%2==0 for i in l]
print(int(n))

Submission status: Runtime Error

Solution code:
import math


def resolve():
    n = int(input())
    print(2 ** int(math.log2(n)))


if __name__ == "__main__":
    resolve()

Submission status: Runtime Error

Solution code:
n=int(input())
if n==1:
    print(n):
    exit()
i=2
for _ in range(9):
    i**=2
    if i==n:
        print(i)
        exit()
    elif i>n:
        print(i//2)
        exit()

Submission status: Runtime Error

Solution code:
import numpy as np
N = int(input())
a = [1, 2, 4, 8, 16, 32, 64]
b = []
for i in range(len(a)):
    if a[i]<=N:
        b.append(a[i])
print(max(b))

Submission status: Runtime Error

Solution code:
n=int(input())
for i in range(math.inf):
  if 2**i < n:
    continue
  else:
    print(2**(i-1))
    break

Submission status: Runtime Error

Solution code:
n=int(input())
for i in range(math.inf):
  if 2**i < n:
    continue
  else:
    print(2**(i-1))

Submission status: Runtime Error

Solution code:
n=int(input())
for i in range(math.inf):
  if n%2==0:
    print(n)
    break
  else:
    n=n/2

Submission status: Runtime Error

Solution code:
a=int(input())
cnt=0
for i in range(math.inf):
  if a%2==0:
    cnt+=1
    a/=2
  else:
    print(cnt)
    break

Submission status: Runtime Error

Solution code:
a=int(input())
cnt=0
for i in range(math.inf):
  if a%2==0:
    cnt+=1
    a/=2
  else:
    print(cnt)

Submission status: Runtime Error

Solution code:
n = (int(input()))
li = []
for i in range(1,n+1):
    if i%2 == 0:
        li.append(i)

li = [bin(x) for x in li]
li = li[::-1]
for i in range(len(li)):
    if li[i].count(str(1)) == 1:
        a=((li[i].count(str(0)) -1))
        break
print(2**a)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())

for i in range(7):
  if n > 2**i:
    ans = 2**i
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())

ans = 1
for i in range(7)
    if 2**i < N:
        ans = 2**i
    else:
        break

print(ans)

Submission status: Runtime Error

Solution code:
N=int(input())
a=math.log2(N)
print(round(a))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# https://atcoder.jp/contests/abc068/tasks/abc068_b


def two_factor(x):
    cnt = 0
    while x % 2 == 0:
        cnt += 1
        x //= 2
    return cnt


N = int(input())
a = map(two_factor, range(1, N + 1))
max_cnt = max(a)
print(a.index(max_cnt) + 1)

Submission status: Runtime Error

Solution code:
# https://atcoder.jp/contests/abc068/tasks/abc068_b


def two_factor(x):
    cnt = 0
    while x % 2 == 0:
        cnt += 1
        x //= 2
    return cnt


N = int(input())
a = map(two_factor, range(1, N + 1))
max_cnt = max(a)
print(list(range(1, N + 1)).index(max_cnt) + 1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

for N >= 2:
  N = N // 2
  exp += 1
  
print(2 ** exp)

Submission status: Runtime Error

Solution code:
ans = 10**2
N = int(input())
for i in N:
    p = 0
    while i % 2 == 0:
        i //= 2
        p += 1
    if p < ans:
        ans = p
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
l = [1, 2, 4, 8, 16, 32, 64]
i = 0
while l[i] < n:
  i += 1
else:
  print(l[i])

Submission status: Runtime Error

Solution code:
n = int(input())
I_J = {}

for i in range(1,n+1):
  for j in range(1,n+1):
    if i%(2**j) == 0:
      I_J[j] = i

max_j = max(I_J.keys())
print(I_J[max_j])

Submission status: Runtime Error

Solution code:
N = int(input())
L = [(N,0),(1,0), (2,1), (4,2), (8,3), (16,4), (32,5), (64,6)]
sorted_L = sorted(L,key=lambda x:x[0])
for i,j in enumerate(sorted_L):
  if j[0] == N:
    if sorted_L[i][0] == sorted_L[i+1][0]:
      print(sorted_L[i][0])
      break
    else:
      print(sorted_L[i-1][0])
      break

Submission status: Runtime Error

Solution code:
N = int(input())
L = [(N,0),(1,0), (2,1), (4,2), (8,3), (16,4), (32,5), (64,6)]
sorted_L = sorted(L,key=lambda x:x[0])
print(sorted_L)
for i,j in enumerate(sorted_L):
  if j[0] == N:
    if sorted_L[i][0] == sorted_L[i+1][0]:
      print(sorted_L[i][0])
      break
    else:
      print(sorted_L[i-1][0])
      break

Submission status: Runtime Error

Solution code:
N = int(input())
L = [(N,0),(1,0), (2,1), (4,2), (8,3), (16,4), (32,5), (64,6)]
sorted_L = sorted(L,key=lambda x:x[0])
print(sorted_L)
for i,j in enumerate(sorted_L):
  if j[0] == N:
    if sorted_L[i][0] == sorted_L[i+1][0]:
      print(sorted_L[i][0])
    else:
      print(sorted_L[i-1][0])
      break

Submission status: Runtime Error

Solution code:
N = int(input())

a = []
for i in range(1,N + 1):
  count = 0
  while True:
    if i % 2 == 0:
      i /= 2
    count += 1
    else:
      break
  a.append(count)
print(a.index(max(a)) + 1)

Submission status: Runtime Error

Solution code:
N = int(input())

a = []
for i in range(1,N + 1):
  count = 0
  while True:
    if i % 2 == 0:
      i /= 2
    count += 1
    else:
      break
  a.append(count)
print(a.index(max(X)) + 1)

Submission status: Runtime Error

Solution code:
N = int(input())

a = []
for i in range(1,N + 1):
  count = 0
  while True:
    if i % 2 == 0:
      i /= 2
    count += 1
    else:
      break
  a.append(count)
print(a.index(max(X) + 1))

Submission status: Runtime Error

Solution code:
N = int(input())

a = []
for i in range(1,N + 1):
  count = 0
  while True:
    if i % 2 == 0:
      i /= 2
    count += 1
    else:
      break
  a.append(count)
print(a.index(max(X) + 1)

Submission status: Runtime Error

Solution code:
N = input()

tnum = 0
iter_num = 0

for i in range(N):
    res = 0
    num = i+1
    while num % 2 == 0:
        num /= 2
        res += 1
    if iter_num < res:
        iter_num = res
        tnum = i+1

print(tnum)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
print(2**(len(bin(int(input())))-3)

Submission status: Runtime Error

Solution code:
n = int(input())
list = []
for i in n:
  counter = 0
  while i%2 = 0:
    counter += 1
    i = i / 2
  elif :
    break
  list.append(counter)
answer = list.index(max(list)) + 1
print(answer)

Submission status: Runtime Error

Solution code:
import sys

N=int(input())

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

Flag=0
nCnt=1
Tmp=2
while Flag=0:
  TmpN = N /Tmp
  if TMpN >= 2:
    Tmp *= 2
    nCnt +=1
  else:
    Flag=1

A = 2 ** (nCnt)
print(A)

Submission status: Runtime Error

Solution code:
res=0
for i in range(1,int(input())+1):
  t=0
  while i==1:
    t+=1 if i%2==0
    i//=2
  res=max(res,t)
print(res)

Submission status: Runtime Error

Solution code:
a = input()
b = range(1, a + 1)
res = 0
max_cnt = 0

for bb in b:
  cnt = 0
  bb_org = bb
  while True:
    if bb % 2 == 0:
      bb /= 2
      cnt += 1
    else:
      break
  if cnt > max_cnt:
    max_cnt = cnt
    res = bb_org
    
print(res)

Submission status: Runtime Error

Solution code:
a = input()
b = range(1, a + 1)
res = 0
max_cnt = 0

for index, bb in enumerate(b):
  cnt = 0
  while True:
    if bb % 2 == 0:
      bb /= 2
      cnt += 1
    else:
      break
  if cnt > max_cnt:
    max_cnt = cnt
    res = index + 1
    
print(res)

Submission status: Runtime Error

Solution code:
N = input()

for i in range(1,N+1):
  a = list(filter(lambda x: x%2 ==0 , i))
  if len(a) == 1:
    print(a)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
ans = 1
while N > ans:
  ans = ans * N2
print(int(ans/2))

Submission status: Runtime Error

Solution code:
n=int(input())
sp = 0
for i in range(1,n+1):
  s_i=i
  count =0
  a =True
  while a:
    if i % 2 ==0:
      i=i/2
      count += 1
    else:
      a =False
  if count >sp:
    sp = count
    sp_i = s_i
    
    
print(sp_i)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
counter =-1 
number = 0
for i+1 in range(N):
    k = i
    now_counter = 0
    while(k % 2 == 0):
        now_counter += 1
        k /= 2
    if(now_counter > counter):
        number = i
print(number)

Submission status: Runtime Error

Solution code:
n = int(input())

n_max = 1
cnt_max = 0
for i in range(1, n + 1):
  cnt = 0
  a = i
  while(a % 2 == 0)
    a %= 2
    cnt += 1
  if cnt > cnt_max:
    cnt_max = cnt
    n_max = i

print(n_max)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
count = 0
While N%2==0:
      N = N/2
      count += 1
    else:
      break
print(count)

Submission status: Runtime Error

Solution code:
N = int(input())
count = 0
for i in range(N):
	if N%2==0:
      count += 1
    else:
      break
print(count)

Submission status: Runtime Error

Solution code:
N = int(input())
count = 0
While True:
	if N%2==0:
      count += 1
    else:
      break
print(count)

Submission status: Runtime Error

Solution code:
N = int(input())
count = 0
for i in range():
	if N%2==0:
      count += 1
    else:
      break
print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = 0
ans = 0
N = input()
for i in N :
  p = 0
  while i % 2 == 0 :
    N //= 2
    p += 1
  if a < p :
    a = p
    ans = i
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys

N = int(sys.stdin.readline().rstrip())

n = 1

while n <= N
  n = n * 2

print(n/2)

Submission status: Runtime Error

Solution code:
n = int(input())

ans = 0

for i in range(6,,-1):
  if n >= 2**i:
    ans = 2**i
    break
print(ans)

Submission status: Runtime Error

Solution code:
a = int(input())
c = 1

while (c <= a):
c = c * 2

print(int(c/2))

Submission status: Runtime Error

Solution code:
import math
math.log2(2)

Submission status: Runtime Error

Solution code:
import math
math.log2("hoge")

Submission status: Runtime Error

Solution code:
# coding:utf-8
def recurcive(N,c):
    if N%2==0 and N!=0:
        c+=1
        return recurcive(int(N/2),c)
    else:
        return c
#print(recurcive(8,0))

N=int(input())
maxim=0

for i in range(1,N+1):
    if recurcive(i,0) > maxim:
        maxim=ans
print(2**maxim)

Submission status: Runtime Error

Solution code:
# coding:utf-8
def recurcive(N,c):
    if N%2==0 and N!=0:
        c+=1
        return recurcive(int(N/2),c)
    else:
        return c
N=int(input())
maxim=-1

for i in range(1,N+1):
    if ans = recurcive(i,0) > maxim:
        maxim=ans
print(2**maxim)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
X = 1
while(N>=X):
  　X = X<<1
print(X>>1)

Submission status: Runtime Error

Solution code:
N = int(input())
X = 1
while(N>=X):
  　X<<1
print(X>>1)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#coding:UTF-8
num = int(input())
max=0
for i in range(1,num+1):
  count=0
  work=i
  while work%2==0:
    work=work//2
    count = count+1
#    print("i:{} count:{} max:{}".format(i,count,max))
  if max<count:
    max=count
    ans=i
if(max==0):
  print(1)
print(ans)

Submission status: Runtime Error

Solution code:
#coding:UTF-8
num = int(input())
max=0
for i in range(1,num+1):
  count=0
  work=i
  while work%2==0:
    work=work//2
    count = count+1
#    print("i:{} count:{} max:{}".format(i,count,max))
  if max<count:
    max=count
    ans=i
print(ans)

Submission status: Runtime Error

Solution code:
print(2**(len(bin(int(input()))-3))

Submission status: Runtime Error

Solution code:
n=int(input())
elif n<2**1:
  print(1)
elif n<2**2:
  print(2)
elif n<2**3:
  print(4)
elif n<2**4:
  print(8)
elif n<2**5:
  print(16)
elif n<2**6:
  print(32)
elif n<2**7:
  print(64)

Submission status: Runtime Error

Solution code:
j=int(input())
print([2**i for i in range(8) if 2**i<=N][-1])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys

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

sorted_list = [1, 2, 4, 8, 16, 32, 64, N][::1]
min_index = sorted_list[sorted_list.index(N) + 1]
print(min_index)

Submission status: Runtime Error

Solution code:
import sys

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


def dev(x):
    global cnt
    if x % 2 == 0:
        cnt += 1
        dev(x / 2)
    return cnt


sorted_list = [2, 4, 8, 16, 32, 64, N][::1]
min_index = sorted_list[sorted_list.index(N) + 1]

cnt = 0
min_cnt = dev(min_index)
for i in reversed(range(min_index, N + 1, 2)):
    cnt = 0
    result = dev(i)
    if min_cnt < result:
        print(i)
        exit()
print(min_index)

Submission status: Runtime Error

Solution code:
import sys

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


def dev(x):
    global cnt
    if x % 2 == 0:
        cnt += 1
        dev(x / 2)
    return cnt


sorted_list = sorted([2, 4, 8, 16, 32, 64, N], reverse=True)
min_index = sorted_list[sorted([2, 4, 8, 16, 32, 64, N], reverse=True).index(N) + 1]

cnt = 0
min_cnt = dev(min_index)
for i in range(min_index, N + 1, 2):
    cnt = 0
    result = dev(i)
    if min_cnt < result:
        print(i)
        exit()
print(min_index)

Submission status: Runtime Error

Solution code:
import sys

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


def dev(x):
    global cnt
    if x % 2 == 0:
        cnt += 1
        dev(x / 2)
    return cnt


min_cnt = 0
sorted_list = sorted([2, 4, 8, 16, 32, 64, N], reverse=True)
min_index = sorted_list[sorted([2, 4, 8, 16, 32, 64, N], reverse=True).index(N) + 1]

for i in range(min_index, N + 1, 2):
    cnt = 0
    result = dev(i)
    if min_cnt < result:
        min_i = i
        min_cnt = result
print(min_i)

Submission status: Runtime Error

Solution code:
import sys
N = int(sys.stdin.readline())


def dev(x):
    global cnt
    if x % 2 == 0:
        cnt += 1
        dev(x / 2)
    return cnt


min_cnt = 0
for i in reversed(range((N + 1)//2, N + 1, 2)):
    cnt = 0
    result = dev(i)
    if min_cnt < result:
        min_i = i
        min_cnt = result
print(min_i)

Submission status: Runtime Error

Solution code:
import sys
N = int(sys.stdin.readline())


def dev(x):
    global cnt
    if x % 2 == 0:
        cnt += 1
        dev(x / 2)
    return cnt


min_cnt = 0
for i in range(2, N + 1, 2):
    cnt = 0
    result = dev(i)
    if min_cnt < result:
        min_i = i
        min_cnt = result
print(min_i)

Submission status: Runtime Error

Solution code:
N = int(input())


def dev(x):
    global cnt
    if x % 2 == 0:
        cnt += 1
        dev(x / 2)
    return cnt


min_cnt = 0
for i in range(2, N + 1, 2):
    cnt = 0
    result = dev(i)
    if min_cnt < result:
        min_i = i
        min_cnt = result
print(min_i)

Submission status: Runtime Error

Solution code:
N = int(intput())
if N == 1:
  print(1)
  exit()
X = [2, 4, 8, 16, 32, 64, 128]
for i, x in enumerate(X):
  if N < x:
    print(X[i - 1])

Submission status: Runtime Error

Solution code:
i=int(input())
for n in range(0,9):
  if 2**n=<i<2**(n+1):
    print(2**n)
    break

Submission status: Runtime Error

Solution code:
from sys import exit
# A,B,C = [int(n) for n in input().split()]
N = int(input())
# a = [int(input()) for _ in range(N)]
# S = str(input())
# L = len(S)
# T = str(input())
maxd = 0
for i in range(1,N+1):
    tmp = i
    tmpa = 0
    while(tmp%2 == 0):
        tmp//=2
        tmpa +=1
    if(maxd < tmpa):
        ans = i
        maxd = tmpa
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
M = 0
for i in range(1, n + 1):
  t = i
  s = 0
  while t % 2 == 0:
    t /= 2
    s += 1
  if M < s:
    M = s
    ans = i
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
""" AtCoder """

N = int(input())
ans_list = [2, 4, 8, 16, 32, 64]
ans_list = ans_list[::-1]

if N == 1:
    print(1)

for i in range(7):
    if N > ans_list[i]:
        print(ans_list[i])
        break

Submission status: Runtime Error

Solution code:
n = int(input())
count = 0
currCount = 0
ans = 0
for i in range(n+1):
    currCount = 0
    currNum = i
    while (i % 2) == 0:
        if i == 0:
            break
        i = int(i / 2)
        currCount += 1
    if count < caurrCount:
        count = currCount
        ans = currNum
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
print(2<<len(bin(int(input())))-4)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())

for i in range(n):
    if 2**i > n:
        ans = 2**(i-1)
        break

print(ans)

Submission status: Runtime Error

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

l=[[i,num2(i)] for i in range(1,N+1)]
l.sort(key=lambda x:x[1])

print(l[0][0])

Submission status: Runtime Error

Solution code:
import math
print(2**int(log2(int(input()))))

Submission status: Runtime Error

Solution code:
print(2**int(log2(int(input()))))

Submission status: Runtime Error

Solution code:
N = int(input())
for k in range(1,7):
    if(N < 2**k):
        ans = 2**(k-1)
        break

print(ans)

Submission status: Runtime Error

Solution code:
import java.util.Scanner;

class Main{
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        scan.close();
        System.out.println(0b1 << Integer.toBinaryString(N).length() - 1);
    }
}