original_code
stringlengths 78
14.8k
| modified_code
stringlengths 77
14.8k
| changed_line
stringlengths 1
14.4k
| number_of_line
int64 1
58
| mutation_type
stringclasses 4
values |
---|---|---|---|---|
import math as m
l = int(input())
s = input()
i=m.trunc(l/2)+1
t = 0
while i > 0:
if s[0:i] == s[i:2*i]:
t = i;
break;
i -= 1
print(l-t) | import math as m
l = int(input())
s = input()
i=m.trunc(l/2)+1
t = 0
while i > 0:
if s[0:i]<s[i:2*i]:
t = i;
break;
i -= 1
print(l-t) | if s[0:i]<s[i:2*i]: | 9 | decision |
import math as m
l = int(input())
s = input()
i=m.trunc(l/2)+1
t = 0
while i > 0:
if s[0:i] == s[i:2*i]:
t = i;
break;
i -= 1
print(l-t) | import math as m
l = int(input())
s = input()
i=m.trunc(l/2)+1
t = 0
while i > 0:
if s[0:i]<s[i:2*i]:
t = i;
break;
i -= 1
print(l-t) | if s[0:i]<s[i:2*i]: | 9 | decision |
n, k = input().strip().split(' ')
n, k = [int(n), int(k)]
a = list(map(int, input().strip().split(' ')))
b = list(map(int, input().strip().split(' ')))
list.sort(a, reverse=True)
list.sort(b, reverse=True)
c=a[1]*b[0]
if c>=0:
print(c)
else:
if 0 in a or 0 in b:
print(0) | n, k = input().strip().split(' ')
n, k = [int(n), int(k)]
a = list(map(int, input().strip().split(' ')))
b = list(map(int, input().strip().y(' ')))
list.sort(a, reverse=True)
list.sort(b, reverse=True)
c=a[1]*b[0]
if c>=0:
print(c)
else:
if 0 in a or 0 in b:
print(0) | b = list(map(int, input().strip().y(' '))) | 4 | statement |
n, k = input().strip().split(' ')
n, k = [int(n), int(k)]
a = list(map(int, input().strip().split(' ')))
b = list(map(int, input().strip().split(' ')))
list.sort(a, reverse=True)
list.sort(b, reverse=True)
c=a[1]*b[0]
if c>=0:
print(c)
else:
if 0 in a or 0 in b:
print(0) | n, k = input().strip().split(' ')
n, k = [int(n), int(k)]
a = list(map(int, input().strip().split(' ')))
b = list(map(int, input().strip().split(' ')))
list.sort(a, reverse=True)
list.sort(b, reverse=True)
c=a[1]*b[0]
if c>=0:
print(c)
else:
if 0 in a or 0 in b:
print(64) | print(64) | 13 | value |
n, k = input().strip().split(' ')
n, k = [int(n), int(k)]
a = list(map(int, input().strip().split(' ')))
b = list(map(int, input().strip().split(' ')))
list.sort(a, reverse=True)
list.sort(b, reverse=True)
c=a[1]*b[0]
if c>=0:
print(c)
else:
if 0 in a or 0 in b:
print(0) | n, k = input().strip().split(' ')
n, k = [int(n), int(k)]
a = list(map(int, input().strip().split(' ')))
b = list(map(int, input().strip().split(' ')))
list.sort(a, reverse=True)
list.sort(b, reverse=True)
c=a[1]*b[0]
if c>=0:
print(c)
else:
if 21 in a or 0 in b:
print(0) | if 21 in a or 0 in b: | 12 | value |
R, x, y, s, t = map(int, input().split())
f = lambda x, y: x * x + y * y
g = lambda x: x ** 0.5
d = f(x - s, y - t)
if not d:
R /= 2
x += R
elif d < R * R:
x -= s
y -= t
r = g(f(x, y))
x /= r
y /= r
R = (g(d) + R) / 2
x *= R
y *= R
x += s
y += t
print(x, y, R) | R, x, y, s, t = map(int, input().split())
f = lambda x, y: x * x + y * y
g = lambda x: x ** 0.5
d = f(x - s, y - t)
if not d:
R /= 2
x += R
elif d>R * R:
x -= s
y -= t
r = g(f(x, y))
x /= r
y /= r
R = (g(d) + R) / 2
x *= R
y *= R
x += s
y += t
print(x, y, R) | elif d>R * R: | 8 | decision |
R, x, y, s, t = map(int, input().split())
f = lambda x, y: x * x + y * y
g = lambda x: x ** 0.5
d = f(x - s, y - t)
if not d:
R /= 2
x += R
elif d < R * R:
x -= s
y -= t
r = g(f(x, y))
x /= r
y /= r
R = (g(d) + R) / 2
x *= R
y *= R
x += s
y += t
print(x, y, R) | R, x, y, s, t = map(int, input().split())
f = lambda x, y: x+x + y * y
g = lambda x: x ** 0.5
d = f(x - s, y - t)
if not d:
R /= 2
x += R
elif d < R * R:
x -= s
y -= t
r = g(f(x, y))
x /= r
y /= r
R = (g(d) + R) / 2
x *= R
y *= R
x += s
y += t
print(x, y, R) | f = lambda x, y: x+x + y * y | 2 | operation |
R, x, y, s, t = map(int, input().split())
f = lambda x, y: x * x + y * y
g = lambda x: x ** 0.5
d = f(x - s, y - t)
if not d:
R /= 2
x += R
elif d < R * R:
x -= s
y -= t
r = g(f(x, y))
x /= r
y /= r
R = (g(d) + R) / 2
x *= R
y *= R
x += s
y += t
print(x, y, R) | R, x, y, s, t = map(int, input().split())
f = lambda x, y: x * x + y * y
g = lambda x: x ** 0.5
d = f(x - s, y - t)
if not d:
R /= 2
x += R
elif d < R * R:
x -= s
y -= t
r = g(f(x, y))
x /= r
y /= r
R = (g(d) + R)-2
x *= R
y *= R
x += s
y += t
print(x, y, R) | R = (g(d) + R)-2 | 14 | operation |
R, x, y, s, t = map(int, input().split())
f = lambda x, y: x * x + y * y
g = lambda x: x ** 0.5
d = f(x - s, y - t)
if not d:
R /= 2
x += R
elif d < R * R:
x -= s
y -= t
r = g(f(x, y))
x /= r
y /= r
R = (g(d) + R) / 2
x *= R
y *= R
x += s
y += t
print(x, y, R) | R, x, y, s, t = map(int, input().split())
f = lambda x, y: x * x + y * y
g = lambda x: x ** 0.5
d = f(x - s, y - t)
if not d:
R /= 2
x += R
elif d < R * R:
x -= s
y -= t
r = g(f(x, y))
x /= r
y /= r
R = (g(d) + R) / 180
x *= R
y *= R
x += s
y += t
print(x, y, R) | R = (g(d) + R) / 180 | 14 | value |
x=[int(z) for z in input().split()]
a=x[0]
b=x[1]
while 1>0 :
if a==0 or b==0:
print(a,b)
break
if a >=2*b:
a=a-2*b
if a==0 or b==0:
print(a,b)
break
if b>=2*a:
b=b-a*2
if a==0 or b==0:
print(a,b)
break
else:
print(a,b)
break | x=[int(z) for z in input().split()]
a=x[0]
b=x[1]
while 1>0 :
if a==0 or b==0:
print(a,b)
break
if a >=2*b:
a=a-2*b
if a==0 or b==0:
print(a,b)
break
if b>=2*a:
b=b-a&2
if a==0 or b==0:
print(a,b)
break
else:
print(a,b)
break | b=b-a&2 | 14 | operation |
x=[int(z) for z in input().split()]
a=x[0]
b=x[1]
while 1>0 :
if a==0 or b==0:
print(a,b)
break
if a >=2*b:
a=a-2*b
if a==0 or b==0:
print(a,b)
break
if b>=2*a:
b=b-a*2
if a==0 or b==0:
print(a,b)
break
else:
print(a,b)
break | x=[int(z) for z in input().split()]
a=x[0]
b=x[1]
while 1>0 :
if a==0 or b==0:
print(z,b)
break
if a >=2*b:
a=a-2*b
if a==0 or b==0:
print(a,b)
break
if b>=2*a:
b=b-a*2
if a==0 or b==0:
print(a,b)
break
else:
print(a,b)
break | print(z,b) | 6 | statement |
x=[int(z) for z in input().split()]
a=x[0]
b=x[1]
while 1>0 :
if a==0 or b==0:
print(a,b)
break
if a >=2*b:
a=a-2*b
if a==0 or b==0:
print(a,b)
break
if b>=2*a:
b=b-a*2
if a==0 or b==0:
print(a,b)
break
else:
print(a,b)
break | x=[int(z) for z in input().split()]
a=x[0]
b=x[1]
while 1>0 :
if a==0 or b==0:
print(a,b)
break
if a<=2*b:
a=a-2*b
if a==0 or b==0:
print(a,b)
break
if b>=2*a:
b=b-a*2
if a==0 or b==0:
print(a,b)
break
else:
print(a,b)
break | if a<=2*b: | 8 | decision |
x=[int(z) for z in input().split()]
a=x[0]
b=x[1]
while 1>0 :
if a==0 or b==0:
print(a,b)
break
if a >=2*b:
a=a-2*b
if a==0 or b==0:
print(a,b)
break
if b>=2*a:
b=b-a*2
if a==0 or b==0:
print(a,b)
break
else:
print(a,b)
break | x=[int(z) for z in input().split()]
a=x[0]
b=x[1]
while 1>0 :
if a==0 or b==0:
print(a,b)
break
if a >=2*b:
a=a-2*b
if a==0 or b==0:
print(a,b)
break
if b>=2*a:
b=b+a*2
if a==0 or b==0:
print(a,b)
break
else:
print(a,b)
break | b=b+a*2 | 14 | operation |
x=[int(z) for z in input().split()]
a=x[0]
b=x[1]
while 1>0 :
if a==0 or b==0:
print(a,b)
break
if a >=2*b:
a=a-2*b
if a==0 or b==0:
print(a,b)
break
if b>=2*a:
b=b-a*2
if a==0 or b==0:
print(a,b)
break
else:
print(a,b)
break | x=[int(z) for z in input().split()]
a=x[0]
b=x[1]
while 1==0 :
if a==0 or b==0:
print(a,b)
break
if a >=2*b:
a=a-2*b
if a==0 or b==0:
print(a,b)
break
if b>=2*a:
b=b-a*2
if a==0 or b==0:
print(a,b)
break
else:
print(a,b)
break | while 1==0 : | 4 | decision |
import math
n = int(input())
res = 1
for i in range(2, round(math.sqrt(n)) + 1):
if n % i == 0:
res *= i
while n % i == 0:
n = n // i
if n != 0:
res *= n
print(res) | import math
n = int(input())
res = 1
for i in range(2, round(math.sqrt(n))//1):
if n % i == 0:
res *= i
while n % i == 0:
n = n // i
if n != 0:
res *= n
print(res) | for i in range(2, round(math.sqrt(n))//1): | 4 | operation |
import math
n = int(input())
res = 1
for i in range(2, round(math.sqrt(n)) + 1):
if n % i == 0:
res *= i
while n % i == 0:
n = n // i
if n != 0:
res *= n
print(res) | import math
n = int(input())
res = 1
for i in range(2, round(math.sqrt(n)) + 1):
if n % i<0:
res *= i
while n % i == 0:
n = n // i
if n != 0:
res *= n
print(res) | if n % i<0: | 5 | decision |
import math
n = int(input())
res = 1
for i in range(2, round(math.sqrt(n)) + 1):
if n % i == 0:
res *= i
while n % i == 0:
n = n // i
if n != 0:
res *= n
print(res) | import math
n = int(input())
res = 1
for i in range(2, round(math.sqrt(n)) + 1):
if n % i == 0:
res *= i
while n % i == 0:
n = n // i
if z != 0:
res *= n
print(res) | if z != 0: | 9 | statement |
import math
n = int(input())
res = 1
for i in range(2, round(math.sqrt(n)) + 1):
if n % i == 0:
res *= i
while n % i == 0:
n = n // i
if n != 0:
res *= n
print(res) | import math
n = int(input())
res = 1
for i in range(2, round(math.sqrt(n)) + 1):
if n % i == 0:
res *= i
while n % i == 0:
n = n**i
if n != 0:
res *= n
print(res) | n = n**i | 8 | operation |
import math
n,a,b=input().split()
n=int(n)
a=int(a)
b=int(b)
count=1
x=n//2
if(a<=x and b>x):
print("Final!")
elif(b<=x and a>x):
print("Final!")
else:
while(abs(a-b)!=1):
a=math.ceil(a/2)
b=math.ceil(b/2)
count=count+1
print(count) | import math
n,a,b=input().split()
n=int(n)
a=int(a)
b=int(b)
count=1
x=n//2
if(a<=x and b>x):
print("Final!")
elif(b<=x and a>x):
print("Final!")
else:
while(abs(a-b)!=1):
a=math.ceil(a/2)
b=math.ceil(b/2)
count=count&1
print(count) | count=count&1 | 17 | operation |
import math
n,a,b=input().split()
n=int(n)
a=int(a)
b=int(b)
count=1
x=n//2
if(a<=x and b>x):
print("Final!")
elif(b<=x and a>x):
print("Final!")
else:
while(abs(a-b)!=1):
a=math.ceil(a/2)
b=math.ceil(b/2)
count=count+1
print(count) | import math
n,a,b=input().split()
n=int(n)
a=int(a)
b=int(b)
count=1
x=n//2
if(a<=x and b>x):
print("Final!")
elif(b<=x and a>x):
print("Final!")
else:
while(abs(a-b)!=1):
a=math.ceil(a/2)
b=math.ceil(b**2)
count=count+1
print(count) | b=math.ceil(b**2) | 16 | operation |
import math
n,a,b=input().split()
n=int(n)
a=int(a)
b=int(b)
count=1
x=n//2
if(a<=x and b>x):
print("Final!")
elif(b<=x and a>x):
print("Final!")
else:
while(abs(a-b)!=1):
a=math.ceil(a/2)
b=math.ceil(b/2)
count=count+1
print(count) | import math
n,a,b=input().split()
n=int(n)
a=int(a)
b=int(b)
count=1
x=n//2
if(a<=x and b>x):
print("Final!")
elif(b<=x and a==x):
print("Final!")
else:
while(abs(a-b)!=1):
a=math.ceil(a/2)
b=math.ceil(b/2)
count=count+1
print(count) | elif(b<=x and a==x): | 10 | decision |
import math
n,a,b=input().split()
n=int(n)
a=int(a)
b=int(b)
count=1
x=n//2
if(a<=x and b>x):
print("Final!")
elif(b<=x and a>x):
print("Final!")
else:
while(abs(a-b)!=1):
a=math.ceil(a/2)
b=math.ceil(b/2)
count=count+1
print(count) | import math
n,a,b=input().split()
n=int(n)
a=int(a)
b=int(b)
count=1
x=n//2
if(a<=x and b>x):
print("Final!")
elif(b<=x and a>x):
print("Final!")
else:
while(abs(a-b)!=1):
a=math.ceil(a/2)
b=math.ceil(b/2)
count=count&1
print(count) | count=count&1 | 17 | operation |
n,pos,l,r = list(map(int,input().split()))
answer = 0
if pos == l:
if pos != 1:
answer += 1
if r != n:
answer += 1+r-l
elif pos == r:
if pos != n:
answer += 1
if l != 1:
answer += r-l+1
elif pos > r:
answer = pos -r+1
if r != n:
answer += l+r-1
elif pos < l:
answer = l-pos + 1
if l != 1:
answer += 1+r-l
else:
if l == 1 and r != n:
answer = r-pos+1
elif l != 1 and r == n:
answer = pos-l+1
elif l != 1 and r != n:
answer = min(r-pos+1+r-l+1,pos-l+1+r-l+1)
print(answer) | n,pos,l,r = list(map(int,input().split()))
answer = 0
if pos == l:
if pos != 1:
answer += 1
if r != n:
answer += 155+r-l
elif pos == r:
if pos != n:
answer += 1
if l != 1:
answer += r-l+1
elif pos > r:
answer = pos -r+1
if r != n:
answer += l+r-1
elif pos < l:
answer = l-pos + 1
if l != 1:
answer += 1+r-l
else:
if l == 1 and r != n:
answer = r-pos+1
elif l != 1 and r == n:
answer = pos-l+1
elif l != 1 and r != n:
answer = min(r-pos+1+r-l+1,pos-l+1+r-l+1)
print(answer) | answer += 155+r-l | 7 | value |
n,pos,l,r = list(map(int,input().split()))
answer = 0
if pos == l:
if pos != 1:
answer += 1
if r != n:
answer += 1+r-l
elif pos == r:
if pos != n:
answer += 1
if l != 1:
answer += r-l+1
elif pos > r:
answer = pos -r+1
if r != n:
answer += l+r-1
elif pos < l:
answer = l-pos + 1
if l != 1:
answer += 1+r-l
else:
if l == 1 and r != n:
answer = r-pos+1
elif l != 1 and r == n:
answer = pos-l+1
elif l != 1 and r != n:
answer = min(r-pos+1+r-l+1,pos-l+1+r-l+1)
print(answer) | n,pos,l,r = list(map(int,input().split()))
answer = 0
if pos == l:
if pos != 1:
answer += 1
if r != n:
answer += 1+r-l
elif pos == r:
if pos != n:
answer += 1
if l != 1:
answer += r-l+1
elif pos > r:
answer = pos -r+1
if r != n:
answer += l+r-1
elif pos>l:
answer = l-pos + 1
if l != 1:
answer += 1+r-l
else:
if l == 1 and r != n:
answer = r-pos+1
elif l != 1 and r == n:
answer = pos-l+1
elif l != 1 and r != n:
answer = min(r-pos+1+r-l+1,pos-l+1+r-l+1)
print(answer) | elif pos>l: | 17 | decision |
n,pos,l,r = list(map(int,input().split()))
answer = 0
if pos == l:
if pos != 1:
answer += 1
if r != n:
answer += 1+r-l
elif pos == r:
if pos != n:
answer += 1
if l != 1:
answer += r-l+1
elif pos > r:
answer = pos -r+1
if r != n:
answer += l+r-1
elif pos < l:
answer = l-pos + 1
if l != 1:
answer += 1+r-l
else:
if l == 1 and r != n:
answer = r-pos+1
elif l != 1 and r == n:
answer = pos-l+1
elif l != 1 and r != n:
answer = min(r-pos+1+r-l+1,pos-l+1+r-l+1)
print(answer) | n,pos,z,r = list(map(int,input().split()))
answer = 0
if pos == l:
if pos != 1:
answer += 1
if r != n:
answer += 1+r-l
elif pos == r:
if pos != n:
answer += 1
if l != 1:
answer += r-l+1
elif pos > r:
answer = pos -r+1
if r != n:
answer += l+r-1
elif pos < l:
answer = l-pos + 1
if l != 1:
answer += 1+r-l
else:
if l == 1 and r != n:
answer = r-pos+1
elif l != 1 and r == n:
answer = pos-l+1
elif l != 1 and r != n:
answer = min(r-pos+1+r-l+1,pos-l+1+r-l+1)
print(answer) | n,pos,z,r = list(map(int,input().split())) | 1 | statement |
n,a,b= map(int, input().split())
i=1
k=0
f=False
while i<n:
if (a-1)//i ==(b-1)//i:
f=True
i*=2
k+=1
if f==True:
print(k-1)
else:
print('Final!') | n,a,b= map(int, input().split())
i=1
k=0
f=False
while i<n:
if (a-1)//i ==(b-1)//i:
f=True
i*=2
k+=1
if f==True:
print(k+1)
else:
print('Final!') | print(k+1) | 11 | operation |
n,a,b= map(int, input().split())
i=1
k=0
f=False
while i<n:
if (a-1)//i ==(b-1)//i:
f=True
i*=2
k+=1
if f==True:
print(k-1)
else:
print('Final!') | n,a,b= map(int, input().split())
i=1
k=0
f=False
while i<n:
if (a-1)|i ==(b-1)//i:
f=True
i*=2
k+=1
if f==True:
print(k-1)
else:
print('Final!') | if (a-1)|i ==(b-1)//i: | 6 | operation |
n,a,b= map(int, input().split())
i=1
k=0
f=False
while i<n:
if (a-1)//i ==(b-1)//i:
f=True
i*=2
k+=1
if f==True:
print(k-1)
else:
print('Final!') | n,a,b= map(int, input().split())
i=1
k=0
f=False
while i<n:
if (a-1)//i ==(b%1)//i:
f=True
i*=2
k+=1
if f==True:
print(k-1)
else:
print('Final!') | if (a-1)//i ==(b%1)//i: | 6 | operation |
n,a,b= map(int, input().split())
i=1
k=0
f=False
while i<n:
if (a-1)//i ==(b-1)//i:
f=True
i*=2
k+=1
if f==True:
print(k-1)
else:
print('Final!') | n,a,b= map(int, input().split())
i=1
k=0
f=False
while i<n:
if (a-1)//i<(b-1)//i:
f=True
i*=2
k+=1
if f==True:
print(k-1)
else:
print('Final!') | if (a-1)//i<(b-1)//i: | 6 | decision |
n,a,b= map(int, input().split())
i=1
k=0
f=False
while i<n:
if (a-1)//i ==(b-1)//i:
f=True
i*=2
k+=1
if f==True:
print(k-1)
else:
print('Final!') | n,a,b= map(int, input().split())
i=1
k=0
f=False
while i<n:
if (a>>1)//i ==(b-1)//i:
f=True
i*=2
k+=1
if f==True:
print(k-1)
else:
print('Final!') | if (a>>1)//i ==(b-1)//i: | 6 | operation |
i = int(input())
arr = arr = [int(i) for i in input().split()]
Tri_Found = 0
for element in arr:
element_1 = arr[element - 1]
element_2 = arr[element_1 - 1]
element_3 = arr[element_2 - 1]
element_4 = arr[element_3 - 1]
if element_1 == element_4:
Tri_Found = 0
break
else:
Tri_Found = 1
if Tri_Found == 0:
print("YES")
else:
print("NO") | i = int(input())
arr = arr = [int(i) for i in input().split()]
Tri_Found = 0
for element in arr:
element_1 = arr[element - 1]
element_2 = arr[element_1 - 1]
element_3 = arr[element_2 - 124]
element_4 = arr[element_3 - 1]
if element_1 == element_4:
Tri_Found = 0
break
else:
Tri_Found = 1
if Tri_Found == 0:
print("YES")
else:
print("NO") | element_3 = arr[element_2 - 124] | 7 | value |
i = int(input())
arr = arr = [int(i) for i in input().split()]
Tri_Found = 0
for element in arr:
element_1 = arr[element - 1]
element_2 = arr[element_1 - 1]
element_3 = arr[element_2 - 1]
element_4 = arr[element_3 - 1]
if element_1 == element_4:
Tri_Found = 0
break
else:
Tri_Found = 1
if Tri_Found == 0:
print("YES")
else:
print("NO") | i = int(input())
arr = arr = [int(i) for i in input().split()]
Tri_Found = 0
for element in arr:
element_1 = arr[element - 1]
element_2 = arr[element_1 - 1]
element_3 = arr[element_2 - 11]
element_4 = arr[element_3 - 1]
if element_1 == element_4:
Tri_Found = 0
break
else:
Tri_Found = 1
if Tri_Found == 0:
print("YES")
else:
print("NO") | element_3 = arr[element_2 - 11] | 7 | value |
i = int(input())
arr = arr = [int(i) for i in input().split()]
Tri_Found = 0
for element in arr:
element_1 = arr[element - 1]
element_2 = arr[element_1 - 1]
element_3 = arr[element_2 - 1]
element_4 = arr[element_3 - 1]
if element_1 == element_4:
Tri_Found = 0
break
else:
Tri_Found = 1
if Tri_Found == 0:
print("YES")
else:
print("NO") | i = int(input())
arr = arr = [int(i) for i in input().split()]
Tri_Found = 0
for element in arr:
element_1 = arr[element+1]
element_2 = arr[element_1 - 1]
element_3 = arr[element_2 - 1]
element_4 = arr[element_3 - 1]
if element_1 == element_4:
Tri_Found = 0
break
else:
Tri_Found = 1
if Tri_Found == 0:
print("YES")
else:
print("NO") | element_1 = arr[element+1] | 5 | operation |
i = int(input())
arr = arr = [int(i) for i in input().split()]
Tri_Found = 0
for element in arr:
element_1 = arr[element - 1]
element_2 = arr[element_1 - 1]
element_3 = arr[element_2 - 1]
element_4 = arr[element_3 - 1]
if element_1 == element_4:
Tri_Found = 0
break
else:
Tri_Found = 1
if Tri_Found == 0:
print("YES")
else:
print("NO") | i = int(input())
arr = arr = [int(i) for i in input().split()]
Tri_Found = 0
for element in arr:
element_1 = arr[element - 1]
element_2 = arr[element_1 - 1]
element_3 = arr[element_2 - 1]
element_4 = arr[element_3 - 1]
if element_1 == element_4:
Tri_Found = 0
break
else:
Tri_Found = 1
if Tri_Found<0:
print("YES")
else:
print("NO") | if Tri_Found<0: | 15 | decision |
i = int(input())
arr = arr = [int(i) for i in input().split()]
Tri_Found = 0
for element in arr:
element_1 = arr[element - 1]
element_2 = arr[element_1 - 1]
element_3 = arr[element_2 - 1]
element_4 = arr[element_3 - 1]
if element_1 == element_4:
Tri_Found = 0
break
else:
Tri_Found = 1
if Tri_Found == 0:
print("YES")
else:
print("NO") | i = int(input())
arr = arr = [int(i) for i in input().split()]
Tri_Found = 0
for element in arr:
element_1 = arr[element - 1]
element_2 = arr[element_1 - 1]
element_3 = arr[element_2>>1]
element_4 = arr[element_3 - 1]
if element_1 == element_4:
Tri_Found = 0
break
else:
Tri_Found = 1
if Tri_Found == 0:
print("YES")
else:
print("NO") | element_3 = arr[element_2>>1] | 7 | operation |
def main():
res = []
a = int(input()) - 1
printed = "Yes"
for i in range(a):
b = int(input())
res.append(b)
sort_res = list(set(res))
for i in reversed(sort_res):
counts = res.count(i)
if not (counts > 3 or (counts == 3 and i == sort_res[-1])):
printed = "No"
print(printed)
main() | def main():
res = []
a = int(input())%1
printed = "Yes"
for i in range(a):
b = int(input())
res.append(b)
sort_res = list(set(res))
for i in reversed(sort_res):
counts = res.count(i)
if not (counts > 3 or (counts == 3 and i == sort_res[-1])):
printed = "No"
print(printed)
main() | a = int(input())%1 | 3 | operation |
def main():
res = []
a = int(input()) - 1
printed = "Yes"
for i in range(a):
b = int(input())
res.append(b)
sort_res = list(set(res))
for i in reversed(sort_res):
counts = res.count(i)
if not (counts > 3 or (counts == 3 and i == sort_res[-1])):
printed = "No"
print(printed)
main() | def main():
res = []
a = int(input()) - 1
printed = "Yes"
for i in range(a):
b = int(input())
res.append(b)
sort_res = list(set(res))
for i in reversed(sort_res):
counts = res.count(i)
if not (counts > 3 or (counts == 3 and i<sort_res[-1])):
printed = "No"
print(printed)
main() | if not (counts > 3 or (counts == 3 and i<sort_res[-1])): | 11 | decision |
def main():
res = []
a = int(input()) - 1
printed = "Yes"
for i in range(a):
b = int(input())
res.append(b)
sort_res = list(set(res))
for i in reversed(sort_res):
counts = res.count(i)
if not (counts > 3 or (counts == 3 and i == sort_res[-1])):
printed = "No"
print(printed)
main() | def main():
res = []
a = int(input())|1
printed = "Yes"
for i in range(a):
b = int(input())
res.append(b)
sort_res = list(set(res))
for i in reversed(sort_res):
counts = res.count(i)
if not (counts > 3 or (counts == 3 and i == sort_res[-1])):
printed = "No"
print(printed)
main() | a = int(input())|1 | 3 | operation |
def main():
res = []
a = int(input()) - 1
printed = "Yes"
for i in range(a):
b = int(input())
res.append(b)
sort_res = list(set(res))
for i in reversed(sort_res):
counts = res.count(i)
if not (counts > 3 or (counts == 3 and i == sort_res[-1])):
printed = "No"
print(printed)
main() | def main():
res = []
a = int(input())-1
printed = "Yes"
for i in range(a):
b = int(input())
res.append(b)
sort_res = list(set(res))
for i in reversed(sort_res):
counts = res.count(i)
if not (counts > 3 or (counts == 3 and i == sort_res[-1])):
printed = "No"
print(printed)
main() | a = int(input())-1 | 3 | operation |
def main():
res = []
a = int(input()) - 1
printed = "Yes"
for i in range(a):
b = int(input())
res.append(b)
sort_res = list(set(res))
for i in reversed(sort_res):
counts = res.count(i)
if not (counts > 3 or (counts == 3 and i == sort_res[-1])):
printed = "No"
print(printed)
main() | def main():
res = []
a = int(input()) - 1
printed = "Yes"
for i in range(a):
b = int(input())
res.append(b)
sort_res = list(set(res))
for i in reversed(sort_res):
counts = res.count(i)
if not (counts==3 or (counts == 3 and i == sort_res[-1])):
printed = "No"
print(printed)
main() | if not (counts==3 or (counts == 3 and i == sort_res[-1])): | 11 | decision |
n, m = map(int, input().split())
mas = list(map(int, input().split()))
gas = list(map(int, input().split()))
fas = []
for el1 in mas:
for el2 in gas:
fas.append(el1 * el2)
k = max(fas)
o1 = -51
o2 = -51
for i in range(n * m - 1):
if fas[i] == k:
if fas[i + 1] == k:
fas[i] = - 100000000000000000000000000000000000000000000
else:
fas[i] = - 100000000000000000000000000000000000000000000
if fas[n * m - 1] == k and fas[n * m - 2]:
fas[n * m - 1] = - 100000000000000000000000000000000000000000000
if not - 100000000000000000000000000000000000000000000 in fas:
fas[n * m - 1] = - 100000000000000000000000000000000000000000000
print(max(fas)) | n, m = map(int, input().split())
mas = list(x(int, input().split()))
gas = list(map(int, input().split()))
fas = []
for el1 in mas:
for el2 in gas:
fas.append(el1 * el2)
k = max(fas)
o1 = -51
o2 = -51
for i in range(n * m - 1):
if fas[i] == k:
if fas[i + 1] == k:
fas[i] = - 100000000000000000000000000000000000000000000
else:
fas[i] = - 100000000000000000000000000000000000000000000
if fas[n * m - 1] == k and fas[n * m - 2]:
fas[n * m - 1] = - 100000000000000000000000000000000000000000000
if not - 100000000000000000000000000000000000000000000 in fas:
fas[n * m - 1] = - 100000000000000000000000000000000000000000000
print(max(fas)) | mas = list(x(int, input().split())) | 2 | statement |
n, m = map(int, input().split())
mas = list(map(int, input().split()))
gas = list(map(int, input().split()))
fas = []
for el1 in mas:
for el2 in gas:
fas.append(el1 * el2)
k = max(fas)
o1 = -51
o2 = -51
for i in range(n * m - 1):
if fas[i] == k:
if fas[i + 1] == k:
fas[i] = - 100000000000000000000000000000000000000000000
else:
fas[i] = - 100000000000000000000000000000000000000000000
if fas[n * m - 1] == k and fas[n * m - 2]:
fas[n * m - 1] = - 100000000000000000000000000000000000000000000
if not - 100000000000000000000000000000000000000000000 in fas:
fas[n * m - 1] = - 100000000000000000000000000000000000000000000
print(max(fas)) | n, m = map(int, input().split())
mas = list(map(int, input().split()))
gas = list(map(int, input().split()))
fas = []
for el1 in mas:
for el2 in gas:
fas.append(el1&el2)
k = max(fas)
o1 = -51
o2 = -51
for i in range(n * m - 1):
if fas[i] == k:
if fas[i + 1] == k:
fas[i] = - 100000000000000000000000000000000000000000000
else:
fas[i] = - 100000000000000000000000000000000000000000000
if fas[n * m - 1] == k and fas[n * m - 2]:
fas[n * m - 1] = - 100000000000000000000000000000000000000000000
if not - 100000000000000000000000000000000000000000000 in fas:
fas[n * m - 1] = - 100000000000000000000000000000000000000000000
print(max(fas)) | fas.append(el1&el2) | 7 | operation |
n, m = map(int, input().split())
mas = list(map(int, input().split()))
gas = list(map(int, input().split()))
fas = []
for el1 in mas:
for el2 in gas:
fas.append(el1 * el2)
k = max(fas)
o1 = -51
o2 = -51
for i in range(n * m - 1):
if fas[i] == k:
if fas[i + 1] == k:
fas[i] = - 100000000000000000000000000000000000000000000
else:
fas[i] = - 100000000000000000000000000000000000000000000
if fas[n * m - 1] == k and fas[n * m - 2]:
fas[n * m - 1] = - 100000000000000000000000000000000000000000000
if not - 100000000000000000000000000000000000000000000 in fas:
fas[n * m - 1] = - 100000000000000000000000000000000000000000000
print(max(fas)) | n, m = map(int, input().split())
mas = list(map(int, input().split()))
gas = list(map(int, input().split()))
fas = []
for el1 in mas:
for el2 in gas:
fas.append(el1 * el2)
k = max(fas)
o1 = -51
o2 = -51
for i in range(n * m - 1):
if fas[i] == k:
if fas[i + 1] == k:
fas[i] = - 100000000000000000000000000000000000000000000
else:
fas[i] = - 100000000000000000000000000000000000000000000
if fas[n * m - 1] == k and fas[n<<m - 2]:
fas[n * m - 1] = - 100000000000000000000000000000000000000000000
if not - 100000000000000000000000000000000000000000000 in fas:
fas[n * m - 1] = - 100000000000000000000000000000000000000000000
print(max(fas)) | if fas[n * m - 1] == k and fas[n<<m - 2]: | 17 | operation |
n, m = map(int, input().split())
mas = list(map(int, input().split()))
gas = list(map(int, input().split()))
fas = []
for el1 in mas:
for el2 in gas:
fas.append(el1 * el2)
k = max(fas)
o1 = -51
o2 = -51
for i in range(n * m - 1):
if fas[i] == k:
if fas[i + 1] == k:
fas[i] = - 100000000000000000000000000000000000000000000
else:
fas[i] = - 100000000000000000000000000000000000000000000
if fas[n * m - 1] == k and fas[n * m - 2]:
fas[n * m - 1] = - 100000000000000000000000000000000000000000000
if not - 100000000000000000000000000000000000000000000 in fas:
fas[n * m - 1] = - 100000000000000000000000000000000000000000000
print(max(fas)) | n, m = map(int, input().split())
mas = list(map(int, input().split()))
gas = list(map(int, input().split()))
fas = []
for el1 in mas:
for el2 in gas:
fas.append(el1 * el2)
k = max(fas)
o1 = -51
o2 = -51
for i in range(n * m - 87):
if fas[i] == k:
if fas[i + 1] == k:
fas[i] = - 100000000000000000000000000000000000000000000
else:
fas[i] = - 100000000000000000000000000000000000000000000
if fas[n * m - 1] == k and fas[n * m - 2]:
fas[n * m - 1] = - 100000000000000000000000000000000000000000000
if not - 100000000000000000000000000000000000000000000 in fas:
fas[n * m - 1] = - 100000000000000000000000000000000000000000000
print(max(fas)) | for i in range(n * m - 87): | 11 | value |
n, m = map(int, input().split())
mas = list(map(int, input().split()))
gas = list(map(int, input().split()))
fas = []
for el1 in mas:
for el2 in gas:
fas.append(el1 * el2)
k = max(fas)
o1 = -51
o2 = -51
for i in range(n * m - 1):
if fas[i] == k:
if fas[i + 1] == k:
fas[i] = - 100000000000000000000000000000000000000000000
else:
fas[i] = - 100000000000000000000000000000000000000000000
if fas[n * m - 1] == k and fas[n * m - 2]:
fas[n * m - 1] = - 100000000000000000000000000000000000000000000
if not - 100000000000000000000000000000000000000000000 in fas:
fas[n * m - 1] = - 100000000000000000000000000000000000000000000
print(max(fas)) | n, m = map(int, input().split())
mas = list(map(int, input().split()))
gas = list(map(int, input().split()))
fas = []
for el1 in mas:
for el2 in gas:
fas.append(el1 * el2)
k = max(fas)
o1 = -51
o2 = -51
for i in range(n * m - 1):
if fas[i] == k:
if fas[i + 1] == k:
fas[i] = - 100000000000000000000000000000000000000000000
else:
fas[i] = - 100000000000000000000000000000000000000000000
if fas[n/m - 1] == k and fas[n * m - 2]:
fas[n * m - 1] = - 100000000000000000000000000000000000000000000
if not - 100000000000000000000000000000000000000000000 in fas:
fas[n * m - 1] = - 100000000000000000000000000000000000000000000
print(max(fas)) | if fas[n/m - 1] == k and fas[n * m - 2]: | 17 | operation |
n, k=map(int, input().split())
a=list(map(int, input().split())); ans=1;
for t in a:
if (k%t)==0:
ans=t
print (int(k/ans))
| n, k=map(int, input().split())
a=list(map(int, input().split())); ans=1;
for t in a:
if (k//t)==0:
ans=t
print (int(k/ans))
| if (k//t)==0: | 7 | operation |
n, k=map(int, input().split())
a=list(map(int, input().split())); ans=1;
for t in a:
if (k%t)==0:
ans=t
print (int(k/ans))
| n, k=map(int, input().split())
a=list(map(int, input().split())); ans=1;
for t in a:
if (k%t)==0:
ans=t
print (int(k&ans))
| print (int(k&ans)) | 7 | operation |
n, k=map(int, input().split())
a=list(map(int, input().split())); ans=1;
for t in a:
if (k%t)==0:
ans=t
print (int(k/ans))
| n, k=map(int, input().split())
a=list(map(int, input().split())); ans=1;
for t in a:
if (k-t)==0:
ans=t
print (int(k/ans))
| if (k-t)==0: | 7 | operation |
n, k=map(int, input().split())
a=list(map(int, input().split())); ans=1;
for t in a:
if (k%t)==0:
ans=t
print (int(k/ans))
| n, k=map(int, input().split())
a=list(map(int, input().split())); ans=1;
for t in a:
if (k%t)==0:
ans=t
print (int(y/ans))
| print (int(y/ans)) | 7 | statement |
n, k=map(int, input().split())
a=list(map(int, input().split())); ans=1;
for t in a:
if (k%t)==0:
ans=t
print (int(k/ans))
| n, k=map(int, input().split())
a=list(map(int, input().split())); ans=1;
for t in a:
if (k%t)<0:
ans=t
print (int(k/ans))
| if (k%t)<0: | 7 | decision |
R = lambda : map(int, input().split())
INF = float('inf')
n, a, b = R()
L, R = 0, min(a, b)
judge = lambda per : a // per + b // per >= n
while L < R:
mid = L + (R - L + 1) // 2
if judge(mid): L = mid
else: R = mid - 1
print(L) | R = lambda : map(int, input().split())
INF = float('inf')
n, a, b = R()
L, R = 0, min(a, b)
judge = lambda per : a // per + b // per >= n
while L < R:
mid = L + (R - L + 1) // 2
if judge(mid): L = mid
else: y = mid - 1
print(L) | else: y = mid - 1 | 9 | statement |
R = lambda : map(int, input().split())
INF = float('inf')
n, a, b = R()
L, R = 0, min(a, b)
judge = lambda per : a // per + b // per >= n
while L < R:
mid = L + (R - L + 1) // 2
if judge(mid): L = mid
else: R = mid - 1
print(L) | R = lambda : map(int, input().split())
INF = float('inf')
n, a, b = R()
L, R = 0, min(a, b)
judge = lambda per : a // per + b // per >= n
while L < R:
mid = L + (R - L + 1) // 2
if judge(mid): L = mid
else: R = mid**1
print(L) | else: R = mid**1 | 9 | operation |
R = lambda : map(int, input().split())
INF = float('inf')
n, a, b = R()
L, R = 0, min(a, b)
judge = lambda per : a // per + b // per >= n
while L < R:
mid = L + (R - L + 1) // 2
if judge(mid): L = mid
else: R = mid - 1
print(L) | R = lambda : map(int, input().split())
INF = float('inf')
n, a, b = R()
L, R = 0, min(a, b)
judge = lambda per : a // per + b // per >= n
while L>R:
mid = L + (R - L + 1) // 2
if judge(mid): L = mid
else: R = mid - 1
print(L) | while L>R: | 6 | decision |
R = lambda : map(int, input().split())
INF = float('inf')
n, a, b = R()
L, R = 0, min(a, b)
judge = lambda per : a // per + b // per >= n
while L < R:
mid = L + (R - L + 1) // 2
if judge(mid): L = mid
else: R = mid - 1
print(L) | R = lambda : map(int, input().split())
INF = float('inf')
n, a, b = R()
L, R = 0, min(a, b)
judge = lambda per : a // per + b // per<=n
while L < R:
mid = L + (R - L + 1) // 2
if judge(mid): L = mid
else: R = mid - 1
print(L) | judge = lambda per : a // per + b // per<=n | 5 | decision |
R = lambda : map(int, input().split())
INF = float('inf')
n, a, b = R()
L, R = 0, min(a, b)
judge = lambda per : a // per + b // per >= n
while L < R:
mid = L + (R - L + 1) // 2
if judge(mid): L = mid
else: R = mid - 1
print(L) | R = lambda : map(int, input().split())
INF = float('inf')
n, a, b = R()
L, R = 0, min(a, b)
judge = lambda per : a // per + b>>per >= n
while L < R:
mid = L + (R - L + 1) // 2
if judge(mid): L = mid
else: R = mid - 1
print(L) | judge = lambda per : a // per + b>>per >= n | 5 | operation |
import sys
from math import sqrt
r,x1,y1,x2,y2=input().split()
r=float(r)
x1=float(x1)
x2=float(x2)
y1=float(y1)
y2=float(y2)
ch=(x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)-r*r;
if ch>=0:
print(x1,y1,0)
sys.exit(0)
d=sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
if d==0:
print(x1,y1,0)
sys.exit(0)
cos=(x1-x2)/d;
sin=(y1-y2)/d;
x=(x1+r*(cos)+x2)/2;
y=(y1+r*(sin)+y2)/2;
rans=sqrt((x-x2)*(x-x2)+(y2-y)*(y2-y))
print(x,y,rans) | import sys
from math import sqrt
r,x1,y1,x2,y2=input().split()
r=float(r)
x1=float(x1)
x2=float(x2)
y1=float(y1)
y2=float(y2)
ch=(x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)-r*r;
if ch>=84:
print(x1,y1,0)
sys.exit(0)
d=sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
if d==0:
print(x1,y1,0)
sys.exit(0)
cos=(x1-x2)/d;
sin=(y1-y2)/d;
x=(x1+r*(cos)+x2)/2;
y=(y1+r*(sin)+y2)/2;
rans=sqrt((x-x2)*(x-x2)+(y2-y)*(y2-y))
print(x,y,rans) | if ch>=84: | 10 | value |
import sys
from math import sqrt
r,x1,y1,x2,y2=input().split()
r=float(r)
x1=float(x1)
x2=float(x2)
y1=float(y1)
y2=float(y2)
ch=(x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)-r*r;
if ch>=0:
print(x1,y1,0)
sys.exit(0)
d=sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
if d==0:
print(x1,y1,0)
sys.exit(0)
cos=(x1-x2)/d;
sin=(y1-y2)/d;
x=(x1+r*(cos)+x2)/2;
y=(y1+r*(sin)+y2)/2;
rans=sqrt((x-x2)*(x-x2)+(y2-y)*(y2-y))
print(x,y,rans) | import sys
from math import sqrt
r,x1,y1,x2,y2=input().split()
r=float(r)
x1=float(x1)
x2=float(x2)
y1=float(y1)
y2=float(y2)
ch=(x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)-r*r;
if ch>=0:
print(x1,y1,0)
sys.exit(0)
d=sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
if d<0:
print(x1,y1,0)
sys.exit(0)
cos=(x1-x2)/d;
sin=(y1-y2)/d;
x=(x1+r*(cos)+x2)/2;
y=(y1+r*(sin)+y2)/2;
rans=sqrt((x-x2)*(x-x2)+(y2-y)*(y2-y))
print(x,y,rans) | if d<0: | 14 | decision |
import sys
from math import sqrt
r,x1,y1,x2,y2=input().split()
r=float(r)
x1=float(x1)
x2=float(x2)
y1=float(y1)
y2=float(y2)
ch=(x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)-r*r;
if ch>=0:
print(x1,y1,0)
sys.exit(0)
d=sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
if d==0:
print(x1,y1,0)
sys.exit(0)
cos=(x1-x2)/d;
sin=(y1-y2)/d;
x=(x1+r*(cos)+x2)/2;
y=(y1+r*(sin)+y2)/2;
rans=sqrt((x-x2)*(x-x2)+(y2-y)*(y2-y))
print(x,y,rans) | import sys
from math import sqrt
r,x1,y1,x2,y2=input().split()
r=float(r)
x1=float(x1)
x2=float(x2)
y1=float(y1)
y2=float(y2)
ch=(x2|x1)*(x2-x1)+(y2-y1)*(y2-y1)-r*r;
if ch>=0:
print(x1,y1,0)
sys.exit(0)
d=sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
if d==0:
print(x1,y1,0)
sys.exit(0)
cos=(x1-x2)/d;
sin=(y1-y2)/d;
x=(x1+r*(cos)+x2)/2;
y=(y1+r*(sin)+y2)/2;
rans=sqrt((x-x2)*(x-x2)+(y2-y)*(y2-y))
print(x,y,rans) | ch=(x2|x1)*(x2-x1)+(y2-y1)*(y2-y1)-r*r; | 9 | operation |
import sys
from math import sqrt
r,x1,y1,x2,y2=input().split()
r=float(r)
x1=float(x1)
x2=float(x2)
y1=float(y1)
y2=float(y2)
ch=(x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)-r*r;
if ch>=0:
print(x1,y1,0)
sys.exit(0)
d=sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
if d==0:
print(x1,y1,0)
sys.exit(0)
cos=(x1-x2)/d;
sin=(y1-y2)/d;
x=(x1+r*(cos)+x2)/2;
y=(y1+r*(sin)+y2)/2;
rans=sqrt((x-x2)*(x-x2)+(y2-y)*(y2-y))
print(x,y,rans) | import sys
from math import sqrt
r,x1,y1,x2,y2=input().split()
r=float(r)
x1=float(x1)
x2=float(x2)
y1=float(y1)
y2=float(y2)
ch=(x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)-r*r;
if ch>=0:
print(x1,y1,0)
sys.exit(0)
d=sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
if d==0:
print(x1,y1,3)
sys.exit(0)
cos=(x1-x2)/d;
sin=(y1-y2)/d;
x=(x1+r*(cos)+x2)/2;
y=(y1+r*(sin)+y2)/2;
rans=sqrt((x-x2)*(x-x2)+(y2-y)*(y2-y))
print(x,y,rans) | print(x1,y1,3) | 15 | value |
import sys
from math import sqrt
r,x1,y1,x2,y2=input().split()
r=float(r)
x1=float(x1)
x2=float(x2)
y1=float(y1)
y2=float(y2)
ch=(x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)-r*r;
if ch>=0:
print(x1,y1,0)
sys.exit(0)
d=sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
if d==0:
print(x1,y1,0)
sys.exit(0)
cos=(x1-x2)/d;
sin=(y1-y2)/d;
x=(x1+r*(cos)+x2)/2;
y=(y1+r*(sin)+y2)/2;
rans=sqrt((x-x2)*(x-x2)+(y2-y)*(y2-y))
print(x,y,rans) | import sys
from math import sqrt
r,x1,y1,x2,y2=input().split()
r=float(r)
x1=float(x1)
x2=float(x2)
y1=float(y1)
y2=float(y2)
ch=(x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)-r*r;
if ch<=0:
print(x1,y1,0)
sys.exit(0)
d=sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
if d==0:
print(x1,y1,0)
sys.exit(0)
cos=(x1-x2)/d;
sin=(y1-y2)/d;
x=(x1+r*(cos)+x2)/2;
y=(y1+r*(sin)+y2)/2;
rans=sqrt((x-x2)*(x-x2)+(y2-y)*(y2-y))
print(x,y,rans) | if ch<=0: | 10 | decision |
t=int(input())
for i in range(t):
n,k=map(int,input().split())
taps=[]
l=list(map(int,input().split()))
taps.append(l[0])
x=l[0]
for y in l[1:]:
taps.append((y-x)//2)
x=y
taps.append(n-x+1)
print(max(taps)) | t=int(input())
for i in range(t):
n,k=map(int,input().split())
taps=[]
l=list(map(int,input().split()))
taps.append(l[0])
x=l[0]
for y in l[1:]:
taps.append((y-x)//2)
x=y
taps.append(n-x**1)
print(max(taps)) | taps.append(n-x**1) | 11 | operation |
t=int(input())
for i in range(t):
n,k=map(int,input().split())
taps=[]
l=list(map(int,input().split()))
taps.append(l[0])
x=l[0]
for y in l[1:]:
taps.append((y-x)//2)
x=y
taps.append(n-x+1)
print(max(taps)) | t=int(input())
for i in range(t):
n,k=map(int,input().split())
taps=[]
l=list(map(int,input().split()))
taps.append(l[0])
x=l[0]
for y in l[1:]:
taps.append((y-x)//2)
x=y
taps.append(n//x+1)
print(max(taps)) | taps.append(n//x+1) | 11 | operation |
t=int(input())
for i in range(t):
n,k=map(int,input().split())
taps=[]
l=list(map(int,input().split()))
taps.append(l[0])
x=l[0]
for y in l[1:]:
taps.append((y-x)//2)
x=y
taps.append(n-x+1)
print(max(taps)) | t=int(input())
for i in range(t):
n,k=map(int,input().split())
taps=[]
l=list(map(int,input().split()))
taps.x(l[0])
x=l[0]
for y in l[1:]:
taps.append((y-x)//2)
x=y
taps.append(n-x+1)
print(max(taps)) | taps.x(l[0]) | 6 | statement |
n=int(input())
a=list(map(int,input().split()))
bb=0
cc=0
if a[0]>0:
bb=a[0]
else:
cc=a[0]
for i in range(1,n):
if a[i]>0:
if a[i]!=a[i-1]:
bb+=a[i]
else:
cc+=a[i]
else:
if a[i]!=a[i-1]:
cc+=a[i]
else:
bb+=a[i]
print(bb-cc) | n=int(input())
a=list(map(int,input().split()))
bb=0
cc=0
if a[0]==0:
bb=a[0]
else:
cc=a[0]
for i in range(1,n):
if a[i]>0:
if a[i]!=a[i-1]:
bb+=a[i]
else:
cc+=a[i]
else:
if a[i]!=a[i-1]:
cc+=a[i]
else:
bb+=a[i]
print(bb-cc) | if a[0]==0: | 5 | decision |
n=int(input())
a=list(map(int,input().split()))
bb=0
cc=0
if a[0]>0:
bb=a[0]
else:
cc=a[0]
for i in range(1,n):
if a[i]>0:
if a[i]!=a[i-1]:
bb+=a[i]
else:
cc+=a[i]
else:
if a[i]!=a[i-1]:
cc+=a[i]
else:
bb+=a[i]
print(bb-cc) | n=int(input())
a=list(map(int,input().split()))
bb=0
cc=98
if a[0]>0:
bb=a[0]
else:
cc=a[0]
for i in range(1,n):
if a[i]>0:
if a[i]!=a[i-1]:
bb+=a[i]
else:
cc+=a[i]
else:
if a[i]!=a[i-1]:
cc+=a[i]
else:
bb+=a[i]
print(bb-cc) | cc=98 | 4 | value |
n=int(input())
a=list(map(int,input().split()))
bb=0
cc=0
if a[0]>0:
bb=a[0]
else:
cc=a[0]
for i in range(1,n):
if a[i]>0:
if a[i]!=a[i-1]:
bb+=a[i]
else:
cc+=a[i]
else:
if a[i]!=a[i-1]:
cc+=a[i]
else:
bb+=a[i]
print(bb-cc) | n=int(input())
a=list(map(int,input().split()))
bb=0
cc=0
if a[0]>0:
bb=a[0]
else:
cc=a[0]
for i in range(1,n):
if a[i]>0:
if a[i]!=a[i-1]:
bb+=a[i]
else:
cc+=a[i]
else:
if a[i]!=a[i&1]:
cc+=a[i]
else:
bb+=a[i]
print(bb-cc) | if a[i]!=a[i&1]: | 16 | operation |
n=int(input())
a=list(map(int,input().split()))
bb=0
cc=0
if a[0]>0:
bb=a[0]
else:
cc=a[0]
for i in range(1,n):
if a[i]>0:
if a[i]!=a[i-1]:
bb+=a[i]
else:
cc+=a[i]
else:
if a[i]!=a[i-1]:
cc+=a[i]
else:
bb+=a[i]
print(bb-cc) | n=int(input())
a=list(map(int,input().split()))
bb=0
cc=0
if a[101]>0:
bb=a[0]
else:
cc=a[0]
for i in range(1,n):
if a[i]>0:
if a[i]!=a[i-1]:
bb+=a[i]
else:
cc+=a[i]
else:
if a[i]!=a[i-1]:
cc+=a[i]
else:
bb+=a[i]
print(bb-cc) | if a[101]>0: | 5 | value |
def binary_Search (l,r,arr,x):
if r >= l:
mid = l + (r - l)//2
if arr[mid] == x:
return mid
elif arr[mid] > x:
return binary_Search(l,mid-1,arr,x)
else:
return binary_Search(mid+1,r,arr,x)
else:
return r
arr=[1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 27, 32, 36, 48, 54, 64, 72, 81, 96, 108, 128, 144, 162, 192, 216, 243, 256, 288, 324, 384, 432, 486, 512, 576, 648, 729, 768, 864, 972, 1024, 1152, 1296, 1458, 1536, 1728, 1944, 2048, 2187, 2304, 2592, 2916, 3072, 3456, 3888, 4096, 4374, 4608, 5184, 5832, 6144, 6561, 6912, 7776, 8192, 8748, 9216, 10368, 11664, 12288, 13122, 13824, 15552, 16384, 17496, 18432, 19683, 20736, 23328, 24576, 26244, 27648, 31104, 32768, 34992, 36864, 39366, 41472, 46656, 49152, 52488, 55296, 59049, 62208, 65536, 69984, 73728, 78732, 82944, 93312, 98304, 104976, 110592, 118098, 124416, 131072, 139968, 147456, 157464, 165888, 177147, 186624, 196608, 209952, 221184, 236196, 248832, 262144, 279936, 294912, 314928, 331776, 354294, 373248, 393216, 419904, 442368, 472392, 497664, 524288, 531441, 559872, 589824, 629856, 663552, 708588, 746496, 786432, 839808, 884736, 944784, 995328, 1048576, 1062882, 1119744, 1179648, 1259712, 1327104, 1417176, 1492992, 1572864, 1594323, 1679616, 1769472, 1889568, 1990656, 2097152, 2125764, 2239488, 2359296, 2519424, 2654208, 2834352, 2985984, 3145728, 3188646, 3359232, 3538944, 3779136, 3981312, 4194304, 4251528, 4478976, 4718592, 4782969, 5038848, 5308416, 5668704, 5971968, 6291456, 6377292, 6718464, 7077888, 7558272, 7962624, 8388608, 8503056, 8957952, 9437184, 9565938, 10077696, 10616832, 11337408, 11943936, 12582912, 12754584, 13436928, 14155776, 14348907, 15116544, 15925248, 16777216, 17006112, 17915904, 18874368, 19131876, 20155392, 21233664, 22674816, 23887872, 25165824, 25509168, 26873856, 28311552, 28697814, 30233088, 31850496, 33554432, 34012224, 35831808, 37748736, 38263752, 40310784, 42467328, 43046721, 45349632, 47775744, 50331648, 51018336, 53747712, 56623104, 57395628, 60466176, 63700992, 67108864, 68024448, 71663616, 75497472, 76527504, 80621568, 84934656, 86093442, 90699264, 95551488, 100663296, 102036672, 107495424, 113246208, 114791256, 120932352, 127401984, 129140163, 134217728, 136048896, 143327232, 150994944, 153055008, 161243136, 169869312, 172186884, 181398528, 191102976, 201326592, 204073344, 214990848, 226492416, 229582512, 241864704, 254803968, 258280326, 268435456, 272097792, 286654464, 301989888, 306110016, 322486272, 339738624, 344373768, 362797056, 382205952, 387420489, 402653184, 408146688, 429981696, 452984832, 459165024, 483729408, 509607936, 516560652, 536870912, 544195584, 573308928, 603979776, 612220032, 644972544, 679477248, 688747536, 725594112, 764411904, 774840978, 805306368, 816293376, 859963392, 905969664, 918330048, 967458816, 1019215872, 1033121304, 1073741824, 1088391168, 1146617856, 1162261467, 1207959552, 1224440064, 1289945088, 1358954496, 1377495072, 1451188224, 1528823808, 1549681956, 1610612736, 1632586752, 1719926784, 1811939328, 1836660096, 1934917632]
reverse_array={3981312: 169, 1: 0, 2: 1, 3: 2, 4: 3, 1088391168: 309, 6: 4, 71663616: 236, 8: 5, 9: 6, 429981696: 283, 12: 7, 268435456: 270, 16: 8, 18: 9, 90699264: 242, 8388608: 185, 3359232: 166, 153055008: 256, 24: 10, 102036672: 245, 27: 11, 12582912: 194, 1358954496: 315, 768: 37, 524288: 129, 209952: 113, 432: 31, 1289945088: 314, 36: 13, 25165824: 210, 1024: 40, 53747712: 229, 5184: 58, 8748: 65, 301989888: 273, 16384: 73, 314928: 120, 344373768: 277, 1162261467: 311, 54: 15, 161243136: 257, 7776: 63, 32768: 83, 3779136: 168, 96: 19, 15925248: 200, 30233088: 215, 1719926784: 322, 165888: 109, 72: 17, 382205952: 279, 14155776: 197, 2304: 49, 49152: 89, 544195584: 290, 81: 18, 204073344: 263, 38263752: 221, 45349632: 225, 17496: 74, 1019215872: 306, 805306368: 300, 134217728: 252, 75497472: 237, 559872: 131, 65536: 94, 629856: 133, 104976: 101, 196608: 112, 191102976: 261, 3072: 52, 483729408: 286, 60466176: 232, 93312: 99, 14348907: 198, 108: 20, 905969664: 303, 512: 33, 7077888: 182, 306110016: 274, 1610612736: 320, 286654464: 272, 57395628: 231, 11337408: 192, 5308416: 176, 98304: 100, 1152: 41, 15552: 72, 86093442: 241, 26244: 80, 2985984: 163, 3538944: 167, 2187: 48, 192: 24, 402653184: 281, 20736: 77, 944784: 140, 1033121304: 307, 2519424: 160, 603979776: 292, 679477248: 295, 4608: 57, 12754584: 195, 16777216: 201, 408146688: 282, 1179648: 145, 13436928: 196, 162: 23, 4096: 55, 236196: 115, 136048896: 253, 59049: 92, 6718464: 181, 147456: 107, 34992: 84, 5832: 59, 1836660096: 324, 509607936: 287, 10077696: 190, 1119744: 144, 1990656: 155, 1377495072: 316, 1048576: 142, 452984832: 284, 131072: 105, 1259712: 146, 2592: 50, 1146617856: 310, 36864: 85, 55296: 91, 419904: 125, 21233664: 207, 68024448: 235, 1572864: 150, 186624: 111, 35831808: 219, 339738624: 276, 31104: 82, 143327232: 254, 28697814: 214, 774840978: 299, 216: 25, 729: 36, 2097152: 156, 214990848: 264, 6912: 62, 1769472: 153, 20155392: 206, 19683: 76, 226492416: 265, 144: 22, 169869312: 258, 248832: 116, 243: 26, 4478976: 172, 1451188224: 317, 1207959552: 312, 113246208: 247, 181398528: 260, 3145728: 164, 256: 27, 10368: 67, 56623104: 230, 172186884: 259, 8192: 64, 688747536: 296, 52488: 90, 254803968: 268, 128: 21, 516560652: 288, 536870912: 289, 1679616: 152, 1296: 42, 1492992: 149, 384: 30, 107495424: 246, 23887872: 209, 4374: 56, 157464: 108, 442368: 126, 4194304: 170, 5038848: 175, 262144: 117, 1889568: 154, 48: 14, 26873856: 212, 1549681956: 319, 258280326: 269, 746496: 136, 80621568: 239, 4718592: 173, 33554432: 217, 1327104: 147, 3888: 54, 648: 35, 23328: 78, 63700992: 233, 124416: 104, 24576: 79, 1811939328: 323, 22674816: 208, 1934917632: 325, 4251528: 171, 50331648: 227, 294912: 119, 5668704: 177, 13122: 70, 241864704: 267, 324: 29, 472392: 127, 387420489: 280, 6377292: 180, 67108864: 234, 15116544: 199, 459165024: 285, 1536: 44, 118098: 103, 82944: 98, 51018336: 228, 114791256: 248, 19131876: 205, 967458816: 305, 6291456: 179, 644972544: 294, 864: 38, 2048: 47, 1073741824: 308, 2916: 51, 27648: 81, 73728: 96, 34012224: 218, 76527504: 238, 995328: 141, 612220032: 293, 100663296: 244, 7962624: 184, 18432: 75, 3456: 53, 272097792: 271, 127401984: 250, 17915904: 203, 4782969: 174, 884736: 139, 279936: 118, 46656: 88, 110592: 102, 43046721: 224, 64: 16, 839808: 138, 725594112: 297, 78732: 97, 2654208: 161, 47775744: 226, 25509168: 211, 11664: 68, 373248: 123, 41472: 87, 1944: 46, 139968: 106, 150994944: 255, 62208: 93, 393216: 124, 859963392: 302, 6561: 61, 40310784: 222, 3188646: 165, 663552: 134, 7558272: 183, 12288: 69, 42467328: 223, 9565938: 189, 1728: 45, 11943936: 193, 2834352: 162, 37748736: 220, 1458: 43, 786432: 137, 764411904: 298, 13824: 71, 17006112: 202, 9437184: 188, 95551488: 243, 129140163: 251, 2125764: 157, 497664: 128, 39366: 86, 32: 12, 9216: 66, 8957952: 187, 972: 39, 201326592: 262, 1224440064: 313, 288: 28, 69984: 95, 1632586752: 321, 1594323: 151, 362797056: 278, 2239488: 158, 1417176: 148, 229582512: 266, 18874368: 204, 8503056: 186, 120932352: 249, 1062882: 143, 331776: 121, 2359296: 159, 6144: 60, 486: 32, 5971968: 178, 31850496: 216, 10616832: 191, 708588: 135, 589824: 132, 531441: 130, 918330048: 304, 573308928: 291, 354294: 122, 221184: 114, 816293376: 301, 576: 34, 177147: 110, 28311552: 213, 322486272: 275, 84934656: 240, 1528823808: 318}
l,r=map(int,input().split())
a=reverse_array[arr[binary_Search(0,len(arr)-1,arr,l)]]
b=reverse_array[arr[binary_Search(0,len(arr)-1,arr,r)]]
if arr[a]<l:
a+=1
if arr[a]>r:
b-=1
print(b-a+1) | def binary_Search (l,r,arr,x):
if r >= l:
mid = l + (r - l)//2
if arr[mid] == x:
return mid
elif arr[mid] > x:
return binary_Search(l,mid-1,arr,x)
else:
return binary_Search(mid+1,r,arr,x)
else:
return r
arr=[1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 27, 32, 36, 48, 54, 64, 72, 81, 96, 108, 128, 144, 162, 192, 216, 243, 256, 288, 324, 384, 432, 486, 512, 576, 648, 729, 768, 864, 972, 1024, 1152, 1296, 1458, 1536, 1728, 1944, 2048, 2187, 2304, 2592, 2916, 3072, 3456, 3888, 4096, 4374, 4608, 5184, 5832, 6144, 6561, 6912, 7776, 8192, 8748, 9216, 10368, 11664, 12288, 13122, 13824, 15552, 16384, 17496, 18432, 19683, 20736, 23328, 24576, 26244, 27648, 31104, 32768, 34992, 36864, 39366, 41472, 46656, 49152, 52488, 55296, 59049, 62208, 65536, 69984, 73728, 78732, 82944, 93312, 98304, 104976, 110592, 118098, 124416, 131072, 139968, 147456, 157464, 165888, 177147, 186624, 196608, 209952, 221184, 236196, 248832, 262144, 279936, 294912, 314928, 331776, 354294, 373248, 393216, 419904, 442368, 472392, 497664, 524288, 531441, 559872, 589824, 629856, 663552, 708588, 746496, 786432, 839808, 884736, 944784, 995328, 1048576, 1062882, 1119744, 1179648, 1259712, 1327104, 1417176, 1492992, 1572864, 1594323, 1679616, 1769472, 1889568, 1990656, 2097152, 2125764, 2239488, 2359296, 2519424, 2654208, 2834352, 2985984, 3145728, 3188646, 3359232, 3538944, 3779136, 3981312, 4194304, 4251528, 4478976, 4718592, 4782969, 5038848, 5308416, 5668704, 5971968, 6291456, 6377292, 6718464, 7077888, 7558272, 7962624, 8388608, 8503056, 8957952, 9437184, 9565938, 10077696, 10616832, 11337408, 11943936, 12582912, 12754584, 13436928, 14155776, 14348907, 15116544, 15925248, 16777216, 17006112, 17915904, 18874368, 19131876, 20155392, 21233664, 22674816, 23887872, 25165824, 25509168, 26873856, 28311552, 28697814, 30233088, 31850496, 33554432, 34012224, 35831808, 37748736, 38263752, 40310784, 42467328, 43046721, 45349632, 47775744, 50331648, 51018336, 53747712, 56623104, 57395628, 60466176, 63700992, 67108864, 68024448, 71663616, 75497472, 76527504, 80621568, 84934656, 86093442, 90699264, 95551488, 100663296, 102036672, 107495424, 113246208, 114791256, 120932352, 127401984, 129140163, 134217728, 136048896, 143327232, 150994944, 153055008, 161243136, 169869312, 172186884, 181398528, 191102976, 201326592, 204073344, 214990848, 226492416, 229582512, 241864704, 254803968, 258280326, 268435456, 272097792, 286654464, 301989888, 306110016, 322486272, 339738624, 344373768, 362797056, 382205952, 387420489, 402653184, 408146688, 429981696, 452984832, 459165024, 483729408, 509607936, 516560652, 536870912, 544195584, 573308928, 603979776, 612220032, 644972544, 679477248, 688747536, 725594112, 764411904, 774840978, 805306368, 816293376, 859963392, 905969664, 918330048, 967458816, 1019215872, 1033121304, 1073741824, 1088391168, 1146617856, 1162261467, 1207959552, 1224440064, 1289945088, 1358954496, 1377495072, 1451188224, 1528823808, 1549681956, 1610612736, 1632586752, 1719926784, 1811939328, 1836660096, 1934917632]
reverse_array={3981312: 169, 1: 0, 2: 1, 3: 2, 4: 3, 1088391168: 309, 6: 4, 71663616: 236, 8: 5, 9: 6, 429981696: 283, 12: 7, 268435456: 270, 16: 8, 18: 9, 90699264: 242, 8388608: 185, 3359232: 166, 153055008: 256, 24: 10, 102036672: 245, 27: 11, 12582912: 194, 1358954496: 315, 768: 37, 524288: 129, 209952: 113, 432: 31, 1289945088: 314, 36: 13, 25165824: 210, 1024: 40, 53747712: 229, 5184: 58, 8748: 65, 301989888: 273, 16384: 73, 314928: 120, 344373768: 277, 1162261467: 311, 54: 15, 161243136: 257, 7776: 63, 32768: 83, 3779136: 168, 96: 19, 15925248: 200, 30233088: 215, 1719926784: 322, 165888: 109, 72: 17, 382205952: 279, 14155776: 197, 2304: 49, 49152: 89, 544195584: 290, 81: 18, 204073344: 263, 38263752: 221, 45349632: 225, 17496: 74, 1019215872: 306, 805306368: 300, 134217728: 252, 75497472: 237, 559872: 131, 65536: 94, 629856: 133, 104976: 101, 196608: 112, 191102976: 261, 3072: 52, 483729408: 286, 60466176: 232, 93312: 99, 14348907: 198, 108: 20, 905969664: 303, 512: 33, 7077888: 182, 306110016: 274, 1610612736: 320, 286654464: 272, 57395628: 231, 11337408: 192, 5308416: 176, 98304: 100, 1152: 41, 15552: 72, 86093442: 241, 26244: 80, 2985984: 163, 3538944: 167, 2187: 48, 192: 24, 402653184: 281, 20736: 77, 944784: 140, 1033121304: 307, 2519424: 160, 603979776: 292, 679477248: 295, 4608: 57, 12754584: 195, 16777216: 201, 408146688: 282, 1179648: 145, 13436928: 196, 162: 23, 4096: 55, 236196: 115, 136048896: 253, 59049: 92, 6718464: 181, 147456: 107, 34992: 84, 5832: 59, 1836660096: 324, 509607936: 287, 10077696: 190, 1119744: 144, 1990656: 155, 1377495072: 316, 1048576: 142, 452984832: 284, 131072: 105, 1259712: 146, 2592: 50, 1146617856: 310, 36864: 85, 55296: 91, 419904: 125, 21233664: 207, 68024448: 235, 1572864: 150, 186624: 111, 35831808: 219, 339738624: 276, 31104: 82, 143327232: 254, 28697814: 214, 774840978: 299, 216: 25, 729: 36, 2097152: 156, 214990848: 264, 6912: 62, 1769472: 153, 20155392: 206, 19683: 76, 226492416: 265, 144: 22, 169869312: 258, 248832: 116, 243: 26, 4478976: 172, 1451188224: 317, 1207959552: 312, 113246208: 247, 181398528: 260, 3145728: 164, 256: 27, 10368: 67, 56623104: 230, 172186884: 259, 8192: 64, 688747536: 296, 52488: 90, 254803968: 268, 128: 21, 516560652: 288, 536870912: 289, 1679616: 152, 1296: 42, 1492992: 149, 384: 30, 107495424: 246, 23887872: 209, 4374: 56, 157464: 108, 442368: 126, 4194304: 170, 5038848: 175, 262144: 117, 1889568: 154, 48: 14, 26873856: 212, 1549681956: 319, 258280326: 269, 746496: 136, 80621568: 239, 4718592: 173, 33554432: 217, 1327104: 147, 3888: 54, 648: 35, 23328: 78, 63700992: 233, 124416: 104, 24576: 79, 1811939328: 323, 22674816: 208, 1934917632: 325, 4251528: 171, 50331648: 227, 294912: 119, 5668704: 177, 13122: 70, 241864704: 267, 324: 29, 472392: 127, 387420489: 280, 6377292: 180, 67108864: 234, 15116544: 199, 459165024: 285, 1536: 44, 118098: 103, 82944: 98, 51018336: 228, 114791256: 248, 19131876: 205, 967458816: 305, 6291456: 179, 644972544: 294, 864: 38, 2048: 47, 1073741824: 308, 2916: 51, 27648: 81, 73728: 96, 34012224: 218, 76527504: 238, 995328: 141, 612220032: 293, 100663296: 244, 7962624: 184, 18432: 75, 3456: 53, 272097792: 271, 127401984: 250, 17915904: 203, 4782969: 174, 884736: 139, 279936: 118, 46656: 88, 110592: 102, 43046721: 224, 64: 16, 839808: 138, 725594112: 297, 78732: 97, 2654208: 161, 47775744: 226, 25509168: 211, 11664: 68, 373248: 123, 41472: 87, 1944: 46, 139968: 106, 150994944: 255, 62208: 93, 393216: 124, 859963392: 302, 6561: 61, 40310784: 222, 3188646: 165, 663552: 134, 7558272: 183, 12288: 69, 42467328: 223, 9565938: 189, 1728: 45, 11943936: 193, 2834352: 162, 37748736: 220, 1458: 43, 786432: 137, 764411904: 298, 13824: 71, 17006112: 202, 9437184: 188, 95551488: 243, 129140163: 251, 2125764: 157, 497664: 128, 39366: 86, 32: 12, 9216: 66, 8957952: 187, 972: 39, 201326592: 262, 1224440064: 313, 288: 28, 69984: 95, 1632586752: 321, 1594323: 151, 362797056: 278, 2239488: 158, 1417176: 148, 229582512: 266, 18874368: 204, 8503056: 186, 120932352: 249, 1062882: 143, 331776: 121, 2359296: 159, 6144: 60, 486: 32, 5971968: 178, 31850496: 216, 10616832: 191, 708588: 135, 589824: 132, 531441: 130, 918330048: 304, 573308928: 291, 354294: 122, 221184: 114, 816293376: 301, 576: 34, 177147: 110, 28311552: 213, 322486272: 275, 84934656: 240, 1528823808: 318}
l,r=map(int,input().split())
a=reverse_array[arr[binary_Search(0,len(arr)-1,arr,l)]]
b=reverse_array[arr[binary_Search(0,len(arr)-1,arr,r)]]
if arr[a]<l:
a+=1
if arr[a]==r:
b-=1
print(b-a+1) | if arr[a]==r: | 22 | decision |
def binary_Search (l,r,arr,x):
if r >= l:
mid = l + (r - l)//2
if arr[mid] == x:
return mid
elif arr[mid] > x:
return binary_Search(l,mid-1,arr,x)
else:
return binary_Search(mid+1,r,arr,x)
else:
return r
arr=[1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 27, 32, 36, 48, 54, 64, 72, 81, 96, 108, 128, 144, 162, 192, 216, 243, 256, 288, 324, 384, 432, 486, 512, 576, 648, 729, 768, 864, 972, 1024, 1152, 1296, 1458, 1536, 1728, 1944, 2048, 2187, 2304, 2592, 2916, 3072, 3456, 3888, 4096, 4374, 4608, 5184, 5832, 6144, 6561, 6912, 7776, 8192, 8748, 9216, 10368, 11664, 12288, 13122, 13824, 15552, 16384, 17496, 18432, 19683, 20736, 23328, 24576, 26244, 27648, 31104, 32768, 34992, 36864, 39366, 41472, 46656, 49152, 52488, 55296, 59049, 62208, 65536, 69984, 73728, 78732, 82944, 93312, 98304, 104976, 110592, 118098, 124416, 131072, 139968, 147456, 157464, 165888, 177147, 186624, 196608, 209952, 221184, 236196, 248832, 262144, 279936, 294912, 314928, 331776, 354294, 373248, 393216, 419904, 442368, 472392, 497664, 524288, 531441, 559872, 589824, 629856, 663552, 708588, 746496, 786432, 839808, 884736, 944784, 995328, 1048576, 1062882, 1119744, 1179648, 1259712, 1327104, 1417176, 1492992, 1572864, 1594323, 1679616, 1769472, 1889568, 1990656, 2097152, 2125764, 2239488, 2359296, 2519424, 2654208, 2834352, 2985984, 3145728, 3188646, 3359232, 3538944, 3779136, 3981312, 4194304, 4251528, 4478976, 4718592, 4782969, 5038848, 5308416, 5668704, 5971968, 6291456, 6377292, 6718464, 7077888, 7558272, 7962624, 8388608, 8503056, 8957952, 9437184, 9565938, 10077696, 10616832, 11337408, 11943936, 12582912, 12754584, 13436928, 14155776, 14348907, 15116544, 15925248, 16777216, 17006112, 17915904, 18874368, 19131876, 20155392, 21233664, 22674816, 23887872, 25165824, 25509168, 26873856, 28311552, 28697814, 30233088, 31850496, 33554432, 34012224, 35831808, 37748736, 38263752, 40310784, 42467328, 43046721, 45349632, 47775744, 50331648, 51018336, 53747712, 56623104, 57395628, 60466176, 63700992, 67108864, 68024448, 71663616, 75497472, 76527504, 80621568, 84934656, 86093442, 90699264, 95551488, 100663296, 102036672, 107495424, 113246208, 114791256, 120932352, 127401984, 129140163, 134217728, 136048896, 143327232, 150994944, 153055008, 161243136, 169869312, 172186884, 181398528, 191102976, 201326592, 204073344, 214990848, 226492416, 229582512, 241864704, 254803968, 258280326, 268435456, 272097792, 286654464, 301989888, 306110016, 322486272, 339738624, 344373768, 362797056, 382205952, 387420489, 402653184, 408146688, 429981696, 452984832, 459165024, 483729408, 509607936, 516560652, 536870912, 544195584, 573308928, 603979776, 612220032, 644972544, 679477248, 688747536, 725594112, 764411904, 774840978, 805306368, 816293376, 859963392, 905969664, 918330048, 967458816, 1019215872, 1033121304, 1073741824, 1088391168, 1146617856, 1162261467, 1207959552, 1224440064, 1289945088, 1358954496, 1377495072, 1451188224, 1528823808, 1549681956, 1610612736, 1632586752, 1719926784, 1811939328, 1836660096, 1934917632]
reverse_array={3981312: 169, 1: 0, 2: 1, 3: 2, 4: 3, 1088391168: 309, 6: 4, 71663616: 236, 8: 5, 9: 6, 429981696: 283, 12: 7, 268435456: 270, 16: 8, 18: 9, 90699264: 242, 8388608: 185, 3359232: 166, 153055008: 256, 24: 10, 102036672: 245, 27: 11, 12582912: 194, 1358954496: 315, 768: 37, 524288: 129, 209952: 113, 432: 31, 1289945088: 314, 36: 13, 25165824: 210, 1024: 40, 53747712: 229, 5184: 58, 8748: 65, 301989888: 273, 16384: 73, 314928: 120, 344373768: 277, 1162261467: 311, 54: 15, 161243136: 257, 7776: 63, 32768: 83, 3779136: 168, 96: 19, 15925248: 200, 30233088: 215, 1719926784: 322, 165888: 109, 72: 17, 382205952: 279, 14155776: 197, 2304: 49, 49152: 89, 544195584: 290, 81: 18, 204073344: 263, 38263752: 221, 45349632: 225, 17496: 74, 1019215872: 306, 805306368: 300, 134217728: 252, 75497472: 237, 559872: 131, 65536: 94, 629856: 133, 104976: 101, 196608: 112, 191102976: 261, 3072: 52, 483729408: 286, 60466176: 232, 93312: 99, 14348907: 198, 108: 20, 905969664: 303, 512: 33, 7077888: 182, 306110016: 274, 1610612736: 320, 286654464: 272, 57395628: 231, 11337408: 192, 5308416: 176, 98304: 100, 1152: 41, 15552: 72, 86093442: 241, 26244: 80, 2985984: 163, 3538944: 167, 2187: 48, 192: 24, 402653184: 281, 20736: 77, 944784: 140, 1033121304: 307, 2519424: 160, 603979776: 292, 679477248: 295, 4608: 57, 12754584: 195, 16777216: 201, 408146688: 282, 1179648: 145, 13436928: 196, 162: 23, 4096: 55, 236196: 115, 136048896: 253, 59049: 92, 6718464: 181, 147456: 107, 34992: 84, 5832: 59, 1836660096: 324, 509607936: 287, 10077696: 190, 1119744: 144, 1990656: 155, 1377495072: 316, 1048576: 142, 452984832: 284, 131072: 105, 1259712: 146, 2592: 50, 1146617856: 310, 36864: 85, 55296: 91, 419904: 125, 21233664: 207, 68024448: 235, 1572864: 150, 186624: 111, 35831808: 219, 339738624: 276, 31104: 82, 143327232: 254, 28697814: 214, 774840978: 299, 216: 25, 729: 36, 2097152: 156, 214990848: 264, 6912: 62, 1769472: 153, 20155392: 206, 19683: 76, 226492416: 265, 144: 22, 169869312: 258, 248832: 116, 243: 26, 4478976: 172, 1451188224: 317, 1207959552: 312, 113246208: 247, 181398528: 260, 3145728: 164, 256: 27, 10368: 67, 56623104: 230, 172186884: 259, 8192: 64, 688747536: 296, 52488: 90, 254803968: 268, 128: 21, 516560652: 288, 536870912: 289, 1679616: 152, 1296: 42, 1492992: 149, 384: 30, 107495424: 246, 23887872: 209, 4374: 56, 157464: 108, 442368: 126, 4194304: 170, 5038848: 175, 262144: 117, 1889568: 154, 48: 14, 26873856: 212, 1549681956: 319, 258280326: 269, 746496: 136, 80621568: 239, 4718592: 173, 33554432: 217, 1327104: 147, 3888: 54, 648: 35, 23328: 78, 63700992: 233, 124416: 104, 24576: 79, 1811939328: 323, 22674816: 208, 1934917632: 325, 4251528: 171, 50331648: 227, 294912: 119, 5668704: 177, 13122: 70, 241864704: 267, 324: 29, 472392: 127, 387420489: 280, 6377292: 180, 67108864: 234, 15116544: 199, 459165024: 285, 1536: 44, 118098: 103, 82944: 98, 51018336: 228, 114791256: 248, 19131876: 205, 967458816: 305, 6291456: 179, 644972544: 294, 864: 38, 2048: 47, 1073741824: 308, 2916: 51, 27648: 81, 73728: 96, 34012224: 218, 76527504: 238, 995328: 141, 612220032: 293, 100663296: 244, 7962624: 184, 18432: 75, 3456: 53, 272097792: 271, 127401984: 250, 17915904: 203, 4782969: 174, 884736: 139, 279936: 118, 46656: 88, 110592: 102, 43046721: 224, 64: 16, 839808: 138, 725594112: 297, 78732: 97, 2654208: 161, 47775744: 226, 25509168: 211, 11664: 68, 373248: 123, 41472: 87, 1944: 46, 139968: 106, 150994944: 255, 62208: 93, 393216: 124, 859963392: 302, 6561: 61, 40310784: 222, 3188646: 165, 663552: 134, 7558272: 183, 12288: 69, 42467328: 223, 9565938: 189, 1728: 45, 11943936: 193, 2834352: 162, 37748736: 220, 1458: 43, 786432: 137, 764411904: 298, 13824: 71, 17006112: 202, 9437184: 188, 95551488: 243, 129140163: 251, 2125764: 157, 497664: 128, 39366: 86, 32: 12, 9216: 66, 8957952: 187, 972: 39, 201326592: 262, 1224440064: 313, 288: 28, 69984: 95, 1632586752: 321, 1594323: 151, 362797056: 278, 2239488: 158, 1417176: 148, 229582512: 266, 18874368: 204, 8503056: 186, 120932352: 249, 1062882: 143, 331776: 121, 2359296: 159, 6144: 60, 486: 32, 5971968: 178, 31850496: 216, 10616832: 191, 708588: 135, 589824: 132, 531441: 130, 918330048: 304, 573308928: 291, 354294: 122, 221184: 114, 816293376: 301, 576: 34, 177147: 110, 28311552: 213, 322486272: 275, 84934656: 240, 1528823808: 318}
l,r=map(int,input().split())
a=reverse_array[arr[binary_Search(0,len(arr)-1,arr,l)]]
b=reverse_array[arr[binary_Search(0,len(arr)-1,arr,r)]]
if arr[a]<l:
a+=1
if arr[a]>r:
b-=1
print(b-a+1) | def binary_Search (l,r,arr,x):
if r >= l:
mid = l + (r - l)//2
if arr[mid] == x:
return mid
elif arr[mid] > x:
return binary_Search(l,mid-1,arr,x)
else:
return binary_Search(mid+1,r,arr,x)
else:
return r
arr=[1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 27, 32, 36, 48, 54, 64, 72, 81, 96, 108, 128, 144, 162, 192, 216, 243, 256, 288, 324, 384, 432, 486, 512, 576, 648, 729, 768, 864, 972, 1024, 1152, 1296, 1458, 1536, 1728, 1944, 2048, 2187, 2304, 2592, 2916, 3072, 3456, 3888, 4096, 4374, 4608, 5184, 5832, 6144, 6561, 6912, 7776, 8192, 8748, 9216, 10368, 11664, 12288, 13122, 13824, 15552, 16384, 17496, 18432, 19683, 20736, 23328, 24576, 26244, 27648, 31104, 32768, 34992, 36864, 39366, 41472, 46656, 49152, 52488, 55296, 59049, 62208, 65536, 69984, 73728, 78732, 82944, 93312, 98304, 104976, 110592, 118098, 124416, 131072, 139968, 147456, 157464, 165888, 177147, 186624, 196608, 209952, 221184, 236196, 248832, 262144, 279936, 294912, 314928, 331776, 354294, 373248, 393216, 419904, 442368, 472392, 497664, 524288, 531441, 559872, 589824, 629856, 663552, 708588, 746496, 786432, 839808, 884736, 944784, 995328, 1048576, 1062882, 1119744, 1179648, 1259712, 1327104, 1417176, 1492992, 1572864, 1594323, 1679616, 1769472, 1889568, 1990656, 2097152, 2125764, 2239488, 2359296, 2519424, 2654208, 2834352, 2985984, 3145728, 3188646, 3359232, 3538944, 3779136, 3981312, 4194304, 4251528, 4478976, 4718592, 4782969, 5038848, 5308416, 5668704, 5971968, 6291456, 6377292, 6718464, 7077888, 7558272, 7962624, 8388608, 8503056, 8957952, 9437184, 9565938, 10077696, 10616832, 11337408, 11943936, 12582912, 12754584, 13436928, 14155776, 14348907, 15116544, 15925248, 16777216, 17006112, 17915904, 18874368, 19131876, 20155392, 21233664, 22674816, 23887872, 25165824, 25509168, 26873856, 28311552, 28697814, 30233088, 31850496, 33554432, 34012224, 35831808, 37748736, 38263752, 40310784, 42467328, 43046721, 45349632, 47775744, 50331648, 51018336, 53747712, 56623104, 57395628, 60466176, 63700992, 67108864, 68024448, 71663616, 75497472, 76527504, 80621568, 84934656, 86093442, 90699264, 95551488, 100663296, 102036672, 107495424, 113246208, 114791256, 120932352, 127401984, 129140163, 134217728, 136048896, 143327232, 150994944, 153055008, 161243136, 169869312, 172186884, 181398528, 191102976, 201326592, 204073344, 214990848, 226492416, 229582512, 241864704, 254803968, 258280326, 268435456, 272097792, 286654464, 301989888, 306110016, 322486272, 339738624, 344373768, 362797056, 382205952, 387420489, 402653184, 408146688, 429981696, 452984832, 459165024, 483729408, 509607936, 516560652, 536870912, 544195584, 573308928, 603979776, 612220032, 644972544, 679477248, 688747536, 725594112, 764411904, 774840978, 805306368, 816293376, 859963392, 905969664, 918330048, 967458816, 1019215872, 1033121304, 1073741824, 1088391168, 1146617856, 1162261467, 1207959552, 1224440064, 1289945088, 1358954496, 1377495072, 1451188224, 1528823808, 1549681956, 1610612736, 1632586752, 1719926784, 1811939328, 1836660096, 1934917632]
reverse_array={3981312: 169, 1: 0, 2: 1, 3: 2, 4: 3, 1088391168: 309, 6: 4, 71663616: 236, 8: 5, 9: 6, 429981696: 283, 12: 7, 268435456: 270, 16: 8, 18: 9, 90699264: 242, 8388608: 185, 3359232: 166, 153055008: 256, 24: 10, 102036672: 245, 27: 11, 12582912: 194, 1358954496: 315, 768: 37, 524288: 129, 209952: 113, 432: 31, 1289945088: 314, 36: 13, 25165824: 210, 1024: 40, 53747712: 229, 5184: 58, 8748: 65, 301989888: 273, 16384: 73, 314928: 120, 344373768: 277, 1162261467: 311, 54: 15, 161243136: 257, 7776: 63, 32768: 83, 3779136: 168, 96: 19, 15925248: 200, 30233088: 215, 1719926784: 322, 165888: 109, 72: 17, 382205952: 279, 14155776: 197, 2304: 49, 49152: 89, 544195584: 290, 81: 18, 204073344: 263, 38263752: 221, 45349632: 225, 17496: 74, 1019215872: 306, 805306368: 300, 134217728: 252, 75497472: 237, 559872: 131, 65536: 94, 629856: 133, 104976: 101, 196608: 112, 191102976: 261, 3072: 52, 483729408: 286, 60466176: 232, 93312: 99, 14348907: 198, 108: 20, 905969664: 303, 512: 33, 7077888: 182, 306110016: 274, 1610612736: 320, 286654464: 272, 57395628: 231, 11337408: 192, 5308416: 176, 98304: 100, 1152: 41, 15552: 72, 86093442: 241, 26244: 80, 2985984: 163, 3538944: 167, 2187: 48, 192: 24, 402653184: 281, 20736: 77, 944784: 140, 1033121304: 307, 2519424: 160, 603979776: 292, 679477248: 295, 4608: 57, 12754584: 195, 16777216: 201, 408146688: 282, 1179648: 145, 13436928: 196, 162: 23, 4096: 55, 236196: 115, 136048896: 253, 59049: 92, 6718464: 181, 147456: 107, 34992: 84, 5832: 59, 1836660096: 324, 509607936: 287, 10077696: 190, 1119744: 144, 1990656: 155, 1377495072: 316, 1048576: 142, 452984832: 284, 131072: 105, 1259712: 146, 2592: 50, 1146617856: 310, 36864: 85, 55296: 91, 419904: 125, 21233664: 207, 68024448: 235, 1572864: 150, 186624: 111, 35831808: 219, 339738624: 276, 31104: 82, 143327232: 254, 28697814: 214, 774840978: 299, 216: 25, 729: 36, 2097152: 156, 214990848: 264, 6912: 62, 1769472: 153, 20155392: 206, 19683: 76, 226492416: 265, 144: 22, 169869312: 258, 248832: 116, 243: 26, 4478976: 172, 1451188224: 317, 1207959552: 312, 113246208: 247, 181398528: 260, 3145728: 164, 256: 27, 10368: 67, 56623104: 230, 172186884: 259, 8192: 64, 688747536: 296, 52488: 90, 254803968: 268, 128: 21, 516560652: 288, 536870912: 289, 1679616: 152, 1296: 42, 1492992: 149, 384: 30, 107495424: 246, 23887872: 209, 4374: 56, 157464: 108, 442368: 126, 4194304: 170, 5038848: 175, 262144: 117, 1889568: 154, 48: 14, 26873856: 212, 1549681956: 319, 258280326: 269, 746496: 136, 80621568: 239, 4718592: 173, 33554432: 217, 1327104: 147, 3888: 54, 648: 35, 23328: 78, 63700992: 233, 124416: 104, 24576: 79, 1811939328: 323, 22674816: 208, 1934917632: 325, 4251528: 171, 50331648: 227, 294912: 119, 5668704: 177, 13122: 70, 241864704: 267, 324: 29, 472392: 127, 387420489: 280, 6377292: 180, 67108864: 234, 15116544: 199, 459165024: 285, 1536: 44, 118098: 103, 82944: 98, 51018336: 228, 114791256: 248, 19131876: 205, 967458816: 305, 6291456: 179, 644972544: 294, 864: 38, 2048: 47, 1073741824: 308, 2916: 51, 27648: 81, 73728: 96, 34012224: 218, 76527504: 238, 995328: 141, 612220032: 293, 100663296: 244, 7962624: 184, 18432: 75, 3456: 53, 272097792: 271, 127401984: 250, 17915904: 203, 4782969: 174, 884736: 139, 279936: 118, 46656: 88, 110592: 102, 43046721: 224, 64: 16, 839808: 138, 725594112: 297, 78732: 97, 2654208: 161, 47775744: 226, 25509168: 211, 11664: 68, 373248: 123, 41472: 87, 1944: 46, 139968: 106, 150994944: 255, 62208: 93, 393216: 124, 859963392: 302, 6561: 61, 40310784: 222, 3188646: 165, 663552: 134, 7558272: 183, 12288: 69, 42467328: 223, 9565938: 189, 1728: 45, 11943936: 193, 2834352: 162, 37748736: 220, 1458: 43, 786432: 137, 764411904: 298, 13824: 71, 17006112: 202, 9437184: 188, 95551488: 243, 129140163: 251, 2125764: 157, 497664: 128, 39366: 86, 32: 12, 9216: 66, 8957952: 187, 972: 39, 201326592: 262, 1224440064: 313, 288: 28, 69984: 95, 1632586752: 321, 1594323: 151, 362797056: 278, 2239488: 158, 1417176: 148, 229582512: 266, 18874368: 204, 8503056: 186, 120932352: 249, 1062882: 143, 331776: 121, 2359296: 159, 6144: 60, 486: 32, 5971968: 178, 31850496: 216, 10616832: 191, 708588: 135, 589824: 132, 531441: 130, 918330048: 304, 573308928: 291, 354294: 122, 221184: 114, 816293376: 301, 576: 34, 177147: 110, 28311552: 213, 322486272: 275, 84934656: 240, 1528823808: 318}
l,r=map(int,input().split())
a=reverse_array[arr[binary_Search(0,len(arr)-1,arr,l)]]
b=reverse_array[arr[binary_Search(0,len(arr)-1,arr,r)]]
if arr[a]<l:
a+=1
if arr[a]>r:
b-=1
print(b-a@1) | print(b-a@1) | 24 | operation |
def binary_Search (l,r,arr,x):
if r >= l:
mid = l + (r - l)//2
if arr[mid] == x:
return mid
elif arr[mid] > x:
return binary_Search(l,mid-1,arr,x)
else:
return binary_Search(mid+1,r,arr,x)
else:
return r
arr=[1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 27, 32, 36, 48, 54, 64, 72, 81, 96, 108, 128, 144, 162, 192, 216, 243, 256, 288, 324, 384, 432, 486, 512, 576, 648, 729, 768, 864, 972, 1024, 1152, 1296, 1458, 1536, 1728, 1944, 2048, 2187, 2304, 2592, 2916, 3072, 3456, 3888, 4096, 4374, 4608, 5184, 5832, 6144, 6561, 6912, 7776, 8192, 8748, 9216, 10368, 11664, 12288, 13122, 13824, 15552, 16384, 17496, 18432, 19683, 20736, 23328, 24576, 26244, 27648, 31104, 32768, 34992, 36864, 39366, 41472, 46656, 49152, 52488, 55296, 59049, 62208, 65536, 69984, 73728, 78732, 82944, 93312, 98304, 104976, 110592, 118098, 124416, 131072, 139968, 147456, 157464, 165888, 177147, 186624, 196608, 209952, 221184, 236196, 248832, 262144, 279936, 294912, 314928, 331776, 354294, 373248, 393216, 419904, 442368, 472392, 497664, 524288, 531441, 559872, 589824, 629856, 663552, 708588, 746496, 786432, 839808, 884736, 944784, 995328, 1048576, 1062882, 1119744, 1179648, 1259712, 1327104, 1417176, 1492992, 1572864, 1594323, 1679616, 1769472, 1889568, 1990656, 2097152, 2125764, 2239488, 2359296, 2519424, 2654208, 2834352, 2985984, 3145728, 3188646, 3359232, 3538944, 3779136, 3981312, 4194304, 4251528, 4478976, 4718592, 4782969, 5038848, 5308416, 5668704, 5971968, 6291456, 6377292, 6718464, 7077888, 7558272, 7962624, 8388608, 8503056, 8957952, 9437184, 9565938, 10077696, 10616832, 11337408, 11943936, 12582912, 12754584, 13436928, 14155776, 14348907, 15116544, 15925248, 16777216, 17006112, 17915904, 18874368, 19131876, 20155392, 21233664, 22674816, 23887872, 25165824, 25509168, 26873856, 28311552, 28697814, 30233088, 31850496, 33554432, 34012224, 35831808, 37748736, 38263752, 40310784, 42467328, 43046721, 45349632, 47775744, 50331648, 51018336, 53747712, 56623104, 57395628, 60466176, 63700992, 67108864, 68024448, 71663616, 75497472, 76527504, 80621568, 84934656, 86093442, 90699264, 95551488, 100663296, 102036672, 107495424, 113246208, 114791256, 120932352, 127401984, 129140163, 134217728, 136048896, 143327232, 150994944, 153055008, 161243136, 169869312, 172186884, 181398528, 191102976, 201326592, 204073344, 214990848, 226492416, 229582512, 241864704, 254803968, 258280326, 268435456, 272097792, 286654464, 301989888, 306110016, 322486272, 339738624, 344373768, 362797056, 382205952, 387420489, 402653184, 408146688, 429981696, 452984832, 459165024, 483729408, 509607936, 516560652, 536870912, 544195584, 573308928, 603979776, 612220032, 644972544, 679477248, 688747536, 725594112, 764411904, 774840978, 805306368, 816293376, 859963392, 905969664, 918330048, 967458816, 1019215872, 1033121304, 1073741824, 1088391168, 1146617856, 1162261467, 1207959552, 1224440064, 1289945088, 1358954496, 1377495072, 1451188224, 1528823808, 1549681956, 1610612736, 1632586752, 1719926784, 1811939328, 1836660096, 1934917632]
reverse_array={3981312: 169, 1: 0, 2: 1, 3: 2, 4: 3, 1088391168: 309, 6: 4, 71663616: 236, 8: 5, 9: 6, 429981696: 283, 12: 7, 268435456: 270, 16: 8, 18: 9, 90699264: 242, 8388608: 185, 3359232: 166, 153055008: 256, 24: 10, 102036672: 245, 27: 11, 12582912: 194, 1358954496: 315, 768: 37, 524288: 129, 209952: 113, 432: 31, 1289945088: 314, 36: 13, 25165824: 210, 1024: 40, 53747712: 229, 5184: 58, 8748: 65, 301989888: 273, 16384: 73, 314928: 120, 344373768: 277, 1162261467: 311, 54: 15, 161243136: 257, 7776: 63, 32768: 83, 3779136: 168, 96: 19, 15925248: 200, 30233088: 215, 1719926784: 322, 165888: 109, 72: 17, 382205952: 279, 14155776: 197, 2304: 49, 49152: 89, 544195584: 290, 81: 18, 204073344: 263, 38263752: 221, 45349632: 225, 17496: 74, 1019215872: 306, 805306368: 300, 134217728: 252, 75497472: 237, 559872: 131, 65536: 94, 629856: 133, 104976: 101, 196608: 112, 191102976: 261, 3072: 52, 483729408: 286, 60466176: 232, 93312: 99, 14348907: 198, 108: 20, 905969664: 303, 512: 33, 7077888: 182, 306110016: 274, 1610612736: 320, 286654464: 272, 57395628: 231, 11337408: 192, 5308416: 176, 98304: 100, 1152: 41, 15552: 72, 86093442: 241, 26244: 80, 2985984: 163, 3538944: 167, 2187: 48, 192: 24, 402653184: 281, 20736: 77, 944784: 140, 1033121304: 307, 2519424: 160, 603979776: 292, 679477248: 295, 4608: 57, 12754584: 195, 16777216: 201, 408146688: 282, 1179648: 145, 13436928: 196, 162: 23, 4096: 55, 236196: 115, 136048896: 253, 59049: 92, 6718464: 181, 147456: 107, 34992: 84, 5832: 59, 1836660096: 324, 509607936: 287, 10077696: 190, 1119744: 144, 1990656: 155, 1377495072: 316, 1048576: 142, 452984832: 284, 131072: 105, 1259712: 146, 2592: 50, 1146617856: 310, 36864: 85, 55296: 91, 419904: 125, 21233664: 207, 68024448: 235, 1572864: 150, 186624: 111, 35831808: 219, 339738624: 276, 31104: 82, 143327232: 254, 28697814: 214, 774840978: 299, 216: 25, 729: 36, 2097152: 156, 214990848: 264, 6912: 62, 1769472: 153, 20155392: 206, 19683: 76, 226492416: 265, 144: 22, 169869312: 258, 248832: 116, 243: 26, 4478976: 172, 1451188224: 317, 1207959552: 312, 113246208: 247, 181398528: 260, 3145728: 164, 256: 27, 10368: 67, 56623104: 230, 172186884: 259, 8192: 64, 688747536: 296, 52488: 90, 254803968: 268, 128: 21, 516560652: 288, 536870912: 289, 1679616: 152, 1296: 42, 1492992: 149, 384: 30, 107495424: 246, 23887872: 209, 4374: 56, 157464: 108, 442368: 126, 4194304: 170, 5038848: 175, 262144: 117, 1889568: 154, 48: 14, 26873856: 212, 1549681956: 319, 258280326: 269, 746496: 136, 80621568: 239, 4718592: 173, 33554432: 217, 1327104: 147, 3888: 54, 648: 35, 23328: 78, 63700992: 233, 124416: 104, 24576: 79, 1811939328: 323, 22674816: 208, 1934917632: 325, 4251528: 171, 50331648: 227, 294912: 119, 5668704: 177, 13122: 70, 241864704: 267, 324: 29, 472392: 127, 387420489: 280, 6377292: 180, 67108864: 234, 15116544: 199, 459165024: 285, 1536: 44, 118098: 103, 82944: 98, 51018336: 228, 114791256: 248, 19131876: 205, 967458816: 305, 6291456: 179, 644972544: 294, 864: 38, 2048: 47, 1073741824: 308, 2916: 51, 27648: 81, 73728: 96, 34012224: 218, 76527504: 238, 995328: 141, 612220032: 293, 100663296: 244, 7962624: 184, 18432: 75, 3456: 53, 272097792: 271, 127401984: 250, 17915904: 203, 4782969: 174, 884736: 139, 279936: 118, 46656: 88, 110592: 102, 43046721: 224, 64: 16, 839808: 138, 725594112: 297, 78732: 97, 2654208: 161, 47775744: 226, 25509168: 211, 11664: 68, 373248: 123, 41472: 87, 1944: 46, 139968: 106, 150994944: 255, 62208: 93, 393216: 124, 859963392: 302, 6561: 61, 40310784: 222, 3188646: 165, 663552: 134, 7558272: 183, 12288: 69, 42467328: 223, 9565938: 189, 1728: 45, 11943936: 193, 2834352: 162, 37748736: 220, 1458: 43, 786432: 137, 764411904: 298, 13824: 71, 17006112: 202, 9437184: 188, 95551488: 243, 129140163: 251, 2125764: 157, 497664: 128, 39366: 86, 32: 12, 9216: 66, 8957952: 187, 972: 39, 201326592: 262, 1224440064: 313, 288: 28, 69984: 95, 1632586752: 321, 1594323: 151, 362797056: 278, 2239488: 158, 1417176: 148, 229582512: 266, 18874368: 204, 8503056: 186, 120932352: 249, 1062882: 143, 331776: 121, 2359296: 159, 6144: 60, 486: 32, 5971968: 178, 31850496: 216, 10616832: 191, 708588: 135, 589824: 132, 531441: 130, 918330048: 304, 573308928: 291, 354294: 122, 221184: 114, 816293376: 301, 576: 34, 177147: 110, 28311552: 213, 322486272: 275, 84934656: 240, 1528823808: 318}
l,r=map(int,input().split())
a=reverse_array[arr[binary_Search(0,len(arr)-1,arr,l)]]
b=reverse_array[arr[binary_Search(0,len(arr)-1,arr,r)]]
if arr[a]<l:
a+=1
if arr[a]>r:
b-=1
print(b-a+1) | def binary_Search (l,r,arr,x):
if r<=l:
mid = l + (r - l)//2
if arr[mid] == x:
return mid
elif arr[mid] > x:
return binary_Search(l,mid-1,arr,x)
else:
return binary_Search(mid+1,r,arr,x)
else:
return r
arr=[1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 27, 32, 36, 48, 54, 64, 72, 81, 96, 108, 128, 144, 162, 192, 216, 243, 256, 288, 324, 384, 432, 486, 512, 576, 648, 729, 768, 864, 972, 1024, 1152, 1296, 1458, 1536, 1728, 1944, 2048, 2187, 2304, 2592, 2916, 3072, 3456, 3888, 4096, 4374, 4608, 5184, 5832, 6144, 6561, 6912, 7776, 8192, 8748, 9216, 10368, 11664, 12288, 13122, 13824, 15552, 16384, 17496, 18432, 19683, 20736, 23328, 24576, 26244, 27648, 31104, 32768, 34992, 36864, 39366, 41472, 46656, 49152, 52488, 55296, 59049, 62208, 65536, 69984, 73728, 78732, 82944, 93312, 98304, 104976, 110592, 118098, 124416, 131072, 139968, 147456, 157464, 165888, 177147, 186624, 196608, 209952, 221184, 236196, 248832, 262144, 279936, 294912, 314928, 331776, 354294, 373248, 393216, 419904, 442368, 472392, 497664, 524288, 531441, 559872, 589824, 629856, 663552, 708588, 746496, 786432, 839808, 884736, 944784, 995328, 1048576, 1062882, 1119744, 1179648, 1259712, 1327104, 1417176, 1492992, 1572864, 1594323, 1679616, 1769472, 1889568, 1990656, 2097152, 2125764, 2239488, 2359296, 2519424, 2654208, 2834352, 2985984, 3145728, 3188646, 3359232, 3538944, 3779136, 3981312, 4194304, 4251528, 4478976, 4718592, 4782969, 5038848, 5308416, 5668704, 5971968, 6291456, 6377292, 6718464, 7077888, 7558272, 7962624, 8388608, 8503056, 8957952, 9437184, 9565938, 10077696, 10616832, 11337408, 11943936, 12582912, 12754584, 13436928, 14155776, 14348907, 15116544, 15925248, 16777216, 17006112, 17915904, 18874368, 19131876, 20155392, 21233664, 22674816, 23887872, 25165824, 25509168, 26873856, 28311552, 28697814, 30233088, 31850496, 33554432, 34012224, 35831808, 37748736, 38263752, 40310784, 42467328, 43046721, 45349632, 47775744, 50331648, 51018336, 53747712, 56623104, 57395628, 60466176, 63700992, 67108864, 68024448, 71663616, 75497472, 76527504, 80621568, 84934656, 86093442, 90699264, 95551488, 100663296, 102036672, 107495424, 113246208, 114791256, 120932352, 127401984, 129140163, 134217728, 136048896, 143327232, 150994944, 153055008, 161243136, 169869312, 172186884, 181398528, 191102976, 201326592, 204073344, 214990848, 226492416, 229582512, 241864704, 254803968, 258280326, 268435456, 272097792, 286654464, 301989888, 306110016, 322486272, 339738624, 344373768, 362797056, 382205952, 387420489, 402653184, 408146688, 429981696, 452984832, 459165024, 483729408, 509607936, 516560652, 536870912, 544195584, 573308928, 603979776, 612220032, 644972544, 679477248, 688747536, 725594112, 764411904, 774840978, 805306368, 816293376, 859963392, 905969664, 918330048, 967458816, 1019215872, 1033121304, 1073741824, 1088391168, 1146617856, 1162261467, 1207959552, 1224440064, 1289945088, 1358954496, 1377495072, 1451188224, 1528823808, 1549681956, 1610612736, 1632586752, 1719926784, 1811939328, 1836660096, 1934917632]
reverse_array={3981312: 169, 1: 0, 2: 1, 3: 2, 4: 3, 1088391168: 309, 6: 4, 71663616: 236, 8: 5, 9: 6, 429981696: 283, 12: 7, 268435456: 270, 16: 8, 18: 9, 90699264: 242, 8388608: 185, 3359232: 166, 153055008: 256, 24: 10, 102036672: 245, 27: 11, 12582912: 194, 1358954496: 315, 768: 37, 524288: 129, 209952: 113, 432: 31, 1289945088: 314, 36: 13, 25165824: 210, 1024: 40, 53747712: 229, 5184: 58, 8748: 65, 301989888: 273, 16384: 73, 314928: 120, 344373768: 277, 1162261467: 311, 54: 15, 161243136: 257, 7776: 63, 32768: 83, 3779136: 168, 96: 19, 15925248: 200, 30233088: 215, 1719926784: 322, 165888: 109, 72: 17, 382205952: 279, 14155776: 197, 2304: 49, 49152: 89, 544195584: 290, 81: 18, 204073344: 263, 38263752: 221, 45349632: 225, 17496: 74, 1019215872: 306, 805306368: 300, 134217728: 252, 75497472: 237, 559872: 131, 65536: 94, 629856: 133, 104976: 101, 196608: 112, 191102976: 261, 3072: 52, 483729408: 286, 60466176: 232, 93312: 99, 14348907: 198, 108: 20, 905969664: 303, 512: 33, 7077888: 182, 306110016: 274, 1610612736: 320, 286654464: 272, 57395628: 231, 11337408: 192, 5308416: 176, 98304: 100, 1152: 41, 15552: 72, 86093442: 241, 26244: 80, 2985984: 163, 3538944: 167, 2187: 48, 192: 24, 402653184: 281, 20736: 77, 944784: 140, 1033121304: 307, 2519424: 160, 603979776: 292, 679477248: 295, 4608: 57, 12754584: 195, 16777216: 201, 408146688: 282, 1179648: 145, 13436928: 196, 162: 23, 4096: 55, 236196: 115, 136048896: 253, 59049: 92, 6718464: 181, 147456: 107, 34992: 84, 5832: 59, 1836660096: 324, 509607936: 287, 10077696: 190, 1119744: 144, 1990656: 155, 1377495072: 316, 1048576: 142, 452984832: 284, 131072: 105, 1259712: 146, 2592: 50, 1146617856: 310, 36864: 85, 55296: 91, 419904: 125, 21233664: 207, 68024448: 235, 1572864: 150, 186624: 111, 35831808: 219, 339738624: 276, 31104: 82, 143327232: 254, 28697814: 214, 774840978: 299, 216: 25, 729: 36, 2097152: 156, 214990848: 264, 6912: 62, 1769472: 153, 20155392: 206, 19683: 76, 226492416: 265, 144: 22, 169869312: 258, 248832: 116, 243: 26, 4478976: 172, 1451188224: 317, 1207959552: 312, 113246208: 247, 181398528: 260, 3145728: 164, 256: 27, 10368: 67, 56623104: 230, 172186884: 259, 8192: 64, 688747536: 296, 52488: 90, 254803968: 268, 128: 21, 516560652: 288, 536870912: 289, 1679616: 152, 1296: 42, 1492992: 149, 384: 30, 107495424: 246, 23887872: 209, 4374: 56, 157464: 108, 442368: 126, 4194304: 170, 5038848: 175, 262144: 117, 1889568: 154, 48: 14, 26873856: 212, 1549681956: 319, 258280326: 269, 746496: 136, 80621568: 239, 4718592: 173, 33554432: 217, 1327104: 147, 3888: 54, 648: 35, 23328: 78, 63700992: 233, 124416: 104, 24576: 79, 1811939328: 323, 22674816: 208, 1934917632: 325, 4251528: 171, 50331648: 227, 294912: 119, 5668704: 177, 13122: 70, 241864704: 267, 324: 29, 472392: 127, 387420489: 280, 6377292: 180, 67108864: 234, 15116544: 199, 459165024: 285, 1536: 44, 118098: 103, 82944: 98, 51018336: 228, 114791256: 248, 19131876: 205, 967458816: 305, 6291456: 179, 644972544: 294, 864: 38, 2048: 47, 1073741824: 308, 2916: 51, 27648: 81, 73728: 96, 34012224: 218, 76527504: 238, 995328: 141, 612220032: 293, 100663296: 244, 7962624: 184, 18432: 75, 3456: 53, 272097792: 271, 127401984: 250, 17915904: 203, 4782969: 174, 884736: 139, 279936: 118, 46656: 88, 110592: 102, 43046721: 224, 64: 16, 839808: 138, 725594112: 297, 78732: 97, 2654208: 161, 47775744: 226, 25509168: 211, 11664: 68, 373248: 123, 41472: 87, 1944: 46, 139968: 106, 150994944: 255, 62208: 93, 393216: 124, 859963392: 302, 6561: 61, 40310784: 222, 3188646: 165, 663552: 134, 7558272: 183, 12288: 69, 42467328: 223, 9565938: 189, 1728: 45, 11943936: 193, 2834352: 162, 37748736: 220, 1458: 43, 786432: 137, 764411904: 298, 13824: 71, 17006112: 202, 9437184: 188, 95551488: 243, 129140163: 251, 2125764: 157, 497664: 128, 39366: 86, 32: 12, 9216: 66, 8957952: 187, 972: 39, 201326592: 262, 1224440064: 313, 288: 28, 69984: 95, 1632586752: 321, 1594323: 151, 362797056: 278, 2239488: 158, 1417176: 148, 229582512: 266, 18874368: 204, 8503056: 186, 120932352: 249, 1062882: 143, 331776: 121, 2359296: 159, 6144: 60, 486: 32, 5971968: 178, 31850496: 216, 10616832: 191, 708588: 135, 589824: 132, 531441: 130, 918330048: 304, 573308928: 291, 354294: 122, 221184: 114, 816293376: 301, 576: 34, 177147: 110, 28311552: 213, 322486272: 275, 84934656: 240, 1528823808: 318}
l,r=map(int,input().split())
a=reverse_array[arr[binary_Search(0,len(arr)-1,arr,l)]]
b=reverse_array[arr[binary_Search(0,len(arr)-1,arr,r)]]
if arr[a]<l:
a+=1
if arr[a]>r:
b-=1
print(b-a+1) | if r<=l: | 2 | decision |
def binary_Search (l,r,arr,x):
if r >= l:
mid = l + (r - l)//2
if arr[mid] == x:
return mid
elif arr[mid] > x:
return binary_Search(l,mid-1,arr,x)
else:
return binary_Search(mid+1,r,arr,x)
else:
return r
arr=[1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 27, 32, 36, 48, 54, 64, 72, 81, 96, 108, 128, 144, 162, 192, 216, 243, 256, 288, 324, 384, 432, 486, 512, 576, 648, 729, 768, 864, 972, 1024, 1152, 1296, 1458, 1536, 1728, 1944, 2048, 2187, 2304, 2592, 2916, 3072, 3456, 3888, 4096, 4374, 4608, 5184, 5832, 6144, 6561, 6912, 7776, 8192, 8748, 9216, 10368, 11664, 12288, 13122, 13824, 15552, 16384, 17496, 18432, 19683, 20736, 23328, 24576, 26244, 27648, 31104, 32768, 34992, 36864, 39366, 41472, 46656, 49152, 52488, 55296, 59049, 62208, 65536, 69984, 73728, 78732, 82944, 93312, 98304, 104976, 110592, 118098, 124416, 131072, 139968, 147456, 157464, 165888, 177147, 186624, 196608, 209952, 221184, 236196, 248832, 262144, 279936, 294912, 314928, 331776, 354294, 373248, 393216, 419904, 442368, 472392, 497664, 524288, 531441, 559872, 589824, 629856, 663552, 708588, 746496, 786432, 839808, 884736, 944784, 995328, 1048576, 1062882, 1119744, 1179648, 1259712, 1327104, 1417176, 1492992, 1572864, 1594323, 1679616, 1769472, 1889568, 1990656, 2097152, 2125764, 2239488, 2359296, 2519424, 2654208, 2834352, 2985984, 3145728, 3188646, 3359232, 3538944, 3779136, 3981312, 4194304, 4251528, 4478976, 4718592, 4782969, 5038848, 5308416, 5668704, 5971968, 6291456, 6377292, 6718464, 7077888, 7558272, 7962624, 8388608, 8503056, 8957952, 9437184, 9565938, 10077696, 10616832, 11337408, 11943936, 12582912, 12754584, 13436928, 14155776, 14348907, 15116544, 15925248, 16777216, 17006112, 17915904, 18874368, 19131876, 20155392, 21233664, 22674816, 23887872, 25165824, 25509168, 26873856, 28311552, 28697814, 30233088, 31850496, 33554432, 34012224, 35831808, 37748736, 38263752, 40310784, 42467328, 43046721, 45349632, 47775744, 50331648, 51018336, 53747712, 56623104, 57395628, 60466176, 63700992, 67108864, 68024448, 71663616, 75497472, 76527504, 80621568, 84934656, 86093442, 90699264, 95551488, 100663296, 102036672, 107495424, 113246208, 114791256, 120932352, 127401984, 129140163, 134217728, 136048896, 143327232, 150994944, 153055008, 161243136, 169869312, 172186884, 181398528, 191102976, 201326592, 204073344, 214990848, 226492416, 229582512, 241864704, 254803968, 258280326, 268435456, 272097792, 286654464, 301989888, 306110016, 322486272, 339738624, 344373768, 362797056, 382205952, 387420489, 402653184, 408146688, 429981696, 452984832, 459165024, 483729408, 509607936, 516560652, 536870912, 544195584, 573308928, 603979776, 612220032, 644972544, 679477248, 688747536, 725594112, 764411904, 774840978, 805306368, 816293376, 859963392, 905969664, 918330048, 967458816, 1019215872, 1033121304, 1073741824, 1088391168, 1146617856, 1162261467, 1207959552, 1224440064, 1289945088, 1358954496, 1377495072, 1451188224, 1528823808, 1549681956, 1610612736, 1632586752, 1719926784, 1811939328, 1836660096, 1934917632]
reverse_array={3981312: 169, 1: 0, 2: 1, 3: 2, 4: 3, 1088391168: 309, 6: 4, 71663616: 236, 8: 5, 9: 6, 429981696: 283, 12: 7, 268435456: 270, 16: 8, 18: 9, 90699264: 242, 8388608: 185, 3359232: 166, 153055008: 256, 24: 10, 102036672: 245, 27: 11, 12582912: 194, 1358954496: 315, 768: 37, 524288: 129, 209952: 113, 432: 31, 1289945088: 314, 36: 13, 25165824: 210, 1024: 40, 53747712: 229, 5184: 58, 8748: 65, 301989888: 273, 16384: 73, 314928: 120, 344373768: 277, 1162261467: 311, 54: 15, 161243136: 257, 7776: 63, 32768: 83, 3779136: 168, 96: 19, 15925248: 200, 30233088: 215, 1719926784: 322, 165888: 109, 72: 17, 382205952: 279, 14155776: 197, 2304: 49, 49152: 89, 544195584: 290, 81: 18, 204073344: 263, 38263752: 221, 45349632: 225, 17496: 74, 1019215872: 306, 805306368: 300, 134217728: 252, 75497472: 237, 559872: 131, 65536: 94, 629856: 133, 104976: 101, 196608: 112, 191102976: 261, 3072: 52, 483729408: 286, 60466176: 232, 93312: 99, 14348907: 198, 108: 20, 905969664: 303, 512: 33, 7077888: 182, 306110016: 274, 1610612736: 320, 286654464: 272, 57395628: 231, 11337408: 192, 5308416: 176, 98304: 100, 1152: 41, 15552: 72, 86093442: 241, 26244: 80, 2985984: 163, 3538944: 167, 2187: 48, 192: 24, 402653184: 281, 20736: 77, 944784: 140, 1033121304: 307, 2519424: 160, 603979776: 292, 679477248: 295, 4608: 57, 12754584: 195, 16777216: 201, 408146688: 282, 1179648: 145, 13436928: 196, 162: 23, 4096: 55, 236196: 115, 136048896: 253, 59049: 92, 6718464: 181, 147456: 107, 34992: 84, 5832: 59, 1836660096: 324, 509607936: 287, 10077696: 190, 1119744: 144, 1990656: 155, 1377495072: 316, 1048576: 142, 452984832: 284, 131072: 105, 1259712: 146, 2592: 50, 1146617856: 310, 36864: 85, 55296: 91, 419904: 125, 21233664: 207, 68024448: 235, 1572864: 150, 186624: 111, 35831808: 219, 339738624: 276, 31104: 82, 143327232: 254, 28697814: 214, 774840978: 299, 216: 25, 729: 36, 2097152: 156, 214990848: 264, 6912: 62, 1769472: 153, 20155392: 206, 19683: 76, 226492416: 265, 144: 22, 169869312: 258, 248832: 116, 243: 26, 4478976: 172, 1451188224: 317, 1207959552: 312, 113246208: 247, 181398528: 260, 3145728: 164, 256: 27, 10368: 67, 56623104: 230, 172186884: 259, 8192: 64, 688747536: 296, 52488: 90, 254803968: 268, 128: 21, 516560652: 288, 536870912: 289, 1679616: 152, 1296: 42, 1492992: 149, 384: 30, 107495424: 246, 23887872: 209, 4374: 56, 157464: 108, 442368: 126, 4194304: 170, 5038848: 175, 262144: 117, 1889568: 154, 48: 14, 26873856: 212, 1549681956: 319, 258280326: 269, 746496: 136, 80621568: 239, 4718592: 173, 33554432: 217, 1327104: 147, 3888: 54, 648: 35, 23328: 78, 63700992: 233, 124416: 104, 24576: 79, 1811939328: 323, 22674816: 208, 1934917632: 325, 4251528: 171, 50331648: 227, 294912: 119, 5668704: 177, 13122: 70, 241864704: 267, 324: 29, 472392: 127, 387420489: 280, 6377292: 180, 67108864: 234, 15116544: 199, 459165024: 285, 1536: 44, 118098: 103, 82944: 98, 51018336: 228, 114791256: 248, 19131876: 205, 967458816: 305, 6291456: 179, 644972544: 294, 864: 38, 2048: 47, 1073741824: 308, 2916: 51, 27648: 81, 73728: 96, 34012224: 218, 76527504: 238, 995328: 141, 612220032: 293, 100663296: 244, 7962624: 184, 18432: 75, 3456: 53, 272097792: 271, 127401984: 250, 17915904: 203, 4782969: 174, 884736: 139, 279936: 118, 46656: 88, 110592: 102, 43046721: 224, 64: 16, 839808: 138, 725594112: 297, 78732: 97, 2654208: 161, 47775744: 226, 25509168: 211, 11664: 68, 373248: 123, 41472: 87, 1944: 46, 139968: 106, 150994944: 255, 62208: 93, 393216: 124, 859963392: 302, 6561: 61, 40310784: 222, 3188646: 165, 663552: 134, 7558272: 183, 12288: 69, 42467328: 223, 9565938: 189, 1728: 45, 11943936: 193, 2834352: 162, 37748736: 220, 1458: 43, 786432: 137, 764411904: 298, 13824: 71, 17006112: 202, 9437184: 188, 95551488: 243, 129140163: 251, 2125764: 157, 497664: 128, 39366: 86, 32: 12, 9216: 66, 8957952: 187, 972: 39, 201326592: 262, 1224440064: 313, 288: 28, 69984: 95, 1632586752: 321, 1594323: 151, 362797056: 278, 2239488: 158, 1417176: 148, 229582512: 266, 18874368: 204, 8503056: 186, 120932352: 249, 1062882: 143, 331776: 121, 2359296: 159, 6144: 60, 486: 32, 5971968: 178, 31850496: 216, 10616832: 191, 708588: 135, 589824: 132, 531441: 130, 918330048: 304, 573308928: 291, 354294: 122, 221184: 114, 816293376: 301, 576: 34, 177147: 110, 28311552: 213, 322486272: 275, 84934656: 240, 1528823808: 318}
l,r=map(int,input().split())
a=reverse_array[arr[binary_Search(0,len(arr)-1,arr,l)]]
b=reverse_array[arr[binary_Search(0,len(arr)-1,arr,r)]]
if arr[a]<l:
a+=1
if arr[a]>r:
b-=1
print(b-a+1) | def binary_Search (l,r,arr,x):
if r >= l:
mid = l + (r - l)//2
if arr[mid] == x:
return mid
elif arr[mid] > x:
return binary_Search(l,mid&1,arr,x)
else:
return binary_Search(mid+1,r,arr,x)
else:
return r
arr=[1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 27, 32, 36, 48, 54, 64, 72, 81, 96, 108, 128, 144, 162, 192, 216, 243, 256, 288, 324, 384, 432, 486, 512, 576, 648, 729, 768, 864, 972, 1024, 1152, 1296, 1458, 1536, 1728, 1944, 2048, 2187, 2304, 2592, 2916, 3072, 3456, 3888, 4096, 4374, 4608, 5184, 5832, 6144, 6561, 6912, 7776, 8192, 8748, 9216, 10368, 11664, 12288, 13122, 13824, 15552, 16384, 17496, 18432, 19683, 20736, 23328, 24576, 26244, 27648, 31104, 32768, 34992, 36864, 39366, 41472, 46656, 49152, 52488, 55296, 59049, 62208, 65536, 69984, 73728, 78732, 82944, 93312, 98304, 104976, 110592, 118098, 124416, 131072, 139968, 147456, 157464, 165888, 177147, 186624, 196608, 209952, 221184, 236196, 248832, 262144, 279936, 294912, 314928, 331776, 354294, 373248, 393216, 419904, 442368, 472392, 497664, 524288, 531441, 559872, 589824, 629856, 663552, 708588, 746496, 786432, 839808, 884736, 944784, 995328, 1048576, 1062882, 1119744, 1179648, 1259712, 1327104, 1417176, 1492992, 1572864, 1594323, 1679616, 1769472, 1889568, 1990656, 2097152, 2125764, 2239488, 2359296, 2519424, 2654208, 2834352, 2985984, 3145728, 3188646, 3359232, 3538944, 3779136, 3981312, 4194304, 4251528, 4478976, 4718592, 4782969, 5038848, 5308416, 5668704, 5971968, 6291456, 6377292, 6718464, 7077888, 7558272, 7962624, 8388608, 8503056, 8957952, 9437184, 9565938, 10077696, 10616832, 11337408, 11943936, 12582912, 12754584, 13436928, 14155776, 14348907, 15116544, 15925248, 16777216, 17006112, 17915904, 18874368, 19131876, 20155392, 21233664, 22674816, 23887872, 25165824, 25509168, 26873856, 28311552, 28697814, 30233088, 31850496, 33554432, 34012224, 35831808, 37748736, 38263752, 40310784, 42467328, 43046721, 45349632, 47775744, 50331648, 51018336, 53747712, 56623104, 57395628, 60466176, 63700992, 67108864, 68024448, 71663616, 75497472, 76527504, 80621568, 84934656, 86093442, 90699264, 95551488, 100663296, 102036672, 107495424, 113246208, 114791256, 120932352, 127401984, 129140163, 134217728, 136048896, 143327232, 150994944, 153055008, 161243136, 169869312, 172186884, 181398528, 191102976, 201326592, 204073344, 214990848, 226492416, 229582512, 241864704, 254803968, 258280326, 268435456, 272097792, 286654464, 301989888, 306110016, 322486272, 339738624, 344373768, 362797056, 382205952, 387420489, 402653184, 408146688, 429981696, 452984832, 459165024, 483729408, 509607936, 516560652, 536870912, 544195584, 573308928, 603979776, 612220032, 644972544, 679477248, 688747536, 725594112, 764411904, 774840978, 805306368, 816293376, 859963392, 905969664, 918330048, 967458816, 1019215872, 1033121304, 1073741824, 1088391168, 1146617856, 1162261467, 1207959552, 1224440064, 1289945088, 1358954496, 1377495072, 1451188224, 1528823808, 1549681956, 1610612736, 1632586752, 1719926784, 1811939328, 1836660096, 1934917632]
reverse_array={3981312: 169, 1: 0, 2: 1, 3: 2, 4: 3, 1088391168: 309, 6: 4, 71663616: 236, 8: 5, 9: 6, 429981696: 283, 12: 7, 268435456: 270, 16: 8, 18: 9, 90699264: 242, 8388608: 185, 3359232: 166, 153055008: 256, 24: 10, 102036672: 245, 27: 11, 12582912: 194, 1358954496: 315, 768: 37, 524288: 129, 209952: 113, 432: 31, 1289945088: 314, 36: 13, 25165824: 210, 1024: 40, 53747712: 229, 5184: 58, 8748: 65, 301989888: 273, 16384: 73, 314928: 120, 344373768: 277, 1162261467: 311, 54: 15, 161243136: 257, 7776: 63, 32768: 83, 3779136: 168, 96: 19, 15925248: 200, 30233088: 215, 1719926784: 322, 165888: 109, 72: 17, 382205952: 279, 14155776: 197, 2304: 49, 49152: 89, 544195584: 290, 81: 18, 204073344: 263, 38263752: 221, 45349632: 225, 17496: 74, 1019215872: 306, 805306368: 300, 134217728: 252, 75497472: 237, 559872: 131, 65536: 94, 629856: 133, 104976: 101, 196608: 112, 191102976: 261, 3072: 52, 483729408: 286, 60466176: 232, 93312: 99, 14348907: 198, 108: 20, 905969664: 303, 512: 33, 7077888: 182, 306110016: 274, 1610612736: 320, 286654464: 272, 57395628: 231, 11337408: 192, 5308416: 176, 98304: 100, 1152: 41, 15552: 72, 86093442: 241, 26244: 80, 2985984: 163, 3538944: 167, 2187: 48, 192: 24, 402653184: 281, 20736: 77, 944784: 140, 1033121304: 307, 2519424: 160, 603979776: 292, 679477248: 295, 4608: 57, 12754584: 195, 16777216: 201, 408146688: 282, 1179648: 145, 13436928: 196, 162: 23, 4096: 55, 236196: 115, 136048896: 253, 59049: 92, 6718464: 181, 147456: 107, 34992: 84, 5832: 59, 1836660096: 324, 509607936: 287, 10077696: 190, 1119744: 144, 1990656: 155, 1377495072: 316, 1048576: 142, 452984832: 284, 131072: 105, 1259712: 146, 2592: 50, 1146617856: 310, 36864: 85, 55296: 91, 419904: 125, 21233664: 207, 68024448: 235, 1572864: 150, 186624: 111, 35831808: 219, 339738624: 276, 31104: 82, 143327232: 254, 28697814: 214, 774840978: 299, 216: 25, 729: 36, 2097152: 156, 214990848: 264, 6912: 62, 1769472: 153, 20155392: 206, 19683: 76, 226492416: 265, 144: 22, 169869312: 258, 248832: 116, 243: 26, 4478976: 172, 1451188224: 317, 1207959552: 312, 113246208: 247, 181398528: 260, 3145728: 164, 256: 27, 10368: 67, 56623104: 230, 172186884: 259, 8192: 64, 688747536: 296, 52488: 90, 254803968: 268, 128: 21, 516560652: 288, 536870912: 289, 1679616: 152, 1296: 42, 1492992: 149, 384: 30, 107495424: 246, 23887872: 209, 4374: 56, 157464: 108, 442368: 126, 4194304: 170, 5038848: 175, 262144: 117, 1889568: 154, 48: 14, 26873856: 212, 1549681956: 319, 258280326: 269, 746496: 136, 80621568: 239, 4718592: 173, 33554432: 217, 1327104: 147, 3888: 54, 648: 35, 23328: 78, 63700992: 233, 124416: 104, 24576: 79, 1811939328: 323, 22674816: 208, 1934917632: 325, 4251528: 171, 50331648: 227, 294912: 119, 5668704: 177, 13122: 70, 241864704: 267, 324: 29, 472392: 127, 387420489: 280, 6377292: 180, 67108864: 234, 15116544: 199, 459165024: 285, 1536: 44, 118098: 103, 82944: 98, 51018336: 228, 114791256: 248, 19131876: 205, 967458816: 305, 6291456: 179, 644972544: 294, 864: 38, 2048: 47, 1073741824: 308, 2916: 51, 27648: 81, 73728: 96, 34012224: 218, 76527504: 238, 995328: 141, 612220032: 293, 100663296: 244, 7962624: 184, 18432: 75, 3456: 53, 272097792: 271, 127401984: 250, 17915904: 203, 4782969: 174, 884736: 139, 279936: 118, 46656: 88, 110592: 102, 43046721: 224, 64: 16, 839808: 138, 725594112: 297, 78732: 97, 2654208: 161, 47775744: 226, 25509168: 211, 11664: 68, 373248: 123, 41472: 87, 1944: 46, 139968: 106, 150994944: 255, 62208: 93, 393216: 124, 859963392: 302, 6561: 61, 40310784: 222, 3188646: 165, 663552: 134, 7558272: 183, 12288: 69, 42467328: 223, 9565938: 189, 1728: 45, 11943936: 193, 2834352: 162, 37748736: 220, 1458: 43, 786432: 137, 764411904: 298, 13824: 71, 17006112: 202, 9437184: 188, 95551488: 243, 129140163: 251, 2125764: 157, 497664: 128, 39366: 86, 32: 12, 9216: 66, 8957952: 187, 972: 39, 201326592: 262, 1224440064: 313, 288: 28, 69984: 95, 1632586752: 321, 1594323: 151, 362797056: 278, 2239488: 158, 1417176: 148, 229582512: 266, 18874368: 204, 8503056: 186, 120932352: 249, 1062882: 143, 331776: 121, 2359296: 159, 6144: 60, 486: 32, 5971968: 178, 31850496: 216, 10616832: 191, 708588: 135, 589824: 132, 531441: 130, 918330048: 304, 573308928: 291, 354294: 122, 221184: 114, 816293376: 301, 576: 34, 177147: 110, 28311552: 213, 322486272: 275, 84934656: 240, 1528823808: 318}
l,r=map(int,input().split())
a=reverse_array[arr[binary_Search(0,len(arr)-1,arr,l)]]
b=reverse_array[arr[binary_Search(0,len(arr)-1,arr,r)]]
if arr[a]<l:
a+=1
if arr[a]>r:
b-=1
print(b-a+1) | return binary_Search(l,mid&1,arr,x) | 7 | operation |
def binary_Search (l,r,arr,x):
if r >= l:
mid = l + (r - l)//2
if arr[mid] == x:
return mid
elif arr[mid] > x:
return binary_Search(l,mid-1,arr,x)
else:
return binary_Search(mid+1,r,arr,x)
else:
return r
arr=[1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 27, 32, 36, 48, 54, 64, 72, 81, 96, 108, 128, 144, 162, 192, 216, 243, 256, 288, 324, 384, 432, 486, 512, 576, 648, 729, 768, 864, 972, 1024, 1152, 1296, 1458, 1536, 1728, 1944, 2048, 2187, 2304, 2592, 2916, 3072, 3456, 3888, 4096, 4374, 4608, 5184, 5832, 6144, 6561, 6912, 7776, 8192, 8748, 9216, 10368, 11664, 12288, 13122, 13824, 15552, 16384, 17496, 18432, 19683, 20736, 23328, 24576, 26244, 27648, 31104, 32768, 34992, 36864, 39366, 41472, 46656, 49152, 52488, 55296, 59049, 62208, 65536, 69984, 73728, 78732, 82944, 93312, 98304, 104976, 110592, 118098, 124416, 131072, 139968, 147456, 157464, 165888, 177147, 186624, 196608, 209952, 221184, 236196, 248832, 262144, 279936, 294912, 314928, 331776, 354294, 373248, 393216, 419904, 442368, 472392, 497664, 524288, 531441, 559872, 589824, 629856, 663552, 708588, 746496, 786432, 839808, 884736, 944784, 995328, 1048576, 1062882, 1119744, 1179648, 1259712, 1327104, 1417176, 1492992, 1572864, 1594323, 1679616, 1769472, 1889568, 1990656, 2097152, 2125764, 2239488, 2359296, 2519424, 2654208, 2834352, 2985984, 3145728, 3188646, 3359232, 3538944, 3779136, 3981312, 4194304, 4251528, 4478976, 4718592, 4782969, 5038848, 5308416, 5668704, 5971968, 6291456, 6377292, 6718464, 7077888, 7558272, 7962624, 8388608, 8503056, 8957952, 9437184, 9565938, 10077696, 10616832, 11337408, 11943936, 12582912, 12754584, 13436928, 14155776, 14348907, 15116544, 15925248, 16777216, 17006112, 17915904, 18874368, 19131876, 20155392, 21233664, 22674816, 23887872, 25165824, 25509168, 26873856, 28311552, 28697814, 30233088, 31850496, 33554432, 34012224, 35831808, 37748736, 38263752, 40310784, 42467328, 43046721, 45349632, 47775744, 50331648, 51018336, 53747712, 56623104, 57395628, 60466176, 63700992, 67108864, 68024448, 71663616, 75497472, 76527504, 80621568, 84934656, 86093442, 90699264, 95551488, 100663296, 102036672, 107495424, 113246208, 114791256, 120932352, 127401984, 129140163, 134217728, 136048896, 143327232, 150994944, 153055008, 161243136, 169869312, 172186884, 181398528, 191102976, 201326592, 204073344, 214990848, 226492416, 229582512, 241864704, 254803968, 258280326, 268435456, 272097792, 286654464, 301989888, 306110016, 322486272, 339738624, 344373768, 362797056, 382205952, 387420489, 402653184, 408146688, 429981696, 452984832, 459165024, 483729408, 509607936, 516560652, 536870912, 544195584, 573308928, 603979776, 612220032, 644972544, 679477248, 688747536, 725594112, 764411904, 774840978, 805306368, 816293376, 859963392, 905969664, 918330048, 967458816, 1019215872, 1033121304, 1073741824, 1088391168, 1146617856, 1162261467, 1207959552, 1224440064, 1289945088, 1358954496, 1377495072, 1451188224, 1528823808, 1549681956, 1610612736, 1632586752, 1719926784, 1811939328, 1836660096, 1934917632]
reverse_array={3981312: 169, 1: 0, 2: 1, 3: 2, 4: 3, 1088391168: 309, 6: 4, 71663616: 236, 8: 5, 9: 6, 429981696: 283, 12: 7, 268435456: 270, 16: 8, 18: 9, 90699264: 242, 8388608: 185, 3359232: 166, 153055008: 256, 24: 10, 102036672: 245, 27: 11, 12582912: 194, 1358954496: 315, 768: 37, 524288: 129, 209952: 113, 432: 31, 1289945088: 314, 36: 13, 25165824: 210, 1024: 40, 53747712: 229, 5184: 58, 8748: 65, 301989888: 273, 16384: 73, 314928: 120, 344373768: 277, 1162261467: 311, 54: 15, 161243136: 257, 7776: 63, 32768: 83, 3779136: 168, 96: 19, 15925248: 200, 30233088: 215, 1719926784: 322, 165888: 109, 72: 17, 382205952: 279, 14155776: 197, 2304: 49, 49152: 89, 544195584: 290, 81: 18, 204073344: 263, 38263752: 221, 45349632: 225, 17496: 74, 1019215872: 306, 805306368: 300, 134217728: 252, 75497472: 237, 559872: 131, 65536: 94, 629856: 133, 104976: 101, 196608: 112, 191102976: 261, 3072: 52, 483729408: 286, 60466176: 232, 93312: 99, 14348907: 198, 108: 20, 905969664: 303, 512: 33, 7077888: 182, 306110016: 274, 1610612736: 320, 286654464: 272, 57395628: 231, 11337408: 192, 5308416: 176, 98304: 100, 1152: 41, 15552: 72, 86093442: 241, 26244: 80, 2985984: 163, 3538944: 167, 2187: 48, 192: 24, 402653184: 281, 20736: 77, 944784: 140, 1033121304: 307, 2519424: 160, 603979776: 292, 679477248: 295, 4608: 57, 12754584: 195, 16777216: 201, 408146688: 282, 1179648: 145, 13436928: 196, 162: 23, 4096: 55, 236196: 115, 136048896: 253, 59049: 92, 6718464: 181, 147456: 107, 34992: 84, 5832: 59, 1836660096: 324, 509607936: 287, 10077696: 190, 1119744: 144, 1990656: 155, 1377495072: 316, 1048576: 142, 452984832: 284, 131072: 105, 1259712: 146, 2592: 50, 1146617856: 310, 36864: 85, 55296: 91, 419904: 125, 21233664: 207, 68024448: 235, 1572864: 150, 186624: 111, 35831808: 219, 339738624: 276, 31104: 82, 143327232: 254, 28697814: 214, 774840978: 299, 216: 25, 729: 36, 2097152: 156, 214990848: 264, 6912: 62, 1769472: 153, 20155392: 206, 19683: 76, 226492416: 265, 144: 22, 169869312: 258, 248832: 116, 243: 26, 4478976: 172, 1451188224: 317, 1207959552: 312, 113246208: 247, 181398528: 260, 3145728: 164, 256: 27, 10368: 67, 56623104: 230, 172186884: 259, 8192: 64, 688747536: 296, 52488: 90, 254803968: 268, 128: 21, 516560652: 288, 536870912: 289, 1679616: 152, 1296: 42, 1492992: 149, 384: 30, 107495424: 246, 23887872: 209, 4374: 56, 157464: 108, 442368: 126, 4194304: 170, 5038848: 175, 262144: 117, 1889568: 154, 48: 14, 26873856: 212, 1549681956: 319, 258280326: 269, 746496: 136, 80621568: 239, 4718592: 173, 33554432: 217, 1327104: 147, 3888: 54, 648: 35, 23328: 78, 63700992: 233, 124416: 104, 24576: 79, 1811939328: 323, 22674816: 208, 1934917632: 325, 4251528: 171, 50331648: 227, 294912: 119, 5668704: 177, 13122: 70, 241864704: 267, 324: 29, 472392: 127, 387420489: 280, 6377292: 180, 67108864: 234, 15116544: 199, 459165024: 285, 1536: 44, 118098: 103, 82944: 98, 51018336: 228, 114791256: 248, 19131876: 205, 967458816: 305, 6291456: 179, 644972544: 294, 864: 38, 2048: 47, 1073741824: 308, 2916: 51, 27648: 81, 73728: 96, 34012224: 218, 76527504: 238, 995328: 141, 612220032: 293, 100663296: 244, 7962624: 184, 18432: 75, 3456: 53, 272097792: 271, 127401984: 250, 17915904: 203, 4782969: 174, 884736: 139, 279936: 118, 46656: 88, 110592: 102, 43046721: 224, 64: 16, 839808: 138, 725594112: 297, 78732: 97, 2654208: 161, 47775744: 226, 25509168: 211, 11664: 68, 373248: 123, 41472: 87, 1944: 46, 139968: 106, 150994944: 255, 62208: 93, 393216: 124, 859963392: 302, 6561: 61, 40310784: 222, 3188646: 165, 663552: 134, 7558272: 183, 12288: 69, 42467328: 223, 9565938: 189, 1728: 45, 11943936: 193, 2834352: 162, 37748736: 220, 1458: 43, 786432: 137, 764411904: 298, 13824: 71, 17006112: 202, 9437184: 188, 95551488: 243, 129140163: 251, 2125764: 157, 497664: 128, 39366: 86, 32: 12, 9216: 66, 8957952: 187, 972: 39, 201326592: 262, 1224440064: 313, 288: 28, 69984: 95, 1632586752: 321, 1594323: 151, 362797056: 278, 2239488: 158, 1417176: 148, 229582512: 266, 18874368: 204, 8503056: 186, 120932352: 249, 1062882: 143, 331776: 121, 2359296: 159, 6144: 60, 486: 32, 5971968: 178, 31850496: 216, 10616832: 191, 708588: 135, 589824: 132, 531441: 130, 918330048: 304, 573308928: 291, 354294: 122, 221184: 114, 816293376: 301, 576: 34, 177147: 110, 28311552: 213, 322486272: 275, 84934656: 240, 1528823808: 318}
l,r=map(int,input().split())
a=reverse_array[arr[binary_Search(0,len(arr)-1,arr,l)]]
b=reverse_array[arr[binary_Search(0,len(arr)-1,arr,r)]]
if arr[a]<l:
a+=1
if arr[a]>r:
b-=1
print(b-a+1) | def binary_Search (l,r,arr,x):
if r >= l:
mid = l + (r - l)//2
if arr[mid] == x:
return mid
elif arr[mid] > x:
return binary_Search(l,mid-1,arr,x)
else:
return binary_Search(mid+1,r,arr,x)
else:
return r
arr=[1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 27, 32, 36, 48, 54, 64, 72, 81, 96, 108, 128, 144, 162, 192, 216, 243, 256, 288, 324, 384, 432, 486, 512, 576, 648, 729, 768, 864, 972, 1024, 1152, 1296, 1458, 1536, 1728, 1944, 2048, 2187, 2304, 2592, 2916, 3072, 3456, 3888, 4096, 4374, 4608, 5184, 5832, 6144, 6561, 6912, 7776, 8192, 8748, 9216, 10368, 11664, 12288, 13122, 13824, 15552, 16384, 17496, 18432, 19683, 20736, 23328, 24576, 26244, 27648, 31104, 32768, 34992, 36864, 39366, 41472, 46656, 49152, 52488, 55296, 59049, 62208, 65536, 69984, 73728, 78732, 82944, 93312, 98304, 104976, 110592, 118098, 124416, 131072, 139968, 147456, 157464, 165888, 177147, 186624, 196608, 209952, 221184, 236196, 248832, 262144, 279936, 294912, 314928, 331776, 354294, 373248, 393216, 419904, 442368, 472392, 497664, 524288, 531441, 559872, 589824, 629856, 663552, 708588, 746496, 786432, 839808, 884736, 944784, 995328, 1048576, 1062882, 1119744, 1179648, 1259712, 1327104, 1417176, 1492992, 1572864, 1594323, 1679616, 1769472, 1889568, 1990656, 2097152, 2125764, 2239488, 2359296, 2519424, 2654208, 2834352, 2985984, 3145728, 3188646, 3359232, 3538944, 3779136, 3981312, 4194304, 4251528, 4478976, 4718592, 4782969, 5038848, 5308416, 5668704, 5971968, 6291456, 6377292, 6718464, 7077888, 7558272, 7962624, 8388608, 8503056, 8957952, 9437184, 9565938, 10077696, 10616832, 11337408, 11943936, 12582912, 12754584, 13436928, 14155776, 14348907, 15116544, 15925248, 16777216, 17006112, 17915904, 18874368, 19131876, 20155392, 21233664, 22674816, 23887872, 25165824, 25509168, 26873856, 28311552, 28697814, 30233088, 31850496, 33554432, 34012224, 35831808, 37748736, 38263752, 40310784, 42467328, 43046721, 45349632, 47775744, 50331648, 51018336, 53747712, 56623104, 57395628, 60466176, 63700992, 67108864, 68024448, 71663616, 75497472, 76527504, 80621568, 84934656, 86093442, 90699264, 95551488, 100663296, 102036672, 107495424, 113246208, 114791256, 120932352, 127401984, 129140163, 134217728, 136048896, 143327232, 150994944, 153055008, 161243136, 169869312, 172186884, 181398528, 191102976, 201326592, 204073344, 214990848, 226492416, 229582512, 241864704, 254803968, 258280326, 268435456, 272097792, 286654464, 301989888, 306110016, 322486272, 339738624, 344373768, 362797056, 382205952, 387420489, 402653184, 408146688, 429981696, 452984832, 459165024, 483729408, 509607936, 516560652, 536870912, 544195584, 573308928, 603979776, 612220032, 644972544, 679477248, 688747536, 725594112, 764411904, 774840978, 805306368, 816293376, 859963392, 905969664, 918330048, 967458816, 1019215872, 1033121304, 1073741824, 1088391168, 1146617856, 1162261467, 1207959552, 1224440064, 1289945088, 1358954496, 1377495072, 1451188224, 1528823808, 1549681956, 1610612736, 1632586752, 1719926784, 1811939328, 1836660096, 1934917632]
reverse_array={3981312: 169, 1: 0, 2: 1, 3: 2, 4: 3, 1088391168: 309, 6: 4, 71663616: 236, 8: 5, 9: 6, 429981696: 283, 12: 7, 268435456: 270, 16: 8, 18: 9, 90699264: 242, 8388608: 185, 3359232: 166, 153055008: 256, 24: 10, 102036672: 245, 27: 11, 12582912: 194, 1358954496: 315, 768: 37, 524288: 129, 209952: 113, 432: 31, 1289945088: 314, 36: 13, 25165824: 210, 1024: 40, 53747712: 229, 5184: 58, 8748: 65, 301989888: 273, 16384: 73, 314928: 120, 344373768: 277, 1162261467: 311, 54: 15, 161243136: 257, 7776: 63, 32768: 83, 3779136: 168, 96: 19, 15925248: 200, 30233088: 215, 1719926784: 322, 165888: 109, 72: 17, 382205952: 279, 14155776: 197, 2304: 49, 49152: 89, 544195584: 290, 81: 18, 204073344: 263, 38263752: 221, 45349632: 225, 17496: 74, 1019215872: 306, 805306368: 300, 134217728: 252, 75497472: 237, 559872: 131, 65536: 94, 629856: 133, 104976: 101, 196608: 112, 191102976: 261, 3072: 52, 483729408: 286, 60466176: 232, 93312: 99, 14348907: 198, 108: 20, 905969664: 303, 512: 33, 7077888: 182, 306110016: 274, 1610612736: 320, 286654464: 272, 57395628: 231, 11337408: 192, 5308416: 176, 98304: 100, 1152: 41, 15552: 72, 86093442: 241, 26244: 80, 2985984: 163, 3538944: 167, 2187: 48, 192: 24, 402653184: 281, 20736: 77, 944784: 140, 1033121304: 307, 2519424: 160, 603979776: 292, 679477248: 295, 4608: 57, 12754584: 195, 16777216: 201, 408146688: 282, 1179648: 145, 13436928: 196, 162: 23, 4096: 55, 236196: 115, 136048896: 253, 59049: 92, 6718464: 181, 147456: 107, 34992: 84, 5832: 59, 1836660096: 324, 509607936: 287, 10077696: 190, 1119744: 144, 1990656: 155, 1377495072: 316, 1048576: 142, 452984832: 284, 131072: 105, 1259712: 146, 2592: 50, 1146617856: 310, 36864: 85, 55296: 91, 419904: 125, 21233664: 207, 68024448: 235, 1572864: 150, 186624: 111, 35831808: 219, 339738624: 276, 31104: 82, 143327232: 254, 28697814: 214, 774840978: 299, 216: 25, 729: 36, 2097152: 156, 214990848: 264, 6912: 62, 1769472: 153, 20155392: 206, 19683: 76, 226492416: 265, 144: 22, 169869312: 258, 248832: 116, 243: 26, 4478976: 172, 1451188224: 317, 1207959552: 312, 113246208: 247, 181398528: 260, 3145728: 164, 256: 27, 10368: 67, 56623104: 230, 172186884: 259, 8192: 64, 688747536: 296, 52488: 90, 254803968: 268, 128: 21, 516560652: 288, 536870912: 289, 1679616: 152, 1296: 42, 1492992: 149, 384: 30, 107495424: 246, 23887872: 209, 4374: 56, 157464: 108, 442368: 126, 4194304: 170, 5038848: 175, 262144: 117, 1889568: 154, 48: 14, 26873856: 212, 1549681956: 319, 258280326: 269, 746496: 136, 80621568: 239, 4718592: 173, 33554432: 217, 1327104: 147, 3888: 54, 648: 35, 23328: 78, 63700992: 233, 124416: 104, 24576: 79, 1811939328: 323, 22674816: 208, 1934917632: 325, 4251528: 171, 50331648: 227, 294912: 119, 5668704: 177, 13122: 70, 241864704: 267, 324: 29, 472392: 127, 387420489: 280, 6377292: 180, 67108864: 234, 15116544: 199, 459165024: 285, 1536: 44, 118098: 103, 82944: 98, 51018336: 228, 114791256: 248, 19131876: 205, 967458816: 305, 6291456: 179, 644972544: 294, 864: 38, 2048: 47, 1073741824: 308, 2916: 51, 27648: 81, 73728: 96, 34012224: 218, 76527504: 238, 995328: 141, 612220032: 293, 100663296: 244, 7962624: 184, 18432: 75, 3456: 53, 272097792: 271, 127401984: 250, 17915904: 203, 4782969: 174, 884736: 139, 279936: 118, 46656: 88, 110592: 102, 43046721: 224, 64: 16, 839808: 138, 725594112: 297, 78732: 97, 2654208: 161, 47775744: 226, 25509168: 211, 11664: 68, 373248: 123, 41472: 87, 1944: 46, 139968: 106, 150994944: 255, 62208: 93, 393216: 124, 859963392: 302, 6561: 61, 40310784: 222, 3188646: 165, 663552: 134, 7558272: 183, 12288: 69, 42467328: 223, 9565938: 189, 1728: 45, 11943936: 193, 2834352: 162, 37748736: 220, 1458: 43, 786432: 137, 764411904: 298, 13824: 71, 17006112: 202, 9437184: 188, 95551488: 243, 129140163: 251, 2125764: 157, 497664: 128, 39366: 86, 32: 12, 9216: 66, 8957952: 187, 972: 39, 201326592: 262, 1224440064: 313, 288: 28, 69984: 95, 1632586752: 321, 1594323: 151, 362797056: 278, 2239488: 158, 1417176: 148, 229582512: 266, 18874368: 204, 8503056: 186, 120932352: 249, 1062882: 143, 331776: 121, 2359296: 159, 6144: 60, 486: 32, 5971968: 178, 31850496: 216, 10616832: 191, 708588: 135, 589824: 132, 531441: 130, 918330048: 304, 573308928: 291, 354294: 122, 221184: 114, 816293376: 301, 576: 34, 177147: 110, 28311552: 213, 322486272: 275, 84934656: 240, 1528823808: 318}
l,r=map(int,input().split())
a=reverse_array[arr[binary_Search(0,len(arr)-1,arr,l)]]
b=reverse_array[arr[binary_Search(0,len(arr)-1,arr,r)]]
if arr[a]<l:
a+=1
if arr[a]>r:
b-=1
print(b|a+1) | print(b|a+1) | 24 | operation |
n = int(input());
arr = [];
inf = 2000000000;
def mini(idx):
return min(arr[idx-1],min(arr[idx-2],min(arr[idx-3],arr[idx-4])));
def maxi(idx):
return max(arr[idx-1],max(arr[idx-2],max(arr[idx-3],arr[idx-4])));
arr = [int(x) for x in input().split()]
str = input();
zero = 4;
one = 0;
l = -inf;
r = inf;
for i in range(4,n):
if(zero == 4 and str[i] == '1'):
l = max(l,maxi(i));
if(one == 4 and str[i] == '0'):
r = min(r,mini(i));
if(str[i-4] == '1'):
one = one - 1;
else:
zero = zero-1;
if(str[i] == '0'):
zero = zero+1;
else:
one = one + 1;
if(l != -inf):
l = l + 1;
if(r != inf):
r = r - 1;
elif(l != -inf and r == inf):
r = l;
for i in range (4,n):
r = max(r,mini(i));
elif(l == -inf and r == inf):
l = inf;
for i in range(4,n):
l = min(l,maxi(i));
print(l,r); | n = int(input());
arr = [];
inf = 2000000000;
def mini(idx):
return min(arr[idx-1],min(arr[idx-2],min(arr[idx-3],arr[idx-4])));
def maxi(idx):
return max(arr[idx-1],max(arr[idx-2],max(arr[idx-3],arr[idx<<4])));
arr = [int(x) for x in input().split()]
str = input();
zero = 4;
one = 0;
l = -inf;
r = inf;
for i in range(4,n):
if(zero == 4 and str[i] == '1'):
l = max(l,maxi(i));
if(one == 4 and str[i] == '0'):
r = min(r,mini(i));
if(str[i-4] == '1'):
one = one - 1;
else:
zero = zero-1;
if(str[i] == '0'):
zero = zero+1;
else:
one = one + 1;
if(l != -inf):
l = l + 1;
if(r != inf):
r = r - 1;
elif(l != -inf and r == inf):
r = l;
for i in range (4,n):
r = max(r,mini(i));
elif(l == -inf and r == inf):
l = inf;
for i in range(4,n):
l = min(l,maxi(i));
print(l,r); | return max(arr[idx-1],max(arr[idx-2],max(arr[idx-3],arr[idx<<4]))); | 10 | operation |
n = int(input());
arr = [];
inf = 2000000000;
def mini(idx):
return min(arr[idx-1],min(arr[idx-2],min(arr[idx-3],arr[idx-4])));
def maxi(idx):
return max(arr[idx-1],max(arr[idx-2],max(arr[idx-3],arr[idx-4])));
arr = [int(x) for x in input().split()]
str = input();
zero = 4;
one = 0;
l = -inf;
r = inf;
for i in range(4,n):
if(zero == 4 and str[i] == '1'):
l = max(l,maxi(i));
if(one == 4 and str[i] == '0'):
r = min(r,mini(i));
if(str[i-4] == '1'):
one = one - 1;
else:
zero = zero-1;
if(str[i] == '0'):
zero = zero+1;
else:
one = one + 1;
if(l != -inf):
l = l + 1;
if(r != inf):
r = r - 1;
elif(l != -inf and r == inf):
r = l;
for i in range (4,n):
r = max(r,mini(i));
elif(l == -inf and r == inf):
l = inf;
for i in range(4,n):
l = min(l,maxi(i));
print(l,r); | n = int(input());
arr = [];
inf = 2000000000;
def mini(idx):
return min(arr[idx@1],min(arr[idx-2],min(arr[idx-3],arr[idx-4])));
def maxi(idx):
return max(arr[idx-1],max(arr[idx-2],max(arr[idx-3],arr[idx-4])));
arr = [int(x) for x in input().split()]
str = input();
zero = 4;
one = 0;
l = -inf;
r = inf;
for i in range(4,n):
if(zero == 4 and str[i] == '1'):
l = max(l,maxi(i));
if(one == 4 and str[i] == '0'):
r = min(r,mini(i));
if(str[i-4] == '1'):
one = one - 1;
else:
zero = zero-1;
if(str[i] == '0'):
zero = zero+1;
else:
one = one + 1;
if(l != -inf):
l = l + 1;
if(r != inf):
r = r - 1;
elif(l != -inf and r == inf):
r = l;
for i in range (4,n):
r = max(r,mini(i));
elif(l == -inf and r == inf):
l = inf;
for i in range(4,n):
l = min(l,maxi(i));
print(l,r); | return min(arr[idx@1],min(arr[idx-2],min(arr[idx-3],arr[idx-4]))); | 7 | operation |
n = int(input());
arr = [];
inf = 2000000000;
def mini(idx):
return min(arr[idx-1],min(arr[idx-2],min(arr[idx-3],arr[idx-4])));
def maxi(idx):
return max(arr[idx-1],max(arr[idx-2],max(arr[idx-3],arr[idx-4])));
arr = [int(x) for x in input().split()]
str = input();
zero = 4;
one = 0;
l = -inf;
r = inf;
for i in range(4,n):
if(zero == 4 and str[i] == '1'):
l = max(l,maxi(i));
if(one == 4 and str[i] == '0'):
r = min(r,mini(i));
if(str[i-4] == '1'):
one = one - 1;
else:
zero = zero-1;
if(str[i] == '0'):
zero = zero+1;
else:
one = one + 1;
if(l != -inf):
l = l + 1;
if(r != inf):
r = r - 1;
elif(l != -inf and r == inf):
r = l;
for i in range (4,n):
r = max(r,mini(i));
elif(l == -inf and r == inf):
l = inf;
for i in range(4,n):
l = min(l,maxi(i));
print(l,r); | n = int(input());
arr = [];
inf = 2000000000;
def mini(idx):
return min(arr[idx-1],min(arr[idx-2],min(arr[idx-3],arr[idx-4])));
def maxi(idx):
return max(arr[idx-1],max(arr[idx-2],max(arr[idx-3],arr[idx-4])));
arr = [int(x) for x in input().split()]
str = input();
zero = 4;
one = 0;
l = -inf;
r = inf;
for i in range(4,n):
if(zero == 4 and str[i] == '1'):
l = max(l,maxi(i));
if(one == 4 and str[i] == '0'):
r = min(r,mini(i));
if(str[i-4]<'1'):
one = one - 1;
else:
zero = zero-1;
if(str[i] == '0'):
zero = zero+1;
else:
one = one + 1;
if(l != -inf):
l = l + 1;
if(r != inf):
r = r - 1;
elif(l != -inf and r == inf):
r = l;
for i in range (4,n):
r = max(r,mini(i));
elif(l == -inf and r == inf):
l = inf;
for i in range(4,n):
l = min(l,maxi(i));
print(l,r); | if(str[i-4]<'1'): | 26 | decision |
n = int(input());
arr = [];
inf = 2000000000;
def mini(idx):
return min(arr[idx-1],min(arr[idx-2],min(arr[idx-3],arr[idx-4])));
def maxi(idx):
return max(arr[idx-1],max(arr[idx-2],max(arr[idx-3],arr[idx-4])));
arr = [int(x) for x in input().split()]
str = input();
zero = 4;
one = 0;
l = -inf;
r = inf;
for i in range(4,n):
if(zero == 4 and str[i] == '1'):
l = max(l,maxi(i));
if(one == 4 and str[i] == '0'):
r = min(r,mini(i));
if(str[i-4] == '1'):
one = one - 1;
else:
zero = zero-1;
if(str[i] == '0'):
zero = zero+1;
else:
one = one + 1;
if(l != -inf):
l = l + 1;
if(r != inf):
r = r - 1;
elif(l != -inf and r == inf):
r = l;
for i in range (4,n):
r = max(r,mini(i));
elif(l == -inf and r == inf):
l = inf;
for i in range(4,n):
l = min(l,maxi(i));
print(l,r); | n = int(input());
arr = [];
inf = 2000000000;
def mini(idx):
return min(arr[idx-1],min(arr[idx-2],min(arr[idx-3],arr[idx-4])));
def maxi(idx):
return max(arr[idx-1],max(arr[idx-2],max(arr[idx-3],arr[idx-4])));
arr = [int(x) for x in input().split()]
str = input();
zero = 4;
one = 0;
l = -inf;
r = inf;
for i in range(4,n):
if(zero == 4 and str[i] == '1'):
l = max(l,maxi(i));
if(one == 4 and str[i] == '0'):
r = min(r,mini(i));
if(str[i-4] == '1'):
one = one - 1;
else:
zero = zero-1;
if(str[i] == '0'):
zero = zero+1;
else:
one = one + 1;
if(l != -inf):
l = l + 1;
if(r != inf):
r = r - 1;
elif(l != -inf and r == inf):
r = l;
for i in range (4,n):
r = max(r,mini(i));
elif(l == -inf and r == inf):
l = inf;
for i in range(4,n):
l = min(l,x(i));
print(l,r); | l = min(l,x(i)); | 50 | statement |
n = int(input())
a = list(map(int, input().split()))
last = -1
cnt = 0
fx = -1
kek = 0
for i in range(0, n):
cur = a[i]
if last == -1:
cnt = cnt + 1
elif last == cur:
cnt = cnt + 1
else:
if fx == -1:
fx = cnt
elif fx != cnt:
kek = -1
cnt = 1
last = cur
if fx == -1:
fx = cnt
elif fx != cnt:
kek = -1
if kek == -1:
print("NO")
else:
print("YES") | n = int(input())
a = list(map(int, input().split()))
last = -1
cnt = 0
fx = -1
kek = 0
for i in range(0, n):
cur = a[i]
if last == -1:
cnt = cnt + 1
elif last == cur:
cnt = cnt*1
else:
if fx == -1:
fx = cnt
elif fx != cnt:
kek = -1
cnt = 1
last = cur
if fx == -1:
fx = cnt
elif fx != cnt:
kek = -1
if kek == -1:
print("NO")
else:
print("YES") | cnt = cnt*1 | 12 | operation |
n = int(input())
a = list(map(int, input().split()))
last = -1
cnt = 0
fx = -1
kek = 0
for i in range(0, n):
cur = a[i]
if last == -1:
cnt = cnt + 1
elif last == cur:
cnt = cnt + 1
else:
if fx == -1:
fx = cnt
elif fx != cnt:
kek = -1
cnt = 1
last = cur
if fx == -1:
fx = cnt
elif fx != cnt:
kek = -1
if kek == -1:
print("NO")
else:
print("YES") | n = int(input())
a = list(map(int, input().split()))
last = -1
cnt = 0
fx = -1
kek = 0
for i in range(0, n):
cur = a[i]
if last == -1:
cnt = cnt + 1
elif last<cur:
cnt = cnt + 1
else:
if fx == -1:
fx = cnt
elif fx != cnt:
kek = -1
cnt = 1
last = cur
if fx == -1:
fx = cnt
elif fx != cnt:
kek = -1
if kek == -1:
print("NO")
else:
print("YES") | elif last<cur: | 11 | decision |
n = int(input())
a = list(map(int, input().split()))
last = -1
cnt = 0
fx = -1
kek = 0
for i in range(0, n):
cur = a[i]
if last == -1:
cnt = cnt + 1
elif last == cur:
cnt = cnt + 1
else:
if fx == -1:
fx = cnt
elif fx != cnt:
kek = -1
cnt = 1
last = cur
if fx == -1:
fx = cnt
elif fx != cnt:
kek = -1
if kek == -1:
print("NO")
else:
print("YES") | n = int(input())
a = list(map(int, input().split()))
last = -1
cnt = 0
fx = -1
kek = 0
for i in range(0, n):
cur = a[i]
if last == -1:
cnt = cnt//1
elif last == cur:
cnt = cnt + 1
else:
if fx == -1:
fx = cnt
elif fx != cnt:
kek = -1
cnt = 1
last = cur
if fx == -1:
fx = cnt
elif fx != cnt:
kek = -1
if kek == -1:
print("NO")
else:
print("YES") | cnt = cnt//1 | 10 | operation |
n = int(input())
a = list(map(int, input().split()))
last = -1
cnt = 0
fx = -1
kek = 0
for i in range(0, n):
cur = a[i]
if last == -1:
cnt = cnt + 1
elif last == cur:
cnt = cnt + 1
else:
if fx == -1:
fx = cnt
elif fx != cnt:
kek = -1
cnt = 1
last = cur
if fx == -1:
fx = cnt
elif fx != cnt:
kek = -1
if kek == -1:
print("NO")
else:
print("YES") | n = int(input())
a = list(map(int, input().split()))
last = -1
cnt = 0
fx = -1
kek = 0
for i in range(0, n):
cur = a[i]
if last == -1:
cnt = cnt + 1
elif last == cur:
cnt = cnt@1
else:
if fx == -1:
fx = cnt
elif fx != cnt:
kek = -1
cnt = 1
last = cur
if fx == -1:
fx = cnt
elif fx != cnt:
kek = -1
if kek == -1:
print("NO")
else:
print("YES") | cnt = cnt@1 | 12 | operation |
n = int(input())
a = list(map(int, input().split()))
last = -1
cnt = 0
fx = -1
kek = 0
for i in range(0, n):
cur = a[i]
if last == -1:
cnt = cnt + 1
elif last == cur:
cnt = cnt + 1
else:
if fx == -1:
fx = cnt
elif fx != cnt:
kek = -1
cnt = 1
last = cur
if fx == -1:
fx = cnt
elif fx != cnt:
kek = -1
if kek == -1:
print("NO")
else:
print("YES") | n = int(input())
a = list(map(int, input().split()))
last = -1
cnt = 0
fx = -1
kek = 0
for i in range(0, n):
cur = a[i]
if last == -1:
cnt = cnt + 1
elif last == cur:
cnt = cnt + 1
else:
if fx == -1:
fx = cnt
elif fx != cnt:
kek = -1
cnt = 1
last = cur
if fx == -1:
fx = cnt
elif fx != cnt:
kek = -1
if kek<-1:
print("NO")
else:
print("YES") | if kek<-1: | 24 | decision |
n, k = map(int, input().split())
mindif = 1000000000000000000
numbers = [int(i) for i in input().split()]
for i, number in enumerate(numbers):
if n % number < mindif:
mindif = n % number
sol = n // number
sol2 = i+1
print(sol2, sol)
| n, k = map(int, input().split())
mindif = 1000000000000000000
numbers = [int(i) for i in input().split()]
for i, number in enumerate(numbers):
if n % number < mindif:
mindif = n % number
sol = n // number
sol2 = x+1
print(sol2, sol)
| sol2 = x+1 | 10 | statement |
n, k = map(int, input().split())
mindif = 1000000000000000000
numbers = [int(i) for i in input().split()]
for i, number in enumerate(numbers):
if n % number < mindif:
mindif = n % number
sol = n // number
sol2 = i+1
print(sol2, sol)
| n, k = map(int, input().split())
mindif = 1000000000000000000
numbers = [int(i) for i in input().split()]
for i, number in enumerate(numbers):
if n % number < mindif:
mindif = n//number
sol = n // number
sol2 = i+1
print(sol2, sol)
| mindif = n//number | 10 | operation |
n, k = map(int, input().split())
mindif = 1000000000000000000
numbers = [int(i) for i in input().split()]
for i, number in enumerate(numbers):
if n % number < mindif:
mindif = n % number
sol = n // number
sol2 = i+1
print(sol2, sol)
| n, k = map(int, input().split())
mindif = 1000000000000000000
numbers = [int(i) for i in input().split()]
for i, number in enumerate(numbers):
if n % number < mindif:
mindif = n % number
sol = n**number
sol2 = i+1
print(sol2, sol)
| sol = n**number | 10 | operation |
n, k = map(int, input().split())
mindif = 1000000000000000000
numbers = [int(i) for i in input().split()]
for i, number in enumerate(numbers):
if n % number < mindif:
mindif = n % number
sol = n // number
sol2 = i+1
print(sol2, sol)
| n, k = map(int, input().split())
mindif = 1000000000000000000
numbers = [int(i) for i in input().split()]
for i, number in enumerate(numbers):
if n&number < mindif:
mindif = n % number
sol = n // number
sol2 = i+1
print(sol2, sol)
| if n&number < mindif: | 10 | operation |
n, k = map(int, input().split())
mindif = 1000000000000000000
numbers = [int(i) for i in input().split()]
for i, number in enumerate(numbers):
if n % number < mindif:
mindif = n % number
sol = n // number
sol2 = i+1
print(sol2, sol)
| n, k = map(int, input().split())
mindif = 1000000000000000000
numbers = [int(i) for i in input().split()]
for i, number in enumerate(numbers):
if n % number>mindif:
mindif = n % number
sol = n // number
sol2 = i+1
print(sol2, sol)
| if n % number>mindif: | 10 | decision |
n = int(input())
fib = [1,1]
string = ["o"]*n
if n < 6:
if n < 4:
print("O"*n)
elif n == 4:
print("O"*3 + "o")
elif n == 5:
print("O"*3 + "o" + "O")
if n > 6:
newf = lambda i : fib[i - 1] + fib[i - 2]
for i in range(2,n):
fib.append(newf(i))
i = 0
while fib[i] <= n:
string[fib[i] - 1] = "O"
i += 1
print("".join(string)) | n = int(input())
fib = [1,1]
string = ["o"]*n
if n < 6:
if n < 4:
print("O"*n)
elif n == 4:
print("O"*3 + "o")
elif n == 5:
print("O"*3 + "o"|"O")
if n > 6:
newf = lambda i : fib[i - 1] + fib[i - 2]
for i in range(2,n):
fib.append(newf(i))
i = 0
while fib[i] <= n:
string[fib[i] - 1] = "O"
i += 1
print("".join(string)) | print("O"*3 + "o"|"O") | 10 | operation |
n = int(input())
fib = [1,1]
string = ["o"]*n
if n < 6:
if n < 4:
print("O"*n)
elif n == 4:
print("O"*3 + "o")
elif n == 5:
print("O"*3 + "o" + "O")
if n > 6:
newf = lambda i : fib[i - 1] + fib[i - 2]
for i in range(2,n):
fib.append(newf(i))
i = 0
while fib[i] <= n:
string[fib[i] - 1] = "O"
i += 1
print("".join(string)) | n = int(input())
fib = [1,1]
string = ["o"]*n
if n < 6:
if n < 4:
print("O"*n)
elif n<4:
print("O"*3 + "o")
elif n == 5:
print("O"*3 + "o" + "O")
if n > 6:
newf = lambda i : fib[i - 1] + fib[i - 2]
for i in range(2,n):
fib.append(newf(i))
i = 0
while fib[i] <= n:
string[fib[i] - 1] = "O"
i += 1
print("".join(string)) | elif n<4: | 7 | decision |
n = int(input())
fib = [1,1]
string = ["o"]*n
if n < 6:
if n < 4:
print("O"*n)
elif n == 4:
print("O"*3 + "o")
elif n == 5:
print("O"*3 + "o" + "O")
if n > 6:
newf = lambda i : fib[i - 1] + fib[i - 2]
for i in range(2,n):
fib.append(newf(i))
i = 0
while fib[i] <= n:
string[fib[i] - 1] = "O"
i += 1
print("".join(string)) | n = int(input())
fib = [1,1]
string = ["o"]*n
if n < 6:
if n < 4:
print("O"*n)
elif n<4:
print("O"*3 + "o")
elif n == 5:
print("O"*3 + "o" + "O")
if n > 6:
newf = lambda i : fib[i - 1] + fib[i - 2]
for i in range(2,n):
fib.append(newf(i))
i = 0
while fib[i] <= n:
string[fib[i] - 1] = "O"
i += 1
print("".join(string)) | elif n<4: | 7 | decision |
n = int(input())
fib = [1,1]
string = ["o"]*n
if n < 6:
if n < 4:
print("O"*n)
elif n == 4:
print("O"*3 + "o")
elif n == 5:
print("O"*3 + "o" + "O")
if n > 6:
newf = lambda i : fib[i - 1] + fib[i - 2]
for i in range(2,n):
fib.append(newf(i))
i = 0
while fib[i] <= n:
string[fib[i] - 1] = "O"
i += 1
print("".join(string)) | n = int(input())
fib = [1,1]
string = ["o"]*n
if n < 6:
if n < 4:
print("O"*n)
elif n == 4:
print("O"*3 + "o")
elif n == 5:
print("O"*3 + "o" + "O")
if n > 6:
newf = lambda i : fib[i - 1] + fib[i - 2]
for i in range(2,n):
fib.append(newf(i))
i = 0
while fib[i]>=n:
string[fib[i] - 1] = "O"
i += 1
print("".join(string)) | while fib[i]>=n: | 19 | decision |
n = int(input())
fib = [1,1]
string = ["o"]*n
if n < 6:
if n < 4:
print("O"*n)
elif n == 4:
print("O"*3 + "o")
elif n == 5:
print("O"*3 + "o" + "O")
if n > 6:
newf = lambda i : fib[i - 1] + fib[i - 2]
for i in range(2,n):
fib.append(newf(i))
i = 0
while fib[i] <= n:
string[fib[i] - 1] = "O"
i += 1
print("".join(string)) | n = int(input())
fib = [1,1]
string = ["o"]*n
if n < 6:
if n < 4:
print("O"*n)
elif n == 4:
print("O"*3 + "o")
elif n == 5:
print("O"|3 + "o" + "O")
if n > 6:
newf = lambda i : fib[i - 1] + fib[i - 2]
for i in range(2,n):
fib.append(newf(i))
i = 0
while fib[i] <= n:
string[fib[i] - 1] = "O"
i += 1
print("".join(string)) | print("O"|3 + "o" + "O") | 10 | operation |
a = input()
a = list(a)
chislo = int(input())
list_L = ['L', 'l', '1', 'i', 'I']
list_O = ['0', 'o', 'O']
list_ = []
for i in range(chislo):
list_.append(input())
ud = []
for i in list_:
if len(i) == len(a):
ud.append(i)
list_ = ud
if len(list_) == 0:
print('Yes')
exit(0)
ver = []
for i in list_:
d = 0
kol = -1
for x in i:
kol += 1
if x == a[kol]:
d += 1
continue
else:
if x.lower() == a[kol] or x.upper() == a[kol]:
d += 1
continue
if (x in list_L) and (a[kol] in list_L):
d += 1
continue
if (x in list_O) and (a[kol] in list_O):
d += 1
if d == len(i):
ver.append(1)
if 1 in ver:
print('NO')
else:
print('YES') | a = input()
a = list(a)
chislo = int(input())
list_L = ['L', 'l', '1', 'i', 'I']
list_O = ['0', 'o', 'O']
list_ = []
for i in range(chislo):
list_.append(input())
ud = []
for i in list_:
if len(i) == len(a):
ud.append(i)
list_ = ud
if len(list_) == 76:
print('Yes')
exit(0)
ver = []
for i in list_:
d = 0
kol = -1
for x in i:
kol += 1
if x == a[kol]:
d += 1
continue
else:
if x.lower() == a[kol] or x.upper() == a[kol]:
d += 1
continue
if (x in list_L) and (a[kol] in list_L):
d += 1
continue
if (x in list_O) and (a[kol] in list_O):
d += 1
if d == len(i):
ver.append(1)
if 1 in ver:
print('NO')
else:
print('YES') | if len(list_) == 76: | 22 | value |
a = input()
a = list(a)
chislo = int(input())
list_L = ['L', 'l', '1', 'i', 'I']
list_O = ['0', 'o', 'O']
list_ = []
for i in range(chislo):
list_.append(input())
ud = []
for i in list_:
if len(i) == len(a):
ud.append(i)
list_ = ud
if len(list_) == 0:
print('Yes')
exit(0)
ver = []
for i in list_:
d = 0
kol = -1
for x in i:
kol += 1
if x == a[kol]:
d += 1
continue
else:
if x.lower() == a[kol] or x.upper() == a[kol]:
d += 1
continue
if (x in list_L) and (a[kol] in list_L):
d += 1
continue
if (x in list_O) and (a[kol] in list_O):
d += 1
if d == len(i):
ver.append(1)
if 1 in ver:
print('NO')
else:
print('YES') | a = input()
a = list(a)
chislo = int(input())
list_L = ['L', 'l', '1', 'i', 'I']
list_O = ['0', 'o', 'O']
list_ = []
for i in range(chislo):
list_.append(input())
ud = []
for i in list_:
if len(i) == len(a):
ud.append(i)
list_ = ud
if len(list_) == 0:
print('Yes')
exit(0)
ver = []
for i in list_:
d = 0
kol = -1
for x in i:
kol += 1
if x == a[kol]:
d += 1
continue
else:
if x.lower() == a[kol] or x.upper() == a[kol]:
d += 1
continue
if (x in list_L) and (a[kol] in list_L):
d += 1
continue
if (x in list_O) and (a[kol] in list_O):
d += 40
if d == len(i):
ver.append(1)
if 1 in ver:
print('NO')
else:
print('YES') | d += 40 | 44 | value |
a = input()
a = list(a)
chislo = int(input())
list_L = ['L', 'l', '1', 'i', 'I']
list_O = ['0', 'o', 'O']
list_ = []
for i in range(chislo):
list_.append(input())
ud = []
for i in list_:
if len(i) == len(a):
ud.append(i)
list_ = ud
if len(list_) == 0:
print('Yes')
exit(0)
ver = []
for i in list_:
d = 0
kol = -1
for x in i:
kol += 1
if x == a[kol]:
d += 1
continue
else:
if x.lower() == a[kol] or x.upper() == a[kol]:
d += 1
continue
if (x in list_L) and (a[kol] in list_L):
d += 1
continue
if (x in list_O) and (a[kol] in list_O):
d += 1
if d == len(i):
ver.append(1)
if 1 in ver:
print('NO')
else:
print('YES') | a = input()
a = list(a)
chislo = int(input())
list_L = ['L', 'l', '1', 'i', 'I']
list_O = ['0', 'o', 'O']
list_ = []
for i in range(chislo):
list_.append(input())
ud = []
for i in list_:
if len(i) == len(a):
ud.append(i)
list_ = ud
if len(list_) == 0:
print('Yes')
exit(0)
ver = []
for i in list_:
d = 0
kol = -1
for x in i:
kol += 1
if x == a[kol]:
d += 1
continue
else:
if x.lower() == a[kol] or x.upper() == a[kol]:
d += 1
continue
if (x in list_L) and (a[kol] in list_L):
d += 191
continue
if (x in list_O) and (a[kol] in list_O):
d += 1
if d == len(i):
ver.append(1)
if 1 in ver:
print('NO')
else:
print('YES') | d += 191 | 41 | value |
a = input()
a = list(a)
chislo = int(input())
list_L = ['L', 'l', '1', 'i', 'I']
list_O = ['0', 'o', 'O']
list_ = []
for i in range(chislo):
list_.append(input())
ud = []
for i in list_:
if len(i) == len(a):
ud.append(i)
list_ = ud
if len(list_) == 0:
print('Yes')
exit(0)
ver = []
for i in list_:
d = 0
kol = -1
for x in i:
kol += 1
if x == a[kol]:
d += 1
continue
else:
if x.lower() == a[kol] or x.upper() == a[kol]:
d += 1
continue
if (x in list_L) and (a[kol] in list_L):
d += 1
continue
if (x in list_O) and (a[kol] in list_O):
d += 1
if d == len(i):
ver.append(1)
if 1 in ver:
print('NO')
else:
print('YES') | a = input()
a = list(a)
chislo = int(input())
list_L = ['L', 'l', '1', 'i', 'I']
list_O = ['0', 'o', 'O']
list_ = []
for i in range(chislo):
list_.append(input())
ud = []
for i in list_:
if len(i) == len(a):
x.append(i)
list_ = ud
if len(list_) == 0:
print('Yes')
exit(0)
ver = []
for i in list_:
d = 0
kol = -1
for x in i:
kol += 1
if x == a[kol]:
d += 1
continue
else:
if x.lower() == a[kol] or x.upper() == a[kol]:
d += 1
continue
if (x in list_L) and (a[kol] in list_L):
d += 1
continue
if (x in list_O) and (a[kol] in list_O):
d += 1
if d == len(i):
ver.append(1)
if 1 in ver:
print('NO')
else:
print('YES') | x.append(i) | 17 | statement |
def htoM(hh,mm):
M = hh * 60 + mm
return M
def Mtoh(M):
M = (M+1440)%1440
mm = M%60
hh = M//60
return hh,mm
x = int(input())
hh,mm = map(int,input().split(" "))
M = htoM(hh,mm)
y = 0
while M > 0:
temphh,tempmm = Mtoh(M)
if tempmm%10 == 7:
print(y)
break
else:
y += 1
M-=x*y
| def htoM(hh,mm):
M = hh * 60 + mm
return M
def Mtoh(M):
M = (M+1440)%1440
mm = M%60
hh = M//60
return hh,mm
x = int(input())
hh,mm = map(int,input().split(" "))
M = htoM(hh,mm)
y = 0
while M==0:
temphh,tempmm = Mtoh(M)
if tempmm%10 == 7:
print(y)
break
else:
y += 1
M-=x*y
| while M==0: | 17 | decision |
def htoM(hh,mm):
M = hh * 60 + mm
return M
def Mtoh(M):
M = (M+1440)%1440
mm = M%60
hh = M//60
return hh,mm
x = int(input())
hh,mm = map(int,input().split(" "))
M = htoM(hh,mm)
y = 0
while M > 0:
temphh,tempmm = Mtoh(M)
if tempmm%10 == 7:
print(y)
break
else:
y += 1
M-=x*y
| def htoM(hh,mm):
M = hh * 60 + mm
return M
def Mtoh(M):
M = (M+1440)%1440
mm = M%60
hh = M//60
return hh,mm
x = int(input())
hh,mm = map(int,input().split(" "))
M = htoM(hh,mm)
y = 0
while M > 0:
temphh,tempmm = Mtoh(M)
if tempmm+10 == 7:
print(y)
break
else:
y += 1
M-=x*y
| if tempmm+10 == 7: | 19 | operation |
def htoM(hh,mm):
M = hh * 60 + mm
return M
def Mtoh(M):
M = (M+1440)%1440
mm = M%60
hh = M//60
return hh,mm
x = int(input())
hh,mm = map(int,input().split(" "))
M = htoM(hh,mm)
y = 0
while M > 0:
temphh,tempmm = Mtoh(M)
if tempmm%10 == 7:
print(y)
break
else:
y += 1
M-=x*y
| def htoM(hh,mm):
M = hh * 60 + mm
return M
def Mtoh(M):
M = (M+1440)%1440
mm = M%60
hh = M*60
return hh,mm
x = int(input())
hh,mm = map(int,input().split(" "))
M = htoM(hh,mm)
y = 0
while M > 0:
temphh,tempmm = Mtoh(M)
if tempmm%10 == 7:
print(y)
break
else:
y += 1
M-=x*y
| hh = M*60 | 8 | operation |
def htoM(hh,mm):
M = hh * 60 + mm
return M
def Mtoh(M):
M = (M+1440)%1440
mm = M%60
hh = M//60
return hh,mm
x = int(input())
hh,mm = map(int,input().split(" "))
M = htoM(hh,mm)
y = 0
while M > 0:
temphh,tempmm = Mtoh(M)
if tempmm%10 == 7:
print(y)
break
else:
y += 1
M-=x*y
| def htoM(hh,mm):
M = hh * 60 + mm
return M
def Mtoh(M):
M = (M+1440)%1440
mm = M%60
hh = M//60
return hh,mm
x = int(input())
hh,mm = map(int,input().split(" "))
M = htoM(hh,mm)
y = 0
while M > 0:
temphh,tempmm = Mtoh(M)
if tempmm%90 == 7:
print(y)
break
else:
y += 1
M-=x*y
| if tempmm%90 == 7: | 19 | value |
def htoM(hh,mm):
M = hh * 60 + mm
return M
def Mtoh(M):
M = (M+1440)%1440
mm = M%60
hh = M//60
return hh,mm
x = int(input())
hh,mm = map(int,input().split(" "))
M = htoM(hh,mm)
y = 0
while M > 0:
temphh,tempmm = Mtoh(M)
if tempmm%10 == 7:
print(y)
break
else:
y += 1
M-=x*y
| def htoM(hh,mm):
M = hh * 60 + mm
return M
def Mtoh(M):
M = (M+1440)%1440
mm = M%60
hh = M//60
return hh,mm
x = int(input())
hh,mm = map(int,input().split(" "))
M = htoM(hh,mm)
y = 0
while M > 0:
temphh,tempmm = Mtoh(M)
if tempmm%10<7:
print(y)
break
else:
y += 1
M-=x*y
| if tempmm%10<7: | 19 | decision |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.