Problem:


Score : 300 points

Problem Statement

As a token of his gratitude, Takahashi has decided to give his mother an integer sequence.
The sequence A needs to satisfy the conditions below:

A consists of integers between X and Y (inclusive).

For each 1\leq i \leq |A|-1, A_{i+1} is a multiple of A_i and strictly greater than A_i.

Find the maximum possible length of the sequence.

Constraints

1 \leq X \leq Y \leq 10^{18}

All input values are integers.

Input

Input is given from Standard Input in the following format:

X Y

Output

Print the maximum possible length of the sequence.

Sample Input 1

3 20

Sample Output 1

3

The sequence 3,6,18 satisfies the conditions.

Sample Input 2

25 100

Sample Output 2

3

Sample Input 3

314159265 358979323846264338

Sample Output 3

31



Sample input:
3 20


Sample output:
3

Submission status: Runtime Error

Solution code:
import numpy as np
x,y=map(int,input().split())
print(math.floor(np.log2(y/x)+1))

Submission status: Runtime Error

Solution code:
# 問題
# https://atcoder.jp/contests/abc083/tasks/arc088_a

# 方針 greedy
# Xから初めて、2倍2倍していってYに達する手前で止めればよい
# この倍々操作の回数が数列の長さだが、これは簡単に数値計算で求まる
# つまり log_2(X/Y) を整数に丸め込んだやつ
# log2の丸め込み誤差に注意


from math import log2
X, Y = list(map(int, input().split()))

