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 = int(input())
ans = 0

for i in range(1, 7):
  if 2**i <= n:
    ans = 2**i

print(ans)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

def main():
    n = int(input())
    ans = 0
    for i in range(1, n + 1):
        cnt = 0
        tmp = i
        while tmp % 2 == 0:
            tmp /= 2
            cnt += 1
        ans = max(ans, cnt)
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

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


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

def main():
    n = int(input())
    cnt = 0
    while n % 2 == 0:
        n /= 2
        cnt += 1
    print(cnt)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
ansc = 0
def dc(m):
  cnt = 0
  x = m
  while (True):
    if x%2 == 0:
      cnt += 1
      x = x//2
    else:
      break
  if m == 1:
    cnt = 1
  return cnt
for i in range(1,n+1):
  c = dc(i)
  if c > ansc:
    ans = i
    ansc = c
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
kmax = 0
x = 0
for i in range(1,N+1):
    k = 0
    y = i
    while y%2==0:
        y = y//2
        k += 1
    if k>kmax:
        x=i
        kmax = k
print(x)

Submission status: Wrong Answer

Solution code:
#!/usr/local/bin/python3
# https://atcoder.jp/contests/abc068/tasks/abc068_b
import math

def fact(N):
    ans = {}
    for i in range(2, math.ceil(math.sqrt(N))+1):
        if N % i != 0:
            continue
        ex = 0

        while N % i == 0:
            ex += 1
            N /= i
        ans[i] = ex

    if N != 1:
        ans[int(N)] = 1
    return ans

N = int(input())
max_x = 0
max_n = 0

for i in range(N+1):
    num = fact(i)
    num = num.get(2, 0)
    if num > max_n:
        max_x = i
        max_n = num

print(max_x)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

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

if i < N:
  print(i)
else:
  print(math.floor(i/2))

Submission status: Wrong Answer

Solution code:
N = int(input())

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

if i < N:
  print(i)
else:
  print(i / 2)

Submission status: Wrong Answer

Solution code:
N = int(input())


count_max = -1
OK = True

for i in range(N):
    count = 0
    a = N - i
    while a % 2 == 0:
        a = a // 2
        count += 1
        if count_max < count:
            count_max = count
    else:
        continue
print(2 ** count_max)

Submission status: Wrong Answer

Solution code:
N = int(input())


count_max = -1
OK = True

for i in range(N):
    count = 0
    a = N - i
    while a % 2 == 0:
        a = a // 2
        count += 1
        if count_max < count:
            count_max = count
    else:
        continue
print(count_max)

Submission status: Wrong Answer

Solution code:
N = int(input())

count = 0
count_max = -1
OK = True

for i in range(N):
    a = N - i
    while OK:
        if a % 2 == 0:
            a = a // 2
            count += 1
        else:
            OK = False
    if count_max < count:
        count_max = count

print(count_max)

Submission status: Wrong Answer

Solution code:
N = int(input())

count = 0
count_max = 0
OK = True

for i in range(N):
    a = N - i
    while OK:
        if a % 2 == 0:
            a == a // 2
            count += 1
        else:
            OK = False

        if count_max <= count:
            count_max = count

print(count_max)

Submission status: Wrong Answer

Solution code:
num = int(input())
count = 0
counttmp = 0
ans = 0
for i in range(1,num+1):
    if i % 2 == 0:
        counttmp = 0
        j = i
        while j % 2 == 0:
            j = int(j / 2)
            counttmp += 1
        if counttmp > count:
            ans = i
            count = counttmp
print(ans)

Submission status: Wrong Answer

Solution code:
def solve(n):
  res = 0
  while(n != 1):
    if n%2 == 0:
      res += 1
      n /= 2
    else:
      break
  return res

n = int(input())

ans = 0
ans_max = 0
for i in range(1, n+1):
  cnt = solve(i)
  if cnt > ans_max:
    ans_max = cnt
    ans = i
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

