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())
range_N = range(1,N+1) # 1<=M<=100
target = 1
for i in range_N:
  if 2 ** 1 <= N :
    target = 2 ** i
print(target)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

print(target)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = list(range(n+1))
for i in ans:
    if ans[i]%2!=0:
        ans[i]=0
    else:
        count = 0
        while(True):
            if ans[i]%2 != 0 or ans[i] == 0:
                ans[i] = count
                break
            else:
                ans[i]/=2
                count+=1
print(ans.index(max(ans)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in num_list:
  if N>=i:
    print(i)
    exit(0)

print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

l = [64, 32, 16, 8, 4, 2]

for i in range(len(l)):
  if l[i] <= N:
    print(N)

Submission status: Wrong Answer

Solution code:
A = int(input())
s = 2
for i in range(1,A):
  if A == 1:
    print(1)
  elif s <= A:
    s = 2**i
  else:
    print(s//2)
  break

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
n=int(input())
tmp=0
count=0
ans=0
wer=0
for i in range(1,n+1):
    #print(count,ans,wer)
    tmp=i
    for j in range(n):
        if tmp%2==0:
            count+=1
            tmp=tmp//2
        else:
            if count>ans:
                ans=count
                wer=i
            count=0
            break
print(wer)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
list_n = [2 ** i for i in range(1, 8)]
bag =[1]
for i in list_n:
    if n > i:
        bag.append(i)
print(max(bag))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
N = int(input())
r = 0
res = 0
for i in range(1, N + 1):
  t = i
  c = 0
  while t % 2 == 0:
    c += 1
    t //= 2
  if c > r:
    res = i
    r = c
print(res)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
powers_2 = [2,4,8,16,32,64]
for i in range(len(powers_2)):
    if n == 1:
        ans = n
    elif powers_2[i] <= n:
        continue
    elif powers_2[i] > n:
        ans = powers_2[i - 1]
        break
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
anss = 0
for i in range(1,n+1):
    t = 0
    while i%2 == 0:
        t +=1
        i = i/2
    if t > ans:
        ans = t
        anss = i*(2**t)
    else:
        pass

print(int(anss))

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
anss = 0
for i in range(1,n+1):
    t = 0
    while i%2 == 0:
        t +=1
        i = i/2
    if t > ans:
        ans = t
        anss = i*(2**t)
    else:
        pass

print(anss)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
x = [i for i in range(1,n+1)]
res = []
judge = 0

while len(x)>1:
  for j in x:
    if j%2==0:
      res.append(j/2)
  else:
    x = res
    res = []
    judge += 1

print(x[0]*(2**judge))

Submission status: Wrong Answer

Solution code:
# ABC068B - Break Number
def main():
    N = int(input())
    cnt = 0
    while N > 1:
        N //= 2
        cnt += 1
    print(cnt)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
# ABC068B - Break Number
def main():
    N = int(input())
    cnt = 0
    while N > 1:
        N //= 2
        cnt += 1
    ans = cnt * 2
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#
# abc068 b
#
import unittest
from io import StringIO
import sys


def input():
    return sys.stdin.readline().rstrip()


# def resolve():
#    N = int(input())
#
#    ans = 1
#    ansn = 0
#    for i in range(1, N+1):
#        tmp = 0
#        j = i
#        while j % 2 == 0:
#            tmp += 1
#            j //= 2
#
#        if tmp > ansn:
#            ansn = tmp
#            ans = i
#
#    print(ans)

def resolve():
    N = int(input())
    for i in reversed(range(1, 7)):
        if 2 ** i <= N < 2 ** (i+1):
            print(2**i)


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """7"""
        output = """4"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """32"""
        output = """32"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """1"""
        output = """1"""
        self.assertIO(input, output)

    def test_入力例_4(self):
        input = """100"""
        output = """64"""
        self.assertIO(input, output)


if __name__ == "__main__":
    # unittest.main()
    resolve()

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

Solution code:

input = int(input())

input_list = list(range(1, input + 1))

count_list = []

for e in input_list:
    count = 0
    e_tmp = e
    while True:
        if e_tmp % 2 == 0:
            e_tmp = e_tmp/2
            count += 1
        else:
            break
    count_list.append([e, count])

max_value = 0
max_key = 0

for i in range(input):    
    curr_value = int(count_list[i][1])
    if curr_value > max_value:
        max_value = curr_value
        max_key = count_list[i][0]
    
print(max_key)

Submission status: Wrong Answer

Solution code:
input = int(input())

input_list = list(range(1, input + 1))

count_list = []

for e in input_list:
    count = 0
    e_tmp = e
    while True:
        if e_tmp % 2 == 0:
            e_tmp = e_tmp/2
            count += 1
        else:
            break
    count_list.append([e, count])

max_value = 0
max_key = 0

for i in range(input):    
    curr_value = int(count_list[i][1])
    if curr_value > max_value:
        max_value = curr_value
        max_key = count_list[i][0]
    
print(max_key)

Submission status: Wrong Answer

Solution code:
# ABC068 B - Break Number
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

def div2(n):
    cnt = 0
    while n>0:
        if n%2 == 0:
            cnt += 1
        n = n//2
    return cnt

N = ni()
ans = 0
ans2 = 0

for i in range(1,N+1):
    t = div2(i)
    if t > ans:
        ans = t
        ans2 = i

if N == 1:
    ans = 1
print(ans2)

Submission status: Wrong Answer

Solution code:
# ABC068 B - Break Number
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

def div2(n):
    cnt = 0
    while n>1:
        if n%2 == 0:
            cnt += 1
        n = n//2
    return cnt

N = ni()
ans = 0
ans2 = 0

for i in range(1,N+1):
    t = div2(i)
    if t > ans:
        ans = t
        ans2 = i

print(ans2)

Submission status: Wrong Answer

Solution code:
# ABC068 B - Break Number
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

def div2(n):
    cnt = 0
    while n>1:
        n = n//2
        if n%2 == 0:
            cnt += 1
    return cnt

N = ni()
ans = 0
ans2 = 0

for i in range(1,N+1):
    t = div2(i)
    if t > ans:
        ans = t
        ans2 = i

if N == 1:
    ans2 = 0

print(ans2)

Submission status: Wrong Answer

Solution code:
# ABC068 B - Break Number
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

def div2(n):
    cnt = 0
    while n>0:
        n = n//2
        if n%2 == 0:
            cnt += 1
    return cnt

N = ni()
ans = 0
ans2 = 0

for i in range(1,N+1):
    t = div2(i)
    if t > ans:
        ans = t
        ans2 = i

if N == 1:
    ans2 = 0
print(ans2)

Submission status: Wrong Answer

Solution code:
# ABC068 B - Break Number
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

def div2(n):
    cnt = 0
    while n>0:
        n = n//2
        if n%2 == 0:
            cnt += 1
    return cnt

N = ni()
ans = 0
ans2 = 0

for i in range(1,N+1):
    t = div2(i)
    if t > ans:
        ans = t
        ans2 = i

print(ans2)

Submission status: Wrong Answer

Solution code:
n = int(input())

x = 1

while n > x:
  x *= 2
  
print(1 if x==1 else x//2)

Submission status: Wrong Answer

Solution code:
n = int(input())

x = 1

while n > x:
  x *= 2
  
print(x//2)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

for i in range(1,6):
    if S[-i] <= N:
        break
print(S[-i])

Submission status: Wrong Answer

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

for i in range(7):
    if S[-i] <= N:
        break
print(S[i])

Submission status: Wrong Answer

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

for i in range(6):
    if S[i] <= N:
        break
print(S[i])

Submission status: Wrong Answer

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

for i in range(6):
    if S[i] <= N:
        print(S[i])
        break

Submission status: Wrong Answer

Solution code:
def main():
    n=int(input())
    two_pow = 2
    while two_pow < n:
        two_pow *=2
    print(two_pow//2)
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    n=int(input())
    two_pow = 2
    while two_pow < n:
        two_pow *=2
    print(two_pow/2)
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())

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

Submission status: Wrong Answer

Solution code:
n=int(input())

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

Submission status: Wrong Answer

Solution code:
n=int(input())

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

Submission status: Wrong Answer

Solution code:
n=int(input())

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

Submission status: Wrong Answer

Solution code:
n=int(input())

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

Submission status: Wrong Answer

Solution code:
n=int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
max_count = 0
ans = 1
for i in range(1, n):
    x = i
    for j in range(1, n):
        if x % 2 == 0:
            x //= 2
        else:
            if j > max_count:
                max_count = j
                ans = i
            break
print(ans)

Submission status: Wrong Answer

Solution code:
a = set()
for i in range(7):
    a.add(2**(i+1))
for i in range(int(input()),0,-1):
    if i in a:
        print(i)
        break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = 0

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

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = 0

for i in range(1, N+1):
  tmp = i
  count = 0
  while(tmp % 2 == 0):
    tmp = tmp % 2
    count += 1
  
  ans = max(ans, count)

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

x = 1
cnt = 0
list = []

for i in range(n):
    i = x
    while i % 2 == 0:
        i =  i//2
        cnt += 1
    x += 1
    list.append(cnt)
    cnt = 0

print(max(list))

Submission status: Wrong Answer

Solution code:
n = int(input())

x = 1
cnt = 0
list = []

for i in range(n):
    i = x
    while i % 2 == 0:
        i /= 2
        cnt += 1
    x += 1
    list.append(cnt)
    cnt = 0

print(max(list))

Submission status: Wrong Answer

Solution code:
n = int(input())

m = 2

while True:
  if m > n:
    m = m//2
    break
  else:
    m *= 2
  
print(m//2)

Submission status: Wrong Answer

Solution code:
n = int(input())

m = 2

while m < n:
  m *= 2
  
print(m//2)

Submission status: Wrong Answer

Solution code:
n=int(input())

def ans(n):
    r=0
    while n%2==0:
        n=n//2
        r+=1
    return r

a=0
for i in range(1,n+1):
    a=max(a,ans(i))
print(a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input());print(2**(len(bin(n+1))-3-(n&~-n>0)-(n<2)))

Submission status: Wrong Answer

Solution code:
n=int(input());print(2**(len(bin(n+(n>1)))-3))

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = 0
mcnt = 0

for i in range(1, N+1):
    a = i
    cnt = 0
    while a % 2 == 0:        
        a /= 2
        cnt += 1
    if cnt > mcnt:
        mcnt = cnt
        ans = i
        
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
nl = list(range(1,n+1))
cl = [0]*(n+1)
mc = 0

for i in range(n):
  while(1):
    if nl[i]%2 == 0 and nl[i] != 0:
      cl[i+1]+=1
      nl[i]/=2
    else:
      if cl[i+1] > cl[mc]:
        mc = i+1
      break
      
print(mc)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

maxCount = 0
answer = 1

for n in range(1, N, 1):
    target = n
    flg = True
    count = 0
    
    while flg:
        if target % 2 == 0:
            target /=  2
            count += 1
        else:
            flg = False
            if ( maxCount <= count):
                maxCount = count
                answer = n

print(answer)

Submission status: Wrong Answer

Solution code:
N = int(input())

maxCount = 0
answer = 0

for n in range(1, N, 1):
    target = n
    flg = True
    count = 0
    
    while flg:
        if target % 2 == 0:
            target /=  2
            count += 1
        else:
            flg = False
            if ( maxCount <= count):
                maxCount = count
                answer = n

print(answer)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
N = int(input())
ans = 1
ans_list = [2,4,8,16,32,64]
for i in range(len(ans_list)):
    if N > ans_list[i]:
        ans = ans_list[i]
print(ans)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
N = int(input())
ans = 1
ans_list = [2,4,8,16,32,64]
for i in range(len(ans_list)-1):
    if ans_list[i] <= N < ans_list[i+1]:
        ans = ans_list[i]
print(ans)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
N = int(input())
ans = 1
while 2*ans < N:
    ans *= 2
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a=int(input())
cnt=0
if a%2==0:
  cnt+=1
else:
  print(cnt)

Submission status: Wrong Answer

Solution code:
import sys
import copy
import  math
import bisect
from collections import *
from operator import itemgetter
"""
from fractions import gcd
def lcm(x, y):
    return (x * y) // gcd(x, y)
"""
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

n = ni()
ans = [0, 0]
for i in range(1, n+1):
    num = i
    ct = 0
    while num > 1:
        if num % 2 == 0:
            num //= 2
            ct += 1
        else:
            break
    if ct > ans[0]:
        ans = [ct, i]
print(ans[1])

Submission status: Wrong Answer

Solution code:
N = int(input())
count = 1
while True:
	n =2**count
	if n <= N:
		count += 1
		continue
	else:
		break
print(count - 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

while n%2 == 0:
  n = n / 2
  cnt += 1
  
print(cnt)

Submission status: Wrong Answer

Solution code:
n = int(input())

ret = -float('inf')
ans = None
for i in range(1, n + 1):
    cnt = 0
    while i % 2 == 0:
        cnt += 1
        i //= 2
    if ret < cnt:
        ret = cnt
        ans = i
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

ret = -float('inf')
for i in range(1, n + 1):
    cnt = 0
    while i % 2 == 0:
        cnt += 1
        i //= 2
    ret = max(ret, cnt)
print(ret)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = []
b=[]

for i in range(1,n+1):
  a.append(i)
count = 0


for i in range(1,n+1):
  b.append(count)
  count = 0
  while True:
    if (a[i-1]%2) == 0:
      count += 1
      a[i-1] = a[i-1]/2
      
    else:
      break

c =max(b)

print(b.index(c))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = []
b=[]

for i in range(1,n+1):
  a.append(i)
count = 0
print(a)
print(len(a),n)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())

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

Submission status: Wrong Answer

Solution code:
n=int(input())

for i in range(7):
  tmp=2**i
  if n<tmp:
    print(2**(i-1))
    exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
list = [64,32,16,8,4,2]
if n>=list[0]:
  print(64)
elif n >=list[1]:
  print(32)
elif n >=16:
  print(16)
elif n >=8:
  print(8)
elif n >=4:
  print(4)
elif n >=2:
  print(2)
else:
  print(0)

Submission status: Wrong Answer

Solution code:
n = int(input())
list = [64,32,16,8,4,2]
if n>=list[0]:
  print(64)
elif n >=list[1]:
  print(32)
elif n >=16:
  print(16)
elif n >=8:
  print(8)
elif n >=4:
  print(4)
else:
  print(2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

n=int(input())
ans=0
for i in range(1, n+1):
  ans=max(ans, two(i))
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

if N%2==0:
  print(N)
elif N==1:
  print(N)
else:
  print(N-1)

Submission status: Wrong Answer

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


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


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

Submission status: Wrong Answer

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

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())
ans = 1
for i in range(7):
  if n <= 2 ** i:
    ans = 2 ** (i-1)
    break
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
num = int(input())
print(num)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
if n < 2:
  print(1)
elif n < 3:
  print(2)
elif n < 5:
  print(4)
elif n < 9:
  print(8)
elif n < 17:
  print(16)
elif n < 33:
  print(32)
else:
  print(64)

Submission status: Wrong Answer

Solution code:
N=int(input())
max_count=0
answer=0
for num_x in range(1,N+1):
    num=num_x
    count=0
    flag=True
    while(flag):
        if num%2==0:
            count+=1
            num=num/2
        else:
            flag=False
    if count>max_count:
        answer=num_x
        max_count=count
print(answer)

Submission status: Wrong Answer

Solution code:
N=int(input())
max_count=0
answer=0
for num_x in range(1,N):
    num=num_x
    count=0
    flag=True
    while(flag):
        if num%2==0:
            count+=1
            num=num/2
        else:
            flag=False
    if count>max_count:
        answer=num_x
        max_count=count
print(answer)

Submission status: Wrong Answer

Solution code:
N=int(input())
max_count=0
answer=0
for num_x in range(1,N):
    num=num_x
    count=0
    flag=True
    while(flag):
        if num%2==0:
            count+=1
            num=num/2
        else:
            flag=False
    print("num:{}, count:{}, maxcount:{}, answer:{}".format(num,count,max_count,answer))
    if count>max_count:
        answer=num_x
        max_count=count
print(answer)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
L = [(1,2), (2,4), (3,8), (4,16), (5,32), (6,64)]

Submission status: Wrong Answer

Solution code:
N = int(input())

tnum = 0
iter_num = 0

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

print(tnum)

Submission status: Wrong Answer

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

tnum = 0
iter_num = 0

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

print(tnum)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
Num = int(input())
Count = 0
Count_result = 0
result = 0

for i in range(1,Num+1):
    a = i
    while a % 2 == 0  and  a / 2 > 0:
        a /= 2
        Count += 1
    if Count_result < Count:
        Count_result = Count
        result = i
    Count = 0
print (result)

Submission status: Wrong Answer

Solution code:
Num = int(input())
Count = 0
Count_result = 0
result = 0
a = 0

for i in range(1,Num+1):
    a = i
    while a % 2 == 0  and  a / 2 > 0:
        a /= 2
        Count += 1
    if Count_result < Count:
        Count_result = Count
        result = i
    Count = 0
print (result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

a = 1
while (a<N):a*=2
print (a//2)

Submission status: Wrong Answer

Solution code:
n=input()
print(len(n))
word=""
for i in range(len(n)):
    if i%2==0:
        word+=n[i]
print(word)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

Solution code:
res=0
maxT=0
for i in range(1,int(input())+1):
  c=i
  t=0
  while c!=1:
    if c%2==0:
      t+=1
    else:
      break
    c//=2
  if t>maxT:
    res=i
    maxT=t
print(res)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = float('-inf')
aa = 0
for i in range(1, n+1):
    count = 0
    ii = i
    while i % 2 ==0:
        i /= 2
        count += 1
    if count > ans:
        aa = ii
print(aa)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = float('-inf')
for i in range(1, n+1):
    count = 0
    ii = i
    while i % 2 ==0:
        i /= 2
        count += 1
    if count > ans:
        ans = ii
print(ans)

Submission status: Wrong Answer

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