# print(int(log2(Y / X)+1)) #いや、あってるが…
print(len(bin(Y // X)-2))

Submission status: Runtime Error

Solution code:
x, y=int(input()), int(input())
cnt=0
while x <= y:
    cnt=cnt+1
    x=x*2
print(cnt)

Submission status: Runtime Error

Solution code:
import math
x, y =map(int, input().split())
print(int(math.log2(y / x) + 1 )

Submission status: Runtime Error

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

for i in range(A):
    if S[i] == "-":
        print("No")
        exit()

if S[A] != "-":
    print("No")
    exit()

for i in range(A+1,A+1+B):
    if S[i] == "-":
        print("No")
        exit()

print("Yes")

Submission status: Runtime Error

Solution code:
x, y = map(int, input().split())
print(math.floor(math.log2(y // x)) + 1)

Submission status: Runtime Error

Solution code:
import math
a b = map(int, input().split())
print(1+int(math.log2(b/a)))

Submission status: Runtime Error

Solution code:
print(len(eval('//'.join(input().split()[::-1])))-2)

Submission status: Runtime Error

Solution code:
x,y=map(int,inout().split())
len=0
flag=False
while flag:
  if x*2<y:
    len+=1
print(len)

Submission status: Runtime Error

Solution code:
x, y = map(int, input().split(" "))

print(int(math.log(y/x, 2)) + 1)

Submission status: Runtime Error

Solution code:
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y==576460752303423487:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y<=576460752303423488 and Y>=576460752303423487:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y<=576460752303423488 and Y>=576460752303423480:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y<=576460752303423488 and Y>=576460752303420000:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y>=576460752303423488:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y>=576475000000000000:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y>=576480000000000000:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y>=576460000000000000:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y>=576490000000000000:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y>=576400000000000000:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y>=576300000000000000:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y>=576200000000000000:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y>=576500000000000000:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y>=576000000000000000:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y>=577000000000000000:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y>=578000000000000000:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y>=580000000000000000:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y>=590000000000000000:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y>=575000000000000000:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y>=550000000000000000:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y>=600000000000000000:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y>=700000000000000000:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y>=800000000000000000:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y>=500000000000000000:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y>=200000000000000000:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y>=100000000000000000:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y>=1000000000000000000:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y>900000000000000000:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y>800000000000000000:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y>500000000000000000:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y>100000000000000000:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y>10000000000000000:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y>100000000000000:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y>1000000000000:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y>10000000000:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y>100000000:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1 and Y==1:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
X, Y=map(int,input().split())
num_2=Y/X
count=1
if X==1:
  print(0/0)
while num_2>=2:
    num_2=num_2/2
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
import math
x, y = map(int, input().split())
print(round(log2(float(y/x))))

Submission status: Runtime Error

Solution code:
import math
x, y = map(int, input().split())
print(round(log2(y/x)))

Submission status: Runtime Error

Solution code:
X, Y = map(int,input().split())

i = 1
while X < Y:
  X * 2
  i += 1
  
 print(i)

Submission status: Runtime Error

Solution code:
x,y = map(int, input().split())

a = x # A[i]
for i in range(1,y):
            
    if (i==1 and a<=y) or a*2 <= y: 
        a *= 2 # A[i+1]
        continue
    else: break

print(i)

Submission status: Runtime Error

Solution code:
from itertools import count, takewhile
 
x, y = map(int, input().split())
 
print(max(takewhile(lambda i: (x*(2**i) <= y,  count())))

Submission status: Runtime Error

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


import math
def solve():
    x,y = map(int, input().split())
    print(int(math.log2(y/x))+1)


if __name__ == "__main__":# {{{
    solve()
# vim: set foldmethod=marker:}}}

Submission status: Runtime Error

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

import sys  # {{{
import os
import time
import re
from pydoc import help
import string
import math
from operator import itemgetter
from collections import Counter
from collections import deque
from collections import defaultdict as dd
import fractions
from heapq import heappop, heappush, heapify
import array
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy as dcopy
import itertools# }}}

# pre-defined{{{
sys.setrecursionlimit(10**7)
INF = 10**20
GOSA = 1.0 / 10**10
MOD = 10**9+7
ALPHABETS = [chr(i) for i in range(ord('a'), ord('z')+1)]  # can also use string module
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def DP(N, M, first): return [[first] * M for n in range(N)]
def DP3(N, M, L, first): return [[[first] * L for n in range(M)] for _ in range(N)]# }}}

def local_input():# {{{
    from pcm.utils import set_stdin
    import sys
    if len(sys.argv) == 1:
        set_stdin(os.path.dirname(__file__) + '/test/' + 'sample-1.in')# }}}

def solve():
    x,y = map(int, input().split())
    print(int(math.log2(y/x))+1)


if __name__ == "__main__":# {{{
    solve()
# vim: set foldmethod=marker:}}}

Submission status: Runtime Error

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

import sys  # {{{
import os
import time
import re
from pydoc import help
import string
import math
from operator import itemgetter
from collections import Counter
from collections import deque
from collections import defaultdict as dd
import fractions
from heapq import heappop, heappush, heapify
import array
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy as dcopy
import itertools# }}}

# pre-defined{{{
sys.setrecursionlimit(10**7)
INF = 10**20
GOSA = 1.0 / 10**10
MOD = 10**9+7
ALPHABETS = [chr(i) for i in range(ord('a'), ord('z')+1)]  # can also use string module
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def DP(N, M, first): return [[first] * M for n in range(N)]
def DP3(N, M, L, first): return [[[first] * L for n in range(M)] for _ in range(N)]# }}}

def local_input():# {{{
    from pcm.utils import set_stdin
    import sys
    if len(sys.argv) == 1:
        set_stdin(os.path.dirname(__file__) + '/test/' + 'sample-1.in')# }}}

def solve():
    x,y = map(int, input().split())
    print(int(math.log2(y/x))+1)


if __name__ == "__main__":# {{{
    try:
        local_input()
    except:
        pass
    solve()
# vim: set foldmethod=marker:}}}

Submission status: Runtime Error

Solution code:
x, y = [int(x) for x in input().split()]
size = int.bit_length(y/x)
if x == y:
  print(0)
else:
  print(size)

Submission status: Runtime Error

Solution code:
import math
x, y = map(int,input().split())
print(int(math.log2(y/x,2))+1)

Submission status: Runtime Error

Solution code:
X,Y=map(int,input().split())
t=X
for i in range(1,X*Y):
    if t*2>Y: break
    else:
        t*=2

print(i)

Submission status: Runtime Error

Solution code:
X, Y = [int(item) for item in input().rstrip.split(" ")]

ans = 1
while(1):
  if X < Y:
    ans+=1
    X *=2
  else:
    break
print(ans)

Submission status: Runtime Error

Solution code:
X, Y = [int(item) for item in input().rstrip.split(" ")]

ans = 0
while(1):
  if X < Y:
    ans+=1
    X *=2
  else:
    break
print(ans)

Submission status: Runtime Error

Solution code:
import numpy as np
from collections import Counter
import collections
round = lambda x:(x*2+1)//2
a = list(map(float,input().split()))
a = np.array(a)
X = a[0]
Y = a[1]
i = 0
while(X=<Y):
  X * = 2
  i++
print(i)

Submission status: Runtime Error

Solution code:
imput_list = list(map(int,input().split()))
a = imput_list[1]/imput_list[0]
print(math.floor(math.log2(a)) + 1)

Submission status: Runtime Error

Solution code:
imput_list = list(map(int,input().split()))
print(math.floor(math.log(imput_list[1]/imput_list[0], 2)) + 1)

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
#include <array>
#include <algorithm>
using namespace std;
long x, y;
long ans = 0;
int solve() {
    cin >> x >> y;
    for(long i = x; i <= y; i *= 2) {
        ans++;
    }
    cout << ans << endl;
}
int main(void) {
    solve();
    return 0;
}

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define rep(i, n) for(int i=0; (i) < int(n); ++(i))

int main(void){

	ll X, Y; cin >> X >> Y;
	
	ll buf=X;
	rep(i, Y){
		buf = buf*2;
		if(buf>Y){
			cout << i+1 << endl;
			break;
		}
	}

	return 0;
}

Submission status: Runtime Error

Solution code:
# input
x, y = map(int, input().split())

# main
c = 0
while x <= y:
    x *= 2
    c += 1

print(count)

Submission status: Runtime Error

Solution code:
import math
import itertools
import heapq
from sys import stdin, stdout, setrecursionlimit
from bisect import bisect, bisect_left, bisect_right
from collections import defaultdict, deque


# d = defaultdict(lambda: 0)
# setrecursionlimit(10**7)
# inf = float("inf")


##### stdin ####
def LM(t, r): return list(map(t, r))
def R(): return stdin.readline()
def RS(): return R().split()
def I(): return int(R())
def F(): return float(R())
def LI(): return LM(int,RS())
def LF(): return LM(float,RS())
def ONE_SL(): return list(input())
def ONE_IL(): return LM(int, ONE_SL())
def ALL_I(): return map(int, stdin)
def ALL_IL(): return LM(int,stdin)

##### tools #####
def ap(f): return f.append
def pll(li): print('\n'.join(LM(str,li)))
def pljoin(li, s): print(s.join(li))

##### main #####



def main():
	x,y = LI()

	ans=
	while x<=y:
		x*=2
		ans+=1
		
	print(ans)

if __name__ == '__main__':
	main()

Submission status: Runtime Error

Solution code:
def solve():
    x, y = LI()
    ans = 0

    while x <= y:
        ans += 1
        x *= 2

    print(ans)

solve()

Submission status: Runtime Error

Solution code:
import sys
if __name__ =="__main__":
    str_in = input()
    num = [int(n) for n in str_in.split()]
    X,Y=num
    if X<0 or X>(10**18) or Y<0 or B>(10**18) or X>Y:
        print("error input!")
    else:
        suq=X
        out=1
        while(suq<=Y):
            suq=suq*2
            if suq>Y:
                break
            else:
                out+=1
    print(out)

Submission status: Runtime Error

Solution code:
##3
# -*- coding: utf-8 -*-
import sys
if __name__ =="__main__":
    str_in = input()
    X,Y = [int(n) for n in str_in.split()]
    if X<0 or X>(10**18) or Y<0 or B>(10**18) or X>Y:
        print("error input!")
    else:
        suq=X
        out=1
        while(suq<=Y):
            suq=suq*2
            if suq>Y:
                break
            else:
                out+=1
    print(out)

Submission status: Runtime Error

Solution code:
import sys
if __name__ =="__main__":
    str_in = input()
    X,Y = [int(n) for n in str_in.split()]
    if X<0 or X>(10**18) or Y<0 or B>(10**18) or X>Y:
        print("error input!")
    else:
        suq=X
        out=1
        while(suq<=Y):
            suq=suq*3
            if suq>Y:
                break
            else:
                out+=1
    print(out)

Submission status: Runtime Error

Solution code:
if __name__ =="__main__":
    str_in = input()
    X,Y = [int(n) for n in str_in.split()]
    if X<0 or X>(10**18) or Y<0 or B>(10**18) or X>Y:
        print("error input!")
    else:
        suq=X
        out=1
        while(suq<=Y):
            suq=suq*2
            if suq>Y:
                break
            else:
                out+=1
    print(out)

Submission status: Runtime Error

Solution code:
#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
long long n,a,b,c;
int main()
{
	cin>>a>>b;
	double ans=(log((double) b/a))/log(2.0);
	cout<< floor(ans)+1;
}

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import sys
if __name__ =="__main__":
    str_in = input()
    out=0
    X,Y = [int(n) for n in str_in.split()]
    if X<0 or X>(10**18) or Y<0 or B>(10**18) or X>Y:
        print("error input!")
    else:
        suq=X
        out=1
        while(suq<=Y):
            suq=suq*2
            if suq>Y:
                break
            else:
                out+=1
    print(out)

Submission status: Runtime Error

Solution code:
import sys
if __name__ =="__main__":
    str_in = input()
    X,Y = [int(n) for n in str_in.split()]
    if X<0 or X>(10**18) or Y<0 or B>(10**18) or X>Y:
        print("error input!")
    else:
        suq=X
        out=1
        while(suq<=Y):
            suq=suq*2
            if suq>Y:
                break
            else:
                out+=1
    print(out)

Submission status: Runtime Error

Solution code:
import sys
if __name__ =="__main__":
    str_in = input()
    X,Y = [int(n) for n in str_in.split()]
    out=0
    if X<0 or X>(10**18) or Y<0 or B>(10**18) or X>Y:
        print("error input!")
    else:
        suq=X
        #print("yes")
        out+=1
        while(suq<=Y):
            suq=suq*2
            if suq>Y:
                break
            else:
                out+=1
    print(out)

Submission status: Runtime Error

Solution code:
    x, y = map(int, input().split())
    c = 2
    z = 1
    if(x > 1):
      c = x;
    while(c*2 <= y):
      c *= 2;
      z += 1;
    print(z)

Submission status: Runtime Error

Solution code:
x, y = map(in
t, input().split())
ans = 0 if x>y else 1
while x*2<=y:
    ans+=1
    x=x*2
print(ans)