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: Accepted

Solution code:
maxNum = int(input())
favNum = 1
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: Accepted

Solution code:
N = int(input())

index = -1
for i in range(7):
    if 2 ** i <= N:
        index += 1
    else:
        pass

print(2 ** index)

Submission status: Accepted

Solution code:
#coding=UTF-8

N=int(input())

def waricount(num):
    kaeshi=0
    while num%2==0:
        kaeshi+=1
        num=num//2

    return kaeshi


ans=None
ans_val=-1
for idx in range(1,N+1,1):
    val=waricount(idx)
    if val > ans_val:
        ans=idx
        ans_val=val

print(ans)

Submission status: Accepted

Solution code:
import sys

# sys.stdin = open('b1.in')


def read_int_list():
    return list(map(int, input().split()))


def read_str_list():
    return input().split()


def read_int():
    return int(input())


def read_str():
    return input()


n = read_int()
res = 0
for i in range(100):
    r = 2 ** i
    if r <= n:
        res = r
    else:
        break
print(res)

Submission status: Accepted

Solution code:
# coding: utf-8

N = int(input())

ma = -1
res = 1
for i in range(1, N+1):
    num = i
    tmp = num
    count = 0
    while num % 2 == 0:
        count += 1
        num = num / 2

    if count > ma:
        res = tmp
        ma = count

print(res)

Submission status: Accepted

Solution code:
#Python

N = input()

a=[]
i=1
while i<100:
	i=i*2
	if i>N:
		#print i
		print i/2
		break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

if N == 1:
    print("1")
else:
    l = [2**x for x in list(range(1, 8))]
    a = [ x for x in l if x <= N]
    print(max(a))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

c_max = 0
i_max = 1
for i in range(1, N+1):
    c = 0
    num = i
    while True:
        if num % 2 != 0:
            break
        num = num // 2
        c += 1
    if c > c_max:
        c_max = c
        i_max = i
        
print(i_max)

Submission status: Accepted

Solution code:
f = len("{0:b}".format(int(input()))) - 1
a = '1' + '0' * f

print(int(a, 2))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Here your code !
n=input()
N=int(n)
a=0
ans=[]
for i in range(N):
    I=i+1
    a=0
    if I%2==0:
        a=a+1
        P=I/2
        for w in range(100):
            if P%2==0:
                a=a+1
                P=P/2
            else:
                ans.append(a)
                break
    else:
        ans.append(0)