answer = 0
count = 0
answer_num = 0
for num in range(N+1):
    calnum = num
    while (num % 2 == 0) and num != 0 :
        count += 1
        num = num /2
    if(count > answer):
        answer = count
        answer_num = calnum

print(answer_num)

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np

n = int(input())
even_count = [0 for i in range(n+1)]
for i in range(1,n+1):
  j = i
  count = 0
  while True:
    if i % 2 == 0:
      count += 1
      i = int(i / 2)
    else:
      break
  even_count[j] = count
print(np.argmax(even_count))

Submission status: Wrong Answer

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

#1からnまでの数を調べる
for i in range(1, n + 1):
    count = 0
    num = i
    #iが2で割りきれるまで割る
    while i % 2 == 0 :
        count += 1
        i = i//2
    
    #割り切れる回数を更新
    if max_cnt < count :
        max_cnt = count
        max_num = num

print(max_num)

Submission status: Wrong Answer

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

for i in range(1, n + 1, 2):
    j = 1
    cnt = 0
    
    while j*j <= i :
        if i % j == 0 :
            if j*j == i :
                cnt += 1
                
            else:
                cnt += 2
                
        j += 1
        
    if cnt == 8 :
        eight_cnt += 1
        
print(eight_cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())
cnt_max = 0
ans = 1

for i in range(1, N):
    cnt = 0
    num = i
    while True:
        if num % 2 == 0:
            cnt += 1
            num /= 2
        else:
            break
    if cnt_max < cnt:
        cnt_max = cnt
        ans = i

print(ans)

Submission status: Wrong Answer

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

for i in range(1, N):
    cnt = 0
    num = i
    while True:
        if num % 2 == 0:
            cnt += 1
            num /= 2
        else:
            break
    if cnt_max < cnt:
        cnt_max = cnt
        ans = i

print(ans)

Submission status: Wrong Answer

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

最大 = 0
for i in range(2,n+1):
    if int(math.log(i,2)) == math.log(i,2):
        最大 = i

print(最大)

Submission status: Wrong Answer

Solution code:
"""Boot-camp-for-Beginners_Easy011_B_Collatz-Problem_29-August-2020.py"""
import numpy as np

N = 100
# N=int(input())
Division_2 = []
number=[]
for i in range(1, N+1):
    j = i
    count = 0
    while True:
        count += 1
        j = j/2
        if j/2 != int(j/2):
            break
    Division_2.append(count)
    number.append(i)
Division_2=np.array(Division_2)
print(number[np.argmax(Division_2)])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
from collections import deque
import numpy as np
import math
sys.setrecursionlimit(10**6)
def S(): return sys.stdin.readline().rstrip()
def SL(): return map(str,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def IL(): return map(int,sys.stdin.readline().rstrip().split())

def solve():
    if n<2:
        print(n)
        return
    x = 2
    while x*2<n:
        x *= 2
    print(x)
    return

if __name__=='__main__':
    n = I()
    solve()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
print(n - n%2)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())

d={"num":1,"ans":1}
for i in range(1,n+1):
  if i%2==0:
    num=i
    ans=0
    while i%2==0:
      i=i/2
      ans+=1
    if ans>d["ans"]:
      d["num"]=num
      d["ans"]=ans
    
print(d["num"])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

a = 0
b = 0
for k, v in dic.items():
  if a < v:
    b = k
    a = v

