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

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

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

Submission status: Wrong Answer

Solution code:
nums = [1, 2, 4, 8, 16, 32, 64]
N = int(input())
result = nums[0]
for num in nums:
    if N > num:
        reuslt = num
    else:
        break
print(result)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

Solution code:
n = int(input())
l = [1, 2, 4, 8, 15 ,32, 64]
print(max(0, max([x for x in l if n >= x])))

Submission status: Wrong Answer

Solution code:
n = int(input())
l = [1, 2, 4, 8, 15 ,32, 64]
print(max([x for x in l if n >= x]))

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

Solution code:
N=int(input())
c=4
d=7
ans=0
ans2=0
ans3="No"
for i in range(15):
    ans=d*i
    if ans !=N:
        for j in range(26):
            ans2=ans+c*j
            if ans2==N:
                ans3="Yes"

    else :
        ans3="Yes"

print(ans3)

Submission status: Wrong Answer

Solution code:
import sys
from bisect import bisect_left, bisect_right

def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

N = I()

l = list(range(1,N+1))

ans = 0
ans2 = 0
for i in l:
    temp = 0
    temp2 = i
    while i % 2 == 0:
        i = int(i / 2)
        temp += 1
    
    if ans < temp:
        ans2 = temp2
        ans = temp
print(ans2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 0
cnt = 0
for i in range(1, n + 1):
    count = 0
    temp = i
    while temp % 2 == 0:
        count += 1
        temp //= 2

    if cnt < count:
        cnt = count
        ans = i

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())

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

Submission status: Wrong Answer

Solution code:
N=int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
list = [2**i for i in range(7)]

ans = 1

for k in list:
  if k <= n and k != 64:
    ans = k
    continue
  elif k == 64:
    print(64)
  else:
    print(ans)
    break

Submission status: Wrong Answer

Solution code:
n = int(input())
list = [2**i for i in range(7)]

ans = 1

for k in list:
  if k <= n:
    ans = k
    continue
  else:
    print(ans)
    break

Submission status: Wrong Answer

Solution code:
n = int(input())
list = [2**i for i in range(6)]

ans = 1

for k in list:
  if k <= n:
    ans = k
    continue
  else:
    print(ans)
    break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
import math
import bisect

def query(n):
    ans = 0
    while n % 2 == 0:
        ans += 1
        n >>= 1
    return ans

def solve(n):
    max_val = 0
    sol = -1
    for i in range(1, n + 1):
        val = query(i)
        if max_val < val:
            max_val = val
            sol = i
    return sol

def main():
    n = int(input())
    print(solve(n))
 
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import sys

N = int(input())

cnt = 0
tmp = 0

while tmp<=N:
    if N==1:
        print(0)
        sys.exit()
    else:
        cnt += 1
        tmp = 2**cnt

print(2**(cnt-1))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
results = 0
number = 0
for i in range(n):
    if i == 0:
        continue
    count = 0
    v = i + 1
 
    while v % 2 == 0:
        count += 1
        v = v / 2
    if results < count:
        results = count
        number = i + 1
    elif i == 1:
        number = 1
    continue
print(number)

Submission status: Wrong Answer

Solution code:
n = int(input())
results = 0
number = 0
for i in range(n):
    if i == 0:
        continue
    count = 0
    v = i + 1
 
    while v % 2 == 0:
        count += 1
        v = v / 2
    if results < count:
        results = count
        number = i + 1
    continue
print(number)

Submission status: Wrong Answer

Solution code:
n = int(input())
results = 0
number = 0
for i in range(n):
    print(i)
    if i == 0:
        continue
    count = 0
    v = i + 1

    while v % 2 == 0:
        count += 1
        v = v / 2
    if results < count:
        results = count
        number = i + 1
    continue
print(number)

Submission status: Wrong Answer

Solution code:
n = int(input()) + 1
results = 0
number = 0
for i in range(n):
    if i == 0:
        continue
    count = 0
    while True:
        if i % 2 == 0:
            count += 1
            i = i / 2
        else:
            if results < count:
                results = count
                number = n - 1
            break
print(number)

Submission status: Wrong Answer

Solution code:
n = int(input())
results = 0
number = 0
for i in range(n+1):
    if i == 0:
        continue
    count = 0
    while True:
        if i % 2 == 0:
            count += 1
            i = i / 2
        else:
            if results < count:
                results = count
                number = n
            break
print(number)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
list = [64,32,16,8,4,2]
O = int(input())
if O == 1:
    print(1)
    exit()

for num in list:
    if O > num:
        print(num)
        break

Submission status: Wrong Answer

Solution code:
N = int(input())

count_dic = {}
for i in range(N+1):
    i_tmp = i
    count = 0
    while True:
        if i == 0:
            break
        elif i_tmp % 2 == 0:
            i_tmp = i_tmp / 2
            count += 1
        else:
            break
    count_dic[i] = count