max_idx = ans.index(max(ans))
print(max_idx+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
Nmax = int(input())
ans = 1
maxnum = 0
for N in range(1, Nmax+1):
    cnt=0
    N_before = N
    while 1:
        if int(N/2) == int((N+1)/2):
            N = N/2
            cnt +=1
        else:
            break
    if cnt > maxnum:
        maxnum = cnt
        ans = N_before
print (ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
max = int(input())
x = 1
while(True):
	if x > max:
		x = x/2
		break
	elif x == max:
		break
	else:
		x = x * 2

print(int(x))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/python

import math
import sys

def main(argv):
    for line in sys.stdin:
        N = int(line)
        index = int(math.log(N, 2))
        print(int(math.pow(2, index)))

if __name__ == "__main__":
    main(sys.argv)

Submission status: Accepted

Solution code:
n = map(int, raw_input().split())[0]

i = 1

while i * 2 <= n:
    i *= 2

print i

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main():
    N = int(input())

    if N == 1:
        print(1)
        return

    x = (64, 32, 16, 8, 4, 2)
    for i in x:
        if i <= N:
            print(i)
            break

main()

Submission status: Accepted

Solution code:
n = int(input())

import math as m
print(2** m.floor(m.log(n, 2)))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

N = int(input())

cnt = 0
while True:
    if N >= 2:
        N = N // 2
        cnt += 1
    else:
        break

print(2**cnt)

Submission status: Accepted

Solution code:
from math import log
print (max(1, 2**int(log(int(input()), 2))))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

maxcount = -1
maxi = 0
for i in range(1, N+1):
  count = 0
  cur_i = i
  while True:
    if i % 2 == 0:
      i = i // 2
      count += 1
    else:
      break
  if count > maxcount:
    maxcount = count
    maxi = cur_i
print(maxi)

Submission status: Accepted

Solution code:
N = int(input())
cnt_max = 0
ans = 1
for n in range(1 , N+1):
    cnt = 0
    z = n
    while True:
        if z%2 == 0:
            cnt += 1
            z = z / 2
        else:
            break
    if cnt > cnt_max:
        cnt_max = cnt
        ans = n

print(ans)

Submission status: Accepted

Solution code:
a = int(input())
cnt = 0
while a:
    cnt += 1
    a >>= 1
print(1 << (cnt - 1))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import log2
from math import floor
N=int(input())
print(2**floor(log2(N)))

Submission status: Accepted

Solution code:
n = int(input())
num = 1
while True:
    if num*2 > n:
        print(num)
        break
    elif num*2 == n:
        print(num*2)
        break
    else:
        num *= 2

Submission status: Accepted

Solution code:
N = int(input())

res_list = []
tmp = 1
while True:
    if tmp > N:
        break
    res_list.append(tmp)
    tmp *= 2


print(max(res_list))

Submission status: Accepted

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

num = 1

while (num<=N):
    num*=2
print(int(num/2))

Submission status: Accepted

Solution code:
import sys

N = int(input())						# 5

i = 1
while (i*2) <= N:
	i *= 2

print(i)

Submission status: Accepted

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

print (int(a/2))

Submission status: Accepted

Solution code:
# coding: utf-8

if __name__ == "__main__":
    n = int(input())
    r = 0
    while 2**r <= n:
        r += 1

    r -= 1

    print(2**r)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
l = [2,4,8,16,32,64]
if n==1:
    print(1)
else:
    while True:
        a=l.pop()
        if n>=a:
            print(a)
            break

Submission status: Accepted

Solution code:
n = int(input())
if n < 2:
    print(1)
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: Accepted

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

Submission status: Accepted

Solution code:
# encoding:utf-8

def main():
	n = int(input())
	powers = [2 ** i for i in range(7)]
	out = max([x for x in powers if x <= n])
	print(out)

if __name__ == '__main__':
	main()

Submission status: Accepted

Solution code:
N=int(raw_input())

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

print 2**(i-1)

Submission status: Accepted

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: Accepted

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

import sys
import re
import math
import collections
import itertools
import functools

DEBUG = True
DEBUG = False

def dbg(*args):
    if DEBUG:
        print("DBG: ", file=sys.stderr, end="")
        print(*args, file=sys.stderr)



def main():
    N = int(input())

    k = math.floor(math.log(N, 2))
    print(2**k)

if __name__ == "__main__": main()

Submission status: Accepted

Solution code:
N = int(input())

if N == 1:
	print(1)
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: Accepted

Solution code:
num = int(input())
cnt =0
while num>1:
    num = int(num/2)
    cnt +=1
print(2**cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
pow2 = [2 ** item for item in range(10)]
for item in pow2[::-1]:
    if(item <= n):
        print(item)
        break

Submission status: Accepted

Solution code:
N = int(input())

i = 1
while(1):
    if i*2 > N:
        break
    i = i*2
print(i)

Submission status: Accepted

Solution code:
from math import log

ans = 1

for i in range(1,int(input())+1):
    if int(log(i,2)) > int(log(ans,2)):
        ans = i

print(ans)

Submission status: Accepted

Solution code:

n = int(input())

k = 0
while 1:
    if 2 ** k > n:
        break

    ans = 2 ** k
    k += 1

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
s = [i for i in range(1,n+1)]
counter = 0
while(True):
    if len([i for i in s if i % 2 == 0])==1:
        s = [i for i in s if i % 2 == 0]
        print(int(s[-1] * (2 ** counter)))
        break
    else:
        s = [i/2 for i in s]
        counter += 1

Submission status: Runtime Error

Solution code:
    if 2**i <=n:

Submission status: Runtime Error

Solution code:
N = int(input())
s = [input() for i in range(N)]
b = []
cnt = 0
for i in range(N):
    if s[i] % 2 == 1:
        exit()
    else:
        while s[i] % 2 == 0:
            cnt += 1
            s[i] /= 2
        b.append(cnt)
        cnt = 0
print(min(b))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math
if n == 8:
  	print(8)
else:
	print(int(2 ** (math.log(n) // math.log(2))))

Submission status: Runtime Error

Solution code:
import math
print(2 ** (int(math.log(int(input()))) // int(math.log(2))))

Submission status: Runtime Error

Solution code:
N=int(input())
import ita
data=ita.array.make1d(N)
for i in range(0,N):
    c=0
    while i%2==0:
        c=c+1
    data[i]=c
k=0
while data[k]!=max(data):
    k=k+1
print(k+1)

Submission status: Runtime Error

Solution code:
N = int(input())

ans = 0
for i in range(2,N+1):
  j = i
  if j % 2 == 1:
    continue
  cnt = 0
  while j % 2 == 0:
    j //= 2
    cnt += 1
  if ans < cnt:
    res = i
    ans = cnt
  
print(res)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

print(cnt)

Submission status: Runtime Error

Solution code:
N=int(input())
a=[]
for n in range(1,N,1):
  count=0
  while n%2 == 0:
    count+=1
    n/=2
  a.append(count)

Nmax=a.index(max(a))+1
Tmax=max(a)

Submission status: Runtime Error

Solution code:
n = int(input())

ans = []
for i in range(1, n + 1):
    x = i
    for j in range(100):
        if x % 2 == 0:
            x = int(x // 2)
            #ans.append(j)
        else:
            #ans.append(j)
            break
    #ans.append(j)

#print(ans)
print(ans.index(max(ans)) + 1)

Submission status: Runtime Error

Solution code:
n = int(input())
a = []
for i in range(1, n+1):
  while True:
    if i % 2 != 0:
      break
    i = i // 2
    c += 1
  a.append(c)
print(a.index(max(a)) + 1)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
b = m.bit_length() - 1
ans = int('0b1'+'0'*m, 2)
print(ans)

Submission status: Runtime Error

Solution code:
for i in range(7):
    if 2**i> n:
        break

print(2**(i-1))

Submission status: Runtime Error

Solution code:
import math
c= 0
while(n % 2 == 0):
    n/=2
    c+=1
print c

Submission status: Runtime Error

Solution code:
N = int(input())

ans = 0


for x in range(1, N + 1):
    ans_ = 0
    k = x
    for y in range(999):
        if x % 2 == 0:
            x /= 2
            ans_ += 1
        else:
            break
    if ans_ > ans:
        ans = ans_
        kk = k
print(kk)

Submission status: Runtime Error

Solution code:
N = int(input())

ans = 0


for x in range(1, N + 1):
    ans_ = 0
    k = x
    for y in range(x):
        if x % 2 == 0:
            x /= 2
            ans_ += 1
        else:
            break
    if ans_ > ans:
        ans = ans_
        kk = k
print(kk)

Submission status: Runtime Error

Solution code:
N = int(input())
x = 0
a = []
for i in range(2,N,2):
    while i % 2 == 0:
        i //= 2
        x += 1
    a.append(x)
    x = 0
a = sorted(a)
a = a[::-1]
print(a[0])

Submission status: Runtime Error

Solution code:
N = int(input())
x = 0
a = []
for i in range(2,N,2):
    while i % 2 == 0:
        i //= 2
        x += 1
    a.append(x)
    x = 0
a = sorted(a)
a = a[::-1]
print(a[0])

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s = input()
p = int(s)

x = 1

numbers = []

while (x <= p):
    x *= 2
    numbers.append(x)

y = numbers.pop()
answer = numbers.pop()

print(answer)

Submission status: Runtime Error

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

for n in range(1, N+1):
    cnt = 0
    for div in range(1, 7):
        if n % 2**div == 0:
            cnt += 1
    if cnt > max_cnt:
        max_cnt = cnt
        ans = n
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def resolve(N):
    '''
    code here
    '''
    N = int(input())
    res = 0

    def div2(num):
        if num == 1:
            return 0
        else:
            cnt = 0
            while True:
                if num % 2 == 0:
                    num //= 2
                    cnt += 1
                else:
                    return cnt


    res_max_cnt = 0
    res = 1
    for i in range(N):
        tepm_cnt = div2(i+1)
        if res_max_cnt < tepm_cnt:
            res_max_cnt = tepm_cnt
            res = i+1
    print(res)

if __name__ == "__main__":
    resolve()

Submission status: Runtime Error

Solution code:
def resolve(N):
    '''
    code here
    '''
    # N = int(input())
    res = 0

    def div2(num):
        if num == 1:
            return 0
        else:
            cnt = 0
            while True:
                if num % 2 == 0:
                    num //= 2
                    cnt += 1
                else:
                    return cnt


    res_max_cnt = 0
    res = 1
    for i in range(N):
        tepm_cnt = div2(i+1)
        if res_max_cnt < tepm_cnt:
            res_max_cnt = tepm_cnt
            res = i+1
    print(res)

if __name__ == "__main__":
    resolve()

Submission status: Runtime Error

Solution code:
N = int(input())

while a*2 <= N:
    a = a*2

print(a)

Submission status: Runtime Error

Solution code:
N = int(input())

while a*2 <= N:
    a *= 2

print(a)

Submission status: Runtime Error

Solution code:
n = int(input())

allcount = 0

for i in range(1,n+1):
  count = 0
  vans = i
  while True:
    if i%2 == 1:
      break
    elif i%2 == 0:
      count += 1
      i //= 2

  if count > allcount:
    allcount = count
    ans = vans

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=input()
maxn=0
maxcount=0
 
for i in range(n+1):
  count=0
  now=i
  while n%2==0:
    now=now/2
    count+=1
  if maxcount < count:
    maxn=now
    maxcount=count
 
print(maxn)

Submission status: Runtime Error

Solution code:
n=input()
maxn=0
maxcount=0
 
for i in range(n+1):
  count=0
  while n%2==0:
    n=n/2
    count+=1
  if maxcount < count:
    maxn=i
    maxcount=count
 
print(maxn)

Submission status: Runtime Error

Solution code:
n=input()
maxn=0
maxccount=0

for i in range(n+1):
  count=0
  while n%2==0:
    n=n/2
    count+=1
  if maxcount < count:
    maxn=i
    maxcount=count

print(maxn)

Submission status: Runtime Error

Solution code:
n=input()
maxn=0
maxccount=0

for i in range(n+1):
  count=0
  while n-i%2==0:
    n=n/2
    count+=1
  if maxcount < count:
    maxn=i
    maxcount=count

print(maxn)

Submission status: Runtime Error

Solution code:
N = int(input())
evens = [i for i in range(1, N+1) if i%2 ==0]
even_cnts = []
for even in evens:
    cnt = 0
    while even % 2 ==0:
        cnt += 1
        even = even / 2
    even_cnts.append(cnt)
max_cnts = max(even_cnts)
index = even_cnts.index(max_cnts)
print(evens[index])

Submission status: Runtime Error

Solution code:
n = int(input())
ans = 0
out = 1
for i in range(1, n + 1):
    cnt = 0
    while i % 2 == 0:
        i //= 2
        cnt += 1
    if cnt > ans:
        ans = cnt
        out = i * 2 ** ant
print(out)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=input()
if n<2:
    print(1)
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: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
ans_list = [2**i for i in range(7)]
ai = 0
while (ans_list[ai] <= N):
    ai += 1

print(ans_list[max(0, ai-1)])

Submission status: Runtime Error

Solution code:
N = int(input())
ans_list = [2**i for i in range(7)]
ai = 0
while (ans_list[ai] <= N):
    ai += 1

print(ans_list[ai-1])

Submission status: Runtime Error

Solution code:
n = int(input())

if n>=64:
    print(64)
elif 32<=n<64:
    print(32)
elif 16<=n<32:
    print(16)
elif 8<=n<16:
    print(8)
elif 4<=n<8:

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())

# ans = 1
# mac_c = 0
# for i in range(2, N+1):
#     c_count = 0
#     temp_i = i
#     while True:
#         if temp_i % 2 != 0:
#             break
#         temp_i /= 2
#         c_count += 1
#     if mac_c <= c_count:
#         mac_c = c_count
#         ans = i

# 別解
# 100以内の数で2の累乗を求めればいい
ans_list = [2**i for i in range(7)]
ans = max([i for i in ans_list if N > i])
print(ans)

Submission status: Runtime Error

Solution code:
n = int(sys.stdin.readline().rstrip("\n"))
i = 0
while True:
    if 2**i <= n:
        i += 1
    else:
        break
print(2**i)

Submission status: Runtime Error

Solution code:
n = int(input())
list = []

for i in range(n+1): #nまでの数字について扱うよ
  for j in range(n): #それぞれの数字が割り切れなくなるまで割るよ
    if j % 2 != 1:
      j = j % 2
      cnt += 1
      continue
    else:
      list.append(j)
      
print(list.index(max(list))

Submission status: Runtime Error

Solution code:
import math
a = int(input())
print(2**math.floor(math.log2(a)))

Submission status: Runtime Error

Solution code:
import math
a = int(input())
print(2**math.floor(mat

Submission status: Runtime Error

Solution code:
N = int(input())

cnt = 0
tmp = 0

while tmp<=N:
    if N==1:
        print(ans)
        break
    else:
        cnt += 1
        tmp = 2**cnt

print(2**(cnt-1))

Submission status: Runtime Error

Solution code:
N = int(input())
i = 1
while i <= N:
    i = i*2
peint(i//2)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
def main():
    n = int(input())
    t = 1
    while True:
        if t * 2 > n:
		break
	t *= 2
    print(t)
main()

Submission status: Runtime Error

Solution code:
n = int(input())
precount = 0
for i in range(1, n+1):
    tmp = i
    flag = 1
    count = 0
    while flag :
        flag = 0
        if i%2 == 0:
            i = i//2
            flag = 1
            count += 1
    if precount < count :
        precount = count
        ans = tmp
        
    
            

print(ans)

Submission status: Runtime Error

Solution code:
s=int(input())
two=[]
for i in range(7):
    two.append(2**i)
ans=0
if s in two:
    print(s)
else:
    while s>two[ans]:
        ans+=1
    print(2**(ans-1))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from sys import stdin
import math


if __name__ == "__main__":
    _in = [_.rstrip() for _ in stdin.readlines()]
    N = int(_in[0])  # type:int
    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    cnt = 2**math.floor(math.log2(N))
    # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    print(cnt)

Submission status: Runtime Error

Solution code:
num = int(input())

count_max = 0
for i in range(num):
  tmp = i + 1
  count = 0
  while tmp % 2 == 0:
    tmp = tmp / 2
    count += 1
  if count > count_max:
    count_max = count
    num_max = i + 1

print(num_max)

Submission status: Runtime Error

Solution code:
num = int(input())

count_max = 0
for i in range(num)
  tmp = i
  count = 0
  while tmp % 2 == 0:
    tmp = tmp / 2
    count += 1
  if conut > count_max:
    count_max = count

Submission status: Runtime Error

Solution code:
N = int(intpu())
ans = 1
while True:
  ans *= 2
  if N < ans:
    ans //= 2
    break
    
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
nums = [2**i for i in range(1,7)]
ans = [i - n for i in nums if (i - n) >= 0]
print(ans[0])

Submission status: Runtime Error

Solution code:
N = int(input())
two_list = [1, 2, 4, 8, 16,32,64]
for two in two_list:
  if N > two:
  	if two == 64:
    	print(64)
  else:
    print(two)
    exit()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
# n = 100
m = 0
for i in range(1, n+1):
    a = i
    c = 0
    while a % 2 == 0:
        a = a//2
        c += 1
    if c > m:
        x = i
    m = max(m, c)
print(x)

Submission status: Runtime Error

Solution code:
n = int(input())
l = []
for i in range(1,n**(0.5)):
  a = 2*i
  l.append(a)
print(l[-1])

Submission status: Runtime Error

Solution code:
n = int(input())
l = []
for i in range(1,n**(0.5)):
  a = i*i
  l.append(a)
print(l[-1])

Submission status: Runtime Error

Solution code:
n = int(input())
l = []
for i in range(1,n**(0.5)):
  l.append(i**2)
print(l[-1])

Submission status: Runtime Error

Solution code:
import numpy
s = int(input())
total = []
for i in range(s):
    t = i + 1
    count = 0
    if t % 2 == 1:
        total.insert(i,count)
    while t % 2 == 0:
        t = t / 2
        count += 1
        total.insert(i,count)
del total[s]
max_index = numpy.argmax(total)
print(max_index+1)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
data = [i*2 for i in range(1,n//2+1)]
def f(x):
    cnt = 0
    flg = 0
    while flg==0:
        if x%2==0:
            cnt += 1
            x = x/2
        else:
            flg = 1
    return cnt 
aim = 0
for i in data:
    if aim < f(i):
        aim = f(i)
        num = i
    else:
        continue
print(num)

Submission status: Runtime Error

Solution code:
a=int(input())
b=0
c=[0]*a
for i in range(1,a+1):
  b=0
  e=i
  while 1:
    i%=2
    if i%2!=0:
      c[e]=b
      break
    b+=1
print(max(c))

Submission status: Runtime Error

Solution code:
a=int(input())
b=0
c=[0]*a
for i in range(1,a+1):
  e=i
  while 1:
    i%=2
    if i%2!=0:
      c[e]=b
      break
    b+=1
print(max(c))

Submission status: Runtime Error

Solution code:
a=int(input())
b=0
c=[0]*a
for i in range(1,a+1):
  while 1:
    b%=2
    if b%2!=0:
      c[i]=b
      break
    b+=1
print(max(c))

Submission status: Runtime Error

Solution code:
N = int(input())
K = 0
while True:
  if 2**k <= N < 2**(k+1):
    print(2**k)
    break
  else:k += 1

Submission status: Runtime Error

Solution code:
n = int(input())
box  = []
prime = []
ans = 0
def Prime_Factorization(n):
    i = 2
    prime_factors = []
    while n > 1:
        if n % i == 0:
            prime_factors.append(i)
            n = n / i
        else:
            i += 1
    return prime_factors

for i in range(1,n):
    prime = Prime_Factorization(i)
    box.append(prime.count(2))
    #print(box)

ans = box.index(max(box)) + 1
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
box  = []
prime = []

def Prime_Factorization(n):
    i = 2
    prime_factors = []
    while n > 1:
        if n % i == 0:
            prime_factors.append(i)
            n = n / i
        else:
            i += 1
    return prime_factors

for i in range(1,n):
    prime = Prime_Factorization(i)
    box.append(prime.count(2))
    #print(box)

ans = box.index(max(box)) + 1
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:

if 1 <= N <2:
  print(1)
if 2 <= N <4:
  print(2)
if 4 <= N <8:
  print(4)
if 8 <= N <16:
  print(8)
if 16 <= N <32:
  print(16)
if 32 <= N <64:
  print(32)
if 64 <= N <100:
  print(64)

Submission status: Runtime Error

Solution code:
n = int(input())
l =[64,32,16,8,4,2,1]
for i ib l:
  if i <= n:
    print(i)
    break;

Submission status: Runtime Error

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

for i in range(N):
    if 2**i <= N:
        min = i
    else:
        break

print(min)


N = int(input())
min = 0
max = 0

for i in range(N):
    if 2**i <= N:
        min = i
    else:
        break

print(min)

Submission status: Runtime Error

Solution code:
N = int(input())

i = 1
for i in range(1,10):
  if 2 ** i <= N:
    ans = 2*i

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Solution code:
n = input()
import numpy as np
a = list(range(1,n+1))
b = list(range(1,n+1))
c = [0] * n
for i in range(n):
  while a[i] % 2 ==0:
    a[i] /= 2
    c[i] += 1
print(b[np.argmax(c)])