print(b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def gusuuhantei(i):
    count = 0
    num = i
    while True:
        if num % 2 ==0 and not num == 0:
            num = num / 2
            count += 1
        else:
            break
    return count
N = int(input())
li = [0]*(N+1)
for i in range(1, N+1):
    li[i] = gusuuhantei(i)
Maxcount = max(li)
index = li.index(Maxcount)
print(index)

Submission status: Wrong Answer

Solution code:
def gusuuhantei(i):
    count = 0
    num = i
    while True:
        if num % 2 ==0 and not num == 0:
            num = num / 2
            count += 1
        else:
            break
    return count
N = int(input())
li = [0]*(N+1)
for i in range(N+1):
    li[i] = gusuuhantei(i)
Maxcount = max(li)
index = li.index(Maxcount)
print(index)

Submission status: Wrong Answer

Solution code:
n=int(input())
A=[]
a=0
i=0
while a*2 <= n:
    a = 2**i
    print(i)
    A.append(a)
    i=i+1
print(A[-1])

Submission status: Wrong Answer

Solution code:

n = int(input())

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

print(2**(i-1))

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

Solution code:
print(len(bin(7)))

n = int(input())
print(2**(len(bin(n))-3))

Submission status: Wrong Answer

Solution code:
N=int(input())

for i in range(1,7):
  if N<2**i:
    print(2**(i-1))
    break

Submission status: Wrong Answer

Solution code:
n = int(input())

list = []

for i in range(0, n + 1):
    b = i
    c = 0
    while b % 2 > 0:
            b = b // 2
            c += 1
    list.append(2 ** c)

list.sort()
print(list[-1])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def divide_by_2(num):
	cnt = 0		

	while True:
		if num % 2 != 0:
			break
		num /= 2
		cnt += 1
	
	return cnt


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

	lst = [0] * (N + 1)

	for num in range(1, N + 1):
		cnt = divide_by_2(num)
		lst[num] = cnt

	print(lst.index(max(lst)))


  
if __name__ == "__main__":
  	main()

Submission status: Wrong Answer

Solution code:
N=int(input())
if N==1:
  print(0)
  exit()
L=[1,2,4,8,16,32,64,128]
for i in range(7):
  if L[i+1]>N:
    print(L[i])
    exit()

Submission status: Wrong Answer

Solution code:
import math
print int(math.floor(math.log(int(raw_input()),2)))

Submission status: Wrong Answer

Solution code:
import math
print  math.floor(math.log(int(raw_input()),2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
for i in reversed(range(7)):
	if n>=2**i:
		print(i)
		quit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
m=0
a=1
for i in range(1,n+1):
    c=0
    j=i
    while 1:
        j/=2
        if j%2==0:
            c+=1
        else:
            break
    if m<c:
        m=c
        a=i
print(a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
for i in range(1, n):
  cnt = 0
  x = i
  while x % 2 == 0:
    x //= 2
    cnt += 1
  ans = max(ans, cnt)
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
result = 0
for x in range(100):
  if (1 << x) < n and n < (1 << (x+1)):
    result = 1 << x

print(result)

Submission status: Wrong Answer

Solution code:
def div_by_two(n):
  if n % 2 == 1:
    return 0
  else:
    return div_by_two(n / 2) + 1
  
N = int(input())
count = 1
res = 1
for i in range(1, N+1):
  tmp = div_by_two(i)
  if tmp > count: 
    res = i
    count = tmp 

print(res)

Submission status: Wrong Answer

Solution code:
A = int(input())
chek = 1
res = 0
for i in range(10):
  chek = 2**i
  if chek < A:
    res = 2**(i-1)
    break
print(res)

Submission status: Wrong Answer

Solution code:
N = int(input())
max_cnt = 0
ans = 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: Wrong Answer

Solution code:
N = int(input())

ans = 1
count = 0
while 2*ans <= N:
    ans *= 2
    count += 1
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

res = 1
while (res << 1) < N:
    res = res << 1
print(res)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
tmp = []

for i in range(1, N + 1):
    cnt = 0
    while i % 2 == 0:
        i /= 2
        cnt += 1
    tmp.append(cnt)

print(max(tmp))

Submission status: Wrong Answer

Solution code:
import sys

pow2 = [2 ** i for i in range(1, 7)]
pow2.reverse()
n = int(input())
for i in pow2:
    if i <= n:
        print(i)
        sys.exit(0)

Submission status: Wrong Answer

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

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


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

if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

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

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


    res_max_cnt = 0
    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: Wrong Answer

Solution code:
n = int(input())
a = 0
b = 0
for i in range(10):
  a = 2 ** i
  if a >= n :
    print(b)
    break
  else:
    b = a

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
k=1
for i in range(1,7):
  k*= i
  if k > N:
    break
print(k)

Submission status: Wrong Answer

Solution code:
n=int(input())
 
k=1
while n>k:
  k=k*2
  
if k!=1:
  k=k//2

print(k)

Submission status: Wrong Answer

Solution code:
n=int(input())

k=1
while n>k:
  k=k*2
  
print(k)

Submission status: Wrong Answer

Solution code:
n = int(input())

x = 1
cnt = 1
while x < n:
  x = 2 ** cnt
  cnt += 1
print(x//2)

Submission status: Wrong Answer

Solution code:
n = int(input())

x = 1
cnt = 1
while x < n:
  x = 2 ** cnt
  cnt += 1
print(x/2)

Submission status: Wrong Answer

Solution code:
n = int(input())

x = 1
cnt = 1
while x < n:
  x = 2 ** cnt
  cnt += 1
print(x)

Submission status: Wrong Answer

Solution code:
N = int(input())
Num = [int(2**i) for i in range(N)]
Num.append(N)
Num = sorted(Num)
print(2 ** (Num.index(N) - 1))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:

n = int(input())
a = 0
x = 0
for i in range(1,n+1):
    cnt = 0
    m = i
    while i %2 ==0:
        i = i//2    
        cnt = cnt +1
    
    while a < cnt:
        a = cnt
        x = m

print (x)

Submission status: Wrong Answer

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

print(a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

for i in range(n + 1):
    k = factorization(i)
    for j in k:
        if j[0] == 2:
            if ans < j[1]:
                ans = j[1]
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = 0
for i in range(N):
    a = max(a,len(bin(64))-(bin(64)).rfind('1')-1)
print(2**a)

Submission status: Wrong Answer

Solution code:
import sys
n = int(input())
for i in range(1,6):
  if n < 2**i:
    print(2**(i-1))
    sys.exit()
  elif n == 2**i:
    print(2**i)
    sys.exit()
  else:
    print(64)
    sys.exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

count = 0
number = 0

for i in range(n+1):
    temp = 0
    j = i
    while j > 0 and j % 2 == 0:
        j //= 2
        temp += 1
    if temp > count:
        count = temp
        number = i


print(number)

Submission status: Wrong Answer

Solution code:
n = int(input())
i = True
c = 1

while i:
    c *= 2
    if c > n:
        c /= 2
        i = False

print(c)

Submission status: Wrong Answer

Solution code:
n = int(input())
i = True
c = 1

while c < n:
    c *= 2

print(c)

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:
N = int(input())
a = 0

for i in range(N):
    if i % 2== 0:
        a = i
        
print(a)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

count = 0
list_count = []
max_number = 0

for i in range(n):
    a = i + 1
    while a % 2 == 0:
        count += 1
        a /= 2
    list_count.append(count)
    if max(list_count) == count:
        max_number = i + 1

print(max_number)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input());result=0
for i in range(N):
  if 2**i < N:
    result = 2**i
print(result)

Submission status: Wrong Answer

Solution code:
n=int(input())

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

Submission status: Wrong Answer

Solution code:
n=int(input())

x=0
for i in range(n):
    if 2**i<=n:
        x=2**i
        print(x)

Submission status: Wrong Answer

Solution code:
n=int(input())

x=n
for i in range(n):
    if 2**i<=n:
        x=2**i
        print(x)

Submission status: Wrong Answer

Solution code:
n=int(input())

for i in range(8):
    if 2**i<=n:
        print(2**i)

Submission status: Wrong Answer

Solution code:
n=int(input())

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

Submission status: Wrong Answer

Solution code:
n=int(input())

for i in range(n+2):
    if 2**i<=n:
        print(2**i)

Submission status: Wrong Answer

Solution code:
n=int(input())

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

Submission status: Wrong Answer

Solution code:
import sys
n=int(input())
if n==1:
    print(0)
    sys.exit()
k=2
ans=0
while k*2<=n:
    k*=2
    ans+=1
print(k)

Submission status: Wrong Answer

Solution code:
N=int(input())
ans=0
check=0
for i in range(2,N+1):
  count=0
  waru=i
  while waru>0:
    waru//=2
    if waru>0:
      count+=1
  if check<count:
    check=count
    ans=i
print(ans)

Submission status: Wrong Answer

Solution code:
import math

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

for i in range(1,N+1):
  if max<=math.log2(i):
    max=math.log2(i)
    max_number=i
print(max_number)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

Solution code:
N=int(input())
count=0
max=0
max_number=1

if N==1:
  print(1)

for i in range(1,N+1):
  while i>=1:
    if i%2==0:
      i=i//2
      count+=1
    else:
      break
  if count>=max:
    max=count
    max_number=1
print(max_number)

Submission status: Wrong Answer

Solution code:
N=int(input())
list=[1,2,4,8,16,32,64]
list.append(N)
anslist=sorted(list)

print(anslist[anslist.index(N)-1])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = []
a = 1
t = 1

while a <= 100:
    ans.append(a)
    a *= 2

for b in ans :
    if b < n:
        t = b

print(t)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
maxd=0
ans=1
for i in range(1,N+1):
    c=0
    for j in range(1,7):
        if i % (2**j)==0:
            print(i,j)
            c=j
    if maxd < c:
        maxd=max(maxd,c)
        ans=i
    
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

if N < 2:
    ans = 1
elif N < 4:
    ans = 2
elif N < 8:
    ans = 4
elif N < 16:
    ans = 8
elif N < 32:
    ans = 16
elif N < 64:
    ans = 16
else:
    ans = 64

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
while True:
    if n < pow(2, ans + 1):
        break
    else:
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
m = 0
for i in range(2,n+1,2):
    a = 0
    x = i
    while(True):
        if x%2!=0:
            break
        a+=1
        x = x//2
    if a>=m:
        m=a
        ans=i

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
m = 0
for i in range(2,n+1,2):
    a = 0
    x = i
    while(True):
        if x%2!=0:
            break
        a+=1
        x = x//2
    if a>m:
        m=a
        ans=i

print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())

for x in range(0,8):
  if pow(2,x)>n:
    ans=pow(2,x-1)
    
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
ans1=[0,0]
for i in range(1,n+1):
  count=0
  N=i
  while True:
    if N%2==0:
      N//=2
      count+=1
    else:
      break
  if ans1[0]<count:
    ans1=[count,i]
print(ans1[1])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
ans1=[0,0]
for i in range(1,n):
  count=0
  N=i
  while True:
    if N%2==0:
      N//=2
      count+=1
    else:
      break
  if ans1[0]<count:
    ans1=[count,i]
print(ans1[1])

Submission status: Wrong Answer

Solution code:
7

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    a = int(input())
    max =0
    maxcount=0

    for i in range(1,a+1):
        s2 = i
        count =0
        while s2 >=2:
            if s2 %2 == 0:
                count+=1
                s2 = s2//2

            else:
                break
            if maxcount < count:
                max = i
                maxcount = count

    print(max)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
for i in range(100):
    if N%2 == 0:
        N = N//2
        ans += 1
    else:
        print(ans)
        exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
c = 1
max_c = 1
max_num = 1

for i in range(1, n+1):
    if i % 2 == 0:
        j = i
        c = 1
        j /= 2
        while j % 2 == 0:
            c += 1
            j /= 2
    if c > max_c:
        max_c = c
        max_num = i

print(max_num)

Submission status: Wrong Answer

Solution code:
N = int(input())
cnt = 0
while True:
  if N % 2 <= 1:
    break
  N /= 2
  cnt += 1
  
print(2**int(cnt))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(1, N+1):
  count = 0
  k = i
  while (k % 2 == 0):
    count += 1
    k /= 2

  if count > max:
    max = count
    ans = i
    
print(ans)