print(max(count_dic, key=count_dic.get))

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
count_dic = {}
for i in range(N):
    i_tmp = i
    count = 0
    while True:
        if i == 0:
            break
        elif i_tmp % 2 == 0:
            i_tmp = i_tmp / 2
            count += 1
        else:
            break
    count_dic[i] = count

print(max(count_dic, key=count_dic.get))

Submission status: Wrong Answer

Solution code:
n = int(input())

result = 1

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

result = result / 2
print(int(result))

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 0
s = 0
for i in range(1, n + 1):
    sub = 0
    g = i
    while g >= 2:
        sub += 1
        g = g // 2
    if s < sub:
        ans = i
        s = sub

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

def t(n):
    div = n
    cnt = 0
    while True:
        div, mod = divmod(div, 2)
        if mod == 0:
            cnt += 1
        else:
            return cnt

ans = 0
maxt = 0
for i in range(1, n+1):
    tt = t(i)
    if maxt < tt:
        maxt = tt
        ans = i
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 2

while ans < n:
    ans *= 2

print(ans//2)

Submission status: Wrong Answer

Solution code:
n = int(input())

ans = 1

while ans < n:
    ans *= 2

print(ans//2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

for i in range(N+1,-1,-1):
  if i == 64:
    print(i)
    break
  elif i == 32:
    print(i)
    break
  elif i == 16:
    print(i)
    break
  elif i == 8:
    print(i)
    break
  elif i == 4:
    print(i)
    break
  elif i == 2:
    print(i)
    break
  elif i == 1:
    print(1)

Submission status: Wrong Answer

Solution code:
import sys
n = int(input())
a = [2**i for i in range(0,7)]
for i in range(len(a)):
    if n == a[i]:
        print(a[i])
        sys.exit()
    elif n < a[i]:
        print(a[i-1])
        sys.exit()

Submission status: Wrong Answer

Solution code:
import sys
n = int(input())
a = [2**i for i in range(0,7)]

for i in range(len(a)):
    if n <= a[i]:
        print(a[i])
        sys.exit()

print(64)

Submission status: Wrong Answer

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:
  print(4)
else:
  print(2)

Submission status: Wrong Answer

Solution code:

N = int(input())

R = [2**i for i in range(7)]
for i in range(len(R)):
    if N > R[i]:
        print(R[i-1])
        exit()

Submission status: Wrong Answer

Solution code:

N = int(input())

R = [2**i for i in range(7)]
for i in range(len(R)):
    if N < R[i]:
        print(R[i-1])
        exit()

Submission status: Wrong Answer

Solution code:

N = int(input())
dict = {}
for i in range(1, N+1):
    n = float(i)
    cnt = 0
    while n/2>0.0:
        if n%2 == 0.0:
            cnt += 1
        n = n/2
    dict[i] = cnt
print(dict)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

n=int(input())
cnt=1
for i in range(0, 100):
    cnt*=2
    if cnt >= n:
        print(math.floor(cnt/2))
        break

Submission status: Wrong Answer

Solution code:
n=int(input())
cnt=1
for i in range(0, 100):
    cnt*=2
    if cnt >= n:
        print(cnt/2)
        break

Submission status: Wrong Answer

Solution code:
keep=0
keeeep=0
for i in range(1,int(input())+1):
  count=0
  kept=i
  while kept%2==0:
    count+=1
    kept=kept//2
  if count>keep:
    keeeep=i
    keep=count
print(keeeep)

Submission status: Wrong Answer

Solution code:

def main():
    n = int(input())
    nums = [0]
    for i in range(1, n + 1):
        d = i
        count = 0
        while d != 0:
            d, amari = divmod(d, 2)
            if amari != 0:
                break
            count += 1
        nums.append(count)
    print(nums.index(max(nums)))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

print(int(a/2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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: Wrong Answer

Solution code:
N = int(input())

ans_2 = [2, 4, 8, 16, 32, 64]
ans = 0

for a in ans_2:
    if N >= a:
        ans = a
    else:
        break

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def resolve():
    # 整数 1 つ
    n = int(input())
    # 整数複数個
    # a, b, c = list(map(int, input().split()))
    # 整数 N 個 (改行区切り)
    # N = [int(input()) for i in range(N)]
    # 整数 N 個 (スペース区切り)
    # N = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    # A = [list(map(int, input().split())) for i in range(H)]

    A = [0,2,4,8,16,32,64]
    B = sorted(A, reverse=True)

    for i in B:
        if i <= n:
            print(i)
            break

#    print("n")


resolve()

Submission status: Wrong Answer

Solution code:
n = int(input())
import math
for i in range(n,1,-1):
    if i%(2**int(math.log(i,2))) == 0:
        print(i)
        break

Submission status: Wrong Answer

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

print(ans//2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
L=list(range(1,N+1))

ans=0
while True:
  for i in range(0,N):
    j=0
    if L[i]%2==0:
      j+=1
  if j==0:
    break
  ans+=1
  for i in range(N):
    L[i]=int(L[i]/2)

print(2**ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
L=list(range(1,N+1))

ans=0
while True:
  for i in range(0,N):
    j=0
    if L[i]%2==0:
      j+=1
  if j==0:
    break
  ans+=1
  for i in range(N):
    L[i]=int(L[i]/2)

print(ans)

Submission status: Wrong Answer

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

while N > 2**x:
  x += 1
else:
  result = 2 **(x -1)
  
print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

res_count = 0
res = 0
for i in range(1, n + 1):
    a = i
    count = -1
    mod = 0
    while mod == 0 and a >= 1:
        mod = a % 2
        a = int(a / 2)
        count = count + 1
    if res_count < count:
        res_count = count
        res = i

print(res)

Submission status: Wrong Answer

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

print(2**k)

Submission status: Wrong Answer

Solution code:
num = int(input())

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

if num == 1:
  print(1)
else:
  print(num_max)

Submission status: Wrong Answer

Solution code:
num = int(input())

if num == 1:
  print(1)
  exit()

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

print(num_max)

Submission status: Wrong Answer

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

print(count_max)

Submission status: Wrong Answer

Solution code:

N = int(input())

ans_i = 1
ans = -1
for i in range(N + 1):
    j = i
    cnt = 0
    while j % 2 == 0 and j != 0:
        j = int(j / 2)
        cnt = cnt + 1
    if cnt > ans:
        ans_i = i
        ans = cnt
print(ans_i)

Submission status: Wrong Answer

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

while (N > 0):
  n = N
  count = 0
  while(True):
    if n % 2 != 0:
      break
    else:
      n /= 2 
      count += 1
  if count > best_count:
    ans = N
    best_count = count
  N -= 1
  
print(ans)

Submission status: Wrong Answer

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

while (exist_odd == False):
  if N % 2 != 0:
    exist_odd = True
      
  if exist_odd == True:
    break
  else:
    N /= 2 
  count += 1
print(count)

Submission status: Wrong Answer

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

for i in range(N, 0, -1):
    
    binary_i_reverse = bin(i)[:1:-1]
    devide_count = 0
    
    for j in binary_i_reverse:
        if j == '0':
            devide_count += 1
        else:
            break
    
    if max_devide_count < devide_count:
        max_devide_count = devide_count
        ans = i

print(ans)

Submission status: Wrong Answer

Solution code:
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n = int(input())

    res = 0
    ans = 0
    for i in range(1, n + 1):
        n = int(str(i)[::])
        cnt = 0
        while n % 2 == 0:
            n //= 2
            cnt += 1

        if res < cnt:
            res = cnt
            ans = i
    print(ans)


if __name__ == '__main__':
    resolve()

Submission status: Wrong Answer

Solution code:
import sys
import os
import math
import string

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

MOD = 10 ** 9 + 7


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    cnt = 0
    ret = 0
    for n in range(1, N+1):
        tmp = 0
        q = n
        while n % 2 == 0:
            n = n // 2
            tmp += 1
        if tmp > cnt:
            ret = q
            cnt = tmp

    print(ret)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())
max_count = 1
max_count_number = 1
for i in range(1, n + 1):
    count = 0
    current = i
    while(current % 2 == 0 and current > 0):
        count += 1
        current /= 2
    if max_count < count:
        max_count = count
        max_count_number = i
        
print(max_count_number)

Submission status: Wrong Answer

Solution code:
N = int(input())
C = [1, 2, 4, 8, 16, 32, 64]
for i in range(len(C)):
  if N == C[i]:
    print(N)
    break
  elif C[i] < N and N < 64:
    continue
  elif N >= 64:
    print(64)
  else:
    print(C[i-1])
    break

Submission status: Wrong Answer

Solution code:
N = int(input())
C = [2, 4, 8, 16, 32, 64]
for i in range(len(C)):
  if N == 1:
    print(1)
    break
  elif N == 2:
    print(2)
    break
  elif C[i] < N and N < 64:
    continue
  elif 64 <= N:
    print(64)
    break
  else:
    print(C[i-1])
    break

Submission status: Wrong Answer

Solution code:
N = int(input())
C = [2, 4, 8, 16, 32, 64]
for i in range(len(C)):
  if N == 1:
    print(1)
    break
  elif C[i] < N and N < 64:
    continue
  elif 64 <= N:
    print(64)
    break
  else:
    print(C[i-1])
    break

Submission status: Wrong Answer

Solution code:
N = int(input())
C = [2, 4, 8, 16, 32, 64]
for i in range(len(C)):
  if C[i] < N:
    continue
  elif C[i] == N or N == 1:
    print(N)
  else:
    print(C[i-1])

Submission status: Wrong Answer

Solution code:
N = int(input())
C = [2, 4, 8, 16, 32, 64]
for i in range(len(C)):
  if C[i] < N:
    continue
  elif C[i] == N:
    print(N)
  else:
    print(C[i-1])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
C = [2, 4, 8, 16, 32, 64]
for i in range(len(C)):
  if C[i] <= N:
    continue
  else:
    print(C[i-1])

Submission status: Wrong Answer

Solution code:
N = int(input())
C = [2, 4, 8, 16, 32, 64]
for i in range(len(C)):
  if C[i] < N:
    continue
  else:
    print(C[i-1])

Submission status: Wrong Answer

Solution code:

n = int(input())
cnt = [0] * (n + 1)
for i in range(1, n + 1):
    x = i
    while x % 2 != 1:
        x //= 2
        cnt[i] += 1
    
print(cnt.index(max(cnt)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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: Wrong Answer

Solution code:
n = int(input())
mx = 0
ans = 0
def mod(i, count=0):
    if i%2!=0:
        return count
    else:
        return mod(i//2, count+1)
for i in range(1,n+1):
    if mx < mod(i):
        mx = mod(i)
        ans = i
print(ans)

Submission status: Wrong Answer

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

if N == 1:
    print(1)

elif N == 2 or N == 3:
    print(2)

else:
    even = [i for i in range(2, N+1, 2)]

    while len(even) >1:
        i = 0
        count +=1
        while i < len(even):
            if even[i]%2 == 0:
                even[i] = even[i]/2
                i +=1
            else:
                del even[i]
                i +=1
    print(2**count)

Submission status: Wrong Answer

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

if N == 1:
    print(1)

elif N == 2 or N == 3:
    print(2)

else:
    even = [i for i in range(2, N+1, 2)]

    while len(even) >1:
        i = 0
        count +=1
        while i < len(even):
            if even[i]%2 == 0:
                even[i] = even[i]/2
                i +=1
            else:
                del even[i-1]
                i +=1
    print(2**count)

Submission status: Wrong Answer

Solution code:
N=int(input())
if 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")
elif N==1:
    print("0")

Submission status: Wrong Answer

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

for i in range(1,N+1):
    if 2**i <=N:
        j=2**i

print(j)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def kai(n):
    x=0
    while True:
        if n%2==0:
            n=n//2
            x+=1
        else:
            break
    return x

n=int(input())
a=[0]*(n+1)
for i in range(1,n+1):
    a[i]=kai(i)

print(a.index(max(a)))

Submission status: Wrong Answer

Solution code:
def main(n):
    max_i = 1
    max_time = 1
    
    for i in range(1, n+1):
        max_time_tmp = 0
        is_even = True
        i_tmp = i
        while is_even:
            if i_tmp % 2 == 0:
                max_time_tmp += 1
                i_tmp = i_tmp / 2
            else:
                break
        if max_time_tmp > max_time:
            max_time = max_time_tmp
            max_i = i

    print(max_i)


n = int(input())
main(n)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
key = [2**int(x) for x in range(6, -1)]
for value in key:
  if value <= n:
    print(value)
    break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

n = int(input())
count = 0

while 2 ** count <= 100:
    count += 1
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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)


if n == 1:
    print(1)
else:
    ans = box.index(max(box)) + 1
    print(ans)

Submission status: Wrong Answer

Solution code:
import collections
import sys
import numpy as np
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
MOD = 10**9+7
import itertools
import math

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

n = int(input())
li = [0]*(n+1)
for i in range(1,n+1):
    c = collections.Counter(prime_factorize(i))
    for key,value in c.items():
        if key == 2:
            li[i] = value
            break
ans = max(li)
for i in range(n+1):
    if li[i] == ans:
        print(i)
        sys.exit()

Submission status: Wrong Answer

Solution code:
n = int(input())
li = [1,2,4,8,16,32,64]
for i in range(7):
    if n < li[i]:
        print(li[i-1])
        break

Submission status: Wrong Answer

Solution code:
N = int(input())
i = 1
for i in range(1, 7+1):
  if pow(2, i) > N:
    print(pow(2, i - 1))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:


n = int(input())
max_count = 1
max_num = 1


#
for i in range(1,n+1):
    count = 0
    num = i
    while num%2 == 0:
        count += 1
        num /= 2

    if count > max_count:
        max_count = count
        max_num = i



print(max_num)

Submission status: Wrong Answer

Solution code:

n = int(input())
max_count = 0
max_num = 0


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

    if count > max_count:
        max_count = count
        max_num = i



print(max_num)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Solution code:
N = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
m=1
data=[2,4,8,16,32,64]
for i in range(5):
  if data[i]<=n:
    m=data[i]
print(m)