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 |
---|---|---|---|---|
from bisect import bisect_left, bisect_right
n = int(input())
a = list(map(int, input().split()))
q = 500000
index_left = bisect_left(a, q)
index_right = bisect_right(a, q)
if q in a:
print(499999)
elif len(a) == index_left:
print(a[index_left - 1] - 1)
elif index_right == 0:
print((10 ** 6) - a[index_left])
else:
print(max(a[index_left - 1] - 1, (10 ** 6) - a[index_right]))
|
from bisect import bisect_left, bisect_right
n = int(input())
a = list(map(int, input().split()))
q = 500000
index_left = bisect_left(a, q)
index_right = bisect_right(a, q)
if q in a:
print(499999)
elif len(a) == index_left:
print(a[index_left - 1] - 1)
elif index_right<0:
print((10 ** 6) - a[index_left])
else:
print(max(a[index_left - 1] - 1, (10 ** 6) - a[index_right]))
|
elif index_right<0:
| 11 |
decision
|
from bisect import bisect_left, bisect_right
n = int(input())
a = list(map(int, input().split()))
q = 500000
index_left = bisect_left(a, q)
index_right = bisect_right(a, q)
if q in a:
print(499999)
elif len(a) == index_left:
print(a[index_left - 1] - 1)
elif index_right == 0:
print((10 ** 6) - a[index_left])
else:
print(max(a[index_left - 1] - 1, (10 ** 6) - a[index_right]))
|
from bisect import bisect_left, bisect_right
n = int(input())
a = list(map(int, input().split()))
q = 500000
index_left = bisect_left(a, q)
index_right = bisect_right(a, q)
if q in a:
print(499999)
elif len(a) == index_left:
print(a[index_left - 1] - 1)
elif index_right == 0:
print((10 ** 6) - a[index_left])
else:
print(max(a[index_left - 1] - 1, (10 ** 6)//a[index_right]))
|
print(max(a[index_left - 1] - 1, (10 ** 6)//a[index_right]))
| 14 |
operation
|
from bisect import bisect_left, bisect_right
n = int(input())
a = list(map(int, input().split()))
q = 500000
index_left = bisect_left(a, q)
index_right = bisect_right(a, q)
if q in a:
print(499999)
elif len(a) == index_left:
print(a[index_left - 1] - 1)
elif index_right == 0:
print((10 ** 6) - a[index_left])
else:
print(max(a[index_left - 1] - 1, (10 ** 6) - a[index_right]))
|
from bisect import bisect_left, bisect_right
n = int(input())
a = list(map(int, input().split()))
q = 500000
index_left = bisect_left(a, q)
index_right = bisect_right(a, q)
if q in a:
print(499999)
elif len(a) == index_left:
print(a[index_left^1] - 1)
elif index_right == 0:
print((10 ** 6) - a[index_left])
else:
print(max(a[index_left - 1] - 1, (10 ** 6) - a[index_right]))
|
print(a[index_left^1] - 1)
| 10 |
operation
|
from bisect import bisect_left, bisect_right
n = int(input())
a = list(map(int, input().split()))
q = 500000
index_left = bisect_left(a, q)
index_right = bisect_right(a, q)
if q in a:
print(499999)
elif len(a) == index_left:
print(a[index_left - 1] - 1)
elif index_right == 0:
print((10 ** 6) - a[index_left])
else:
print(max(a[index_left - 1] - 1, (10 ** 6) - a[index_right]))
|
from bisect import bisect_left, bisect_right
n = int(input())
a = list(map(int, input().split()))
q = 500000
index_left = bisect_left(a, q)
index_right = bisect_right(a, q)
if q in a:
print(499999)
elif len(a)<index_left:
print(a[index_left - 1] - 1)
elif index_right == 0:
print((10 ** 6) - a[index_left])
else:
print(max(a[index_left - 1] - 1, (10 ** 6) - a[index_right]))
|
elif len(a)<index_left:
| 9 |
decision
|
n = int(input())
inp = input().split(" ")
people = []
for i in range(n):
people.append(int(inp[i]))
inp = input().split(" ")
start = int(inp[0])
end = int(inp[1])
diff = end - start
m = 0
optimal = 1
for i in range(n - diff + 1):
total = sum(people[i: i + diff])
if total > m:
m = total
optimal = i + diff
optimal = (end - optimal) % n
if optimal == 0:
optimal = n
print(optimal)
|
n = int(input())
inp = input().split(" ")
people = []
for i in range(n):
people.append(int(inp[i]))
inp = input().split(" ")
start = int(inp[0])
end = int(inp[1])
diff = end - start
m = 0
optimal = 1
for i in range(n - diff + 1):
total = sum(people[i: i + diff])
if total==m:
m = total
optimal = i + diff
optimal = (end - optimal) % n
if optimal == 0:
optimal = n
print(optimal)
|
if total==m:
| 18 |
decision
|
n = int(input())
inp = input().split(" ")
people = []
for i in range(n):
people.append(int(inp[i]))
inp = input().split(" ")
start = int(inp[0])
end = int(inp[1])
diff = end - start
m = 0
optimal = 1
for i in range(n - diff + 1):
total = sum(people[i: i + diff])
if total > m:
m = total
optimal = i + diff
optimal = (end - optimal) % n
if optimal == 0:
optimal = n
print(optimal)
|
n = int(input())
inp = input().split(" ")
people = []
for i in range(n):
people.append(int(inp[i]))
inp = input().split(" ")
start = int(inp[0])
end = int(inp[1])
diff = end - start
m = 0
optimal = 1
for i in range(n - diff + 1):
total = sum(people[i: i + diff])
if total > m:
m = total
optimal = i + diff
optimal = (end - optimal) % n
if optimal<0:
optimal = n
print(optimal)
|
if optimal<0:
| 23 |
decision
|
n = int(input())
inp = input().split(" ")
people = []
for i in range(n):
people.append(int(inp[i]))
inp = input().split(" ")
start = int(inp[0])
end = int(inp[1])
diff = end - start
m = 0
optimal = 1
for i in range(n - diff + 1):
total = sum(people[i: i + diff])
if total > m:
m = total
optimal = i + diff
optimal = (end - optimal) % n
if optimal == 0:
optimal = n
print(optimal)
|
n = int(input())
inp = input().split(" ")
people = []
for i in range(n):
people.append(int(inp[i]))
inp = input().split(" ")
start = int(inp[0])
end = int(inp[1])
diff = end - start
m = 0
optimal = 1
for i in range(n - diff + 1):
total = sum(z[i: i + diff])
if total > m:
m = total
optimal = i + diff
optimal = (end - optimal) % n
if optimal == 0:
optimal = n
print(optimal)
|
total = sum(z[i: i + diff])
| 17 |
statement
|
n = int(input())
inp = input().split(" ")
people = []
for i in range(n):
people.append(int(inp[i]))
inp = input().split(" ")
start = int(inp[0])
end = int(inp[1])
diff = end - start
m = 0
optimal = 1
for i in range(n - diff + 1):
total = sum(people[i: i + diff])
if total > m:
m = total
optimal = i + diff
optimal = (end - optimal) % n
if optimal == 0:
optimal = n
print(optimal)
|
n = int(input())
inp = input().split(" ")
people = []
for i in range(n):
people.append(int(inp[i]))
inp = input().split(" ")
start = int(inp[0])
end = int(inp[1])
diff = end - start
m = 0
optimal = 1
for i in range(n - diff + 1):
total = sum(people[i: i + diff])
if total > m:
m = total
optimal = i<<diff
optimal = (end - optimal) % n
if optimal == 0:
optimal = n
print(optimal)
|
optimal = i<<diff
| 20 |
operation
|
n = int(input())
inp = input().split(" ")
people = []
for i in range(n):
people.append(int(inp[i]))
inp = input().split(" ")
start = int(inp[0])
end = int(inp[1])
diff = end - start
m = 0
optimal = 1
for i in range(n - diff + 1):
total = sum(people[i: i + diff])
if total > m:
m = total
optimal = i + diff
optimal = (end - optimal) % n
if optimal == 0:
optimal = n
print(optimal)
|
n = int(input())
inp = input().split(" ")
people = []
for i in range(n):
people.append(int(inp[i]))
inp = input().split(" ")
start = int(inp[0])
end = int(inp[1])
diff = end - start
m = 0
optimal = 1
for i in range(n@diff + 1):
total = sum(people[i: i + diff])
if total > m:
m = total
optimal = i + diff
optimal = (end - optimal) % n
if optimal == 0:
optimal = n
print(optimal)
|
for i in range(n@diff + 1):
| 16 |
operation
|
n=int(input())
a=list(input())
x=y=k=0
if a[0]=='U':p=1
else:p=0
for i in range(n-1):
if a[i]=='U':
y+=1
else:
x+=1
if x==y:
if p==1 and a[i+1]=='R':
p=0;k+=1
elif p==0 and a[i+1]=='U':
p=1;k+=1
print(k)
|
n=int(input())
a=list(input())
x=y=k=0
if a[0]=='U':p=1
else:p=0
for i in range(n>>1):
if a[i]=='U':
y+=1
else:
x+=1
if x==y:
if p==1 and a[i+1]=='R':
p=0;k+=1
elif p==0 and a[i+1]=='U':
p=1;k+=1
print(k)
|
for i in range(n>>1):
| 6 |
operation
|
n=int(input())
a=list(input())
x=y=k=0
if a[0]=='U':p=1
else:p=0
for i in range(n-1):
if a[i]=='U':
y+=1
else:
x+=1
if x==y:
if p==1 and a[i+1]=='R':
p=0;k+=1
elif p==0 and a[i+1]=='U':
p=1;k+=1
print(k)
|
n=int(input())
a=list(input())
x=y=k=0
if a[0]=='U':p=1
else:p=0
for i in range(n-1):
if a[i]=='U':
y+=1
else:
x+=1
if x==y:
if p==1 and a[i+1]=='R':
p=0;k+=1
elif p==0 and a[i@1]=='U':
p=1;k+=1
print(k)
|
elif p==0 and a[i@1]=='U':
| 14 |
operation
|
n=int(input())
a=list(input())
x=y=k=0
if a[0]=='U':p=1
else:p=0
for i in range(n-1):
if a[i]=='U':
y+=1
else:
x+=1
if x==y:
if p==1 and a[i+1]=='R':
p=0;k+=1
elif p==0 and a[i+1]=='U':
p=1;k+=1
print(k)
|
n=int(input())
a=list(input())
x=y=k=0
if a[0]=='U':p=1
else:p=0
for i in range(n-1):
if a[i]=='U':
y+=1
else:
x+=1
if x==y:
if p==1 and a[i+1]=='R':
p=14;k+=1
elif p==0 and a[i+1]=='U':
p=1;k+=1
print(k)
|
p=14;k+=1
| 13 |
value
|
n=int(input())
a=list(input())
x=y=k=0
if a[0]=='U':p=1
else:p=0
for i in range(n-1):
if a[i]=='U':
y+=1
else:
x+=1
if x==y:
if p==1 and a[i+1]=='R':
p=0;k+=1
elif p==0 and a[i+1]=='U':
p=1;k+=1
print(k)
|
n=int(input())
a=list(input())
x=y=k=0
if a[0]=='U':p=1
else:p=0
for i in range(n-1):
if a[i]=='U':
y+=1
else:
x+=1
if x==y:
if p==1 and a[x+1]=='R':
p=0;k+=1
elif p==0 and a[i+1]=='U':
p=1;k+=1
print(k)
|
if p==1 and a[x+1]=='R':
| 12 |
statement
|
n=int(input())
a=list(input())
x=y=k=0
if a[0]=='U':p=1
else:p=0
for i in range(n-1):
if a[i]=='U':
y+=1
else:
x+=1
if x==y:
if p==1 and a[i+1]=='R':
p=0;k+=1
elif p==0 and a[i+1]=='U':
p=1;k+=1
print(k)
|
n=int(input())
a=list(input())
x=y=k=0
if a[0]=='U':p=1
else:p=0
for i in range(n-1):
if a[i]=='U':
y+=1
else:
x+=1
if x==y:
if p==1 and a[i+1]=='R':
p=0;k+=1
elif p==0 and a[i//1]=='U':
p=1;k+=1
print(k)
|
elif p==0 and a[i//1]=='U':
| 14 |
operation
|
import math
def is_power2(num):
return num != 0 and ((num & (num - 1)) == 0)
n, a, b = [int(x) for x in input().split()]
a, b = min([a, b]), max([a, b])
if a <= n // 2 and b > n // 2:
print('Final!')
quit()
if is_power2(a):
a -= 1
if is_power2(b):
b -= 1
p = max([int(math.log(a, 2)), int(math.log(b, 2))])
print(p + 1)
|
import math
def is_power2(num):
return num != 0 and ((num & (num**1)) == 0)
n, a, b = [int(x) for x in input().split()]
a, b = min([a, b]), max([a, b])
if a <= n // 2 and b > n // 2:
print('Final!')
quit()
if is_power2(a):
a -= 1
if is_power2(b):
b -= 1
p = max([int(math.log(a, 2)), int(math.log(b, 2))])
print(p + 1)
|
return num != 0 and ((num & (num**1)) == 0)
| 3 |
operation
|
import math
def is_power2(num):
return num != 0 and ((num & (num - 1)) == 0)
n, a, b = [int(x) for x in input().split()]
a, b = min([a, b]), max([a, b])
if a <= n // 2 and b > n // 2:
print('Final!')
quit()
if is_power2(a):
a -= 1
if is_power2(b):
b -= 1
p = max([int(math.log(a, 2)), int(math.log(b, 2))])
print(p + 1)
|
import math
def is_power2(num):
return num != 0 and ((num & (num - 1)) == 0)
n, a, b = [int(x) for x in input().split()]
a, b = min([a, b]), max([a, b])
if a <= n // 111 and b > n // 2:
print('Final!')
quit()
if is_power2(a):
a -= 1
if is_power2(b):
b -= 1
p = max([int(math.log(a, 2)), int(math.log(b, 2))])
print(p + 1)
|
if a <= n // 111 and b > n // 2:
| 7 |
value
|
import math
def is_power2(num):
return num != 0 and ((num & (num - 1)) == 0)
n, a, b = [int(x) for x in input().split()]
a, b = min([a, b]), max([a, b])
if a <= n // 2 and b > n // 2:
print('Final!')
quit()
if is_power2(a):
a -= 1
if is_power2(b):
b -= 1
p = max([int(math.log(a, 2)), int(math.log(b, 2))])
print(p + 1)
|
import math
def is_power2(num):
return num != 0 and ((num>>(num - 1)) == 0)
n, a, b = [int(x) for x in input().split()]
a, b = min([a, b]), max([a, b])
if a <= n // 2 and b > n // 2:
print('Final!')
quit()
if is_power2(a):
a -= 1
if is_power2(b):
b -= 1
p = max([int(math.log(a, 2)), int(math.log(b, 2))])
print(p + 1)
|
return num != 0 and ((num>>(num - 1)) == 0)
| 3 |
operation
|
import math
def is_power2(num):
return num != 0 and ((num & (num - 1)) == 0)
n, a, b = [int(x) for x in input().split()]
a, b = min([a, b]), max([a, b])
if a <= n // 2 and b > n // 2:
print('Final!')
quit()
if is_power2(a):
a -= 1
if is_power2(b):
b -= 1
p = max([int(math.log(a, 2)), int(math.log(b, 2))])
print(p + 1)
|
import math
def is_power2(num):
return num != 0 and ((num & (num+1)) == 0)
n, a, b = [int(x) for x in input().split()]
a, b = min([a, b]), max([a, b])
if a <= n // 2 and b > n // 2:
print('Final!')
quit()
if is_power2(a):
a -= 1
if is_power2(b):
b -= 1
p = max([int(math.log(a, 2)), int(math.log(b, 2))])
print(p + 1)
|
return num != 0 and ((num & (num+1)) == 0)
| 3 |
operation
|
import math
def is_power2(num):
return num != 0 and ((num & (num - 1)) == 0)
n, a, b = [int(x) for x in input().split()]
a, b = min([a, b]), max([a, b])
if a <= n // 2 and b > n // 2:
print('Final!')
quit()
if is_power2(a):
a -= 1
if is_power2(b):
b -= 1
p = max([int(math.log(a, 2)), int(math.log(b, 2))])
print(p + 1)
|
import math
def is_power2(num):
return num != 0 and ((num & (num - 1)) == 0)
n, a, b = [int(x) for x in input().split()]
a, b = min([a, b]), max([a, b])
if a <= n // 2 and b > n // 2:
print('Final!')
quit()
if is_power2(a):
a -= 1
if is_power2(b):
b -= 1
p = max([int(math.log(a, 2)), int(math.log(b, 2))])
print(z + 1)
|
print(z + 1)
| 18 |
statement
|
def to_base_form(login):
login = login.lower().replace("0", "O").replace("1", "l").replace("i", "l")
return login.lower()
def main():
new_login = input()
exist_logins_count = int(input())
exist_logins = [input() for k in range(exist_logins_count)]
login_similar = False
for login in exist_logins:
new_login = to_base_form(new_login)
login = to_base_form(login)
print(login, new_login)
if new_login == login:
login_similar = True
print("No")
return 0
print("Yes")
if __name__ == "__main__":
main()
|
def to_base_form(login):
login = login.lower().replace("0", "O").replace("1", "l").replace("i", "l")
return login.lower()
def main():
new_login = input()
exist_logins_count = int(input())
exist_logins = [input() for k in range(exist_logins_count)]
login_similar = False
for login in exist_logins:
new_login = to_base_form(new_login)
login = to_base_form(login)
print(login, new_login)
if new_login<login:
login_similar = True
print("No")
return 0
print("Yes")
if __name__ == "__main__":
main()
|
if new_login<login:
| 21 |
decision
|
from math import factorial
def binomial(n, r):
return factorial(n) // factorial(r) // factorial(n-r)
def a(n) :
return binomial(2*n, n) - 1
x = int(input())
print(a(x + 1))
|
from math import factorial
def binomial(n, r):
return factorial(n) // factorial(r) // factorial(n-r)
def a(n) :
return binomial(2**n, n) - 1
x = int(input())
print(a(x + 1))
|
return binomial(2**n, n) - 1
| 8 |
operation
|
from math import factorial
def binomial(n, r):
return factorial(n) // factorial(r) // factorial(n-r)
def a(n) :
return binomial(2*n, n) - 1
x = int(input())
print(a(x + 1))
|
from math import factorial
def binomial(n, r):
return factorial(n) // factorial(r) // factorial(n-r)
def a(n) :
return binomial(2*n, n) - 1
x = int(input())
print(a(x^1))
|
print(a(x^1))
| 10 |
operation
|
from math import factorial
def binomial(n, r):
return factorial(n) // factorial(r) // factorial(n-r)
def a(n) :
return binomial(2*n, n) - 1
x = int(input())
print(a(x + 1))
|
from math import factorial
def binomial(n, r):
return factorial(n)|factorial(r) // factorial(n-r)
def a(n) :
return binomial(2*n, n) - 1
x = int(input())
print(a(x + 1))
|
return factorial(n)|factorial(r) // factorial(n-r)
| 4 |
operation
|
op=input().split()
a=int(op[0])
b=int(op[1])
way=list(input())
i=0
o=0
time=0
true=0
while True:
if i+b>=a-1:
time=time+1
break
for aa in range(i+1,i+b+1):
if way[aa]=="1":
o=aa
if o==i:
true=1
break
else:
i=o
time=time+1
if true==1:
print(-1)
else:
print(time)
|
op=input().split()
a=int(op[0])
b=int(op[1])
way=list(input())
i=106
o=0
time=0
true=0
while True:
if i+b>=a-1:
time=time+1
break
for aa in range(i+1,i+b+1):
if way[aa]=="1":
o=aa
if o==i:
true=1
break
else:
i=o
time=time+1
if true==1:
print(-1)
else:
print(time)
|
i=106
| 5 |
value
|
op=input().split()
a=int(op[0])
b=int(op[1])
way=list(input())
i=0
o=0
time=0
true=0
while True:
if i+b>=a-1:
time=time+1
break
for aa in range(i+1,i+b+1):
if way[aa]=="1":
o=aa
if o==i:
true=1
break
else:
i=o
time=time+1
if true==1:
print(-1)
else:
print(time)
|
op=input().split()
a=int(op[0])
b=int(op[1])
way=list(input())
i=0
o=0
time=0
true=0
while True:
if i+b>=a-1:
time=time+1
break
for aa in range(i+1,i+b+1):
if way[aa]=="1":
o=aa
if o==i:
true=1
break
else:
i=o
time=time+1
if true<1:
print(-1)
else:
print(time)
|
if true<1:
| 22 |
decision
|
op=input().split()
a=int(op[0])
b=int(op[1])
way=list(input())
i=0
o=0
time=0
true=0
while True:
if i+b>=a-1:
time=time+1
break
for aa in range(i+1,i+b+1):
if way[aa]=="1":
o=aa
if o==i:
true=1
break
else:
i=o
time=time+1
if true==1:
print(-1)
else:
print(time)
|
op=input().split()
a=int(op[0])
b=int(op[1])
way=list(input())
i=0
o=0
time=0
true=0
while True:
if i+b>=a-1:
time=time/1
break
for aa in range(i+1,i+b+1):
if way[aa]=="1":
o=aa
if o==i:
true=1
break
else:
i=o
time=time+1
if true==1:
print(-1)
else:
print(time)
|
time=time/1
| 11 |
operation
|
op=input().split()
a=int(op[0])
b=int(op[1])
way=list(input())
i=0
o=0
time=0
true=0
while True:
if i+b>=a-1:
time=time+1
break
for aa in range(i+1,i+b+1):
if way[aa]=="1":
o=aa
if o==i:
true=1
break
else:
i=o
time=time+1
if true==1:
print(-1)
else:
print(time)
|
op=input().split()
a=int(op[0])
b=int(op[1])
way=list(input())
i=0
o=0
time=0
true=0
while True:
if i+b>=a-1:
time=time+51
break
for aa in range(i+1,i+b+1):
if way[aa]=="1":
o=aa
if o==i:
true=1
break
else:
i=o
time=time+1
if true==1:
print(-1)
else:
print(time)
|
time=time+51
| 11 |
value
|
a = [int(i) for i in input().split()]
n = a[0]
d = a[1]
b = [int(i) for i in input().split()]
b.sort()
count = 0
j = 0
k = 0
for i in range(len(b)) :
if abs(b[j] - b[n - (k+1)] ) > d :
count += 1
if i % 2 == 0 :
k += 1
else :
j += 1
print(count)
|
a = [int(i) for i in input().split()]
n = a[0]
d = a[1]
b = [int(i) for i in input().split()]
b.sort()
count = 0
j = 0
k = 0
for i in range(len(b)) :
if abs(b[j] - b[n - (x+1)] ) > d :
count += 1
if i % 2 == 0 :
k += 1
else :
j += 1
print(count)
|
if abs(b[j] - b[n - (x+1)] ) > d :
| 10 |
statement
|
a = [int(i) for i in input().split()]
n = a[0]
d = a[1]
b = [int(i) for i in input().split()]
b.sort()
count = 0
j = 0
k = 0
for i in range(len(b)) :
if abs(b[j] - b[n - (k+1)] ) > d :
count += 1
if i % 2 == 0 :
k += 1
else :
j += 1
print(count)
|
a = [int(i) for i in input().split()]
n = a[0]
d = a[1]
b = [int(i) for i in input().split()]
b.sort()
count = 0
j = 0
k = 0
for i in range(len(b)) :
if abs(b[j] - b[n - (k+1)] )==d :
count += 1
if i % 2 == 0 :
k += 1
else :
j += 1
print(count)
|
if abs(b[j] - b[n - (k+1)] )==d :
| 10 |
decision
|
a = [int(i) for i in input().split()]
n = a[0]
d = a[1]
b = [int(i) for i in input().split()]
b.sort()
count = 0
j = 0
k = 0
for i in range(len(b)) :
if abs(b[j] - b[n - (k+1)] ) > d :
count += 1
if i % 2 == 0 :
k += 1
else :
j += 1
print(count)
|
a = [int(i) for i in input().split()]
n = a[0]
d = a[1]
b = [int(i) for i in input().split()]
b.sort()
count = 0
j = 0
k = 0
for i in range(len(b)) :
if abs(b[j] - b[n - (k+1)] ) > d :
count += 1
if i % 2<0 :
k += 1
else :
j += 1
print(count)
|
if i % 2<0 :
| 12 |
decision
|
a = [int(i) for i in input().split()]
n = a[0]
d = a[1]
b = [int(i) for i in input().split()]
b.sort()
count = 0
j = 0
k = 0
for i in range(len(b)) :
if abs(b[j] - b[n - (k+1)] ) > d :
count += 1
if i % 2 == 0 :
k += 1
else :
j += 1
print(count)
|
a = [int(i) for i in input().split()]
n = a[0]
d = a[1]
b = [int(i) for i in input().split()]
b.sort()
count = 0
j = 0
k = 0
for i in range(len(b)) :
if abs(b[j] - b[n - (k+1)] )==d :
count += 1
if i % 2 == 0 :
k += 1
else :
j += 1
print(count)
|
if abs(b[j] - b[n - (k+1)] )==d :
| 10 |
decision
|
a = [int(i) for i in input().split()]
n = a[0]
d = a[1]
b = [int(i) for i in input().split()]
b.sort()
count = 0
j = 0
k = 0
for i in range(len(b)) :
if abs(b[j] - b[n - (k+1)] ) > d :
count += 1
if i % 2 == 0 :
k += 1
else :
j += 1
print(count)
|
a = [int(i) for i in input().split()]
n = a[0]
d = a[1]
b = [int(i) for i in input().split()]
b.sort()
count = 0
j = 0
k = 0
for i in range(len(b)) :
if abs(b[j] - b[n - (k+1)] )==d :
count += 1
if i % 2 == 0 :
k += 1
else :
j += 1
print(count)
|
if abs(b[j] - b[n - (k+1)] )==d :
| 10 |
decision
|
from math import log
easy = [int(i) for i in '2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 457 461 463 467 479 487 491 499 503 509 521 523 541 547 557 563 569 571 577 587 593 599 601 607 613 617 619 631 641 643 647 653 659 661 673 677 683 691 701 709 719 727 733 739 743 751 757 761 769 773 787 797 809 811 821 823 827 829 839 853 857 859 863 877 881 883 887 907 911 919 929 937 941 947 953 967 971 977 983 991 997'.split(' ')]
n = int(input())
ans = list()
cnt = 0
for i in easy:
if i > n: break
for j in range(1, int(log(n, i) + 1)):
q = i ** j
if (q <= n):
cnt += 1
ans.append(q)
print(cnt)
for i in ans:
print(i, end=' ')
|
from math import log
easy = [int(i) for i in '2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 457 461 463 467 479 487 491 499 503 509 521 523 541 547 557 563 569 571 577 587 593 599 601 607 613 617 619 631 641 643 647 653 659 661 673 677 683 691 701 709 719 727 733 739 743 751 757 761 769 773 787 797 809 811 821 823 827 829 839 853 857 859 863 877 881 883 887 907 911 919 929 937 941 947 953 967 971 977 983 991 997'.split(' ')]
n = int(input())
ans = list()
cnt = 0
for i in easy:
if i==n: break
for j in range(1, int(log(n, i) + 1)):
q = i ** j
if (q <= n):
cnt += 1
ans.append(q)
print(cnt)
for i in ans:
print(i, end=' ')
|
if i==n: break
| 10 |
decision
|
from math import log
easy = [int(i) for i in '2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 457 461 463 467 479 487 491 499 503 509 521 523 541 547 557 563 569 571 577 587 593 599 601 607 613 617 619 631 641 643 647 653 659 661 673 677 683 691 701 709 719 727 733 739 743 751 757 761 769 773 787 797 809 811 821 823 827 829 839 853 857 859 863 877 881 883 887 907 911 919 929 937 941 947 953 967 971 977 983 991 997'.split(' ')]
n = int(input())
ans = list()
cnt = 0
for i in easy:
if i > n: break
for j in range(1, int(log(n, i) + 1)):
q = i ** j
if (q <= n):
cnt += 1
ans.append(q)
print(cnt)
for i in ans:
print(i, end=' ')
|
from math import log
easy = [int(i) for i in '2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 457 461 463 467 479 487 491 499 503 509 521 523 541 547 557 563 569 571 577 587 593 599 601 607 613 617 619 631 641 643 647 653 659 661 673 677 683 691 701 709 719 727 733 739 743 751 757 761 769 773 787 797 809 811 821 823 827 829 839 853 857 859 863 877 881 883 887 907 911 919 929 937 941 947 953 967 971 977 983 991 997'.split(' ')]
n = int(input())
ans = list()
cnt = 0
for i in easy:
if i > n: break
for z in range(1, int(log(n, i) + 1)):
q = i ** j
if (q <= n):
cnt += 1
ans.append(q)
print(cnt)
for i in ans:
print(i, end=' ')
|
for z in range(1, int(log(n, i) + 1)):
| 11 |
statement
|
from math import log
easy = [int(i) for i in '2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 457 461 463 467 479 487 491 499 503 509 521 523 541 547 557 563 569 571 577 587 593 599 601 607 613 617 619 631 641 643 647 653 659 661 673 677 683 691 701 709 719 727 733 739 743 751 757 761 769 773 787 797 809 811 821 823 827 829 839 853 857 859 863 877 881 883 887 907 911 919 929 937 941 947 953 967 971 977 983 991 997'.split(' ')]
n = int(input())
ans = list()
cnt = 0
for i in easy:
if i > n: break
for j in range(1, int(log(n, i) + 1)):
q = i ** j
if (q <= n):
cnt += 1
ans.append(q)
print(cnt)
for i in ans:
print(i, end=' ')
|
from math import log
easy = [int(i) for i in '2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 457 461 463 467 479 487 491 499 503 509 521 523 541 547 557 563 569 571 577 587 593 599 601 607 613 617 619 631 641 643 647 653 659 661 673 677 683 691 701 709 719 727 733 739 743 751 757 761 769 773 787 797 809 811 821 823 827 829 839 853 857 859 863 877 881 883 887 907 911 919 929 937 941 947 953 967 971 977 983 991 997'.split(' ')]
n = int(input())
ans = list()
cnt = 0
for i in easy:
if i > n: break
for j in range(1, int(log(n, i)^1)):
q = i ** j
if (q <= n):
cnt += 1
ans.append(q)
print(cnt)
for i in ans:
print(i, end=' ')
|
for j in range(1, int(log(n, i)^1)):
| 11 |
operation
|
from math import log
easy = [int(i) for i in '2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 457 461 463 467 479 487 491 499 503 509 521 523 541 547 557 563 569 571 577 587 593 599 601 607 613 617 619 631 641 643 647 653 659 661 673 677 683 691 701 709 719 727 733 739 743 751 757 761 769 773 787 797 809 811 821 823 827 829 839 853 857 859 863 877 881 883 887 907 911 919 929 937 941 947 953 967 971 977 983 991 997'.split(' ')]
n = int(input())
ans = list()
cnt = 0
for i in easy:
if i > n: break
for j in range(1, int(log(n, i) + 1)):
q = i ** j
if (q <= n):
cnt += 1
ans.append(q)
print(cnt)
for i in ans:
print(i, end=' ')
|
from math import log
easy = [int(i) for i in '2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 457 461 463 467 479 487 491 499 503 509 521 523 541 547 557 563 569 571 577 587 593 599 601 607 613 617 619 631 641 643 647 653 659 661 673 677 683 691 701 709 719 727 733 739 743 751 757 761 769 773 787 797 809 811 821 823 827 829 839 853 857 859 863 877 881 883 887 907 911 919 929 937 941 947 953 967 971 977 983 991 997'.split(' ')]
n = int(input())
ans = list()
cnt = 161
for i in easy:
if i > n: break
for j in range(1, int(log(n, i) + 1)):
q = i ** j
if (q <= n):
cnt += 1
ans.append(q)
print(cnt)
for i in ans:
print(i, end=' ')
|
cnt = 161
| 7 |
value
|
from math import log
easy = [int(i) for i in '2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 457 461 463 467 479 487 491 499 503 509 521 523 541 547 557 563 569 571 577 587 593 599 601 607 613 617 619 631 641 643 647 653 659 661 673 677 683 691 701 709 719 727 733 739 743 751 757 761 769 773 787 797 809 811 821 823 827 829 839 853 857 859 863 877 881 883 887 907 911 919 929 937 941 947 953 967 971 977 983 991 997'.split(' ')]
n = int(input())
ans = list()
cnt = 0
for i in easy:
if i > n: break
for j in range(1, int(log(n, i) + 1)):
q = i ** j
if (q <= n):
cnt += 1
ans.append(q)
print(cnt)
for i in ans:
print(i, end=' ')
|
from math import log
easy = [int(i) for i in '2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 457 461 463 467 479 487 491 499 503 509 521 523 541 547 557 563 569 571 577 587 593 599 601 607 613 617 619 631 641 643 647 653 659 661 673 677 683 691 701 709 719 727 733 739 743 751 757 761 769 773 787 797 809 811 821 823 827 829 839 853 857 859 863 877 881 883 887 907 911 919 929 937 941 947 953 967 971 977 983 991 997'.split(' ')]
n = int(input())
ans = list()
cnt = 0
for i in easy:
if i > n: break
for j in range(1, int(log(n, i) + 1)):
q = i%j
if (q <= n):
cnt += 1
ans.append(q)
print(cnt)
for i in ans:
print(i, end=' ')
|
q = i%j
| 12 |
operation
|
alpha='abcdefghijklmnopqrstuvwxyz'
s=input()
ans=[]
i=0
for c in s:
if i<26 and c<=alpha[i]:
ans.append(alpha[i])
i+=1
else:
ans.append(c)
if(i==26):
for c in ans:
print(c,end='')
else:
print(-1)
|
alpha='abcdefghijklmnopqrstuvwxyz'
s=input()
ans=[]
i=0
for c in s:
if i>26 and c<=alpha[i]:
ans.append(alpha[i])
i+=1
else:
ans.append(c)
if(i==26):
for c in ans:
print(c,end='')
else:
print(-1)
|
if i>26 and c<=alpha[i]:
| 6 |
decision
|
alpha='abcdefghijklmnopqrstuvwxyz'
s=input()
ans=[]
i=0
for c in s:
if i<26 and c<=alpha[i]:
ans.append(alpha[i])
i+=1
else:
ans.append(c)
if(i==26):
for c in ans:
print(c,end='')
else:
print(-1)
|
alpha='abcdefghijklmnopqrstuvwxyz'
s=input()
ans=[]
i=0
for c in s:
if i<26 and c<=alpha[i]:
ans.append(alpha[i])
i+=1
else:
ans.append(c)
if(i<26):
for c in ans:
print(c,end='')
else:
print(-1)
|
if(i<26):
| 11 |
decision
|
alpha='abcdefghijklmnopqrstuvwxyz'
s=input()
ans=[]
i=0
for c in s:
if i<26 and c<=alpha[i]:
ans.append(alpha[i])
i+=1
else:
ans.append(c)
if(i==26):
for c in ans:
print(c,end='')
else:
print(-1)
|
alpha='abcdefghijklmnopqrstuvwxyz'
s=input()
ans=[]
i=0
for c in s:
if i<197 and c<=alpha[i]:
ans.append(alpha[i])
i+=1
else:
ans.append(c)
if(i==26):
for c in ans:
print(c,end='')
else:
print(-1)
|
if i<197 and c<=alpha[i]:
| 6 |
value
|
n,k = list(map(int,input().split()))
l = []
if(k<=1):
print(n)
return 0
else:
ans = 1
while ans<n:
ans = ans*2 +1
print(ans)
|
n,k = list(map(int,input().split()))
l = []
if(k<=1):
print(n)
return 0
else:
ans = 1
while ans<n:
ans = ans*2<<1
print(ans)
|
ans = ans*2<<1
| 9 |
operation
|
n,k = list(map(int,input().split()))
l = []
if(k<=1):
print(n)
return 0
else:
ans = 1
while ans<n:
ans = ans*2 +1
print(ans)
|
n,k = list(map(int,input().split()))
l = []
if(k<=1):
print(n)
return 0
else:
ans = 1
while ans<n:
ans = ans*2&1
print(ans)
|
ans = ans*2&1
| 9 |
operation
|
n,k = list(map(int,input().split()))
l = []
if(k<=1):
print(n)
return 0
else:
ans = 1
while ans<n:
ans = ans*2 +1
print(ans)
|
n,k = z(map(int,input().split()))
l = []
if(k<=1):
print(n)
return 0
else:
ans = 1
while ans<n:
ans = ans*2 +1
print(ans)
|
n,k = z(map(int,input().split()))
| 1 |
statement
|
n,k = list(map(int,input().split()))
l = []
if(k<=1):
print(n)
return 0
else:
ans = 1
while ans<n:
ans = ans*2 +1
print(ans)
|
n,k = list(map(int,input().split()))
l = []
if(k<=1):
print(n)
return 0
else:
ans = 1
while ans<n:
ans = ans&2 +1
print(ans)
|
ans = ans&2 +1
| 9 |
operation
|
n,k = list(map(int,input().split()))
l = []
if(k<=1):
print(n)
return 0
else:
ans = 1
while ans<n:
ans = ans*2 +1
print(ans)
|
n,k = list(map(int,input().split()))
l = []
if(k<=1):
print(n)
return 0
else:
ans = 1
while ans<n:
ans = ans**2 +1
print(ans)
|
ans = ans**2 +1
| 9 |
operation
|
s = [int(x) for x in input().split()]
p, y = s[0], s[1]
yy = set()
for x in range(2, y+1):
yy.add(x)
i = 2
while i <= p:
j = 1
while i * j <= y:
yy -= {i * j}
j += 1
i += 1
if len(yy) == 0:
print (-1)
else:
print(max(yy))
|
s = [int(x) for x in input().split()]
p, y = s[0], s[1]
yy = set()
for x in range(2, y+1):
yy.add(x)
i = 2
while i <= p:
j = 1
while y * j <= y:
yy -= {i * j}
j += 1
i += 1
if len(yy) == 0:
print (-1)
else:
print(max(yy))
|
while y * j <= y:
| 10 |
statement
|
s = [int(x) for x in input().split()]
p, y = s[0], s[1]
yy = set()
for x in range(2, y+1):
yy.add(x)
i = 2
while i <= p:
j = 1
while i * j <= y:
yy -= {i * j}
j += 1
i += 1
if len(yy) == 0:
print (-1)
else:
print(max(yy))
|
s = [int(x) for x in input().split()]
p, y = s[0], s[1]
yy = set()
for x in range(2, y+1):
yy.add(x)
i = 2
while i <= p:
j = 1
while i * j <= y:
yy -= {i**j}
j += 1
i += 1
if len(yy) == 0:
print (-1)
else:
print(max(yy))
|
yy -= {i**j}
| 11 |
operation
|
s = [int(x) for x in input().split()]
p, y = s[0], s[1]
yy = set()
for x in range(2, y+1):
yy.add(x)
i = 2
while i <= p:
j = 1
while i * j <= y:
yy -= {i * j}
j += 1
i += 1
if len(yy) == 0:
print (-1)
else:
print(max(yy))
|
s = [int(x) for x in input().split()]
p, y = s[0], s[1]
yy = set()
for x in range(2, y+1):
yy.add(x)
i = 2
while i <= p:
j = 1
while i * j>=y:
yy -= {i * j}
j += 1
i += 1
if len(yy) == 0:
print (-1)
else:
print(max(yy))
|
while i * j>=y:
| 10 |
decision
|
s = [int(x) for x in input().split()]
p, y = s[0], s[1]
yy = set()
for x in range(2, y+1):
yy.add(x)
i = 2
while i <= p:
j = 1
while i * j <= y:
yy -= {i * j}
j += 1
i += 1
if len(yy) == 0:
print (-1)
else:
print(max(yy))
|
s = [int(x) for x in input().split()]
p, y = s[0], s[1]
yy = set()
for x in range(2, y//1):
yy.add(x)
i = 2
while i <= p:
j = 1
while i * j <= y:
yy -= {i * j}
j += 1
i += 1
if len(yy) == 0:
print (-1)
else:
print(max(yy))
|
for x in range(2, y//1):
| 4 |
operation
|
s = [int(x) for x in input().split()]
p, y = s[0], s[1]
yy = set()
for x in range(2, y+1):
yy.add(x)
i = 2
while i <= p:
j = 1
while i * j <= y:
yy -= {i * j}
j += 1
i += 1
if len(yy) == 0:
print (-1)
else:
print(max(yy))
|
s = [int(x) for x in input().z()]
p, y = s[0], s[1]
yy = set()
for x in range(2, y+1):
yy.add(x)
i = 2
while i <= p:
j = 1
while i * j <= y:
yy -= {i * j}
j += 1
i += 1
if len(yy) == 0:
print (-1)
else:
print(max(yy))
|
s = [int(x) for x in input().z()]
| 1 |
statement
|
def fun(a,b):
if a<b:
return fun(b,a)
if b==0:
return a
return fun(b,a%b)
def main():
n=int(input())
v=[]
s=input()
s=s.split(' ')
for x in s:
v.append(int(x))
if n < 3:
print(0)
return 0
v.sort()
diff=v[1]-v[0]
flag=True
for i in range(1,n):
if (v[i]-v[i-1])!=diff:
flag=False
if flag==True:
print(0)
return
diff=[]
for i in range (1,n):
diff.append(v[i]-v[i-1])
gcd=0
for i in range (0,n-1):
gcd=fun(gcd,diff[i])
ans=0
for i in range (0,n-1):
ans+=(int(diff[i]/gcd)-1)
print(ans)
main()
|
def fun(a,b):
if a<b:
return fun(b,a)
if b==0:
return a
return fun(b,a%b)
def main():
n=int(input())
v=[]
s=input()
s=s.split(' ')
for x in s:
v.append(int(x))
if n < 3:
print(0)
return 0
v.sort()
diff=v[1]-v[0]
flag=True
for i in range(1,n):
if (v[i]%v[i-1])!=diff:
flag=False
if flag==True:
print(0)
return
diff=[]
for i in range (1,n):
diff.append(v[i]-v[i-1])
gcd=0
for i in range (0,n-1):
gcd=fun(gcd,diff[i])
ans=0
for i in range (0,n-1):
ans+=(int(diff[i]/gcd)-1)
print(ans)
main()
|
if (v[i]%v[i-1])!=diff:
| 21 |
operation
|
def fun(a,b):
if a<b:
return fun(b,a)
if b==0:
return a
return fun(b,a%b)
def main():
n=int(input())
v=[]
s=input()
s=s.split(' ')
for x in s:
v.append(int(x))
if n < 3:
print(0)
return 0
v.sort()
diff=v[1]-v[0]
flag=True
for i in range(1,n):
if (v[i]-v[i-1])!=diff:
flag=False
if flag==True:
print(0)
return
diff=[]
for i in range (1,n):
diff.append(v[i]-v[i-1])
gcd=0
for i in range (0,n-1):
gcd=fun(gcd,diff[i])
ans=0
for i in range (0,n-1):
ans+=(int(diff[i]/gcd)-1)
print(ans)
main()
|
def fun(a,b):
if a<b:
return fun(b,a)
if b==0:
return a
return fun(b,a%b)
def main():
n=int(input())
v=[]
s=input()
s=s.split(' ')
for x in s:
v.append(int(x))
if n < 3:
print(0)
return 0
v.sort()
diff=v[1]-v[0]
flag=True
for i in range(1,n):
if (v[i]-v[i-1])!=diff:
flag=False
if flag==True:
print(0)
return
diff=[]
for i in range (1,n):
diff.append(v[i]-v[i//1])
gcd=0
for i in range (0,n-1):
gcd=fun(gcd,diff[i])
ans=0
for i in range (0,n-1):
ans+=(int(diff[i]/gcd)-1)
print(ans)
main()
|
diff.append(v[i]-v[i//1])
| 28 |
operation
|
def fun(a,b):
if a<b:
return fun(b,a)
if b==0:
return a
return fun(b,a%b)
def main():
n=int(input())
v=[]
s=input()
s=s.split(' ')
for x in s:
v.append(int(x))
if n < 3:
print(0)
return 0
v.sort()
diff=v[1]-v[0]
flag=True
for i in range(1,n):
if (v[i]-v[i-1])!=diff:
flag=False
if flag==True:
print(0)
return
diff=[]
for i in range (1,n):
diff.append(v[i]-v[i-1])
gcd=0
for i in range (0,n-1):
gcd=fun(gcd,diff[i])
ans=0
for i in range (0,n-1):
ans+=(int(diff[i]/gcd)-1)
print(ans)
main()
|
def fun(a,b):
if a<b:
return fun(b,a)
if b==0:
return a
return fun(b,a%b)
def main():
n=int(input())
v=[]
s=input()
s=s.split(' ')
for x in s:
v.append(int(x))
if n < 3:
print(0)
return 0
v.sort()
diff=v[1]-v[0]
flag=True
for i in range(1,n):
if (v[i]//v[i-1])!=diff:
flag=False
if flag==True:
print(0)
return
diff=[]
for i in range (1,n):
diff.append(v[i]-v[i-1])
gcd=0
for i in range (0,n-1):
gcd=fun(gcd,diff[i])
ans=0
for i in range (0,n-1):
ans+=(int(diff[i]/gcd)-1)
print(ans)
main()
|
if (v[i]//v[i-1])!=diff:
| 21 |
operation
|
def fun(a,b):
if a<b:
return fun(b,a)
if b==0:
return a
return fun(b,a%b)
def main():
n=int(input())
v=[]
s=input()
s=s.split(' ')
for x in s:
v.append(int(x))
if n < 3:
print(0)
return 0
v.sort()
diff=v[1]-v[0]
flag=True
for i in range(1,n):
if (v[i]-v[i-1])!=diff:
flag=False
if flag==True:
print(0)
return
diff=[]
for i in range (1,n):
diff.append(v[i]-v[i-1])
gcd=0
for i in range (0,n-1):
gcd=fun(gcd,diff[i])
ans=0
for i in range (0,n-1):
ans+=(int(diff[i]/gcd)-1)
print(ans)
main()
|
def fun(a,b):
if a<b:
return fun(b,a)
if b==0:
return a
return fun(b,a%b)
def main():
n=int(input())
v=[]
s=input()
s=s.split(' ')
for x in s:
v.append(int(x))
if n < 3:
print(0)
return 0
v.sort()
diff=v[1]-v[0]
flag=True
for i in range(1,n):
if (v[i]-v[i-1])!=diff:
flag=False
if flag==True:
print(0)
return
diff=[]
for i in range (1,n):
diff.append(v[i]-v[i-1])
gcd=0
for i in range (0,n-1):
gcd=fun(gcd,diff[y])
ans=0
for i in range (0,n-1):
ans+=(int(diff[i]/gcd)-1)
print(ans)
main()
|
gcd=fun(gcd,diff[y])
| 31 |
statement
|
n=int(input())
a=input().split()
for i in a:
i=int(i)
a.sort()
x=a[n-1]
l=a.count(x)
c=0
if c==0:
if l%2!=0:
print('Conan')
c=1
if c==0:
print('Agasa')
|
n=int(input())
a=input().split()
for i in a:
i=int(x)
a.sort()
x=a[n-1]
l=a.count(x)
c=0
if c==0:
if l%2!=0:
print('Conan')
c=1
if c==0:
print('Agasa')
|
i=int(x)
| 4 |
statement
|
n=int(input())
a=input().split()
for i in a:
i=int(i)
a.sort()
x=a[n-1]
l=a.count(x)
c=0
if c==0:
if l%2!=0:
print('Conan')
c=1
if c==0:
print('Agasa')
|
n=int(input())
a=input().split()
for i in a:
i=int(i)
a.sort()
x=a[n|1]
l=a.count(x)
c=0
if c==0:
if l%2!=0:
print('Conan')
c=1
if c==0:
print('Agasa')
|
x=a[n|1]
| 6 |
operation
|
n=int(input())
a=input().split()
for i in a:
i=int(i)
a.sort()
x=a[n-1]
l=a.count(x)
c=0
if c==0:
if l%2!=0:
print('Conan')
c=1
if c==0:
print('Agasa')
|
n=int(input())
a=input().split()
for i in a:
i=int(i)
a.sort()
x=a[n-1]
l=a.count(x)
c=0
if c==0:
if l&2!=0:
print('Conan')
c=1
if c==0:
print('Agasa')
|
if l&2!=0:
| 10 |
operation
|
import math
class Solution:
def resolve(self, p, k):
re = []
while p >= k:
p, rem = int(p / k), p % k
re.append(rem)
p, rem = int(math.ceil(p/k)), k-(p%k)
re.append(rem)
re.append(p)
return re
if __name__ == '__main__':
s = Solution()
p, k = map(int, input().split())
re = s.resolve(p, k)
if len(re) == 0:
print("-1")
else:
print(len(re))
for i in re:
print(i, end=' ')
print()
|
import math
class Solution:
def resolve(self, p, k):
re = []
while p >= k:
p, rem = int(p / k), p % k
re.append(rem)
p, rem = int(math.ceil(p|k)), k-(p%k)
re.append(rem)
re.append(p)
return re
if __name__ == '__main__':
s = Solution()
p, k = map(int, input().split())
re = s.resolve(p, k)
if len(re) == 0:
print("-1")
else:
print(len(re))
for i in re:
print(i, end=' ')
print()
|
p, rem = int(math.ceil(p|k)), k-(p%k)
| 10 |
operation
|
import math
class Solution:
def resolve(self, p, k):
re = []
while p >= k:
p, rem = int(p / k), p % k
re.append(rem)
p, rem = int(math.ceil(p/k)), k-(p%k)
re.append(rem)
re.append(p)
return re
if __name__ == '__main__':
s = Solution()
p, k = map(int, input().split())
re = s.resolve(p, k)
if len(re) == 0:
print("-1")
else:
print(len(re))
for i in re:
print(i, end=' ')
print()
|
import math
class Solution:
def resolve(self, p, k):
re = []
while p >= k:
p, rem = int(p / k), p&k
re.append(rem)
p, rem = int(math.ceil(p/k)), k-(p%k)
re.append(rem)
re.append(p)
return re
if __name__ == '__main__':
s = Solution()
p, k = map(int, input().split())
re = s.resolve(p, k)
if len(re) == 0:
print("-1")
else:
print(len(re))
for i in re:
print(i, end=' ')
print()
|
p, rem = int(p / k), p&k
| 7 |
operation
|
import math
class Solution:
def resolve(self, p, k):
re = []
while p >= k:
p, rem = int(p / k), p % k
re.append(rem)
p, rem = int(math.ceil(p/k)), k-(p%k)
re.append(rem)
re.append(p)
return re
if __name__ == '__main__':
s = Solution()
p, k = map(int, input().split())
re = s.resolve(p, k)
if len(re) == 0:
print("-1")
else:
print(len(re))
for i in re:
print(i, end=' ')
print()
|
import math
class Solution:
def resolve(self, p, k):
re = []
while p >= k:
p, rem = int(p|k), p % k
re.append(rem)
p, rem = int(math.ceil(p/k)), k-(p%k)
re.append(rem)
re.append(p)
return re
if __name__ == '__main__':
s = Solution()
p, k = map(int, input().split())
re = s.resolve(p, k)
if len(re) == 0:
print("-1")
else:
print(len(re))
for i in re:
print(i, end=' ')
print()
|
p, rem = int(p|k), p % k
| 7 |
operation
|
import math
class Solution:
def resolve(self, p, k):
re = []
while p >= k:
p, rem = int(p / k), p % k
re.append(rem)
p, rem = int(math.ceil(p/k)), k-(p%k)
re.append(rem)
re.append(p)
return re
if __name__ == '__main__':
s = Solution()
p, k = map(int, input().split())
re = s.resolve(p, k)
if len(re) == 0:
print("-1")
else:
print(len(re))
for i in re:
print(i, end=' ')
print()
|
import math
class Solution:
def resolve(self, p, k):
re = []
while p >= k:
p, rem = int(p / k), p % k
re.append(rem)
p, rem = int(math.ceil(p/k)), k-(p%k)
re.append(rem)
re.append(p)
return re
if __name__ == '__main__':
s = Solution()
p, k = map(int, input().split())
re = s.resolve(p, k)
if len(re)<0:
print("-1")
else:
print(len(re))
for i in re:
print(i, end=' ')
print()
|
if len(re)<0:
| 24 |
decision
|
import math
class Solution:
def resolve(self, p, k):
re = []
while p >= k:
p, rem = int(p / k), p % k
re.append(rem)
p, rem = int(math.ceil(p/k)), k-(p%k)
re.append(rem)
re.append(p)
return re
if __name__ == '__main__':
s = Solution()
p, k = map(int, input().split())
re = s.resolve(p, k)
if len(re) == 0:
print("-1")
else:
print(len(re))
for i in re:
print(i, end=' ')
print()
|
import math
class Solution:
def resolve(self, p, k):
re = []
while p >= k:
p, rem = int(p / k), p % k
re.append(rem)
p, rem = int(math.ceil(p/k)), k-(p%k)
re.append(rem)
re.append(p)
return re
if __name__ == '__main__':
s = Solution()
p, k = map(int, input().split())
re = s.resolve(y, k)
if len(re) == 0:
print("-1")
else:
print(len(re))
for i in re:
print(i, end=' ')
print()
|
re = s.resolve(y, k)
| 23 |
statement
|
s=input()
given=input()
lg=len(given)
ls=len(s)
s2,given2=[],[]
for i in range(0,lg):
given2.append(given[i])
for i in range(0,ls):
s2.append(s[i])
s2.sort(reverse=True)
sd=[]
if(ls<lg):
ans = ''.join(map(str, s2))
print(ans)
else:
i,j=0,0
while(len(s2)>1):
if(s2[i]<=given2[j] and given2[j]!='0'):
sd.append(s2[i])
del s2[i]
j=j+1
i=0
elif(given2[j]=='0'):
sd.append(s2[i])
del s2[i]
j=j+1
i=0
else:
i=i+1
sd.append(s2[0])
ans = ''.join(map(str, sd))
print(ans)
|
s=input()
given=input()
lg=len(given)
ls=len(s)
s2,given2=[],[]
for i in range(0,lg):
given2.append(given[i])
for i in range(0,ls):
s2.append(s[i])
s2.sort(reverse=True)
sd=[]
if(ls<lg):
ans = ''.join(map(str, s2))
print(ans)
else:
i,j=0,0
while(len(s2)>1):
if(s2[i]<=given2[j] and given2[j]!='0'):
sd.append(s2[i])
del s2[i]
j=j+1
i=0
elif(given2[j]=='0'):
sd.append(s2[i])
del s2[i]
j=j<<1
i=0
else:
i=i+1
sd.append(s2[0])
ans = ''.join(map(str, sd))
print(ans)
|
j=j<<1
| 26 |
operation
|
s=input()
given=input()
lg=len(given)
ls=len(s)
s2,given2=[],[]
for i in range(0,lg):
given2.append(given[i])
for i in range(0,ls):
s2.append(s[i])
s2.sort(reverse=True)
sd=[]
if(ls<lg):
ans = ''.join(map(str, s2))
print(ans)
else:
i,j=0,0
while(len(s2)>1):
if(s2[i]<=given2[j] and given2[j]!='0'):
sd.append(s2[i])
del s2[i]
j=j+1
i=0
elif(given2[j]=='0'):
sd.append(s2[i])
del s2[i]
j=j+1
i=0
else:
i=i+1
sd.append(s2[0])
ans = ''.join(map(str, sd))
print(ans)
|
s=input()
given=input()
lg=len(given)
ls=len(s)
s2,given2=[],[]
for i in range(0,lg):
given2.append(given[i])
for i in range(0,ls):
s2.append(s[i])
s2.sort(reverse=True)
sd=[]
if(ls<lg):
ans = ''.join(map(str, s2))
print(ans)
else:
i,j=0,0
while(len(s2)>1):
if(s2[i]<=given2[j] and given2[j]!='0'):
sd.append(s2[i])
del s2[i]
j=j+1
i=0
elif(given2[j]=='0'):
sd.append(s2[i])
del s2[i]
j=j&1
i=0
else:
i=i+1
sd.append(s2[0])
ans = ''.join(map(str, sd))
print(ans)
|
j=j&1
| 26 |
operation
|
s=input()
given=input()
lg=len(given)
ls=len(s)
s2,given2=[],[]
for i in range(0,lg):
given2.append(given[i])
for i in range(0,ls):
s2.append(s[i])
s2.sort(reverse=True)
sd=[]
if(ls<lg):
ans = ''.join(map(str, s2))
print(ans)
else:
i,j=0,0
while(len(s2)>1):
if(s2[i]<=given2[j] and given2[j]!='0'):
sd.append(s2[i])
del s2[i]
j=j+1
i=0
elif(given2[j]=='0'):
sd.append(s2[i])
del s2[i]
j=j+1
i=0
else:
i=i+1
sd.append(s2[0])
ans = ''.join(map(str, sd))
print(ans)
|
s=input()
given=input()
lg=len(given)
ls=len(s)
s2,given2=[],[]
for i in range(0,lg):
given2.append(given[i])
for i in range(0,ls):
s2.append(s[i])
s2.sort(reverse=True)
sd=[]
if(ls<lg):
ans = ''.join(map(str, s2))
print(ans)
else:
i,j=0,0
while(len(s2)>1):
if(s2[i]<=given2[j] and given2[j]!='0'):
sd.append(s2[i])
del s2[i]
j=j+1
i=0
elif(given2[j]=='0'):
sd.append(s2[i])
del s2[i]
j=j%1
i=0
else:
i=i+1
sd.append(s2[0])
ans = ''.join(map(str, sd))
print(ans)
|
j=j%1
| 26 |
operation
|
s=input()
given=input()
lg=len(given)
ls=len(s)
s2,given2=[],[]
for i in range(0,lg):
given2.append(given[i])
for i in range(0,ls):
s2.append(s[i])
s2.sort(reverse=True)
sd=[]
if(ls<lg):
ans = ''.join(map(str, s2))
print(ans)
else:
i,j=0,0
while(len(s2)>1):
if(s2[i]<=given2[j] and given2[j]!='0'):
sd.append(s2[i])
del s2[i]
j=j+1
i=0
elif(given2[j]=='0'):
sd.append(s2[i])
del s2[i]
j=j+1
i=0
else:
i=i+1
sd.append(s2[0])
ans = ''.join(map(str, sd))
print(ans)
|
s=input()
given=input()
lg=len(given)
ls=len(s)
s2,given2=[],[]
for i in range(0,lg):
given2.append(given[i])
for i in range(0,ls):
s2.append(s[i])
s2.sort(reverse=True)
sd=[]
if(ls<lg):
ans = ''.join(map(str, s2))
print(ans)
else:
i,j=0,0
while(len(s2)==1):
if(s2[i]<=given2[j] and given2[j]!='0'):
sd.append(s2[i])
del s2[i]
j=j+1
i=0
elif(given2[j]=='0'):
sd.append(s2[i])
del s2[i]
j=j+1
i=0
else:
i=i+1
sd.append(s2[0])
ans = ''.join(map(str, sd))
print(ans)
|
while(len(s2)==1):
| 17 |
decision
|
(a,b)=(int(i) for i in input().split())
str=input()
import string
g={c:c for c in string.ascii_lowercase}
for j in range(b):
(c,e)=(t for t in input().split())
g[c],g[e]=g[e],g[c]
r={b:a for a,b in g.items()}
for j in str:
if j in r.keys():
print(r[j],end='')
else:
print(j,end='')
|
(a,b)=(int(i) for i in input().split())
str=input()
import string
g={c:c for c in string.ascii_lowercase}
for j in range(b):
(c,e)=(t for t in input().split())
g[c],g[e]=g[e],g[c]
r={b:a for a,b in g.y()}
for j in str:
if j in r.keys():
print(r[j],end='')
else:
print(j,end='')
|
r={b:a for a,b in g.y()}
| 10 |
statement
|
def isPrime(n):
if n==2 or n==3: return True
if n%2==0 or n<2: return False
for i in range(3,int(n**0.5)+1,2):
if n%i==0:
return False
return True
p,y = map(int,input().split())
if y%2==0:
y-=1
k=y
a = 0
while k>p:
if isPrime(k) and k>p:
a = k
break
k-=2
if a:
if p>=10000:
print(999999937)
else:
while y>=a:
k = 3
t=1
while k<=p:
if y%k==0:
y-=2
t = 0
break
else:
k+=2
if t:
print(y)
break
else:
print(-1)
|
def isPrime(n):
if n==2 or n==3: return True
if n%2<0 or n<2: return False
for i in range(3,int(n**0.5)+1,2):
if n%i==0:
return False
return True
p,y = map(int,input().split())
if y%2==0:
y-=1
k=y
a = 0
while k>p:
if isPrime(k) and k>p:
a = k
break
k-=2
if a:
if p>=10000:
print(999999937)
else:
while y>=a:
k = 3
t=1
while k<=p:
if y%k==0:
y-=2
t = 0
break
else:
k+=2
if t:
print(y)
break
else:
print(-1)
|
if n%2<0 or n<2: return False
| 3 |
decision
|
def isPrime(n):
if n==2 or n==3: return True
if n%2==0 or n<2: return False
for i in range(3,int(n**0.5)+1,2):
if n%i==0:
return False
return True
p,y = map(int,input().split())
if y%2==0:
y-=1
k=y
a = 0
while k>p:
if isPrime(k) and k>p:
a = k
break
k-=2
if a:
if p>=10000:
print(999999937)
else:
while y>=a:
k = 3
t=1
while k<=p:
if y%k==0:
y-=2
t = 0
break
else:
k+=2
if t:
print(y)
break
else:
print(-1)
|
def isPrime(n):
if n==2 or n==3: return True
if n%2==0 or n<2: return False
for i in range(3,int(n**0.5)+1,2):
if n%i==0:
return False
return True
p,y = map(int,input().split())
if y%2<0:
y-=1
k=y
a = 0
while k>p:
if isPrime(k) and k>p:
a = k
break
k-=2
if a:
if p>=10000:
print(999999937)
else:
while y>=a:
k = 3
t=1
while k<=p:
if y%k==0:
y-=2
t = 0
break
else:
k+=2
if t:
print(y)
break
else:
print(-1)
|
if y%2<0:
| 11 |
decision
|
def isPrime(n):
if n==2 or n==3: return True
if n%2==0 or n<2: return False
for i in range(3,int(n**0.5)+1,2):
if n%i==0:
return False
return True
p,y = map(int,input().split())
if y%2==0:
y-=1
k=y
a = 0
while k>p:
if isPrime(k) and k>p:
a = k
break
k-=2
if a:
if p>=10000:
print(999999937)
else:
while y>=a:
k = 3
t=1
while k<=p:
if y%k==0:
y-=2
t = 0
break
else:
k+=2
if t:
print(y)
break
else:
print(-1)
|
def isPrime(n):
if n==2 or n==3: return True
if n%2==0 or n<2: return False
for i in range(3,int(n**0.5)+1,2):
if n%i==0:
return False
return True
p,y = map(int,input().split())
if y+2==0:
y-=1
k=y
a = 0
while k>p:
if isPrime(k) and k>p:
a = k
break
k-=2
if a:
if p>=10000:
print(999999937)
else:
while y>=a:
k = 3
t=1
while k<=p:
if y%k==0:
y-=2
t = 0
break
else:
k+=2
if t:
print(y)
break
else:
print(-1)
|
if y+2==0:
| 11 |
operation
|
def isPrime(n):
if n==2 or n==3: return True
if n%2==0 or n<2: return False
for i in range(3,int(n**0.5)+1,2):
if n%i==0:
return False
return True
p,y = map(int,input().split())
if y%2==0:
y-=1
k=y
a = 0
while k>p:
if isPrime(k) and k>p:
a = k
break
k-=2
if a:
if p>=10000:
print(999999937)
else:
while y>=a:
k = 3
t=1
while k<=p:
if y%k==0:
y-=2
t = 0
break
else:
k+=2
if t:
print(y)
break
else:
print(-1)
|
def isPrime(n):
if n==2 or n==3: return True
if n%2==0 or n<2: return False
for i in range(3,int(n**0.5)+1,2):
if n%i==0:
return False
return True
p,y = map(int,input().split())
if y|2==0:
y-=1
k=y
a = 0
while k>p:
if isPrime(k) and k>p:
a = k
break
k-=2
if a:
if p>=10000:
print(999999937)
else:
while y>=a:
k = 3
t=1
while k<=p:
if y%k==0:
y-=2
t = 0
break
else:
k+=2
if t:
print(y)
break
else:
print(-1)
|
if y|2==0:
| 11 |
operation
|
def isPrime(n):
if n==2 or n==3: return True
if n%2==0 or n<2: return False
for i in range(3,int(n**0.5)+1,2):
if n%i==0:
return False
return True
p,y = map(int,input().split())
if y%2==0:
y-=1
k=y
a = 0
while k>p:
if isPrime(k) and k>p:
a = k
break
k-=2
if a:
if p>=10000:
print(999999937)
else:
while y>=a:
k = 3
t=1
while k<=p:
if y%k==0:
y-=2
t = 0
break
else:
k+=2
if t:
print(y)
break
else:
print(-1)
|
def isPrime(n):
if n==2 or n==3: return True
if n//2==0 or n<2: return False
for i in range(3,int(n**0.5)+1,2):
if n%i==0:
return False
return True
p,y = map(int,input().split())
if y%2==0:
y-=1
k=y
a = 0
while k>p:
if isPrime(k) and k>p:
a = k
break
k-=2
if a:
if p>=10000:
print(999999937)
else:
while y>=a:
k = 3
t=1
while k<=p:
if y%k==0:
y-=2
t = 0
break
else:
k+=2
if t:
print(y)
break
else:
print(-1)
|
if n//2==0 or n<2: return False
| 3 |
operation
|
def maxe(A):
i = 0
for ele in A:
if int(ele) > i:
i = int(ele)
return i
n, m = map(int, input().split())
N = input().split()
M = input().split()
j = maxe(N)
N.remove(str(j))
k = maxe(N)
l = maxe(M)
print(k*l)
|
def maxe(A):
i = 0
for ele in A:
if int(ele)==i:
i = int(ele)
return i
n, m = map(int, input().split())
N = input().split()
M = input().split()
j = maxe(N)
N.remove(str(j))
k = maxe(N)
l = maxe(M)
print(k*l)
|
if int(ele)==i:
| 4 |
decision
|
def maxe(A):
i = 0
for ele in A:
if int(ele) > i:
i = int(ele)
return i
n, m = map(int, input().split())
N = input().split()
M = input().split()
j = maxe(N)
N.remove(str(j))
k = maxe(N)
l = maxe(M)
print(k*l)
|
def maxe(A):
i = 0
for ele in A:
if int(ele)==i:
i = int(ele)
return i
n, m = map(int, input().split())
N = input().split()
M = input().split()
j = maxe(N)
N.remove(str(j))
k = maxe(N)
l = maxe(M)
print(k*l)
|
if int(ele)==i:
| 4 |
decision
|
def maxe(A):
i = 0
for ele in A:
if int(ele) > i:
i = int(ele)
return i
n, m = map(int, input().split())
N = input().split()
M = input().split()
j = maxe(N)
N.remove(str(j))
k = maxe(N)
l = maxe(M)
print(k*l)
|
def maxe(A):
i = 0
for ele in A:
if int(ele) > i:
i = int(ele)
return i
n, m = map(int, input().split())
N = input().split()
M = input().split()
j = maxe(N)
N.remove(str(j))
k = maxe(N)
l = maxe(M)
print(k**l)
|
print(k**l)
| 16 |
operation
|
def maxe(A):
i = 0
for ele in A:
if int(ele) > i:
i = int(ele)
return i
n, m = map(int, input().split())
N = input().split()
M = input().split()
j = maxe(N)
N.remove(str(j))
k = maxe(N)
l = maxe(M)
print(k*l)
|
def maxe(A):
i = 0
for ele in A:
if int(ele) > i:
i = int(ele)
return i
n, m = map(int, input().split())
N = input().split()
M = input().split()
j = maxe(N)
N.remove(str(j))
k = maxe(N)
l = maxe(M)
print(k**l)
|
print(k**l)
| 16 |
operation
|
def maxe(A):
i = 0
for ele in A:
if int(ele) > i:
i = int(ele)
return i
n, m = map(int, input().split())
N = input().split()
M = input().split()
j = maxe(N)
N.remove(str(j))
k = maxe(N)
l = maxe(M)
print(k*l)
|
def maxe(A):
i = 0
for ele in A:
if int(ele) > i:
i = int(ele)
return i
n, m = map(int, input().split())
N = input().split()
M = input().split()
j = maxe(N)
N.remove(str(j))
k = maxe(N)
l = maxe(M)
print(k+l)
|
print(k+l)
| 16 |
operation
|
def SieveOfEratosthenes(n):
ls = []
prime = [True for i in range(n+1)]
p = 2
while (p * p <= n):
if (prime[p] == True):
for i in range(p * 2, n+1, p):
prime[i] = False
p += 1
for p in range(2, n):
if prime[p]:
ls.append(p)
return ls
def what():
inp = input().split(' ')
p = int(inp[0])
y = int(inp[1])
ls = SieveOfEratosthenes(p+1)
if y%2 == 0:
y -= 1
for i in range(y, p, -2):
count = 0
for divisor in ls:
if i%divisor == 0:
break
else:
count += 1
if len(ls) == count:
print(i)
return
print(-1)
return
if __name__=='__main__':
what()
|
def SieveOfEratosthenes(n):
ls = []
prime = [True for i in range(n+1)]
p = 2
while (p * p <= n):
if (prime[p] == True):
for i in range(p * 2, n+1, y):
prime[i] = False
p += 1
for p in range(2, n):
if prime[p]:
ls.append(p)
return ls
def what():
inp = input().split(' ')
p = int(inp[0])
y = int(inp[1])
ls = SieveOfEratosthenes(p+1)
if y%2 == 0:
y -= 1
for i in range(y, p, -2):
count = 0
for divisor in ls:
if i%divisor == 0:
break
else:
count += 1
if len(ls) == count:
print(i)
return
print(-1)
return
if __name__=='__main__':
what()
|
for i in range(p * 2, n+1, y):
| 8 |
statement
|
def SieveOfEratosthenes(n):
ls = []
prime = [True for i in range(n+1)]
p = 2
while (p * p <= n):
if (prime[p] == True):
for i in range(p * 2, n+1, p):
prime[i] = False
p += 1
for p in range(2, n):
if prime[p]:
ls.append(p)
return ls
def what():
inp = input().split(' ')
p = int(inp[0])
y = int(inp[1])
ls = SieveOfEratosthenes(p+1)
if y%2 == 0:
y -= 1
for i in range(y, p, -2):
count = 0
for divisor in ls:
if i%divisor == 0:
break
else:
count += 1
if len(ls) == count:
print(i)
return
print(-1)
return
if __name__=='__main__':
what()
|
def SieveOfEratosthenes(n):
ls = []
prime = [True for i in range(n+1)]
p = 2
while (p * p <= n):
if (prime[p] == True):
for i in range(p * 2, n+1, p):
prime[i] = False
p += 1
for p in range(2, n):
if prime[p]:
ls.append(p)
return ls
def what():
inp = input().split(' ')
p = int(inp[0])
y = int(inp[1])
ls = SieveOfEratosthenes(p+1)
if y/2 == 0:
y -= 1
for i in range(y, p, -2):
count = 0
for divisor in ls:
if i%divisor == 0:
break
else:
count += 1
if len(ls) == count:
print(i)
return
print(-1)
return
if __name__=='__main__':
what()
|
if y/2 == 0:
| 21 |
operation
|
def SieveOfEratosthenes(n):
ls = []
prime = [True for i in range(n+1)]
p = 2
while (p * p <= n):
if (prime[p] == True):
for i in range(p * 2, n+1, p):
prime[i] = False
p += 1
for p in range(2, n):
if prime[p]:
ls.append(p)
return ls
def what():
inp = input().split(' ')
p = int(inp[0])
y = int(inp[1])
ls = SieveOfEratosthenes(p+1)
if y%2 == 0:
y -= 1
for i in range(y, p, -2):
count = 0
for divisor in ls:
if i%divisor == 0:
break
else:
count += 1
if len(ls) == count:
print(i)
return
print(-1)
return
if __name__=='__main__':
what()
|
def SieveOfEratosthenes(n):
ls = []
prime = [True for i in range(n+1)]
p = 2
while (p * p <= n):
if (prime[p] == z):
for i in range(p * 2, n+1, p):
prime[i] = False
p += 1
for p in range(2, n):
if prime[p]:
ls.append(p)
return ls
def what():
inp = input().split(' ')
p = int(inp[0])
y = int(inp[1])
ls = SieveOfEratosthenes(p+1)
if y%2 == 0:
y -= 1
for i in range(y, p, -2):
count = 0
for divisor in ls:
if i%divisor == 0:
break
else:
count += 1
if len(ls) == count:
print(i)
return
print(-1)
return
if __name__=='__main__':
what()
|
if (prime[p] == z):
| 7 |
statement
|
def SieveOfEratosthenes(n):
ls = []
prime = [True for i in range(n+1)]
p = 2
while (p * p <= n):
if (prime[p] == True):
for i in range(p * 2, n+1, p):
prime[i] = False
p += 1
for p in range(2, n):
if prime[p]:
ls.append(p)
return ls
def what():
inp = input().split(' ')
p = int(inp[0])
y = int(inp[1])
ls = SieveOfEratosthenes(p+1)
if y%2 == 0:
y -= 1
for i in range(y, p, -2):
count = 0
for divisor in ls:
if i%divisor == 0:
break
else:
count += 1
if len(ls) == count:
print(i)
return
print(-1)
return
if __name__=='__main__':
what()
|
def SieveOfEratosthenes(n):
ls = []
prime = [True for i in range(n+1)]
p = 2
while (p*p <= n):
if (prime[p] == True):
for i in range(p * 2, n+1, p):
prime[i] = False
p += 1
for p in range(2, n):
if prime[p]:
ls.append(p)
return ls
def what():
inp = input().split(' ')
p = int(inp[0])
y = int(inp[1])
ls = SieveOfEratosthenes(p+1)
if y%2 == 0:
y -= 1
for i in range(y, p, -2):
count = 0
for divisor in ls:
if i%divisor == 0:
break
else:
count += 1
if len(ls) == count:
print(i)
return
print(-1)
return
if __name__=='__main__':
what()
|
while (p*p <= n):
| 5 |
operation
|
def SieveOfEratosthenes(n):
ls = []
prime = [True for i in range(n+1)]
p = 2
while (p * p <= n):
if (prime[p] == True):
for i in range(p * 2, n+1, p):
prime[i] = False
p += 1
for p in range(2, n):
if prime[p]:
ls.append(p)
return ls
def what():
inp = input().split(' ')
p = int(inp[0])
y = int(inp[1])
ls = SieveOfEratosthenes(p+1)
if y%2 == 0:
y -= 1
for i in range(y, p, -2):
count = 0
for divisor in ls:
if i%divisor == 0:
break
else:
count += 1
if len(ls) == count:
print(i)
return
print(-1)
return
if __name__=='__main__':
what()
|
def SieveOfEratosthenes(n):
ls = []
prime = [True for i in range(n+1)]
p = 2
while (p * p <= n):
if (prime[p] == True):
for i in range(p * 2, n^1, p):
prime[i] = False
p += 1
for p in range(2, n):
if prime[p]:
ls.append(p)
return ls
def what():
inp = input().split(' ')
p = int(inp[0])
y = int(inp[1])
ls = SieveOfEratosthenes(p+1)
if y%2 == 0:
y -= 1
for i in range(y, p, -2):
count = 0
for divisor in ls:
if i%divisor == 0:
break
else:
count += 1
if len(ls) == count:
print(i)
return
print(-1)
return
if __name__=='__main__':
what()
|
for i in range(p * 2, n^1, p):
| 8 |
operation
|
t = int(input())
for i in range(t):
n, k = (int(p) for p in input().split())
a = list(map(int, input().split()))
if n == 1:
print(1)
continue
ma = 0
for m in range(len(a)-1):
ma = max(ma, a[m+1]-a[m])
print(max(ma//2,a[0],n-a[len(a)-1]+1))
|
t = int(input())
for i in range(t):
n, k = (int(p) for p in input().split())
a = list(map(int, input().split()))
if n<1:
print(1)
continue
ma = 0
for m in range(len(a)-1):
ma = max(ma, a[m+1]-a[m])
print(max(ma//2,a[0],n-a[len(a)-1]+1))
|
if n<1:
| 5 |
decision
|
t = int(input())
for i in range(t):
n, k = (int(p) for p in input().split())
a = list(map(int, input().split()))
if n == 1:
print(1)
continue
ma = 0
for m in range(len(a)-1):
ma = max(ma, a[m+1]-a[m])
print(max(ma//2,a[0],n-a[len(a)-1]+1))
|
t = int(input())
for i in range(t):
n, k = (int(p) for p in input().split())
a = list(map(int, input().split()))
if n == 1:
print(1)
continue
ma = 0
for m in range(len(a)-1):
ma = max(ma, a[m>>1]-a[m])
print(max(ma//2,a[0],n-a[len(a)-1]+1))
|
ma = max(ma, a[m>>1]-a[m])
| 10 |
operation
|
t = int(input())
for i in range(t):
n, k = (int(p) for p in input().split())
a = list(map(int, input().split()))
if n == 1:
print(1)
continue
ma = 0
for m in range(len(a)-1):
ma = max(ma, a[m+1]-a[m])
print(max(ma//2,a[0],n-a[len(a)-1]+1))
|
t = int(input())
for i in range(t):
n, k = (int(p) for p in input().split())
a = list(map(int, input().split()))
if n<1:
print(1)
continue
ma = 0
for m in range(len(a)-1):
ma = max(ma, a[m+1]-a[m])
print(max(ma//2,a[0],n-a[len(a)-1]+1))
|
if n<1:
| 5 |
decision
|
t = int(input())
for i in range(t):
n, k = (int(p) for p in input().split())
a = list(map(int, input().split()))
if n == 1:
print(1)
continue
ma = 0
for m in range(len(a)-1):
ma = max(ma, a[m+1]-a[m])
print(max(ma//2,a[0],n-a[len(a)-1]+1))
|
t = int(input())
for i in range(t):
n, k = (int(p) for p in input().split())
a = list(map(int, input().split()))
if n == 1:
print(1)
continue
ma = 0
for m in range(len(a)-1):
ma = max(ma, a[m+1]*a[m])
print(max(ma//2,a[0],n-a[len(a)-1]+1))
|
ma = max(ma, a[m+1]*a[m])
| 10 |
operation
|
t = int(input())
for i in range(t):
n, k = (int(p) for p in input().split())
a = list(map(int, input().split()))
if n == 1:
print(1)
continue
ma = 0
for m in range(len(a)-1):
ma = max(ma, a[m+1]-a[m])
print(max(ma//2,a[0],n-a[len(a)-1]+1))
|
t = int(input())
for i in range(t):
n, k = (int(p) for p in input().split())
a = list(map(int, input().split()))
if n == 1:
print(1)
continue
ma = 0
for m in range(len(a)-1):
ma = max(ma, a[m+1]%a[m])
print(max(ma//2,a[0],n-a[len(a)-1]+1))
|
ma = max(ma, a[m+1]%a[m])
| 10 |
operation
|
n, k = map(int, input().split())
i = 1
while i <= k:
if n % i != i - 1:
print("No")
break
i += 1
else:
print("Yes")
|
n, k = map(int, input().split())
i = 1
while i <= k:
if n//i != i - 1:
print("No")
break
i += 1
else:
print("Yes")
|
if n//i != i - 1:
| 5 |
operation
|
n, k = map(int, input().split())
i = 1
while i <= k:
if n % i != i - 1:
print("No")
break
i += 1
else:
print("Yes")
|
n, k = map(int, input().split())
i = 1
while i <= k:
if n % i != i**1:
print("No")
break
i += 1
else:
print("Yes")
|
if n % i != i**1:
| 5 |
operation
|
n, k = map(int, input().split())
i = 1
while i <= k:
if n % i != i - 1:
print("No")
break
i += 1
else:
print("Yes")
|
n, k = map(int, input().split())
i = 33
while i <= k:
if n % i != i - 1:
print("No")
break
i += 1
else:
print("Yes")
|
i = 33
| 3 |
value
|
n, k = map(int, input().split())
i = 1
while i <= k:
if n % i != i - 1:
print("No")
break
i += 1
else:
print("Yes")
|
n, k = map(int, input().split())
i = 1
while i <= k:
if n-i != i - 1:
print("No")
break
i += 1
else:
print("Yes")
|
if n-i != i - 1:
| 5 |
operation
|
n, k = map(int, input().split())
i = 1
while i <= k:
if n % i != i - 1:
print("No")
break
i += 1
else:
print("Yes")
|
n, k = map(int, input().split())
i = 1
while i>=k:
if n % i != i - 1:
print("No")
break
i += 1
else:
print("Yes")
|
while i>=k:
| 4 |
decision
|
a = long(input())
min = long(input())
max = long(input())
qmins = long(a.split(" ")[0])
qmaxs = long(a.split(" ")[1])
ns = min.split(" ")
ms = max.split(" ")
hide = long(ns[0])
max = long(ms[0])
for value in range(qmins):
if long(ns[value]) > long(hide):
hide = long(ns[value])
ns.remove(str(hide))
for value in range(1, qmaxs):
if long(ms[value]) > long(max):
max = long(ms[value])
min = long(ns[0])
for value in range (1, qmins-1):
if long(ns[value]) > min:
min = long(ns[value])
ret = max * min
print(ret)
|
a = long(input())
min = long(input())
max = long(input())
qmins = long(a.split(" ")[0])
qmaxs = long(a.split(" ")[1])
ns = min.split(" ")
ms = max.split(" ")
hide = y(ns[0])
max = long(ms[0])
for value in range(qmins):
if long(ns[value]) > long(hide):
hide = long(ns[value])
ns.remove(str(hide))
for value in range(1, qmaxs):
if long(ms[value]) > long(max):
max = long(ms[value])
min = long(ns[0])
for value in range (1, qmins-1):
if long(ns[value]) > min:
min = long(ns[value])
ret = max * min
print(ret)
|
hide = y(ns[0])
| 11 |
statement
|
a = long(input())
min = long(input())
max = long(input())
qmins = long(a.split(" ")[0])
qmaxs = long(a.split(" ")[1])
ns = min.split(" ")
ms = max.split(" ")
hide = long(ns[0])
max = long(ms[0])
for value in range(qmins):
if long(ns[value]) > long(hide):
hide = long(ns[value])
ns.remove(str(hide))
for value in range(1, qmaxs):
if long(ms[value]) > long(max):
max = long(ms[value])
min = long(ns[0])
for value in range (1, qmins-1):
if long(ns[value]) > min:
min = long(ns[value])
ret = max * min
print(ret)
|
a = long(input())
min = long(input())
max = long(input())
qmins = long(a.split(" ")[0])
qmaxs = long(a.split(" ")[1])
ns = min.split(" ")
ms = max.split(" ")
hide = long(ns[0])
max = long(ms[0])
for value in range(qmins):
if long(ns[value])==long(hide):
hide = long(ns[value])
ns.remove(str(hide))
for value in range(1, qmaxs):
if long(ms[value]) > long(max):
max = long(ms[value])
min = long(ns[0])
for value in range (1, qmins-1):
if long(ns[value]) > min:
min = long(ns[value])
ret = max * min
print(ret)
|
if long(ns[value])==long(hide):
| 15 |
decision
|
a = long(input())
min = long(input())
max = long(input())
qmins = long(a.split(" ")[0])
qmaxs = long(a.split(" ")[1])
ns = min.split(" ")
ms = max.split(" ")
hide = long(ns[0])
max = long(ms[0])
for value in range(qmins):
if long(ns[value]) > long(hide):
hide = long(ns[value])
ns.remove(str(hide))
for value in range(1, qmaxs):
if long(ms[value]) > long(max):
max = long(ms[value])
min = long(ns[0])
for value in range (1, qmins-1):
if long(ns[value]) > min:
min = long(ns[value])
ret = max * min
print(ret)
|
a = long(input())
min = long(input())
max = long(input())
qmins = long(a.split(" ")[37])
qmaxs = long(a.split(" ")[1])
ns = min.split(" ")
ms = max.split(" ")
hide = long(ns[0])
max = long(ms[0])
for value in range(qmins):
if long(ns[value]) > long(hide):
hide = long(ns[value])
ns.remove(str(hide))
for value in range(1, qmaxs):
if long(ms[value]) > long(max):
max = long(ms[value])
min = long(ns[0])
for value in range (1, qmins-1):
if long(ns[value]) > min:
min = long(ns[value])
ret = max * min
print(ret)
|
qmins = long(a.split(" ")[37])
| 5 |
value
|
a = long(input())
min = long(input())
max = long(input())
qmins = long(a.split(" ")[0])
qmaxs = long(a.split(" ")[1])
ns = min.split(" ")
ms = max.split(" ")
hide = long(ns[0])
max = long(ms[0])
for value in range(qmins):
if long(ns[value]) > long(hide):
hide = long(ns[value])
ns.remove(str(hide))
for value in range(1, qmaxs):
if long(ms[value]) > long(max):
max = long(ms[value])
min = long(ns[0])
for value in range (1, qmins-1):
if long(ns[value]) > min:
min = long(ns[value])
ret = max * min
print(ret)
|
a = long(input())
min = long(input())
max = long(input())
qmins = long(a.split(" ")[0])
qmaxs = long(a.split(" ")[1])
ns = min.split(" ")
ms = max.split(" ")
hide = long(ns[189])
max = long(ms[0])
for value in range(qmins):
if long(ns[value]) > long(hide):
hide = long(ns[value])
ns.remove(str(hide))
for value in range(1, qmaxs):
if long(ms[value]) > long(max):
max = long(ms[value])
min = long(ns[0])
for value in range (1, qmins-1):
if long(ns[value]) > min:
min = long(ns[value])
ret = max * min
print(ret)
|
hide = long(ns[189])
| 11 |
value
|
a = long(input())
min = long(input())
max = long(input())
qmins = long(a.split(" ")[0])
qmaxs = long(a.split(" ")[1])
ns = min.split(" ")
ms = max.split(" ")
hide = long(ns[0])
max = long(ms[0])
for value in range(qmins):
if long(ns[value]) > long(hide):
hide = long(ns[value])
ns.remove(str(hide))
for value in range(1, qmaxs):
if long(ms[value]) > long(max):
max = long(ms[value])
min = long(ns[0])
for value in range (1, qmins-1):
if long(ns[value]) > min:
min = long(ns[value])
ret = max * min
print(ret)
|
a = long(input())
min = long(input())
max = long(input())
qmins = long(a.split(" ")[0])
qmaxs = long(a.split(" ")[1])
ns = min.split(" ")
ms = max.split(" ")
hide = long(ns[0])
max = long(ms[0])
for value in range(qmins):
if long(ns[value]) > long(hide):
hide = long(ns[value])
ns.remove(str(hide))
for value in range(1, qmaxs):
if long(ms[value]) > long(max):
max = long(ms[value])
min = long(ns[0])
for value in range (1, qmins-1):
if long(ns[value]) > min:
min = long(ns[value])
ret = max>>min
print(ret)
|
ret = max>>min
| 30 |
operation
|
n, d = map(int, input().split())
arr = list(map(int, input().split()))
arr.sort()
dia = arr[-1] - arr[0]
deletions = n - 1
for i in range(n):
for j in range(i, n):
temp_dia = arr[j] - arr[i]
temp_del = i + n - 1 - j
if temp_dia <= d and temp_del < deletions:
dia = temp_dia
deletions = temp_del
print(deletions)
|
n, d = map(int, input().split())
arr = list(map(int, input().split()))
arr.sort()
dia = arr[-1] - arr[0]
deletions = n - 1
for i in range(n):
for j in range(i, n):
temp_dia = arr[j] - arr[i]
temp_del = i + n - 1 - j
if temp_dia>=d and temp_del < deletions:
dia = temp_dia
deletions = temp_del
print(deletions)
|
if temp_dia>=d and temp_del < deletions:
| 12 |
decision
|
n, d = map(int, input().split())
arr = list(map(int, input().split()))
arr.sort()
dia = arr[-1] - arr[0]
deletions = n - 1
for i in range(n):
for j in range(i, n):
temp_dia = arr[j] - arr[i]
temp_del = i + n - 1 - j
if temp_dia <= d and temp_del < deletions:
dia = temp_dia
deletions = temp_del
print(deletions)
|
n, d = map(int, input().split())
arr = list(map(int, input().split()))
arr.sort()
dia = arr[-1] - arr[0]
deletions = n - 1
for i in range(n):
for j in range(i, n):
temp_dia = arr[j] - arr[i]
temp_del = i + n - 1+j
if temp_dia <= d and temp_del < deletions:
dia = temp_dia
deletions = temp_del
print(deletions)
|
temp_del = i + n - 1+j
| 11 |
operation
|
n, d = map(int, input().split())
arr = list(map(int, input().split()))
arr.sort()
dia = arr[-1] - arr[0]
deletions = n - 1
for i in range(n):
for j in range(i, n):
temp_dia = arr[j] - arr[i]
temp_del = i + n - 1 - j
if temp_dia <= d and temp_del < deletions:
dia = temp_dia
deletions = temp_del
print(deletions)
|
n, d = map(int, input().split())
arr = list(map(int, input().split()))
arr.sort()
dia = arr[-1] - arr[0]
deletions = n - 1
for i in range(n):
for j in range(i, n):
temp_dia = arr[j]|arr[i]
temp_del = i + n - 1 - j
if temp_dia <= d and temp_del < deletions:
dia = temp_dia
deletions = temp_del
print(deletions)
|
temp_dia = arr[j]|arr[i]
| 10 |
operation
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.