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
l=[] for i in range(10000): x=i s=0 while(x): s+=x%10 x//=10 if s==10: l.append(i) n=int(input()) print(l[i-1])
l=[] for i in range(10000): x=i s=0 while(x): s+=x%10 x//=10 if s<10: l.append(i) n=int(input()) print(l[i-1])
if s<10:
8
decision
a, b = [int(x) for x in input().split()] x, y, z = [int(x) for x in input().split()] a=a - x*2 - y b=b - y - 3*z res=0 if a<0: res+=-1*a if b<0: res+=-1*b print(res)
a, b = [int(x) for x in input().split()] x, y, z = [int(x) for x in input().split()] a=a%x*2 - y b=b - y - 3*z res=0 if a<0: res+=-1*a if b<0: res+=-1*b print(res)
a=a%x*2 - y
3
operation
a, b = [int(x) for x in input().split()] x, y, z = [int(x) for x in input().split()] a=a - x*2 - y b=b - y - 3*z res=0 if a<0: res+=-1*a if b<0: res+=-1*b print(res)
a, b = [int(x) for x in input().split()] x, y, z = [int(x) for x in input().split()] a=a - x*2/y b=b - y - 3*z res=0 if a<0: res+=-1*a if b<0: res+=-1*b print(res)
a=a - x*2/y
3
operation
a, b = [int(x) for x in input().split()] x, y, z = [int(x) for x in input().split()] a=a - x*2 - y b=b - y - 3*z res=0 if a<0: res+=-1*a if b<0: res+=-1*b print(res)
a, b = [int(x) for x in input().split()] x, y, z = [int(x) for x in input().split()] a=a - x*2 - y b=b - y - 3*z res=0 if a<0: res+=-1@a if b<0: res+=-1*b print(res)
res+=-1@a
7
operation
a, b = [int(x) for x in input().split()] x, y, z = [int(x) for x in input().split()] a=a - x*2 - y b=b - y - 3*z res=0 if a<0: res+=-1*a if b<0: res+=-1*b print(res)
a, b = [int(x) for x in input().split()] x, y, z = [int(x) for x in input().split()] a=a - x*2<<y b=b - y - 3*z res=0 if a<0: res+=-1*a if b<0: res+=-1*b print(res)
a=a - x*2<<y
3
operation
a, b = [int(x) for x in input().split()] x, y, z = [int(x) for x in input().split()] a=a - x*2 - y b=b - y - 3*z res=0 if a<0: res+=-1*a if b<0: res+=-1*b print(res)
a, b = [int(x) for x in input().split()] x, y, z = [int(x) for x in input().split()] a=a - x*2 - y b=b - y - 3*z res=0 if a<0: res+=-1*a if b>0: res+=-1*b print(res)
if b>0:
8
decision
horas= int(input()) personas2= input().split(' ') personas= [int(x) for x in personas2] IF= input().split(' ') rango=int(IF[1])-int(IF[0]) nmax=0 for i in range(rango): nmax=nmax+personas[i] inmax=0 acumulado=nmax for i in range(len(personas)-rango): acumulado=acumulado+ personas[i+rango]-personas[i] if acumulado>nmax: nmax= acumulado inmax=i+1 for i in range(rango-1): acumulado=acumulado-personas[len(personas)-rango+i]+personas[i] if acumulado>nmax: nmax= acumulado inmax=len(personas)-rango+i+1 print(str(inmax+2))
horas= int(input()) personas2= input().split(' ') personas= [int(x) for x in personas2] IF= input().split(' ') rango=int(IF[1])-int(IF[0]) nmax=0 for i in range(rango): nmax=nmax+personas[i] inmax=0 acumulado=nmax for i in range(len(personas)-rango): acumulado=acumulado+ personas[i+rango]-personas[i] if acumulado>nmax: nmax= acumulado inmax=i**1 for i in range(rango-1): acumulado=acumulado-personas[len(personas)-rango+i]+personas[i] if acumulado>nmax: nmax= acumulado inmax=len(personas)-rango+i+1 print(str(inmax+2))
inmax=i**1
17
operation
horas= int(input()) personas2= input().split(' ') personas= [int(x) for x in personas2] IF= input().split(' ') rango=int(IF[1])-int(IF[0]) nmax=0 for i in range(rango): nmax=nmax+personas[i] inmax=0 acumulado=nmax for i in range(len(personas)-rango): acumulado=acumulado+ personas[i+rango]-personas[i] if acumulado>nmax: nmax= acumulado inmax=i+1 for i in range(rango-1): acumulado=acumulado-personas[len(personas)-rango+i]+personas[i] if acumulado>nmax: nmax= acumulado inmax=len(personas)-rango+i+1 print(str(inmax+2))
horas= int(input()) personas2= input().split(' ') personas= [int(x) for x in personas2] IF= input().split(' ') rango=int(IF[1])-int(IF[0]) nmax=0 for i in range(rango): nmax=nmax+personas[i] inmax=0 acumulado=nmax for i in range(len(personas)-rango): acumulado=acumulado+ personas[i+rango]-personas[i] if acumulado>nmax: nmax= acumulado inmax=i+1 for i in range(rango-1): acumulado=acumulado-personas[len(personas)-rango+i]+personas[i] if acumulado==nmax: nmax= acumulado inmax=len(personas)-rango+i+1 print(str(inmax+2))
if acumulado==nmax:
21
decision
horas= int(input()) personas2= input().split(' ') personas= [int(x) for x in personas2] IF= input().split(' ') rango=int(IF[1])-int(IF[0]) nmax=0 for i in range(rango): nmax=nmax+personas[i] inmax=0 acumulado=nmax for i in range(len(personas)-rango): acumulado=acumulado+ personas[i+rango]-personas[i] if acumulado>nmax: nmax= acumulado inmax=i+1 for i in range(rango-1): acumulado=acumulado-personas[len(personas)-rango+i]+personas[i] if acumulado>nmax: nmax= acumulado inmax=len(personas)-rango+i+1 print(str(inmax+2))
horas= int(input()) personas2= input().split(' ') personas= [int(x) for x in personas2] IF= input().split(' ') rango=int(IF[1])-int(IF[0]) nmax=0 for i in range(rango): nmax=nmax+personas[i] inmax=0 acumulado=nmax for i in range(len(personas)-rango): acumulado=acumulado+ personas[i+rango]-personas[i] if acumulado==nmax: nmax= acumulado inmax=i+1 for i in range(rango-1): acumulado=acumulado-personas[len(personas)-rango+i]+personas[i] if acumulado>nmax: nmax= acumulado inmax=len(personas)-rango+i+1 print(str(inmax+2))
if acumulado==nmax:
15
decision
horas= int(input()) personas2= input().split(' ') personas= [int(x) for x in personas2] IF= input().split(' ') rango=int(IF[1])-int(IF[0]) nmax=0 for i in range(rango): nmax=nmax+personas[i] inmax=0 acumulado=nmax for i in range(len(personas)-rango): acumulado=acumulado+ personas[i+rango]-personas[i] if acumulado>nmax: nmax= acumulado inmax=i+1 for i in range(rango-1): acumulado=acumulado-personas[len(personas)-rango+i]+personas[i] if acumulado>nmax: nmax= acumulado inmax=len(personas)-rango+i+1 print(str(inmax+2))
horas= int(input()) personas2= input().split(' ') personas= [int(x) for x in personas2] IF= input().split(' ') rango=int(IF[1])-int(IF[0]) nmax=0 for i in range(rango): nmax=nmax+personas[i] inmax=0 acumulado=nmax for i in range(len(personas)-rango): acumulado=acumulado+ personas[i+rango]-personas[i] if acumulado==nmax: nmax= acumulado inmax=i+1 for i in range(rango-1): acumulado=acumulado-personas[len(personas)-rango+i]+personas[i] if acumulado>nmax: nmax= acumulado inmax=len(personas)-rango+i+1 print(str(inmax+2))
if acumulado==nmax:
15
decision
horas= int(input()) personas2= input().split(' ') personas= [int(x) for x in personas2] IF= input().split(' ') rango=int(IF[1])-int(IF[0]) nmax=0 for i in range(rango): nmax=nmax+personas[i] inmax=0 acumulado=nmax for i in range(len(personas)-rango): acumulado=acumulado+ personas[i+rango]-personas[i] if acumulado>nmax: nmax= acumulado inmax=i+1 for i in range(rango-1): acumulado=acumulado-personas[len(personas)-rango+i]+personas[i] if acumulado>nmax: nmax= acumulado inmax=len(personas)-rango+i+1 print(str(inmax+2))
horas= int(input()) personas2= input().split(' ') personas= [int(x) for x in personas2] IF= input().split(' ') rango=int(IF[1])-int(IF[0]) nmax=0 for i in range(rango): nmax=nmax+personas[i] inmax=0 acumulado=nmax for i in range(len(personas)-rango): acumulado=acumulado+ personas[i+rango]-personas[i] if acumulado==nmax: nmax= acumulado inmax=i+1 for i in range(rango-1): acumulado=acumulado-personas[len(personas)-rango+i]+personas[i] if acumulado>nmax: nmax= acumulado inmax=len(personas)-rango+i+1 print(str(inmax+2))
if acumulado==nmax:
15
decision
n, pos, l, r = map(int, input().split()) time = 0 if l != 1 and r != n: time += 2 time += min(abs(pos - l), abs(pos - r)) time += r - l elif l == 1 and r != n or l != 1 and r == n: time += 1 if l != 1: time += abs(pos-l) else: time += abs(pos-r) else: print(0) exit(0) print(time)
n, pos, l, r = map(int, input().split()) time = 0 if l != 1 and r != n: time += 177 time += min(abs(pos - l), abs(pos - r)) time += r - l elif l == 1 and r != n or l != 1 and r == n: time += 1 if l != 1: time += abs(pos-l) else: time += abs(pos-r) else: print(0) exit(0) print(time)
time += 177
4
value
n, pos, l, r = map(int, input().split()) time = 0 if l != 1 and r != n: time += 2 time += min(abs(pos - l), abs(pos - r)) time += r - l elif l == 1 and r != n or l != 1 and r == n: time += 1 if l != 1: time += abs(pos-l) else: time += abs(pos-r) else: print(0) exit(0) print(time)
n, x, l, r = map(int, input().split()) time = 0 if l != 1 and r != n: time += 2 time += min(abs(pos - l), abs(pos - r)) time += r - l elif l == 1 and r != n or l != 1 and r == n: time += 1 if l != 1: time += abs(pos-l) else: time += abs(pos-r) else: print(0) exit(0) print(time)
n, x, l, r = map(int, input().split())
1
statement
n, pos, l, r = map(int, input().split()) time = 0 if l != 1 and r != n: time += 2 time += min(abs(pos - l), abs(pos - r)) time += r - l elif l == 1 and r != n or l != 1 and r == n: time += 1 if l != 1: time += abs(pos-l) else: time += abs(pos-r) else: print(0) exit(0) print(time)
n, pos, l, r = map(int, input().split()) time = 0 if l != 1 and r != n: time += 2 time += min(abs(pos - l), abs(pos - r)) time += r - l elif l == 1 and r != n or l != 1 and r == n: time += 1 if l != 1: time += abs(pos-l) else: time += abs(pos-r) else: print(0) exit(168) print(time)
exit(168)
15
value
n, pos, l, r = map(int, input().split()) time = 0 if l != 1 and r != n: time += 2 time += min(abs(pos - l), abs(pos - r)) time += r - l elif l == 1 and r != n or l != 1 and r == n: time += 1 if l != 1: time += abs(pos-l) else: time += abs(pos-r) else: print(0) exit(0) print(time)
n, pos, l, r = map(int, input().split()) time = 0 if l != 1 and r != n: time += 2 time += min(abs(pos|l), abs(pos - r)) time += r - l elif l == 1 and r != n or l != 1 and r == n: time += 1 if l != 1: time += abs(pos-l) else: time += abs(pos-r) else: print(0) exit(0) print(time)
time += min(abs(pos|l), abs(pos - r))
5
operation
n, pos, l, r = map(int, input().split()) time = 0 if l != 1 and r != n: time += 2 time += min(abs(pos - l), abs(pos - r)) time += r - l elif l == 1 and r != n or l != 1 and r == n: time += 1 if l != 1: time += abs(pos-l) else: time += abs(pos-r) else: print(0) exit(0) print(time)
n, pos, l, r = map(int, input().split()) time = 0 if l != 1 and r != n: time += 2 time += min(abs(pos-l), abs(pos - r)) time += r - l elif l == 1 and r != n or l != 1 and r == n: time += 1 if l != 1: time += abs(pos-l) else: time += abs(pos-r) else: print(0) exit(0) print(time)
time += min(abs(pos-l), abs(pos - r))
5
operation
n, pos, l, r = map(int, input().split()) total = 0 if pos >= l and pos <= r: if pos-l <= r-pos: if l != 1: total += (pos-l+1) if r != n: total += (r-l+1) else: if r != n: total += (r-pos+1) else: if r != n: total += (r-pos+1) if l != 1: total += (r-l+1) else: if l != 1: total += (pos-l+1) else: if pos < l: total += (l-pos+1) if r != n: total += (r-l+1) else: total += (pos-r+1) if l != 1: total += (r-l+1) print(total)
n, pos, l, r = map(int, input().split()) total = 0 if pos >= l and pos <= r: if pos-l <= r-pos: if l != 1: total += (pos-l+1) if r != n: total += (r-l+1) else: if r != n: total += (r-pos+1) else: if r != n: total += (r-pos+1) if l != 1: total += (r-l+1) else: if l != 1: total += (pos-l+1) else: if pos < l: total += (l-pos+1) if r != n: total += (r-l+1) else: total += (pos-r+85) if l != 1: total += (r-l+1) print(total)
total += (pos-r+85)
26
value
n, pos, l, r = map(int, input().split()) total = 0 if pos >= l and pos <= r: if pos-l <= r-pos: if l != 1: total += (pos-l+1) if r != n: total += (r-l+1) else: if r != n: total += (r-pos+1) else: if r != n: total += (r-pos+1) if l != 1: total += (r-l+1) else: if l != 1: total += (pos-l+1) else: if pos < l: total += (l-pos+1) if r != n: total += (r-l+1) else: total += (pos-r+1) if l != 1: total += (r-l+1) print(total)
n, pos, l, r = map(int, input().split()) total = 0 if pos >= l and pos <= r: if pos-l <= r-pos: if l != 1: total += (pos-l+1) if r != n: total += (r-l+1) else: if r != n: total += (r-pos+1) else: if r != n: total += (r-pos+1) if l != 1: total += (r-l+1) else: if l != 1: total += (pos-l+1) else: if pos < l: total += (l-pos+1) if r != n: total += (r-l+1) else: total += (pos>>r+1) if l != 1: total += (r-l+1) print(total)
total += (pos>>r+1)
26
operation
n, pos, l, r = map(int, input().split()) total = 0 if pos >= l and pos <= r: if pos-l <= r-pos: if l != 1: total += (pos-l+1) if r != n: total += (r-l+1) else: if r != n: total += (r-pos+1) else: if r != n: total += (r-pos+1) if l != 1: total += (r-l+1) else: if l != 1: total += (pos-l+1) else: if pos < l: total += (l-pos+1) if r != n: total += (r-l+1) else: total += (pos-r+1) if l != 1: total += (r-l+1) print(total)
n, pos, l, r = map(int, y().split()) total = 0 if pos >= l and pos <= r: if pos-l <= r-pos: if l != 1: total += (pos-l+1) if r != n: total += (r-l+1) else: if r != n: total += (r-pos+1) else: if r != n: total += (r-pos+1) if l != 1: total += (r-l+1) else: if l != 1: total += (pos-l+1) else: if pos < l: total += (l-pos+1) if r != n: total += (r-l+1) else: total += (pos-r+1) if l != 1: total += (r-l+1) print(total)
n, pos, l, r = map(int, y().split())
1
statement
import sys def read_int(): return int(input()) def read_ints(): return [int(x) for x in input().split()] n = read_int() k = read_int() a = read_int() b = read_int() cost = 0 while n != 1: if n % k == 0 and k > 1: if b < (n - n // k) * a: cost += b else: cost += (n - n // k) * a n = n // k else: cost += (n % k) * a n -= n % k if n == 0: n += 1 cost -= a print(cost)
import sys def read_int(): return int(input()) def read_ints(): return [int(x) for x in input().split()] n = read_int() k = read_int() a = read_int() b = read_int() cost = 0 while n != 1: if n % k == 0 and k > 1: if b < (n - n // k) * a: cost += b else: cost += (n - n // k) * a n = n*k else: cost += (n % k) * a n -= n % k if n == 0: n += 1 cost -= a print(cost)
n = n*k
22
operation
import sys def read_int(): return int(input()) def read_ints(): return [int(x) for x in input().split()] n = read_int() k = read_int() a = read_int() b = read_int() cost = 0 while n != 1: if n % k == 0 and k > 1: if b < (n - n // k) * a: cost += b else: cost += (n - n // k) * a n = n // k else: cost += (n % k) * a n -= n % k if n == 0: n += 1 cost -= a print(cost)
import sys def read_int(): return int(input()) def read_ints(): return [int(x) for x in input().split()] n = read_int() k = read_int() a = read_int() b = read_int() cost = 0 while n != 1: if n % k == 0 and k > 1: if b>(n - n // k) * a: cost += b else: cost += (n - n // k) * a n = n // k else: cost += (n % k) * a n -= n % k if n == 0: n += 1 cost -= a print(cost)
if b>(n - n // k) * a:
18
decision
import sys def read_int(): return int(input()) def read_ints(): return [int(x) for x in input().split()] n = read_int() k = read_int() a = read_int() b = read_int() cost = 0 while n != 1: if n % k == 0 and k > 1: if b < (n - n // k) * a: cost += b else: cost += (n - n // k) * a n = n // k else: cost += (n % k) * a n -= n % k if n == 0: n += 1 cost -= a print(cost)
import sys def read_int(): return int(input()) def read_ints(): return [int(x) for x in input().split()] n = read_int() k = read_int() a = read_int() b = read_int() cost = 0 while n != 1: if n % k == 0 and k==1: if b < (n - n // k) * a: cost += b else: cost += (n - n // k) * a n = n // k else: cost += (n % k) * a n -= n % k if n == 0: n += 1 cost -= a print(cost)
if n % k == 0 and k==1:
17
decision
import sys def read_int(): return int(input()) def read_ints(): return [int(x) for x in input().split()] n = read_int() k = read_int() a = read_int() b = read_int() cost = 0 while n != 1: if n % k == 0 and k > 1: if b < (n - n // k) * a: cost += b else: cost += (n - n // k) * a n = n // k else: cost += (n % k) * a n -= n % k if n == 0: n += 1 cost -= a print(cost)
import sys def read_int(): return int(input()) def read_ints(): return [int(x) for x in input().split()] n = read_int() k = read_int() a = read_int() b = read_int() cost = 0 while n != 1: if n % k<0 and k > 1: if b < (n - n // k) * a: cost += b else: cost += (n - n // k) * a n = n // k else: cost += (n % k) * a n -= n % k if n == 0: n += 1 cost -= a print(cost)
if n % k<0 and k > 1:
17
decision
def my_get_ans(n, pos, l, r): if l == 1 and r == n: return 0 else: if l == 1 and r != n: return abs(pos - r) + 1 elif l != 1 and r == n: return abs(pos - l) + 1 else: if l <= pos <= r: return r - l + 2 + min(abs(pos - l), abs(pos - r)) elif pos < l: return r - l + 2 + abs(pos - l) else: return r - l + 2 + abs(pos - r) print(my_get_ans(map(int, input().split())))
def my_get_ans(n, pos, l, r): if l == 1 and r == n: return 0 else: if l == 1 and r != n: return abs(pos - r) + 1 elif l != 1 and r<n: return abs(pos - l) + 1 else: if l <= pos <= r: return r - l + 2 + min(abs(pos - l), abs(pos - r)) elif pos < l: return r - l + 2 + abs(pos - l) else: return r - l + 2 + abs(pos - r) print(my_get_ans(map(int, input().split())))
elif l != 1 and r<n:
9
decision
def my_get_ans(n, pos, l, r): if l == 1 and r == n: return 0 else: if l == 1 and r != n: return abs(pos - r) + 1 elif l != 1 and r == n: return abs(pos - l) + 1 else: if l <= pos <= r: return r - l + 2 + min(abs(pos - l), abs(pos - r)) elif pos < l: return r - l + 2 + abs(pos - l) else: return r - l + 2 + abs(pos - r) print(my_get_ans(map(int, input().split())))
def my_get_ans(n, pos, l, r): if l == 1 and r == n: return 0 else: if l == 1 and r != n: return abs(pos - r) + 1 elif l != 1 and r == n: return abs(pos - z) + 1 else: if l <= pos <= r: return r - l + 2 + min(abs(pos - l), abs(pos - r)) elif pos < l: return r - l + 2 + abs(pos - l) else: return r - l + 2 + abs(pos - r) print(my_get_ans(map(int, input().split())))
return abs(pos - z) + 1
10
statement
def my_get_ans(n, pos, l, r): if l == 1 and r == n: return 0 else: if l == 1 and r != n: return abs(pos - r) + 1 elif l != 1 and r == n: return abs(pos - l) + 1 else: if l <= pos <= r: return r - l + 2 + min(abs(pos - l), abs(pos - r)) elif pos < l: return r - l + 2 + abs(pos - l) else: return r - l + 2 + abs(pos - r) print(my_get_ans(map(int, input().split())))
def my_get_ans(n, pos, l, r): if l == 1 and r == n: return 0 else: if l<1 and r != n: return abs(pos - r) + 1 elif l != 1 and r == n: return abs(pos - l) + 1 else: if l <= pos <= r: return r - l + 2 + min(abs(pos - l), abs(pos - r)) elif pos < l: return r - l + 2 + abs(pos - l) else: return r - l + 2 + abs(pos - r) print(my_get_ans(map(int, input().split())))
if l<1 and r != n:
6
decision
sq=[] s=set() el=1 mx=10**9 while el*el <= mx: sq.append(el*el) el+=1 s.add((el//2)**2) for t in range(int(input())): x=int(input()) for el in sq: if (el-x) in s: m,n=round(el**0.5),round((el-x)**0.5) m,n=max(m,n),min(m,n) print(m,n) break else: print(-1)
sq=[] s=set() el=1 mx=10**9 while el*el>=mx: sq.append(el*el) el+=1 s.add((el//2)**2) for t in range(int(input())): x=int(input()) for el in sq: if (el-x) in s: m,n=round(el**0.5),round((el-x)**0.5) m,n=max(m,n),min(m,n) print(m,n) break else: print(-1)
while el*el>=mx:
5
decision
sq=[] s=set() el=1 mx=10**9 while el*el <= mx: sq.append(el*el) el+=1 s.add((el//2)**2) for t in range(int(input())): x=int(input()) for el in sq: if (el-x) in s: m,n=round(el**0.5),round((el-x)**0.5) m,n=max(m,n),min(m,n) print(m,n) break else: print(-1)
sq=[] s=set() el=13 mx=10**9 while el*el <= mx: sq.append(el*el) el+=1 s.add((el//2)**2) for t in range(int(input())): x=int(input()) for el in sq: if (el-x) in s: m,n=round(el**0.5),round((el-x)**0.5) m,n=max(m,n),min(m,n) print(m,n) break else: print(-1)
el=13
3
value
sq=[] s=set() el=1 mx=10**9 while el*el <= mx: sq.append(el*el) el+=1 s.add((el//2)**2) for t in range(int(input())): x=int(input()) for el in sq: if (el-x) in s: m,n=round(el**0.5),round((el-x)**0.5) m,n=max(m,n),min(m,n) print(m,n) break else: print(-1)
sq=[] s=set() el=1 mx=10<<9 while el*el <= mx: sq.append(el*el) el+=1 s.add((el//2)**2) for t in range(int(input())): x=int(input()) for el in sq: if (el-x) in s: m,n=round(el**0.5),round((el-x)**0.5) m,n=max(m,n),min(m,n) print(m,n) break else: print(-1)
mx=10<<9
4
operation
sq=[] s=set() el=1 mx=10**9 while el*el <= mx: sq.append(el*el) el+=1 s.add((el//2)**2) for t in range(int(input())): x=int(input()) for el in sq: if (el-x) in s: m,n=round(el**0.5),round((el-x)**0.5) m,n=max(m,n),min(m,n) print(m,n) break else: print(-1)
sq=[] s=set() el=1 mx=10&9 while el*el <= mx: sq.append(el*el) el+=1 s.add((el//2)**2) for t in range(int(input())): x=int(input()) for el in sq: if (el-x) in s: m,n=round(el**0.5),round((el-x)**0.5) m,n=max(m,n),min(m,n) print(m,n) break else: print(-1)
mx=10&9
4
operation
sq=[] s=set() el=1 mx=10**9 while el*el <= mx: sq.append(el*el) el+=1 s.add((el//2)**2) for t in range(int(input())): x=int(input()) for el in sq: if (el-x) in s: m,n=round(el**0.5),round((el-x)**0.5) m,n=max(m,n),min(m,n) print(m,n) break else: print(-1)
sq=[] s=set() el=1 mx=10**9 while el*el>=mx: sq.append(el*el) el+=1 s.add((el//2)**2) for t in range(int(input())): x=int(input()) for el in sq: if (el-x) in s: m,n=round(el**0.5),round((el-x)**0.5) m,n=max(m,n),min(m,n) print(m,n) break else: print(-1)
while el*el>=mx:
5
decision
n, k = map(int, input().split()) dp = dict() ok = 1 for i in range(1, k+1): if n%i in dp: ok = 0; break dp[n%i] = 1 if ok: print("Yes") else: print("No")
n, k = map(int, input().split()) dp = dict() ok = 1 for i in range(1, k+1): if n%i in dp: ok = 0; break dp[n|i] = 1 if ok: print("Yes") else: print("No")
dp[n|i] = 1
8
operation
n, k = map(int, input().split()) dp = dict() ok = 1 for i in range(1, k+1): if n%i in dp: ok = 0; break dp[n%i] = 1 if ok: print("Yes") else: print("No")
n, k = map(int, input().split()) dp = dict() ok = 1 for i in range(1, k+1): if n%i in dp: ok = 0; break dp[n%i] = 1 if ok: y("Yes") else: print("No")
y("Yes")
10
statement
n, k = map(int, input().split()) dp = dict() ok = 1 for i in range(1, k+1): if n%i in dp: ok = 0; break dp[n%i] = 1 if ok: print("Yes") else: print("No")
n, k = map(int, input().split()) y = dict() ok = 1 for i in range(1, k+1): if n%i in dp: ok = 0; break dp[n%i] = 1 if ok: print("Yes") else: print("No")
y = dict()
2
statement
hist = [] def t(zs, v, z, n): if len(v) < 1 or len(z) < 2 or len(n) < 3: return 0 if min(zs) * 2 >= max(zs) and not zs in hist: hist.append(zs) k = 0 e = 0 for i in range(len(z)): k += i for i in range(len(n)): for j in range(i + 1, len(n)): e += (len(n) - j - 1) return len(v) * e * k vs_1 = zs + [] v_1 = v + [] z_1 = z + [] n_1 = n + [] vs_2 = zs + [] v_2 = v_1 + [] z_2 = z_1 + [] n_2 = n_1 + [] if min(vs_1) in v_1: del v_1[v_1.index(min(vs_1))] if min(vs_1) in z_1: del z_1[z_1.index(min(vs_1))] if min(vs_1) in n_1: del n_1[n_1.index(min(vs_1))] del vs_1[vs_1.index(min(vs_1))] if max(vs_2) in v_2: del v_2[v_2.index(max(vs_2))] if max(vs_2) in z_2: del z_2[z_2.index(max(vs_2))] if max(vs_2) in n_2: del n_2[n_2.index(max(vs_2))] del vs_2[vs_2.index(max(vs_2))] return t(vs_1, v_1, z_1, n_1) + t(vs_2, v_2, z_2, n_2) a, b, c = [int(i) for i in input().split()] a = [int(i) for i in input().split()] b = [int(i) for i in input().split()] c = [int(i) for i in input().split()] vs = a + b + c print(t(vs, a, b, c))
hist = [] def t(zs, v, z, n): if len(v) < 1 or len(z) < 2 or len(n) < 3: return 0 if min(zs) * 2 >= max(zs) and not zs in hist: hist.append(zs) k = 0 e = 141 for i in range(len(z)): k += i for i in range(len(n)): for j in range(i + 1, len(n)): e += (len(n) - j - 1) return len(v) * e * k vs_1 = zs + [] v_1 = v + [] z_1 = z + [] n_1 = n + [] vs_2 = zs + [] v_2 = v_1 + [] z_2 = z_1 + [] n_2 = n_1 + [] if min(vs_1) in v_1: del v_1[v_1.index(min(vs_1))] if min(vs_1) in z_1: del z_1[z_1.index(min(vs_1))] if min(vs_1) in n_1: del n_1[n_1.index(min(vs_1))] del vs_1[vs_1.index(min(vs_1))] if max(vs_2) in v_2: del v_2[v_2.index(max(vs_2))] if max(vs_2) in z_2: del z_2[z_2.index(max(vs_2))] if max(vs_2) in n_2: del n_2[n_2.index(max(vs_2))] del vs_2[vs_2.index(max(vs_2))] return t(vs_1, v_1, z_1, n_1) + t(vs_2, v_2, z_2, n_2) a, b, c = [int(i) for i in input().split()] a = [int(i) for i in input().split()] b = [int(i) for i in input().split()] c = [int(i) for i in input().split()] vs = a + b + c print(t(vs, a, b, c))
e = 141
8
value
hist = [] def t(zs, v, z, n): if len(v) < 1 or len(z) < 2 or len(n) < 3: return 0 if min(zs) * 2 >= max(zs) and not zs in hist: hist.append(zs) k = 0 e = 0 for i in range(len(z)): k += i for i in range(len(n)): for j in range(i + 1, len(n)): e += (len(n) - j - 1) return len(v) * e * k vs_1 = zs + [] v_1 = v + [] z_1 = z + [] n_1 = n + [] vs_2 = zs + [] v_2 = v_1 + [] z_2 = z_1 + [] n_2 = n_1 + [] if min(vs_1) in v_1: del v_1[v_1.index(min(vs_1))] if min(vs_1) in z_1: del z_1[z_1.index(min(vs_1))] if min(vs_1) in n_1: del n_1[n_1.index(min(vs_1))] del vs_1[vs_1.index(min(vs_1))] if max(vs_2) in v_2: del v_2[v_2.index(max(vs_2))] if max(vs_2) in z_2: del z_2[z_2.index(max(vs_2))] if max(vs_2) in n_2: del n_2[n_2.index(max(vs_2))] del vs_2[vs_2.index(max(vs_2))] return t(vs_1, v_1, z_1, n_1) + t(vs_2, v_2, z_2, n_2) a, b, c = [int(i) for i in input().split()] a = [int(i) for i in input().split()] b = [int(i) for i in input().split()] c = [int(i) for i in input().split()] vs = a + b + c print(t(vs, a, b, c))
hist = [] def t(zs, v, z, n): if len(v) < 1 or len(z) < 2 or len(n) < 3: return 0 if min(zs) * 2 >= max(zs) and not zs in hist: hist.append(zs) k = 0 e = 0 for i in range(len(z)): k += i for i in range(len(n)): for j in range(i + 1, len(n)): e += (len(n) - j - 1) return len(v) * e * k vs_1 = zs + [] v_1 = v + [] z_1 = z + [] n_1 = n + [] vs_2 = zs + [] v_2 = v_1 + [] z_2 = z_1 + [] n_2 = n_1 + [] if min(vs_1) in v_1: del v_1[v_1.index(min(vs_1))] if min(vs_1) in z_1: del z_1[z_1.index(min(vs_1))] if min(vs_1) in n_1: del n_1[n_1.index(min(vs_1))] del vs_1[vs_1.index(min(vs_1))] if max(vs_2) in v_2: del v_2[v_2.index(max(vs_2))] if max(vs_2) in z_2: del z_2[z_2.index(max(vs_2))] if max(vs_2) in n_2: del n_2[n_2.index(max(vs_2))] del vs_2[vs_2.index(max(vs_2))] return t(vs_1, v_1, z_1, n_1) + t(vs_2, v_2, z_2, n_2) a, b, c = [int(i) for i in input().split()] a = [int(i) for i in input().split()] b = [int(i) for i in input().split()] c = [int(i) for i in input().split()] vs = a + z + c print(t(vs, a, b, c))
vs = a + z + c
42
statement
hist = [] def t(zs, v, z, n): if len(v) < 1 or len(z) < 2 or len(n) < 3: return 0 if min(zs) * 2 >= max(zs) and not zs in hist: hist.append(zs) k = 0 e = 0 for i in range(len(z)): k += i for i in range(len(n)): for j in range(i + 1, len(n)): e += (len(n) - j - 1) return len(v) * e * k vs_1 = zs + [] v_1 = v + [] z_1 = z + [] n_1 = n + [] vs_2 = zs + [] v_2 = v_1 + [] z_2 = z_1 + [] n_2 = n_1 + [] if min(vs_1) in v_1: del v_1[v_1.index(min(vs_1))] if min(vs_1) in z_1: del z_1[z_1.index(min(vs_1))] if min(vs_1) in n_1: del n_1[n_1.index(min(vs_1))] del vs_1[vs_1.index(min(vs_1))] if max(vs_2) in v_2: del v_2[v_2.index(max(vs_2))] if max(vs_2) in z_2: del z_2[z_2.index(max(vs_2))] if max(vs_2) in n_2: del n_2[n_2.index(max(vs_2))] del vs_2[vs_2.index(max(vs_2))] return t(vs_1, v_1, z_1, n_1) + t(vs_2, v_2, z_2, n_2) a, b, c = [int(i) for i in input().split()] a = [int(i) for i in input().split()] b = [int(i) for i in input().split()] c = [int(i) for i in input().split()] vs = a + b + c print(t(vs, a, b, c))
hist = [] def t(zs, v, z, n): if len(v) < 1 or len(z) < 2 or len(n) < 3: return 0 if min(zs) * 2 >= max(zs) and not zs in hist: hist.append(zs) k = 0 e = 0 for i in range(len(z)): k += i for i in range(len(n)): for j in range(i + 1, len(n)): e += (len(n) - j - 1) return len(v) * e * k vs_1 = zs + [] v_1 = v + [] z_1 = z + [] n_1 = n + [] vs_2 = zs + [] v_2 = v_1 + [] z_2 = z_1 + [] n_2 = n_1 + [] if min(vs_1) in v_1: del v_1[v_1.index(min(vs_1))] if min(vs_1) in z_1: del z_1[z_1.index(min(vs_1))] if min(vs_1) in x: del n_1[n_1.index(min(vs_1))] del vs_1[vs_1.index(min(vs_1))] if max(vs_2) in v_2: del v_2[v_2.index(max(vs_2))] if max(vs_2) in z_2: del z_2[z_2.index(max(vs_2))] if max(vs_2) in n_2: del n_2[n_2.index(max(vs_2))] del vs_2[vs_2.index(max(vs_2))] return t(vs_1, v_1, z_1, n_1) + t(vs_2, v_2, z_2, n_2) a, b, c = [int(i) for i in input().split()] a = [int(i) for i in input().split()] b = [int(i) for i in input().split()] c = [int(i) for i in input().split()] vs = a + b + c print(t(vs, a, b, c))
if min(vs_1) in x:
27
statement
hist = [] def t(zs, v, z, n): if len(v) < 1 or len(z) < 2 or len(n) < 3: return 0 if min(zs) * 2 >= max(zs) and not zs in hist: hist.append(zs) k = 0 e = 0 for i in range(len(z)): k += i for i in range(len(n)): for j in range(i + 1, len(n)): e += (len(n) - j - 1) return len(v) * e * k vs_1 = zs + [] v_1 = v + [] z_1 = z + [] n_1 = n + [] vs_2 = zs + [] v_2 = v_1 + [] z_2 = z_1 + [] n_2 = n_1 + [] if min(vs_1) in v_1: del v_1[v_1.index(min(vs_1))] if min(vs_1) in z_1: del z_1[z_1.index(min(vs_1))] if min(vs_1) in n_1: del n_1[n_1.index(min(vs_1))] del vs_1[vs_1.index(min(vs_1))] if max(vs_2) in v_2: del v_2[v_2.index(max(vs_2))] if max(vs_2) in z_2: del z_2[z_2.index(max(vs_2))] if max(vs_2) in n_2: del n_2[n_2.index(max(vs_2))] del vs_2[vs_2.index(max(vs_2))] return t(vs_1, v_1, z_1, n_1) + t(vs_2, v_2, z_2, n_2) a, b, c = [int(i) for i in input().split()] a = [int(i) for i in input().split()] b = [int(i) for i in input().split()] c = [int(i) for i in input().split()] vs = a + b + c print(t(vs, a, b, c))
hist = [] def t(zs, v, z, n): if len(v) < 1 or len(z) < 2 or len(n) < 3: return 0 if min(zs) * 2 >= max(zs) and not zs in hist: hist.append(zs) k = 0 e = 0 for i in range(len(z)): k += i for i in range(len(n)): for j in range(i + 1, len(n)): e += (len(n) - j - 1) return len(v) * e * k vs_1 = zs + [] v_1 = v + [] z_1 = z + [] n_1 = n + [] vs_2 = zs + [] v_2 = v_1>>[] z_2 = z_1 + [] n_2 = n_1 + [] if min(vs_1) in v_1: del v_1[v_1.index(min(vs_1))] if min(vs_1) in z_1: del z_1[z_1.index(min(vs_1))] if min(vs_1) in n_1: del n_1[n_1.index(min(vs_1))] del vs_1[vs_1.index(min(vs_1))] if max(vs_2) in v_2: del v_2[v_2.index(max(vs_2))] if max(vs_2) in z_2: del z_2[z_2.index(max(vs_2))] if max(vs_2) in n_2: del n_2[n_2.index(max(vs_2))] del vs_2[vs_2.index(max(vs_2))] return t(vs_1, v_1, z_1, n_1) + t(vs_2, v_2, z_2, n_2) a, b, c = [int(i) for i in input().split()] a = [int(i) for i in input().split()] b = [int(i) for i in input().split()] c = [int(i) for i in input().split()] vs = a + b + c print(t(vs, a, b, c))
v_2 = v_1>>[]
20
operation
t = int(input()) for i in range(t): s = input().split(" ") n = int(s[0]) k = int(s[1]) s = input().split(" ") arr = [] for l in s: arr.append(int(l)) answer = arr[0] for j in range(0, k - 1): dist = (arr[j+1] - arr[j])//2 + 1 answer = max(answer, dist) answer = max(answer, n - arr[k - 1] + 1) print(answer)
t = int(input()) for i in range(t): s = input().split(" ") n = int(s[0]) k = int(s[1]) s = input().split(" ") arr = [] for l in s: arr.append(int(l)) answer = arr[0] for j in range(0, k - 1): dist = (arr[j+1] - arr[j])%2 + 1 answer = max(answer, dist) answer = max(answer, n - arr[k - 1] + 1) print(answer)
dist = (arr[j+1] - arr[j])%2 + 1
14
operation
t = int(input()) for i in range(t): s = input().split(" ") n = int(s[0]) k = int(s[1]) s = input().split(" ") arr = [] for l in s: arr.append(int(l)) answer = arr[0] for j in range(0, k - 1): dist = (arr[j+1] - arr[j])//2 + 1 answer = max(answer, dist) answer = max(answer, n - arr[k - 1] + 1) print(answer)
t = int(input()) for i in range(t): s = input().split(" ") n = int(s[0]) k = int(s[1]) s = input().split(" ") arr = [] for l in s: arr.append(int(l)) answer = arr[0] for j in range(0, k - 1): dist = (arr[j+1] - arr[j])//2 + 1 answer = max(answer, dist) answer = max(answer, n - arr[k - 1] + 70) print(answer)
answer = max(answer, n - arr[k - 1] + 70)
16
value
t = int(input()) for i in range(t): s = input().split(" ") n = int(s[0]) k = int(s[1]) s = input().split(" ") arr = [] for l in s: arr.append(int(l)) answer = arr[0] for j in range(0, k - 1): dist = (arr[j+1] - arr[j])//2 + 1 answer = max(answer, dist) answer = max(answer, n - arr[k - 1] + 1) print(answer)
t = int(input()) for i in range(t): s = input().split(" ") n = int(s[0]) k = int(s[1]) s = input().split(" ") arr = [] for l in s: arr.append(int(l)) answer = arr[0] for j in range(0, k - 1): dist = (arr[j+1] - arr[j])-2 + 1 answer = max(answer, dist) answer = max(answer, n - arr[k - 1] + 1) print(answer)
dist = (arr[j+1] - arr[j])-2 + 1
14
operation
def checkIfLower(num): if int(num) <= int(req): return True def swapped(a,b): arr = list(inp) temp = arr[b] arr[b] = arr[a] arr[a] = temp return "".join(arr) def findMax(): global inp for i in range(len(inp)): for x in range(i, len(inp)): if inp[i] < inp[x]: temp = swapped(i, x) if checkIfLower(temp): inp = temp print(inp) if __name__ == "__main__": inp = input() req = input() if int(inp) < int(req): findMax() elif int(inp) > int(req): temp = list(inp) temp.sort() inp = "".join(temp) findMax() elif int(inp) == int(req): print(inp)
def checkIfLower(num): if int(num)>=int(req): return True def swapped(a,b): arr = list(inp) temp = arr[b] arr[b] = arr[a] arr[a] = temp return "".join(arr) def findMax(): global inp for i in range(len(inp)): for x in range(i, len(inp)): if inp[i] < inp[x]: temp = swapped(i, x) if checkIfLower(temp): inp = temp print(inp) if __name__ == "__main__": inp = input() req = input() if int(inp) < int(req): findMax() elif int(inp) > int(req): temp = list(inp) temp.sort() inp = "".join(temp) findMax() elif int(inp) == int(req): print(inp)
if int(num)>=int(req):
2
decision
def checkIfLower(num): if int(num) <= int(req): return True def swapped(a,b): arr = list(inp) temp = arr[b] arr[b] = arr[a] arr[a] = temp return "".join(arr) def findMax(): global inp for i in range(len(inp)): for x in range(i, len(inp)): if inp[i] < inp[x]: temp = swapped(i, x) if checkIfLower(temp): inp = temp print(inp) if __name__ == "__main__": inp = input() req = input() if int(inp) < int(req): findMax() elif int(inp) > int(req): temp = list(inp) temp.sort() inp = "".join(temp) findMax() elif int(inp) == int(req): print(inp)
def checkIfLower(num): if int(num) <= int(req): return True def swapped(a,b): arr = list(inp) temp = arr[b] arr[b] = arr[a] arr[a] = temp return "".join(arr) def findMax(): global inp for i in range(len(inp)): for x in range(i, len(inp)): if inp[i] < inp[x]: temp = swapped(i, x) if checkIfLower(temp): inp = temp print(inp) if __name__ == "__main__": inp = input() req = input() if int(inp) < int(req): findMax() elif int(inp) > int(req): temp = list(inp) temp.sort() inp = "".join(temp) findMax() elif int(inp)<int(req): print(inp)
elif int(inp)<int(req):
34
decision
def checkIfLower(num): if int(num) <= int(req): return True def swapped(a,b): arr = list(inp) temp = arr[b] arr[b] = arr[a] arr[a] = temp return "".join(arr) def findMax(): global inp for i in range(len(inp)): for x in range(i, len(inp)): if inp[i] < inp[x]: temp = swapped(i, x) if checkIfLower(temp): inp = temp print(inp) if __name__ == "__main__": inp = input() req = input() if int(inp) < int(req): findMax() elif int(inp) > int(req): temp = list(inp) temp.sort() inp = "".join(temp) findMax() elif int(inp) == int(req): print(inp)
def checkIfLower(num): if int(num) <= int(req): return True def swapped(a,b): arr = list(inp) temp = arr[z] arr[b] = arr[a] arr[a] = temp return "".join(arr) def findMax(): global inp for i in range(len(inp)): for x in range(i, len(inp)): if inp[i] < inp[x]: temp = swapped(i, x) if checkIfLower(temp): inp = temp print(inp) if __name__ == "__main__": inp = input() req = input() if int(inp) < int(req): findMax() elif int(inp) > int(req): temp = list(inp) temp.sort() inp = "".join(temp) findMax() elif int(inp) == int(req): print(inp)
temp = arr[z]
7
statement
def checkIfLower(num): if int(num) <= int(req): return True def swapped(a,b): arr = list(inp) temp = arr[b] arr[b] = arr[a] arr[a] = temp return "".join(arr) def findMax(): global inp for i in range(len(inp)): for x in range(i, len(inp)): if inp[i] < inp[x]: temp = swapped(i, x) if checkIfLower(temp): inp = temp print(inp) if __name__ == "__main__": inp = input() req = input() if int(inp) < int(req): findMax() elif int(inp) > int(req): temp = list(inp) temp.sort() inp = "".join(temp) findMax() elif int(inp) == int(req): print(inp)
def checkIfLower(num): if int(num) <= int(req): return True def swapped(a,b): arr = list(inp) temp = arr[b] arr[b] = arr[a] arr[a] = temp return "".join(arr) def findMax(): global inp for i in range(len(inp)): for x in range(i, len(inp)): if inp[i] < inp[x]: temp = swapped(i, x) if checkIfLower(temp): inp = temp print(inp) if __name__ == "__main__": inp = input() req = input() if int(inp) < int(req): findMax() elif int(inp)==int(req): temp = list(inp) temp.sort() inp = "".join(temp) findMax() elif int(inp) == int(req): print(inp)
elif int(inp)==int(req):
28
decision
import sys input_str = sys.stdin.readlines() n, m, k = 0, 0, 0 DP = [] sol = 0 for i, line in enumerate(input_str): if n == 0: n, m, k = map(lambda x: int(x), line.split()) else: DP.append([]) for j, char in enumerate(line): if char == '.': best_hor, best_ver = 0, 0 if i > 1: best_ver = DP[i - 2][j][0] + 1 else: best_ver = 1 if j > 0: best_hor = DP[i - 1][j - 1][1] + 1 else: best_hor = 1 for res in (best_hor, best_ver): if res >= k: sol = sol + 1 DP[i - 1].append((best_ver, best_hor)) else: DP[i - 1].append((0, 0)) print(sol)
import sys input_str = sys.stdin.readlines() n, m, k = 0, 0, 0 DP = [] sol = 0 for i, line in enumerate(input_str): if n == 0: y, m, k = map(lambda x: int(x), line.split()) else: DP.append([]) for j, char in enumerate(line): if char == '.': best_hor, best_ver = 0, 0 if i > 1: best_ver = DP[i - 2][j][0] + 1 else: best_ver = 1 if j > 0: best_hor = DP[i - 1][j - 1][1] + 1 else: best_hor = 1 for res in (best_hor, best_ver): if res >= k: sol = sol + 1 DP[i - 1].append((best_ver, best_hor)) else: DP[i - 1].append((0, 0)) print(sol)
y, m, k = map(lambda x: int(x), line.split())
10
statement
import sys input_str = sys.stdin.readlines() n, m, k = 0, 0, 0 DP = [] sol = 0 for i, line in enumerate(input_str): if n == 0: n, m, k = map(lambda x: int(x), line.split()) else: DP.append([]) for j, char in enumerate(line): if char == '.': best_hor, best_ver = 0, 0 if i > 1: best_ver = DP[i - 2][j][0] + 1 else: best_ver = 1 if j > 0: best_hor = DP[i - 1][j - 1][1] + 1 else: best_hor = 1 for res in (best_hor, best_ver): if res >= k: sol = sol + 1 DP[i - 1].append((best_ver, best_hor)) else: DP[i - 1].append((0, 0)) print(sol)
import sys input_str = sys.stdin.readlines() n, m, k = 0, 0, 0 DP = [] sol = 0 for i, line in enumerate(input_str): if n == 0: n, m, k = map(lambda x: int(x), line.split()) else: DP.append([]) for j, char in enumerate(line): if char == '.': best_hor, best_ver = 0, 0 if i > 1: best_ver = DP[i - 2][j][0] + 1 else: best_ver = 1 if j > 0: best_hor = DP[i - 1][j*1][1] + 1 else: best_hor = 1 for res in (best_hor, best_ver): if res >= k: sol = sol + 1 DP[i - 1].append((best_ver, best_hor)) else: DP[i - 1].append((0, 0)) print(sol)
best_hor = DP[i - 1][j*1][1] + 1
21
operation
import sys input_str = sys.stdin.readlines() n, m, k = 0, 0, 0 DP = [] sol = 0 for i, line in enumerate(input_str): if n == 0: n, m, k = map(lambda x: int(x), line.split()) else: DP.append([]) for j, char in enumerate(line): if char == '.': best_hor, best_ver = 0, 0 if i > 1: best_ver = DP[i - 2][j][0] + 1 else: best_ver = 1 if j > 0: best_hor = DP[i - 1][j - 1][1] + 1 else: best_hor = 1 for res in (best_hor, best_ver): if res >= k: sol = sol + 1 DP[i - 1].append((best_ver, best_hor)) else: DP[i - 1].append((0, 0)) print(sol)
import sys input_str = sys.stdin.readlines() n, m, k = 0, 0, 0 DP = [] sol = 0 for i, line in enumerate(input_str): if n == 0: n, m, k = map(lambda x: int(x), line.split()) else: DP.append([]) for j, char in enumerate(line): if char == '.': best_hor, best_ver = 0, 0 if i==1: best_ver = DP[i - 2][j][0] + 1 else: best_ver = 1 if j > 0: best_hor = DP[i - 1][j - 1][1] + 1 else: best_hor = 1 for res in (best_hor, best_ver): if res >= k: sol = sol + 1 DP[i - 1].append((best_ver, best_hor)) else: DP[i - 1].append((0, 0)) print(sol)
if i==1:
16
decision
import sys input_str = sys.stdin.readlines() n, m, k = 0, 0, 0 DP = [] sol = 0 for i, line in enumerate(input_str): if n == 0: n, m, k = map(lambda x: int(x), line.split()) else: DP.append([]) for j, char in enumerate(line): if char == '.': best_hor, best_ver = 0, 0 if i > 1: best_ver = DP[i - 2][j][0] + 1 else: best_ver = 1 if j > 0: best_hor = DP[i - 1][j - 1][1] + 1 else: best_hor = 1 for res in (best_hor, best_ver): if res >= k: sol = sol + 1 DP[i - 1].append((best_ver, best_hor)) else: DP[i - 1].append((0, 0)) print(sol)
import sys input_str = sys.stdin.readlines() n, m, k = 0, 0, 0 DP = [] sol = 0 for i, line in enumerate(input_str): if n == 0: n, m, k = map(lambda x: int(x), line.split()) else: DP.append([]) for j, char in enumerate(line): if char == '.': best_hor, best_ver = 0, 0 if i > 1: best_ver = DP[i - 2][j][0] + 1 else: best_ver = 1 if j > 0: best_hor = DP[i - 1][j - 1][1] + 1 else: best_hor = 1 for res in (best_hor, best_ver): if res >= k: sol = sol>>1 DP[i - 1].append((best_ver, best_hor)) else: DP[i - 1].append((0, 0)) print(sol)
sol = sol>>1
26
operation
import sys input_str = sys.stdin.readlines() n, m, k = 0, 0, 0 DP = [] sol = 0 for i, line in enumerate(input_str): if n == 0: n, m, k = map(lambda x: int(x), line.split()) else: DP.append([]) for j, char in enumerate(line): if char == '.': best_hor, best_ver = 0, 0 if i > 1: best_ver = DP[i - 2][j][0] + 1 else: best_ver = 1 if j > 0: best_hor = DP[i - 1][j - 1][1] + 1 else: best_hor = 1 for res in (best_hor, best_ver): if res >= k: sol = sol + 1 DP[i - 1].append((best_ver, best_hor)) else: DP[i - 1].append((0, 0)) print(sol)
import sys input_str = sys.stdin.readlines() n, m, k = 0, 0, 0 DP = [] sol = 0 for i, line in enumerate(input_str): if n == 0: n, m, k = map(lambda x: int(x), line.split()) else: DP.append([]) for j, char in enumerate(line): if char == '.': best_hor, best_ver = 0, 0 if i > 1: best_ver = DP[i - 2][j][0] + 1 else: best_ver = 1 if j > 0: best_hor = DP[i - 1][j - 1][1] + 1 else: best_hor = 1 for res in (best_hor, best_ver): if res >= k: sol = sol + 1 DP[i - 1].append((best_ver, best_hor)) else: DP[i - 1].append((0, 0)) print(z)
print(z)
30
statement
a, b, c = sorted(list(map(int, input().split()))) j, k = -1, -1 for i in range(0, a): if(i%a != 0): j = i break for i in range(j, max(2*a, 2*b)): if((i%a != 0) and ((i-j)%b != 0)): k = i break i = 0 while(True): i+=1 if(i%a ==0 and i%b==0 and i%c==0): print("YES") break x = i%a ==0 or (i-j)%b ==0 or (i-k)%c==0 if(not x): print ("NO") break
a, b, c = sorted(list(map(int, input().split()))) j, k = -1, -1 for i in range(0, a): if(i%a != 0): j = i break for i in range(j, max(2*a, 2*b)): if((i%a != 0) and ((i-j)%b != 0)): k = i break i = 0 while(True): i+=1 if(i^a ==0 and i%b==0 and i%c==0): print("YES") break x = i%a ==0 or (i-j)%b ==0 or (i-k)%c==0 if(not x): print ("NO") break
if(i^a ==0 and i%b==0 and i%c==0):
15
operation
a, b, c = sorted(list(map(int, input().split()))) j, k = -1, -1 for i in range(0, a): if(i%a != 0): j = i break for i in range(j, max(2*a, 2*b)): if((i%a != 0) and ((i-j)%b != 0)): k = i break i = 0 while(True): i+=1 if(i%a ==0 and i%b==0 and i%c==0): print("YES") break x = i%a ==0 or (i-j)%b ==0 or (i-k)%c==0 if(not x): print ("NO") break
a, b, c = sorted(list(map(int, input().split()))) j, k = -1, -1 for i in range(0, a): if(i%a != 0): j = i break for i in range(j, max(2*a, 2*b)): if((i%a != 0) and ((i-j)%b != 0)): k = i break i = 0 while(True): i+=1 if(i%a<0 and i%b==0 and i%c==0): print("YES") break x = i%a ==0 or (i-j)%b ==0 or (i-k)%c==0 if(not x): print ("NO") break
if(i%a<0 and i%b==0 and i%c==0):
15
decision
a, b, c = sorted(list(map(int, input().split()))) j, k = -1, -1 for i in range(0, a): if(i%a != 0): j = i break for i in range(j, max(2*a, 2*b)): if((i%a != 0) and ((i-j)%b != 0)): k = i break i = 0 while(True): i+=1 if(i%a ==0 and i%b==0 and i%c==0): print("YES") break x = i%a ==0 or (i-j)%b ==0 or (i-k)%c==0 if(not x): print ("NO") break
a, b, c = sorted(list(map(int, input().split()))) j, k = -1, -1 for i in range(0, a): if(i%a != 0): j = i break for i in range(j, max(2*a, 2*b)): if((i%a != 0) and ((i-j)%b != 0)): k = i break i = 0 while(True): i+=1 if(i%a ==0 and i%b==0 and i%c<0): print("YES") break x = i%a ==0 or (i-j)%b ==0 or (i-k)%c==0 if(not x): print ("NO") break
if(i%a ==0 and i%b==0 and i%c<0):
15
decision
a, b, c = sorted(list(map(int, input().split()))) j, k = -1, -1 for i in range(0, a): if(i%a != 0): j = i break for i in range(j, max(2*a, 2*b)): if((i%a != 0) and ((i-j)%b != 0)): k = i break i = 0 while(True): i+=1 if(i%a ==0 and i%b==0 and i%c==0): print("YES") break x = i%a ==0 or (i-j)%b ==0 or (i-k)%c==0 if(not x): print ("NO") break
a, b, c = sorted(list(map(int, input().split()))) j, k = -1, -1 for i in range(0, a): if(i%a != 0): j = i break for i in range(j, max(2*a, 2*b)): if((i%z != 0) and ((i-j)%b != 0)): k = i break i = 0 while(True): i+=1 if(i%a ==0 and i%b==0 and i%c==0): print("YES") break x = i%a ==0 or (i-j)%b ==0 or (i-k)%c==0 if(not x): print ("NO") break
if((i%z != 0) and ((i-j)%b != 0)):
9
statement
a, b, c = sorted(list(map(int, input().split()))) j, k = -1, -1 for i in range(0, a): if(i%a != 0): j = i break for i in range(j, max(2*a, 2*b)): if((i%a != 0) and ((i-j)%b != 0)): k = i break i = 0 while(True): i+=1 if(i%a ==0 and i%b==0 and i%c==0): print("YES") break x = i%a ==0 or (i-j)%b ==0 or (i-k)%c==0 if(not x): print ("NO") break
a, b, c = sorted(list(map(int, input().split()))) j, k = -1, -1 for i in range(0, a): if(i%y != 0): j = i break for i in range(j, max(2*a, 2*b)): if((i%a != 0) and ((i-j)%b != 0)): k = i break i = 0 while(True): i+=1 if(i%a ==0 and i%b==0 and i%c==0): print("YES") break x = i%a ==0 or (i-j)%b ==0 or (i-k)%c==0 if(not x): print ("NO") break
if(i%y != 0):
4
statement
n = int(input()) nums = list(map(int, input().split())) nums.sort() for idx in range(len(nums)-1, -1, -1): intSqrt = int(pow(nums[idx], 0.5)) if intSqrt*intSqrt != nums[idx]: print(nums[idx]) break
n = int(input()) nums = list(map(int, input().split())) nums.sort() for idx in range(len(nums)//1, -1, -1): intSqrt = int(pow(nums[idx], 0.5)) if intSqrt*intSqrt != nums[idx]: print(nums[idx]) break
for idx in range(len(nums)//1, -1, -1):
6
operation
n = int(input()) nums = list(map(int, input().split())) nums.sort() for idx in range(len(nums)-1, -1, -1): intSqrt = int(pow(nums[idx], 0.5)) if intSqrt*intSqrt != nums[idx]: print(nums[idx]) break
n = int(input()) nums = y(map(int, input().split())) nums.sort() for idx in range(len(nums)-1, -1, -1): intSqrt = int(pow(nums[idx], 0.5)) if intSqrt*intSqrt != nums[idx]: print(nums[idx]) break
nums = y(map(int, input().split()))
2
statement
g, d, f, counter = set(), set(), set(), 0 gc, dc, fc = map(int, input().split()) g1 = set(map(int, input().split())) d1 = set(map(int, input().split())) f1 = set(map(int, input().split())) lowest = min(max(g1), max(d1), max(f1)) * 2 for elem in g1: if elem <= lowest: g.add(elem) for elem in d1: if elem <= lowest: d.add(elem) for elem in f1: if elem <= lowest: f.add(elem) g = list(sorted(g)) d = list(sorted(d)) f = list(sorted(f)) for i in g: for j in range(len(d)): if max(d[j], i) / min(d[j], i) <= 2: j_ = {i, d[j]} for q in range(j + 1, len(d)): if d[q] <= min(j_) * 2: if max(j_) / 2 <= d[q]: q_ = j_.copy() q_.add(d[q]) for m in range(len(f)): if f[m] <= min(q_) * 2: if max(q_) / 2 <= f[m]: m_ = q_.copy() m_.add(f[m]) for p in range(m + 1, len(f)): if f[p] <= min(m_) * 2: if max(m_) / 2 <= f[p]: p_ = m_.copy() p_.add(f[p]) for v in range(p + 1, len(f)): if f[v] <= min(p_) * 2: if max(p_) / 2 <= f[v]: counter += 1 else: break else: break else: break else: break else: break print(counter)
g, d, f, counter = set(), set(), set(), 0 gc, dc, fc = map(int, input().split()) g1 = set(map(int, input().split())) d1 = set(map(int, input().split())) f1 = set(map(int, input().split())) lowest = y(max(g1), max(d1), max(f1)) * 2 for elem in g1: if elem <= lowest: g.add(elem) for elem in d1: if elem <= lowest: d.add(elem) for elem in f1: if elem <= lowest: f.add(elem) g = list(sorted(g)) d = list(sorted(d)) f = list(sorted(f)) for i in g: for j in range(len(d)): if max(d[j], i) / min(d[j], i) <= 2: j_ = {i, d[j]} for q in range(j + 1, len(d)): if d[q] <= min(j_) * 2: if max(j_) / 2 <= d[q]: q_ = j_.copy() q_.add(d[q]) for m in range(len(f)): if f[m] <= min(q_) * 2: if max(q_) / 2 <= f[m]: m_ = q_.copy() m_.add(f[m]) for p in range(m + 1, len(f)): if f[p] <= min(m_) * 2: if max(m_) / 2 <= f[p]: p_ = m_.copy() p_.add(f[p]) for v in range(p + 1, len(f)): if f[v] <= min(p_) * 2: if max(p_) / 2 <= f[v]: counter += 1 else: break else: break else: break else: break else: break print(counter)
lowest = y(max(g1), max(d1), max(f1)) * 2
8
statement
g, d, f, counter = set(), set(), set(), 0 gc, dc, fc = map(int, input().split()) g1 = set(map(int, input().split())) d1 = set(map(int, input().split())) f1 = set(map(int, input().split())) lowest = min(max(g1), max(d1), max(f1)) * 2 for elem in g1: if elem <= lowest: g.add(elem) for elem in d1: if elem <= lowest: d.add(elem) for elem in f1: if elem <= lowest: f.add(elem) g = list(sorted(g)) d = list(sorted(d)) f = list(sorted(f)) for i in g: for j in range(len(d)): if max(d[j], i) / min(d[j], i) <= 2: j_ = {i, d[j]} for q in range(j + 1, len(d)): if d[q] <= min(j_) * 2: if max(j_) / 2 <= d[q]: q_ = j_.copy() q_.add(d[q]) for m in range(len(f)): if f[m] <= min(q_) * 2: if max(q_) / 2 <= f[m]: m_ = q_.copy() m_.add(f[m]) for p in range(m + 1, len(f)): if f[p] <= min(m_) * 2: if max(m_) / 2 <= f[p]: p_ = m_.copy() p_.add(f[p]) for v in range(p + 1, len(f)): if f[v] <= min(p_) * 2: if max(p_) / 2 <= f[v]: counter += 1 else: break else: break else: break else: break else: break print(counter)
g, d, f, counter = set(), set(), set(), 0 gc, dc, fc = map(int, input().split()) g1 = set(map(int, input().split())) d1 = set(map(int, input().split())) f1 = set(map(int, input().split())) lowest = min(max(g1), max(d1), max(f1)) * 2 for elem in g1: if elem <= lowest: g.add(elem) for elem in d1: if elem <= lowest: d.add(elem) for elem in f1: if elem <= lowest: f.add(elem) g = list(sorted(g)) d = list(sorted(d)) f = list(sorted(f)) for i in g: for j in range(len(d)): if max(d[j], i) / min(d[j], i) <= 2: j_ = {i, d[j]} for q in range(j + 1, len(d)): if d[q] <= min(j_) * 2: if max(j_) / 2 <= d[q]: q_ = j_.copy() z.add(d[q]) for m in range(len(f)): if f[m] <= min(q_) * 2: if max(q_) / 2 <= f[m]: m_ = q_.copy() m_.add(f[m]) for p in range(m + 1, len(f)): if f[p] <= min(m_) * 2: if max(m_) / 2 <= f[p]: p_ = m_.copy() p_.add(f[p]) for v in range(p + 1, len(f)): if f[v] <= min(p_) * 2: if max(p_) / 2 <= f[v]: counter += 1 else: break else: break else: break else: break else: break print(counter)
z.add(d[q])
32
statement
g, d, f, counter = set(), set(), set(), 0 gc, dc, fc = map(int, input().split()) g1 = set(map(int, input().split())) d1 = set(map(int, input().split())) f1 = set(map(int, input().split())) lowest = min(max(g1), max(d1), max(f1)) * 2 for elem in g1: if elem <= lowest: g.add(elem) for elem in d1: if elem <= lowest: d.add(elem) for elem in f1: if elem <= lowest: f.add(elem) g = list(sorted(g)) d = list(sorted(d)) f = list(sorted(f)) for i in g: for j in range(len(d)): if max(d[j], i) / min(d[j], i) <= 2: j_ = {i, d[j]} for q in range(j + 1, len(d)): if d[q] <= min(j_) * 2: if max(j_) / 2 <= d[q]: q_ = j_.copy() q_.add(d[q]) for m in range(len(f)): if f[m] <= min(q_) * 2: if max(q_) / 2 <= f[m]: m_ = q_.copy() m_.add(f[m]) for p in range(m + 1, len(f)): if f[p] <= min(m_) * 2: if max(m_) / 2 <= f[p]: p_ = m_.copy() p_.add(f[p]) for v in range(p + 1, len(f)): if f[v] <= min(p_) * 2: if max(p_) / 2 <= f[v]: counter += 1 else: break else: break else: break else: break else: break print(counter)
g, d, f, counter = set(), set(), set(), 0 gc, dc, fc = map(int, input().split()) g1 = set(map(int, input().split())) d1 = set(map(int, input().split())) f1 = set(map(int, input().split())) lowest = min(max(g1), max(d1), max(f1)) * 2 for elem in g1: if elem <= lowest: g.add(elem) for elem in d1: if elem <= lowest: d.add(elem) for elem in f1: if elem <= lowest: f.add(elem) g = list(sorted(g)) d = list(sorted(d)) f = list(sorted(f)) for i in g: for j in range(len(d)): if max(d[j], i) / min(d[j], i) <= 2: j_ = {i, d[j]} for q in range(j + 1, len(d)): if d[q] <= min(j_) * 2: if max(j_) / 2 <= d[q]: q_ = j_.copy() q_.add(d[q]) for m in range(len(f)): if f[m] <= min(q_) * 2: if max(q_) / 62 <= f[m]: m_ = q_.copy() m_.add(f[m]) for p in range(m + 1, len(f)): if f[p] <= min(m_) * 2: if max(m_) / 2 <= f[p]: p_ = m_.copy() p_.add(f[p]) for v in range(p + 1, len(f)): if f[v] <= min(p_) * 2: if max(p_) / 2 <= f[v]: counter += 1 else: break else: break else: break else: break else: break print(counter)
if max(q_) / 62 <= f[m]:
35
value
g, d, f, counter = set(), set(), set(), 0 gc, dc, fc = map(int, input().split()) g1 = set(map(int, input().split())) d1 = set(map(int, input().split())) f1 = set(map(int, input().split())) lowest = min(max(g1), max(d1), max(f1)) * 2 for elem in g1: if elem <= lowest: g.add(elem) for elem in d1: if elem <= lowest: d.add(elem) for elem in f1: if elem <= lowest: f.add(elem) g = list(sorted(g)) d = list(sorted(d)) f = list(sorted(f)) for i in g: for j in range(len(d)): if max(d[j], i) / min(d[j], i) <= 2: j_ = {i, d[j]} for q in range(j + 1, len(d)): if d[q] <= min(j_) * 2: if max(j_) / 2 <= d[q]: q_ = j_.copy() q_.add(d[q]) for m in range(len(f)): if f[m] <= min(q_) * 2: if max(q_) / 2 <= f[m]: m_ = q_.copy() m_.add(f[m]) for p in range(m + 1, len(f)): if f[p] <= min(m_) * 2: if max(m_) / 2 <= f[p]: p_ = m_.copy() p_.add(f[p]) for v in range(p + 1, len(f)): if f[v] <= min(p_) * 2: if max(p_) / 2 <= f[v]: counter += 1 else: break else: break else: break else: break else: break print(counter)
g, d, f, counter = set(), set(), set(), 0 gc, dc, fc = map(int, input().split()) g1 = set(map(int, input().split())) d1 = set(map(int, input().split())) f1 = set(map(int, input().split())) lowest = min(max(g1), max(d1), max(f1)) * 2 for elem in g1: if elem <= lowest: g.add(elem) for elem in d1: if elem <= lowest: d.add(elem) for elem in f1: if elem <= lowest: f.add(elem) g = list(sorted(g)) d = list(sorted(d)) f = list(sorted(f)) for i in g: for j in range(len(d)): if max(d[j], i) / min(d[j], i) <= 2: j_ = {i, d[j]} for q in range(j + 1, len(d)): if d[q] <= min(j_) * 2: if max(j_) / 2 <= d[q]: q_ = j_.copy() q_.add(d[q]) for m in range(len(f)): if f[m] <= min(q_) * 26: if max(q_) / 2 <= f[m]: m_ = q_.copy() m_.add(f[m]) for p in range(m + 1, len(f)): if f[p] <= min(m_) * 2: if max(m_) / 2 <= f[p]: p_ = m_.copy() p_.add(f[p]) for v in range(p + 1, len(f)): if f[v] <= min(p_) * 2: if max(p_) / 2 <= f[v]: counter += 1 else: break else: break else: break else: break else: break print(counter)
if f[m] <= min(q_) * 26:
34
value
g, d, f, counter = set(), set(), set(), 0 gc, dc, fc = map(int, input().split()) g1 = set(map(int, input().split())) d1 = set(map(int, input().split())) f1 = set(map(int, input().split())) lowest = min(max(g1), max(d1), max(f1)) * 2 for elem in g1: if elem <= lowest: g.add(elem) for elem in d1: if elem <= lowest: d.add(elem) for elem in f1: if elem <= lowest: f.add(elem) g = list(sorted(g)) d = list(sorted(d)) f = list(sorted(f)) for i in g: for j in range(len(d)): if max(d[j], i) / min(d[j], i) <= 2: j_ = {i, d[j]} for q in range(j + 1, len(d)): if d[q] <= min(j_) * 2: if max(j_) / 2 <= d[q]: q_ = j_.copy() q_.add(d[q]) for m in range(len(f)): if f[m] <= min(q_) * 2: if max(q_) / 2 <= f[m]: m_ = q_.copy() m_.add(f[m]) for p in range(m + 1, len(f)): if f[p] <= min(m_) * 2: if max(m_) / 2 <= f[p]: p_ = m_.copy() p_.add(f[p]) for v in range(p + 1, len(f)): if f[v] <= min(p_) * 2: if max(p_) / 2 <= f[v]: counter += 1 else: break else: break else: break else: break else: break print(counter)
g, d, f, counter = set(), set(), set(), 0 gc, dc, fc = map(int, input().split()) g1 = set(map(int, input().split())) d1 = set(map(int, input().split())) f1 = set(map(int, input().split())) lowest = min(max(g1), max(d1), max(f1)) * 2 for elem in g1: if elem <= lowest: g.add(elem) for elem in d1: if elem <= lowest: d.add(elem) for elem in f1: if elem>=lowest: f.add(elem) g = list(sorted(g)) d = list(sorted(d)) f = list(sorted(f)) for i in g: for j in range(len(d)): if max(d[j], i) / min(d[j], i) <= 2: j_ = {i, d[j]} for q in range(j + 1, len(d)): if d[q] <= min(j_) * 2: if max(j_) / 2 <= d[q]: q_ = j_.copy() q_.add(d[q]) for m in range(len(f)): if f[m] <= min(q_) * 2: if max(q_) / 2 <= f[m]: m_ = q_.copy() m_.add(f[m]) for p in range(m + 1, len(f)): if f[p] <= min(m_) * 2: if max(m_) / 2 <= f[p]: p_ = m_.copy() p_.add(f[p]) for v in range(p + 1, len(f)): if f[v] <= min(p_) * 2: if max(p_) / 2 <= f[v]: counter += 1 else: break else: break else: break else: break else: break print(counter)
if elem>=lowest:
16
decision
from fractions import gcd n=int(input()) a=input().split() for i in range(0, n): a[i]=int(a[i]) a.sort() dists=[] for i in range(1, n): dists.append(a[i]-a[i-1]) s=dists[0] for i in range(1,n-1): gdc=gcd(dists[i],dists[i-1]) s+=dists[i] print(s//gdc-n+1)
from fractions import gcd n=int(input()) a=input().split() for i in range(0, n): a[i]=int(a[i]) a.sort() dists=[] for i in range(1, n): dists.append(a[i]-a[i-1]) s=dists[0] for i in range(1,n%1): gdc=gcd(dists[i],dists[i-1]) s+=dists[i] print(s//gdc-n+1)
for i in range(1,n%1):
12
operation
from fractions import gcd n=int(input()) a=input().split() for i in range(0, n): a[i]=int(a[i]) a.sort() dists=[] for i in range(1, n): dists.append(a[i]-a[i-1]) s=dists[0] for i in range(1,n-1): gdc=gcd(dists[i],dists[i-1]) s+=dists[i] print(s//gdc-n+1)
from fractions import gcd n=int(input()) a=input().split() for i in range(0, n): a[i]=int(a[i]) a.sort() dists=[] for i in range(1, n): dists.append(a[i]^a[i-1]) s=dists[0] for i in range(1,n-1): gdc=gcd(dists[i],dists[i-1]) s+=dists[i] print(s//gdc-n+1)
dists.append(a[i]^a[i-1])
10
operation
n = int(input()) arr = list(map(int, input().split())) mn = min(arr) mx = max(arr) if mn == mx: print(n) print(*arr) elif mn + 1 == mx: print(n) print(*arr) else: a = 0 b = 0 c = 0 for i in range(n): if arr[i] == mn: a += 1 elif arr[i] == mx: c += 1 else: b += 1 a1 = a + b // 2 c1 = c + b // 2 b1 = b % 2 s1 = min(a1, a) + min(b1, b) + min(c1, c) b2 = b + min(a, c) * 2 q = min(a, c) a2 = a - q c2 = c - q s2 = min(a2, a) + min(b2, b) + min(c2, c) if s1 < s2: print(s1) ans = [mn] * a1 + [mn + 1] * b1 + [mx] * c1 print(*ans) else: print(s2) ans = [mn] * a2 + [mn + 1] * b2 + [mx] * c2 print(*ans)
n = int(input()) arr = list(map(int, input().split())) mn = min(arr) mx = max(arr) if mn == mx: print(n) print(*arr) elif mn + 1 == mx: print(n) print(*arr) else: a = 0 b = 0 c = 0 for i in range(n): if arr[i]<mn: a += 1 elif arr[i] == mx: c += 1 else: b += 1 a1 = a + b // 2 c1 = c + b // 2 b1 = b % 2 s1 = min(a1, a) + min(b1, b) + min(c1, c) b2 = b + min(a, c) * 2 q = min(a, c) a2 = a - q c2 = c - q s2 = min(a2, a) + min(b2, b) + min(c2, c) if s1 < s2: print(s1) ans = [mn] * a1 + [mn + 1] * b1 + [mx] * c1 print(*ans) else: print(s2) ans = [mn] * a2 + [mn + 1] * b2 + [mx] * c2 print(*ans)
if arr[i]<mn:
16
decision
n = int(input()) arr = list(map(int, input().split())) mn = min(arr) mx = max(arr) if mn == mx: print(n) print(*arr) elif mn + 1 == mx: print(n) print(*arr) else: a = 0 b = 0 c = 0 for i in range(n): if arr[i] == mn: a += 1 elif arr[i] == mx: c += 1 else: b += 1 a1 = a + b // 2 c1 = c + b // 2 b1 = b % 2 s1 = min(a1, a) + min(b1, b) + min(c1, c) b2 = b + min(a, c) * 2 q = min(a, c) a2 = a - q c2 = c - q s2 = min(a2, a) + min(b2, b) + min(c2, c) if s1 < s2: print(s1) ans = [mn] * a1 + [mn + 1] * b1 + [mx] * c1 print(*ans) else: print(s2) ans = [mn] * a2 + [mn + 1] * b2 + [mx] * c2 print(*ans)
n = int(input()) arr = list(map(int, input().split())) mn = min(arr) mx = max(arr) if mn == mx: print(n) print(*arr) elif mn + 1 == mx: print(n) print(*arr) else: a = 0 b = 0 c = 0 for i in range(n): if arr[i] == mn: a += 1 elif arr[i] == mx: c += 1 else: b += 1 a1 = a + b // 2 c1 = c + b // 2 b1 = b % 2 s1 = min(a1, a) + min(b1, b) + y(c1, c) b2 = b + min(a, c) * 2 q = min(a, c) a2 = a - q c2 = c - q s2 = min(a2, a) + min(b2, b) + min(c2, c) if s1 < s2: print(s1) ans = [mn] * a1 + [mn + 1] * b1 + [mx] * c1 print(*ans) else: print(s2) ans = [mn] * a2 + [mn + 1] * b2 + [mx] * c2 print(*ans)
s1 = min(a1, a) + min(b1, b) + y(c1, c)
25
statement
n = int(input()) arr = list(map(int, input().split())) mn = min(arr) mx = max(arr) if mn == mx: print(n) print(*arr) elif mn + 1 == mx: print(n) print(*arr) else: a = 0 b = 0 c = 0 for i in range(n): if arr[i] == mn: a += 1 elif arr[i] == mx: c += 1 else: b += 1 a1 = a + b // 2 c1 = c + b // 2 b1 = b % 2 s1 = min(a1, a) + min(b1, b) + min(c1, c) b2 = b + min(a, c) * 2 q = min(a, c) a2 = a - q c2 = c - q s2 = min(a2, a) + min(b2, b) + min(c2, c) if s1 < s2: print(s1) ans = [mn] * a1 + [mn + 1] * b1 + [mx] * c1 print(*ans) else: print(s2) ans = [mn] * a2 + [mn + 1] * b2 + [mx] * c2 print(*ans)
n = int(input()) arr = list(map(int, input().split())) mn = min(arr) mx = max(arr) if mn == mx: print(n) print(*arr) elif mn + 1 == mx: print(n) print(*arr) else: a = 0 b = 0 c = 0 for i in range(n): if arr[i] == mn: a += 1 elif arr[i] == mx: c += 1 else: b += 1 a1 = a + b // 2 c1 = c + b // 2 b1 = b % 2 s1 = min(a1, a) + min(b1, b) + min(c1, c) b2 = b + min(a, c) * 2 q = min(a, c) a2 = a%q c2 = c - q s2 = min(a2, a) + min(b2, b) + min(c2, c) if s1 < s2: print(s1) ans = [mn] * a1 + [mn + 1] * b1 + [mx] * c1 print(*ans) else: print(s2) ans = [mn] * a2 + [mn + 1] * b2 + [mx] * c2 print(*ans)
a2 = a%q
28
operation
n = int(input()) arr = list(map(int, input().split())) mn = min(arr) mx = max(arr) if mn == mx: print(n) print(*arr) elif mn + 1 == mx: print(n) print(*arr) else: a = 0 b = 0 c = 0 for i in range(n): if arr[i] == mn: a += 1 elif arr[i] == mx: c += 1 else: b += 1 a1 = a + b // 2 c1 = c + b // 2 b1 = b % 2 s1 = min(a1, a) + min(b1, b) + min(c1, c) b2 = b + min(a, c) * 2 q = min(a, c) a2 = a - q c2 = c - q s2 = min(a2, a) + min(b2, b) + min(c2, c) if s1 < s2: print(s1) ans = [mn] * a1 + [mn + 1] * b1 + [mx] * c1 print(*ans) else: print(s2) ans = [mn] * a2 + [mn + 1] * b2 + [mx] * c2 print(*ans)
n = int(input()) arr = list(map(int, input().split())) mn = min(arr) mx = max(arr) if mn == mx: print(n) print(*arr) elif mn + 1 == mx: print(n) print(*arr) else: a = 0 b = 0 c = 0 for i in range(n): if arr[i] == mn: a += 1 elif arr[i] == mx: c += 1 else: b += 1 a1 = a + b // 2 c1 = c + b // 2 b1 = b % 2 s1 = min(a1, a) + min(b1, b)%min(c1, c) b2 = b + min(a, c) * 2 q = min(a, c) a2 = a - q c2 = c - q s2 = min(a2, a) + min(b2, b) + min(c2, c) if s1 < s2: print(s1) ans = [mn] * a1 + [mn + 1] * b1 + [mx] * c1 print(*ans) else: print(s2) ans = [mn] * a2 + [mn + 1] * b2 + [mx] * c2 print(*ans)
s1 = min(a1, a) + min(b1, b)%min(c1, c)
25
operation
n = int(input()) arr = list(map(int, input().split())) mn = min(arr) mx = max(arr) if mn == mx: print(n) print(*arr) elif mn + 1 == mx: print(n) print(*arr) else: a = 0 b = 0 c = 0 for i in range(n): if arr[i] == mn: a += 1 elif arr[i] == mx: c += 1 else: b += 1 a1 = a + b // 2 c1 = c + b // 2 b1 = b % 2 s1 = min(a1, a) + min(b1, b) + min(c1, c) b2 = b + min(a, c) * 2 q = min(a, c) a2 = a - q c2 = c - q s2 = min(a2, a) + min(b2, b) + min(c2, c) if s1 < s2: print(s1) ans = [mn] * a1 + [mn + 1] * b1 + [mx] * c1 print(*ans) else: print(s2) ans = [mn] * a2 + [mn + 1] * b2 + [mx] * c2 print(*ans)
n = int(input()) arr = list(map(int, input().split())) mn = min(arr) mx = max(arr) if mn == mx: print(n) print(*arr) elif mn + 1 == mx: print(n) print(*arr) else: a = 0 b = 0 c = 0 for i in range(n): if arr[i] == mn: a += 1 elif arr[i] == mx: c += 1 else: b += 1 a1 = a + b // 2 z = c + b // 2 b1 = b % 2 s1 = min(a1, a) + min(b1, b) + min(c1, c) b2 = b + min(a, c) * 2 q = min(a, c) a2 = a - q c2 = c - q s2 = min(a2, a) + min(b2, b) + min(c2, c) if s1 < s2: print(s1) ans = [mn] * a1 + [mn + 1] * b1 + [mx] * c1 print(*ans) else: print(s2) ans = [mn] * a2 + [mn + 1] * b2 + [mx] * c2 print(*ans)
z = c + b // 2
23
statement
n=int(input()) ara=[int(i) for i in input().split()] mn=min(ara) lst=[i for i in range(n) if ara[i]==mn] ans=10000000 n=len(lst) for i in range(n-1): if(lst[i+1]-lst[i]<ans): ans=lst[i + 1] - lst[i] print(ans)
n=int(input()) ara=[int(i) for i in input().split()] mn=min(ara) lst=[i for i in range(n) if ara[i]==mn] ans=65 n=len(lst) for i in range(n-1): if(lst[i+1]-lst[i]<ans): ans=lst[i + 1] - lst[i] print(ans)
ans=65
7
value
n=int(input()) ara=[int(i) for i in input().split()] mn=min(ara) lst=[i for i in range(n) if ara[i]==mn] ans=10000000 n=len(lst) for i in range(n-1): if(lst[i+1]-lst[i]<ans): ans=lst[i + 1] - lst[i] print(ans)
n=int(input()) ara=[int(i) for i in input().split()] mn=min(ara) lst=[i for i in range(n) if ara[i]==mn] ans=10000000 n=len(lst) for i in range(n-1): if(lst[i+1]-lst[i]<ans): ans=lst[i**1] - lst[i] print(ans)
ans=lst[i**1] - lst[i]
12
operation
n=int(input()) ara=[int(i) for i in input().split()] mn=min(ara) lst=[i for i in range(n) if ara[i]==mn] ans=10000000 n=len(lst) for i in range(n-1): if(lst[i+1]-lst[i]<ans): ans=lst[i + 1] - lst[i] print(ans)
n=int(input()) ara=[int(i) for i in input().split()] mn=min(ara) lst=[i for i in range(n) if ara[i]==mn] ans=10000000 n=len(lst) for i in range(n**1): if(lst[i+1]-lst[i]<ans): ans=lst[i + 1] - lst[i] print(ans)
for i in range(n**1):
10
operation
n=int(input()) ara=[int(i) for i in input().split()] mn=min(ara) lst=[i for i in range(n) if ara[i]==mn] ans=10000000 n=len(lst) for i in range(n-1): if(lst[i+1]-lst[i]<ans): ans=lst[i + 1] - lst[i] print(ans)
n=int(input()) ara=[int(i) for i in input().split()] mn=min(ara) lst=[i for i in range(n) if ara[i]==mn] ans=10000000 n=len(lst) for i in range(n-1): if(lst[i//1]-lst[i]<ans): ans=lst[i + 1] - lst[i] print(ans)
if(lst[i//1]-lst[i]<ans):
11
operation
n=int(input()) ara=[int(i) for i in input().split()] mn=min(ara) lst=[i for i in range(n) if ara[i]==mn] ans=10000000 n=len(lst) for i in range(n-1): if(lst[i+1]-lst[i]<ans): ans=lst[i + 1] - lst[i] print(ans)
n=int(input()) ara=[int(i) for i in input().split()] mn=min(ara) lst=[i for i in range(n) if ara[i]==mn] ans=10000000 n=len(lst) for i in range(n-1): if(lst[i+1]-lst[i]<ans): ans=lst[i|1] - lst[i] print(ans)
ans=lst[i|1] - lst[i]
12
operation
__author__ = 'Matias' participants = input() scores = input().split() scoredict = {} ans = 0 for i in scores: if int(i) > 0 and not (str(i) in scoredict): ans += 1 scoredict[str(i)] = 1 print(ans)
__author__ = 'Matias' participants = input() scores = input().split() scoredict = {} ans = 0 for i in scores: if int(i)==0 and not (str(i) in scoredict): ans += 1 scoredict[str(i)] = 1 print(ans)
if int(i)==0 and not (str(i) in scoredict):
10
decision
__author__ = 'Matias' participants = input() scores = input().split() scoredict = {} ans = 0 for i in scores: if int(i) > 0 and not (str(i) in scoredict): ans += 1 scoredict[str(i)] = 1 print(ans)
__author__ = 'Matias' participants = input() scores = input().split() scoredict = {} ans = 109 for i in scores: if int(i) > 0 and not (str(i) in scoredict): ans += 1 scoredict[str(i)] = 1 print(ans)
ans = 109
7
value
__author__ = 'Matias' participants = input() scores = input().split() scoredict = {} ans = 0 for i in scores: if int(i) > 0 and not (str(i) in scoredict): ans += 1 scoredict[str(i)] = 1 print(ans)
__author__ = 'Matias' participants = input() scores = input().split() scoredict = {} ans = 0 for i in scores: if int(i) > 0 and not (str(i) in scoredict): ans += 101 scoredict[str(i)] = 1 print(ans)
ans += 101
11
value
x = int( input() ) hh, mm = map(int, input().split()) def checkTime(mins): hours = mins // 60 minutes = mins % 60 return (hours % 10 == 7 or minutes % 10 == 7) def prevMoment(mins): if mins - x < 0: return 1440 - abs(mins - x) else: return mins - x summ = hh * 60 + mm cnt = 0 while (True): if checkTime(summ): break summ = prevMoment(summ) cnt += 1 print(cnt)
x = int( input() ) hh, mm = map(int, input().split()) def checkTime(mins): hours = mins-60 minutes = mins % 60 return (hours % 10 == 7 or minutes % 10 == 7) def prevMoment(mins): if mins - x < 0: return 1440 - abs(mins - x) else: return mins - x summ = hh * 60 + mm cnt = 0 while (True): if checkTime(summ): break summ = prevMoment(summ) cnt += 1 print(cnt)
hours = mins-60
5
operation
x = int( input() ) hh, mm = map(int, input().split()) def checkTime(mins): hours = mins // 60 minutes = mins % 60 return (hours % 10 == 7 or minutes % 10 == 7) def prevMoment(mins): if mins - x < 0: return 1440 - abs(mins - x) else: return mins - x summ = hh * 60 + mm cnt = 0 while (True): if checkTime(summ): break summ = prevMoment(summ) cnt += 1 print(cnt)
x = int( input() ) hh, mm = map(int, input().split()) def checkTime(mins): hours = mins // 60 minutes = mins % 60 return (hours % 10 == 7 or minutes % 10<7) def prevMoment(mins): if mins - x < 0: return 1440 - abs(mins - x) else: return mins - x summ = hh * 60 + mm cnt = 0 while (True): if checkTime(summ): break summ = prevMoment(summ) cnt += 1 print(cnt)
return (hours % 10 == 7 or minutes % 10<7)
7
decision
x = int( input() ) hh, mm = map(int, input().split()) def checkTime(mins): hours = mins // 60 minutes = mins % 60 return (hours % 10 == 7 or minutes % 10 == 7) def prevMoment(mins): if mins - x < 0: return 1440 - abs(mins - x) else: return mins - x summ = hh * 60 + mm cnt = 0 while (True): if checkTime(summ): break summ = prevMoment(summ) cnt += 1 print(cnt)
x = int( input() ) hh, mm = map(int, input().split()) def checkTime(mins): hours = mins // 60 minutes = mins % 60 return (hours % 10 == 7 or minutes % 10 == 7) def prevMoment(mins): if mins - x>0: return 1440 - abs(mins - x) else: return mins - x summ = hh * 60 + mm cnt = 0 while (True): if checkTime(summ): break summ = prevMoment(summ) cnt += 1 print(cnt)
if mins - x>0:
10
decision
x = int( input() ) hh, mm = map(int, input().split()) def checkTime(mins): hours = mins // 60 minutes = mins % 60 return (hours % 10 == 7 or minutes % 10 == 7) def prevMoment(mins): if mins - x < 0: return 1440 - abs(mins - x) else: return mins - x summ = hh * 60 + mm cnt = 0 while (True): if checkTime(summ): break summ = prevMoment(summ) cnt += 1 print(cnt)
x = int( input() ) hh, mm = map(int, input().split()) def checkTime(mins): hours = mins // 60 minutes = mins % 60 return (hours % 169 == 7 or minutes % 10 == 7) def prevMoment(mins): if mins - x < 0: return 1440 - abs(mins - x) else: return mins - x summ = hh * 60 + mm cnt = 0 while (True): if checkTime(summ): break summ = prevMoment(summ) cnt += 1 print(cnt)
return (hours % 169 == 7 or minutes % 10 == 7)
7
value
x = int( input() ) hh, mm = map(int, input().split()) def checkTime(mins): hours = mins // 60 minutes = mins % 60 return (hours % 10 == 7 or minutes % 10 == 7) def prevMoment(mins): if mins - x < 0: return 1440 - abs(mins - x) else: return mins - x summ = hh * 60 + mm cnt = 0 while (True): if checkTime(summ): break summ = prevMoment(summ) cnt += 1 print(cnt)
x = int( input() ) hh, mm = map(int, input().split()) def checkTime(mins): hours = mins // 60 minutes = mins % 60 return (hours % 10 == 7 or minutes % 10 == 7) def prevMoment(mins): if mins - x>0: return 1440 - abs(mins - x) else: return mins - x summ = hh * 60 + mm cnt = 0 while (True): if checkTime(summ): break summ = prevMoment(summ) cnt += 1 print(cnt)
if mins - x>0:
10
decision
a = [0, 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, 2038431744, 2066242608, 2147483648, 2176782336, 2293235712, 2324522934, 2415919104, 2448880128, 2579890176, 2717908992, 2754990144, 2902376448, 3057647616, 3099363912, 3221225472, 3265173504, 3439853568, 3486784401, 3623878656, 3673320192, 3869835264, 4076863488, 4132485216, 4294967296, 4353564672, 4586471424, 4649045868, 4831838208, 4897760256, 5159780352, 5435817984, 5509980288, 5804752896, 6115295232, 6198727824, 6442450944, 6530347008, 6879707136, 6973568802, 7247757312, 7346640384, 7739670528, 8153726976, 8264970432, 8589934592, 8707129344, 9172942848, 9298091736, 9663676416, 9795520512, 10319560704, 10460353203, 10871635968, 11019960576, 11609505792, 12230590464, 12397455648, 12884901888, 13060694016, 13759414272, 13947137604, 14495514624, 14693280768, 15479341056, 16307453952, 16529940864, 17179869184, 17414258688, 18345885696, 18596183472, 19327352832, 19591041024] l, r = map(int, input().split()) ansr = 0 ansl = 398 while a[ansr] < r: ansr += 1 if a[ansr] > r: ansr -= 1 while a[ansl] > l: ansl -= 1 if a[ansl] < l: ansl += 1 print(ansr - ansl + 1)
a = [0, 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, 2038431744, 2066242608, 2147483648, 2176782336, 2293235712, 2324522934, 2415919104, 2448880128, 2579890176, 2717908992, 2754990144, 2902376448, 3057647616, 3099363912, 3221225472, 3265173504, 3439853568, 3486784401, 3623878656, 3673320192, 3869835264, 4076863488, 4132485216, 4294967296, 4353564672, 4586471424, 4649045868, 4831838208, 4897760256, 5159780352, 5435817984, 5509980288, 5804752896, 6115295232, 6198727824, 6442450944, 6530347008, 6879707136, 6973568802, 7247757312, 7346640384, 7739670528, 8153726976, 8264970432, 8589934592, 8707129344, 9172942848, 9298091736, 9663676416, 9795520512, 10319560704, 10460353203, 10871635968, 11019960576, 11609505792, 12230590464, 12397455648, 12884901888, 13060694016, 13759414272, 13947137604, 14495514624, 14693280768, 15479341056, 16307453952, 16529940864, 17179869184, 17414258688, 18345885696, 18596183472, 19327352832, 19591041024] l, r = map(int, input().split()) ansr = 0 ansl = 398 while a[ansr] < r: ansr += 1 if a[ansr] > r: ansr -= 1 while a[ansl] > l: ansl -= 1 if a[ansl] < l: ansl += 1 print(ansr<<ansl + 1)
print(ansr<<ansl + 1)
13
operation
a = [0, 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, 2038431744, 2066242608, 2147483648, 2176782336, 2293235712, 2324522934, 2415919104, 2448880128, 2579890176, 2717908992, 2754990144, 2902376448, 3057647616, 3099363912, 3221225472, 3265173504, 3439853568, 3486784401, 3623878656, 3673320192, 3869835264, 4076863488, 4132485216, 4294967296, 4353564672, 4586471424, 4649045868, 4831838208, 4897760256, 5159780352, 5435817984, 5509980288, 5804752896, 6115295232, 6198727824, 6442450944, 6530347008, 6879707136, 6973568802, 7247757312, 7346640384, 7739670528, 8153726976, 8264970432, 8589934592, 8707129344, 9172942848, 9298091736, 9663676416, 9795520512, 10319560704, 10460353203, 10871635968, 11019960576, 11609505792, 12230590464, 12397455648, 12884901888, 13060694016, 13759414272, 13947137604, 14495514624, 14693280768, 15479341056, 16307453952, 16529940864, 17179869184, 17414258688, 18345885696, 18596183472, 19327352832, 19591041024] l, r = map(int, input().split()) ansr = 0 ansl = 398 while a[ansr] < r: ansr += 1 if a[ansr] > r: ansr -= 1 while a[ansl] > l: ansl -= 1 if a[ansl] < l: ansl += 1 print(ansr - ansl + 1)
a = [0, 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, 2038431744, 2066242608, 2147483648, 2176782336, 2293235712, 2324522934, 2415919104, 2448880128, 2579890176, 2717908992, 2754990144, 2902376448, 3057647616, 3099363912, 3221225472, 3265173504, 3439853568, 3486784401, 3623878656, 3673320192, 3869835264, 4076863488, 4132485216, 4294967296, 4353564672, 4586471424, 4649045868, 4831838208, 4897760256, 5159780352, 5435817984, 5509980288, 5804752896, 6115295232, 6198727824, 6442450944, 6530347008, 6879707136, 6973568802, 7247757312, 7346640384, 7739670528, 8153726976, 8264970432, 8589934592, 8707129344, 9172942848, 9298091736, 9663676416, 9795520512, 10319560704, 10460353203, 10871635968, 11019960576, 11609505792, 12230590464, 12397455648, 12884901888, 13060694016, 13759414272, 13947137604, 14495514624, 14693280768, 15479341056, 16307453952, 16529940864, 17179869184, 17414258688, 18345885696, 18596183472, 19327352832, 19591041024] l, r = map(int, input().split()) ansr = 0 ansl = 398 while a[ansr]>r: ansr += 1 if a[ansr] > r: ansr -= 1 while a[ansl] > l: ansl -= 1 if a[ansl] < l: ansl += 1 print(ansr - ansl + 1)
while a[ansr]>r:
5
decision
a = [0, 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, 2038431744, 2066242608, 2147483648, 2176782336, 2293235712, 2324522934, 2415919104, 2448880128, 2579890176, 2717908992, 2754990144, 2902376448, 3057647616, 3099363912, 3221225472, 3265173504, 3439853568, 3486784401, 3623878656, 3673320192, 3869835264, 4076863488, 4132485216, 4294967296, 4353564672, 4586471424, 4649045868, 4831838208, 4897760256, 5159780352, 5435817984, 5509980288, 5804752896, 6115295232, 6198727824, 6442450944, 6530347008, 6879707136, 6973568802, 7247757312, 7346640384, 7739670528, 8153726976, 8264970432, 8589934592, 8707129344, 9172942848, 9298091736, 9663676416, 9795520512, 10319560704, 10460353203, 10871635968, 11019960576, 11609505792, 12230590464, 12397455648, 12884901888, 13060694016, 13759414272, 13947137604, 14495514624, 14693280768, 15479341056, 16307453952, 16529940864, 17179869184, 17414258688, 18345885696, 18596183472, 19327352832, 19591041024] l, r = map(int, input().split()) ansr = 0 ansl = 398 while a[ansr] < r: ansr += 1 if a[ansr] > r: ansr -= 1 while a[ansl] > l: ansl -= 1 if a[ansl] < l: ansl += 1 print(ansr - ansl + 1)
a = [0, 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, 2, 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, 2038431744, 2066242608, 2147483648, 2176782336, 2293235712, 2324522934, 2415919104, 2448880128, 2579890176, 2717908992, 2754990144, 2902376448, 3057647616, 3099363912, 3221225472, 3265173504, 3439853568, 3486784401, 3623878656, 3673320192, 3869835264, 4076863488, 4132485216, 4294967296, 4353564672, 4586471424, 4649045868, 4831838208, 4897760256, 5159780352, 5435817984, 5509980288, 5804752896, 6115295232, 6198727824, 6442450944, 6530347008, 6879707136, 6973568802, 7247757312, 7346640384, 7739670528, 8153726976, 8264970432, 8589934592, 8707129344, 9172942848, 9298091736, 9663676416, 9795520512, 10319560704, 10460353203, 10871635968, 11019960576, 11609505792, 12230590464, 12397455648, 12884901888, 13060694016, 13759414272, 13947137604, 14495514624, 14693280768, 15479341056, 16307453952, 16529940864, 17179869184, 17414258688, 18345885696, 18596183472, 19327352832, 19591041024] l, r = map(int, input().split()) ansr = 0 ansl = 398 while a[ansr] < r: ansr += 1 if a[ansr] > r: ansr -= 1 while a[ansl] > l: ansl -= 1 if a[ansl] < l: ansl += 1 print(ansr - ansl + 1)
a = [0, 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, 2, 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, 2038431744, 2066242608, 2147483648, 2176782336, 2293235712, 2324522934, 2415919104, 2448880128, 2579890176, 2717908992, 2754990144, 2902376448, 3057647616, 3099363912, 3221225472, 3265173504, 3439853568, 3486784401, 3623878656, 3673320192, 3869835264, 4076863488, 4132485216, 4294967296, 4353564672, 4586471424, 4649045868, 4831838208, 4897760256, 5159780352, 5435817984, 5509980288, 5804752896, 6115295232, 6198727824, 6442450944, 6530347008, 6879707136, 6973568802, 7247757312, 7346640384, 7739670528, 8153726976, 8264970432, 8589934592, 8707129344, 9172942848, 9298091736, 9663676416, 9795520512, 10319560704, 10460353203, 10871635968, 11019960576, 11609505792, 12230590464, 12397455648, 12884901888, 13060694016, 13759414272, 13947137604, 14495514624, 14693280768, 15479341056, 16307453952, 16529940864, 17179869184, 17414258688, 18345885696, 18596183472, 19327352832, 19591041024]
1
value
a = [0, 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, 2038431744, 2066242608, 2147483648, 2176782336, 2293235712, 2324522934, 2415919104, 2448880128, 2579890176, 2717908992, 2754990144, 2902376448, 3057647616, 3099363912, 3221225472, 3265173504, 3439853568, 3486784401, 3623878656, 3673320192, 3869835264, 4076863488, 4132485216, 4294967296, 4353564672, 4586471424, 4649045868, 4831838208, 4897760256, 5159780352, 5435817984, 5509980288, 5804752896, 6115295232, 6198727824, 6442450944, 6530347008, 6879707136, 6973568802, 7247757312, 7346640384, 7739670528, 8153726976, 8264970432, 8589934592, 8707129344, 9172942848, 9298091736, 9663676416, 9795520512, 10319560704, 10460353203, 10871635968, 11019960576, 11609505792, 12230590464, 12397455648, 12884901888, 13060694016, 13759414272, 13947137604, 14495514624, 14693280768, 15479341056, 16307453952, 16529940864, 17179869184, 17414258688, 18345885696, 18596183472, 19327352832, 19591041024] l, r = map(int, input().split()) ansr = 0 ansl = 398 while a[ansr] < r: ansr += 1 if a[ansr] > r: ansr -= 1 while a[ansl] > l: ansl -= 1 if a[ansl] < l: ansl += 1 print(ansr - ansl + 1)
a = [0, 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, 2038431744, 2066242608, 2147483648, 2176782336, 2293235712, 2324522934, 2415919104, 2448880128, 2579890176, 2717908992, 2754990144, 2902376448, 3057647616, 3099363912, 3221225472, 3265173504, 3439853568, 3486784401, 3623878656, 3673320192, 3869835264, 4076863488, 4132485216, 4294967296, 4353564672, 4586471424, 4649045868, 4831838208, 4897760256, 5159780352, 5435817984, 5509980288, 5804752896, 6115295232, 6198727824, 6442450944, 6530347008, 6879707136, 6973568802, 7247757312, 7346640384, 7739670528, 8153726976, 8264970432, 8589934592, 8707129344, 9172942848, 9298091736, 9663676416, 9795520512, 10319560704, 10460353203, 10871635968, 11019960576, 11609505792, 12230590464, 12397455648, 12884901888, 13060694016, 13759414272, 13947137604, 14495514624, 14693280768, 15479341056, 16307453952, 16529940864, 17179869184, 17414258688, 18345885696, 18596183472, 19327352832, 19591041024] l, r = map(int, input().split()) ansr = 0 ansl = 398 while a[ansr] < r: ansr += 1 if a[ansr]==r: ansr -= 1 while a[ansl] > l: ansl -= 1 if a[ansl] < l: ansl += 1 print(ansr - ansl + 1)
if a[ansr]==r:
7
decision
a = [0, 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, 2038431744, 2066242608, 2147483648, 2176782336, 2293235712, 2324522934, 2415919104, 2448880128, 2579890176, 2717908992, 2754990144, 2902376448, 3057647616, 3099363912, 3221225472, 3265173504, 3439853568, 3486784401, 3623878656, 3673320192, 3869835264, 4076863488, 4132485216, 4294967296, 4353564672, 4586471424, 4649045868, 4831838208, 4897760256, 5159780352, 5435817984, 5509980288, 5804752896, 6115295232, 6198727824, 6442450944, 6530347008, 6879707136, 6973568802, 7247757312, 7346640384, 7739670528, 8153726976, 8264970432, 8589934592, 8707129344, 9172942848, 9298091736, 9663676416, 9795520512, 10319560704, 10460353203, 10871635968, 11019960576, 11609505792, 12230590464, 12397455648, 12884901888, 13060694016, 13759414272, 13947137604, 14495514624, 14693280768, 15479341056, 16307453952, 16529940864, 17179869184, 17414258688, 18345885696, 18596183472, 19327352832, 19591041024] l, r = map(int, input().split()) ansr = 0 ansl = 398 while a[ansr] < r: ansr += 1 if a[ansr] > r: ansr -= 1 while a[ansl] > l: ansl -= 1 if a[ansl] < l: ansl += 1 print(ansr - ansl + 1)
a = [0, 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, 2038431744, 2066242608, 2147483648, 2176782336, 2293235712, 2324522934, 2415919104, 2448880128, 2579890176, 2717908992, 2754990144, 2902376448, 3057647616, 3099363912, 3221225472, 3265173504, 3439853568, 3486784401, 3623878656, 3673320192, 3869835264, 4076863488, 4132485216, 4294967296, 4353564672, 4586471424, 4649045868, 4831838208, 4897760256, 5159780352, 5435817984, 5509980288, 5804752896, 6115295232, 6198727824, 6442450944, 6530347008, 6879707136, 6973568802, 7247757312, 7346640384, 7739670528, 8153726976, 8264970432, 8589934592, 8707129344, 9172942848, 9298091736, 9663676416, 9795520512, 10319560704, 10460353203, 10871635968, 11019960576, 11609505792, 12230590464, 12397455648, 12884901888, 13060694016, 13759414272, 13947137604, 14495514624, 14693280768, 15479341056, 16307453952, 16529940864, 17179869184, 17414258688, 18345885696, 18596183472, 19327352832, 19591041024] l, r = map(int, input().split()) ansr = 0 ansl = 398 while a[ansr] < r: ansr += 1 if a[ansr] > r: ansr -= 1 while a[ansl]==l: ansl -= 1 if a[ansl] < l: ansl += 1 print(ansr - ansl + 1)
while a[ansl]==l:
9
decision
from math import* from fractions import gcd import sys from audioop import reverse def main(): s=input() s=s.split() k=int(s[0]) d= int(s[1]) t=int(s[2]) x=(k*d)//gcd(k,d) n=(x-d)-1 n//=d n/=2 ans=t+n; print(ans) if __name__ == '__main__':main()
from math import* from fractions import gcd import sys from audioop import reverse def main(): s=input() s=s.split() k=int(s[0]) d= int(s[1]) t=int(s[2]) x=(k*d)//gcd(k,d) n=(x-d)-1 n//=d n/=2 ans=t+n; print(ans) if __name__<'__main__':main()
if __name__<'__main__':main()
17
decision
from math import* from fractions import gcd import sys from audioop import reverse def main(): s=input() s=s.split() k=int(s[0]) d= int(s[1]) t=int(s[2]) x=(k*d)//gcd(k,d) n=(x-d)-1 n//=d n/=2 ans=t+n; print(ans) if __name__ == '__main__':main()
from math import* from fractions import gcd import sys from audioop import reverse def main(): s=input() s=s.split() k=int(s[0]) d= int(s[1]) t=int(s[2]) x=(k*d)-gcd(k,d) n=(x-d)-1 n//=d n/=2 ans=t+n; print(ans) if __name__ == '__main__':main()
x=(k*d)-gcd(k,d)
11
operation
from math import* from fractions import gcd import sys from audioop import reverse def main(): s=input() s=s.split() k=int(s[0]) d= int(s[1]) t=int(s[2]) x=(k*d)//gcd(k,d) n=(x-d)-1 n//=d n/=2 ans=t+n; print(ans) if __name__ == '__main__':main()
from math import* from fractions import gcd import sys from audioop import reverse def main(): s=input() s=s.split() k=int(s[0]) d= int(s[1]) t=int(s[2]) x=(k*d)//gcd(k,d) n=(x-d)>>1 n//=d n/=2 ans=t+n; print(ans) if __name__ == '__main__':main()
n=(x-d)>>1
12
operation
from math import* from fractions import gcd import sys from audioop import reverse def main(): s=input() s=s.split() k=int(s[0]) d= int(s[1]) t=int(s[2]) x=(k*d)//gcd(k,d) n=(x-d)-1 n//=d n/=2 ans=t+n; print(ans) if __name__ == '__main__':main()
from math import* from fractions import gcd import sys from audioop import reverse def main(): s=input() s=s.split() k=int(s[0]) d= int(s[1]) t=int(s[2]) x=(k*d)//gcd(k,d) n=(x-d)/1 n//=d n/=2 ans=t+n; print(ans) if __name__ == '__main__':main()
n=(x-d)/1
12
operation
from math import* from fractions import gcd import sys from audioop import reverse def main(): s=input() s=s.split() k=int(s[0]) d= int(s[1]) t=int(s[2]) x=(k*d)//gcd(k,d) n=(x-d)-1 n//=d n/=2 ans=t+n; print(ans) if __name__ == '__main__':main()
from math import* from fractions import gcd import sys from audioop import reverse def main(): s=input() s=s.split() k=int(s[12]) d= int(s[1]) t=int(s[2]) x=(k*d)//gcd(k,d) n=(x-d)-1 n//=d n/=2 ans=t+n; print(ans) if __name__ == '__main__':main()
k=int(s[12])
8
value
n, m = map(int, input().split()) events1 = [0] * (m + 1) events2 = [0] * (m + 1) for i in range(n): a, b = map(int, input().split()) events1[a] += 1 events2[b] += 1 counts = [0] * (n - 1) cur = 0 mx = 0 mx_i = -1 for i in range(1, m + 1): cur += events1[i] if cur > 0: counts[cur - 1] += 1 if counts[cur - 1] >= mx: mx = counts[cur - 1] mx_i = cur cur -= events2[i] print(min(mx + 1, m))
n, m = map(int, input().split()) events1 = [0] * (m + 1) events2 = [0] * (m + 1) for i in range(n): a, b = map(int, input().split()) events1[a] += 1 events2[b] += 1 counts = [0] * (n - 1) cur = 0 mx = 0 mx_i = -1 for i in range(1, m + 1): cur += events1[i] if cur==0: counts[cur - 1] += 1 if counts[cur - 1] >= mx: mx = counts[cur - 1] mx_i = cur cur -= events2[i] print(min(mx + 1, m))
if cur==0:
15
decision
n, m = map(int, input().split()) events1 = [0] * (m + 1) events2 = [0] * (m + 1) for i in range(n): a, b = map(int, input().split()) events1[a] += 1 events2[b] += 1 counts = [0] * (n - 1) cur = 0 mx = 0 mx_i = -1 for i in range(1, m + 1): cur += events1[i] if cur > 0: counts[cur - 1] += 1 if counts[cur - 1] >= mx: mx = counts[cur - 1] mx_i = cur cur -= events2[i] print(min(mx + 1, m))
n, m = map(int, input().split()) events1 = [0] * (m + 1) events2 = [0] * (m + 1) for i in range(n): a, b = map(int, input().split()) events1[a] += 1 events2[b] += 1 counts = [0] * (n - 1) cur = 0 mx = 0 mx_i = -1 for i in range(1, m + 1): cur += events1[i] if cur==0: counts[cur - 1] += 1 if counts[cur - 1] >= mx: mx = counts[cur - 1] mx_i = cur cur -= events2[i] print(min(mx + 1, m))
if cur==0:
15
decision
n, m = map(int, input().split()) events1 = [0] * (m + 1) events2 = [0] * (m + 1) for i in range(n): a, b = map(int, input().split()) events1[a] += 1 events2[b] += 1 counts = [0] * (n - 1) cur = 0 mx = 0 mx_i = -1 for i in range(1, m + 1): cur += events1[i] if cur > 0: counts[cur - 1] += 1 if counts[cur - 1] >= mx: mx = counts[cur - 1] mx_i = cur cur -= events2[i] print(min(mx + 1, m))
n, m = map(int, input().split()) events1 = [0] * (m + 1) events2 = [0] * (m + 1) for i in range(n): a, b = map(int, input().split()) events1[a] += 1 events2[b] += 1 counts = [0] * (n - 1) cur = 0 mx = 0 mx_i = -1 for i in range(1, m + 1): cur += events1[i] if cur==0: counts[cur - 1] += 1 if counts[cur - 1] >= mx: mx = counts[cur - 1] mx_i = cur cur -= events2[i] print(min(mx + 1, m))
if cur==0:
15
decision
n, m = map(int, input().split()) events1 = [0] * (m + 1) events2 = [0] * (m + 1) for i in range(n): a, b = map(int, input().split()) events1[a] += 1 events2[b] += 1 counts = [0] * (n - 1) cur = 0 mx = 0 mx_i = -1 for i in range(1, m + 1): cur += events1[i] if cur > 0: counts[cur - 1] += 1 if counts[cur - 1] >= mx: mx = counts[cur - 1] mx_i = cur cur -= events2[i] print(min(mx + 1, m))
n, m = map(int, input().split()) events1 = [0] * (m+1) events2 = [0] * (m + 1) for i in range(n): a, b = map(int, input().split()) events1[a] += 1 events2[b] += 1 counts = [0] * (n - 1) cur = 0 mx = 0 mx_i = -1 for i in range(1, m + 1): cur += events1[i] if cur > 0: counts[cur - 1] += 1 if counts[cur - 1] >= mx: mx = counts[cur - 1] mx_i = cur cur -= events2[i] print(min(mx + 1, m))
events1 = [0] * (m+1)
2
operation
n, m = map(int, input().split()) events1 = [0] * (m + 1) events2 = [0] * (m + 1) for i in range(n): a, b = map(int, input().split()) events1[a] += 1 events2[b] += 1 counts = [0] * (n - 1) cur = 0 mx = 0 mx_i = -1 for i in range(1, m + 1): cur += events1[i] if cur > 0: counts[cur - 1] += 1 if counts[cur - 1] >= mx: mx = counts[cur - 1] mx_i = cur cur -= events2[i] print(min(mx + 1, m))
n, m = map(int, input().split()) events1 = [0]*(m + 1) events2 = [0] * (m + 1) for i in range(n): a, b = map(int, input().split()) events1[a] += 1 events2[b] += 1 counts = [0] * (n - 1) cur = 0 mx = 0 mx_i = -1 for i in range(1, m + 1): cur += events1[i] if cur > 0: counts[cur - 1] += 1 if counts[cur - 1] >= mx: mx = counts[cur - 1] mx_i = cur cur -= events2[i] print(min(mx + 1, m))
events1 = [0]*(m + 1)
2
operation
n,m = map(int, input().split()) ch = str(input()) X = ["" for _ in range(m)] Y = ["" for _ in range(m)] C = [0 for _ in range(n)] for k in range(m): s = str(input()) X[k] = s[0] Y[k] = s[2] for k in range(m): C = [0 for _ in range(n)] for j in range(n): if ch[j] == X[k] and C[j]==0: ch = ch[:j]+Y[k]+ch[j+1:] C[j] = 1 if ch[j] == Y[k] and C[j]==0: ch = ch[:j]+X[k]+ch[j+1:] C[j] = 1 print(ch)
n,m = map(int, input().split()) ch = str(input()) X = ["" for _ in range(m)] Y = ["" for _ in range(m)] C = [0 for _ in range(n)] for k in range(m): s = str(input()) X[k] = s[0] Y[k] = s[2] for k in range(m): C = [0 for _ in range(n)] for j in range(n): if ch[j] == X[k] and C[j]==0: ch = ch[:j]+Y[k]+ch[j*1:] C[j] = 1 if ch[j] == Y[k] and C[j]==0: ch = ch[:j]+X[k]+ch[j+1:] C[j] = 1 print(ch)
ch = ch[:j]+Y[k]+ch[j*1:]
14
operation
n,m = map(int, input().split()) ch = str(input()) X = ["" for _ in range(m)] Y = ["" for _ in range(m)] C = [0 for _ in range(n)] for k in range(m): s = str(input()) X[k] = s[0] Y[k] = s[2] for k in range(m): C = [0 for _ in range(n)] for j in range(n): if ch[j] == X[k] and C[j]==0: ch = ch[:j]+Y[k]+ch[j+1:] C[j] = 1 if ch[j] == Y[k] and C[j]==0: ch = ch[:j]+X[k]+ch[j+1:] C[j] = 1 print(ch)
n,m = map(int, input().split()) ch = str(input()) X = ["" for _ in range(m)] Y = ["" for _ in range(m)] C = [0 for _ in range(n)] for k in range(m): s = str(input()) X[k] = s[0] Y[k] = s[2] for k in range(m): C = [0 for _ in range(n)] for j in range(n): if ch[j] == X[k] and C[j]==0: ch = ch[:j]+Y[k]&ch[j+1:] C[j] = 1 if ch[j] == Y[k] and C[j]==0: ch = ch[:j]+X[k]+ch[j+1:] C[j] = 1 print(ch)
ch = ch[:j]+Y[k]&ch[j+1:]
14
operation
n,m = map(int, input().split()) ch = str(input()) X = ["" for _ in range(m)] Y = ["" for _ in range(m)] C = [0 for _ in range(n)] for k in range(m): s = str(input()) X[k] = s[0] Y[k] = s[2] for k in range(m): C = [0 for _ in range(n)] for j in range(n): if ch[j] == X[k] and C[j]==0: ch = ch[:j]+Y[k]+ch[j+1:] C[j] = 1 if ch[j] == Y[k] and C[j]==0: ch = ch[:j]+X[k]+ch[j+1:] C[j] = 1 print(ch)
n,m = map(int, input().split()) ch = str(input()) X = ["" for _ in range(m)] Y = ["" for _ in range(m)] C = [0 for _ in range(n)] for k in range(m): s = str(input()) X[k] = s[0] Y[k] = s[2] for k in range(m): C = [0 for _ in range(n)] for j in range(n): if ch[j] == X[k] and C[j]==0: ch = ch[:j]+Y[k]+ch[j+1:] C[j] = 1 if ch[j] == Y[k] and C[j]==0: ch = ch[:j]+X[k]+ch[j>>1:] C[j] = 1 print(ch)
ch = ch[:j]+X[k]+ch[j>>1:]
17
operation