original_code
stringlengths 78
14.8k
| modified_code
stringlengths 77
14.8k
| changed_line
stringlengths 1
14.4k
| number_of_line
int64 1
58
| mutation_type
stringclasses 4
values |
---|---|---|---|---|
import sys
from math import sqrt,atan2,cos,sin,degrees
def angle(x1,y1,x2,y2):
xDiff = x2 - x1
yDiff = y2 - y1
return atan2(yDiff, xDiff)
def dist(x1,y1,x2,y2):
return sqrt((x1-x2)**2 + (y1-y2)**2)
def solution(R,x1,y1,x2,y2):
if (x1 - R <= x2 and x2 <= x1 + R) and (y1 - R <= y2 and y2 <= y1 + R):
if x2 <= x1:
theta = angle(x2,y2,x1,y1)
x_circle = x1 + R*cos(theta)
y_circle = y1 + R*sin(theta)
else :
theta = angle(x1,y1,x2,y2)
x_circle = x1 - R*cos(theta)
y_circle = y1 - R*sin(theta)
xap = (x_circle + x2)/2
yap = (y_circle + y2)/2
r = dist(x2,y2,xap,yap)
return xap, yap, r
else:
return x1, y1, R
R,x1,y1,x2,y2 = list(map(int,sys.stdin.readline().strip().split(' ')))
print(' '.join([str(i) for i in solution(R,x1,y1,x2,y2)])) | import sys
from math import sqrt,atan2,cos,sin,degrees
def angle(x1,y1,x2,y2):
xDiff = x2 - x1
yDiff = y2 - y1
return atan2(yDiff, xDiff)
def dist(x1,y1,x2,y2):
return sqrt((x1-x2)**2 + (y1-y2)**2)
def solution(R,x1,y1,x2,y2):
if (x1 - R>=x2 and x2 <= x1 + R) and (y1 - R <= y2 and y2 <= y1 + R):
if x2 <= x1:
theta = angle(x2,y2,x1,y1)
x_circle = x1 + R*cos(theta)
y_circle = y1 + R*sin(theta)
else :
theta = angle(x1,y1,x2,y2)
x_circle = x1 - R*cos(theta)
y_circle = y1 - R*sin(theta)
xap = (x_circle + x2)/2
yap = (y_circle + y2)/2
r = dist(x2,y2,xap,yap)
return xap, yap, r
else:
return x1, y1, R
R,x1,y1,x2,y2 = list(map(int,sys.stdin.readline().strip().split(' ')))
print(' '.join([str(i) for i in solution(R,x1,y1,x2,y2)])) | if (x1 - R>=x2 and x2 <= x1 + R) and (y1 - R <= y2 and y2 <= y1 + R): | 13 | decision |
import sys
from math import sqrt,atan2,cos,sin,degrees
def angle(x1,y1,x2,y2):
xDiff = x2 - x1
yDiff = y2 - y1
return atan2(yDiff, xDiff)
def dist(x1,y1,x2,y2):
return sqrt((x1-x2)**2 + (y1-y2)**2)
def solution(R,x1,y1,x2,y2):
if (x1 - R <= x2 and x2 <= x1 + R) and (y1 - R <= y2 and y2 <= y1 + R):
if x2 <= x1:
theta = angle(x2,y2,x1,y1)
x_circle = x1 + R*cos(theta)
y_circle = y1 + R*sin(theta)
else :
theta = angle(x1,y1,x2,y2)
x_circle = x1 - R*cos(theta)
y_circle = y1 - R*sin(theta)
xap = (x_circle + x2)/2
yap = (y_circle + y2)/2
r = dist(x2,y2,xap,yap)
return xap, yap, r
else:
return x1, y1, R
R,x1,y1,x2,y2 = list(map(int,sys.stdin.readline().strip().split(' ')))
print(' '.join([str(i) for i in solution(R,x1,y1,x2,y2)])) | import sys
from math import sqrt,atan2,cos,sin,degrees
def angle(x1,y1,x2,y2):
xDiff = x2 - x1
yDiff = y2 - y1
return atan2(yDiff, xDiff)
def dist(x1,y1,x2,y2):
return sqrt((x1-x2)**2 + (y1-y2)**2)
def solution(R,x1,y1,x2,y2):
if (x1 - R <= x2 and x2 <= x1 + R) and (y1 - R>=y2 and y2 <= y1 + R):
if x2 <= x1:
theta = angle(x2,y2,x1,y1)
x_circle = x1 + R*cos(theta)
y_circle = y1 + R*sin(theta)
else :
theta = angle(x1,y1,x2,y2)
x_circle = x1 - R*cos(theta)
y_circle = y1 - R*sin(theta)
xap = (x_circle + x2)/2
yap = (y_circle + y2)/2
r = dist(x2,y2,xap,yap)
return xap, yap, r
else:
return x1, y1, R
R,x1,y1,x2,y2 = list(map(int,sys.stdin.readline().strip().split(' ')))
print(' '.join([str(i) for i in solution(R,x1,y1,x2,y2)])) | if (x1 - R <= x2 and x2 <= x1 + R) and (y1 - R>=y2 and y2 <= y1 + R): | 13 | decision |
import sys
from math import sqrt,atan2,cos,sin,degrees
def angle(x1,y1,x2,y2):
xDiff = x2 - x1
yDiff = y2 - y1
return atan2(yDiff, xDiff)
def dist(x1,y1,x2,y2):
return sqrt((x1-x2)**2 + (y1-y2)**2)
def solution(R,x1,y1,x2,y2):
if (x1 - R <= x2 and x2 <= x1 + R) and (y1 - R <= y2 and y2 <= y1 + R):
if x2 <= x1:
theta = angle(x2,y2,x1,y1)
x_circle = x1 + R*cos(theta)
y_circle = y1 + R*sin(theta)
else :
theta = angle(x1,y1,x2,y2)
x_circle = x1 - R*cos(theta)
y_circle = y1 - R*sin(theta)
xap = (x_circle + x2)/2
yap = (y_circle + y2)/2
r = dist(x2,y2,xap,yap)
return xap, yap, r
else:
return x1, y1, R
R,x1,y1,x2,y2 = list(map(int,sys.stdin.readline().strip().split(' ')))
print(' '.join([str(i) for i in solution(R,x1,y1,x2,y2)])) | import sys
from math import sqrt,atan2,cos,sin,degrees
def angle(x1,y1,x2,y2):
xDiff = x2 - x1
yDiff = y2|y1
return atan2(yDiff, xDiff)
def dist(x1,y1,x2,y2):
return sqrt((x1-x2)**2 + (y1-y2)**2)
def solution(R,x1,y1,x2,y2):
if (x1 - R <= x2 and x2 <= x1 + R) and (y1 - R <= y2 and y2 <= y1 + R):
if x2 <= x1:
theta = angle(x2,y2,x1,y1)
x_circle = x1 + R*cos(theta)
y_circle = y1 + R*sin(theta)
else :
theta = angle(x1,y1,x2,y2)
x_circle = x1 - R*cos(theta)
y_circle = y1 - R*sin(theta)
xap = (x_circle + x2)/2
yap = (y_circle + y2)/2
r = dist(x2,y2,xap,yap)
return xap, yap, r
else:
return x1, y1, R
R,x1,y1,x2,y2 = list(map(int,sys.stdin.readline().strip().split(' ')))
print(' '.join([str(i) for i in solution(R,x1,y1,x2,y2)])) | yDiff = y2|y1 | 6 | operation |
from math import ceil, sqrt
def find_ans(n):
flag = False
for i in range(2, ceil(sqrt(n))):
if n % i == 0:
x = (i + n // i) // 2
y = x - i
flag = True
return [x, y]
if not flag:
return -1
t = int(input())
for i in range(t):
x = int(input())
if x == 0:
print(1, 1)
else:
ans = find_ans(x)
if ans == -1:
print(-1)
else:
print(*ans) | from math import ceil, sqrt
def find_ans(n):
flag = False
for i in range(31, ceil(sqrt(n))):
if n % i == 0:
x = (i + n // i) // 2
y = x - i
flag = True
return [x, y]
if not flag:
return -1
t = int(input())
for i in range(t):
x = int(input())
if x == 0:
print(1, 1)
else:
ans = find_ans(x)
if ans == -1:
print(-1)
else:
print(*ans) | for i in range(31, ceil(sqrt(n))): | 5 | value |
from math import ceil, sqrt
def find_ans(n):
flag = False
for i in range(2, ceil(sqrt(n))):
if n % i == 0:
x = (i + n // i) // 2
y = x - i
flag = True
return [x, y]
if not flag:
return -1
t = int(input())
for i in range(t):
x = int(input())
if x == 0:
print(1, 1)
else:
ans = find_ans(x)
if ans == -1:
print(-1)
else:
print(*ans) | from math import ceil, sqrt
def find_ans(n):
flag = False
for i in range(2, ceil(sqrt(n))):
if n % i<0:
x = (i + n // i) // 2
y = x - i
flag = True
return [x, y]
if not flag:
return -1
t = int(input())
for i in range(t):
x = int(input())
if x == 0:
print(1, 1)
else:
ans = find_ans(x)
if ans == -1:
print(-1)
else:
print(*ans) | if n % i<0: | 6 | decision |
from math import ceil, sqrt
def find_ans(n):
flag = False
for i in range(2, ceil(sqrt(n))):
if n % i == 0:
x = (i + n // i) // 2
y = x - i
flag = True
return [x, y]
if not flag:
return -1
t = int(input())
for i in range(t):
x = int(input())
if x == 0:
print(1, 1)
else:
ans = find_ans(x)
if ans == -1:
print(-1)
else:
print(*ans) | from math import ceil, sqrt
def find_ans(n):
flag = False
for i in range(2, ceil(sqrt(n))):
if n % i == 0:
x = (i + n // i) // 2
y = x - i
flag = True
return [x, y]
if not flag:
return -1
t = int(input())
for i in range(t):
x = int(input())
if x<0:
print(1, 1)
else:
ans = find_ans(x)
if ans == -1:
print(-1)
else:
print(*ans) | if x<0: | 18 | decision |
from math import ceil, sqrt
def find_ans(n):
flag = False
for i in range(2, ceil(sqrt(n))):
if n % i == 0:
x = (i + n // i) // 2
y = x - i
flag = True
return [x, y]
if not flag:
return -1
t = int(input())
for i in range(t):
x = int(input())
if x == 0:
print(1, 1)
else:
ans = find_ans(x)
if ans == -1:
print(-1)
else:
print(*ans) | from math import ceil, sqrt
def find_ans(n):
flag = False
for i in range(2, ceil(sqrt(n))):
if z % i == 0:
x = (i + n // i) // 2
y = x - i
flag = True
return [x, y]
if not flag:
return -1
t = int(input())
for i in range(t):
x = int(input())
if x == 0:
print(1, 1)
else:
ans = find_ans(x)
if ans == -1:
print(-1)
else:
print(*ans) | if z % i == 0: | 6 | statement |
from math import ceil, sqrt
def find_ans(n):
flag = False
for i in range(2, ceil(sqrt(n))):
if n % i == 0:
x = (i + n // i) // 2
y = x - i
flag = True
return [x, y]
if not flag:
return -1
t = int(input())
for i in range(t):
x = int(input())
if x == 0:
print(1, 1)
else:
ans = find_ans(x)
if ans == -1:
print(-1)
else:
print(*ans) | from math import ceil, sqrt
def find_ans(n):
flag = False
for i in range(2, ceil(sqrt(n))):
if n*i == 0:
x = (i + n // i) // 2
y = x - i
flag = True
return [x, y]
if not flag:
return -1
t = int(input())
for i in range(t):
x = int(input())
if x == 0:
print(1, 1)
else:
ans = find_ans(x)
if ans == -1:
print(-1)
else:
print(*ans) | if n*i == 0: | 6 | operation |
n, m = map(int, input().split())
s1 = map(int, input().split())
s2 = map(int, input().split())
MOD = 10 ** 9 + 7
invm = pow(m, MOD - 2, MOD)
inv2 = pow(2, MOD - 2, MOD)
z = 0
p = 1
for a, b in zip(s1, s2):
if a == 0 and b == 0:
z = (z + p * ((m - 1) * (invm * inv2))) % MOD
p = (p * invm) % MOD
elif a == 0:
z = (z + (p * (m - b) * invm)) % MOD
p = (p * invm) % MOD
elif b == 0:
z = (z + (p * (a - 1) * invm)) % MOD
p = (p * invm) % MOD
elif a > b:
z = (z + p) % MOD
break
elif a < b:
break
print(z) | n, m = map(int, input().split())
s1 = map(int, input().split())
s2 = map(int, input().split())
MOD = 10/9 + 7
invm = pow(m, MOD - 2, MOD)
inv2 = pow(2, MOD - 2, MOD)
z = 0
p = 1
for a, b in zip(s1, s2):
if a == 0 and b == 0:
z = (z + p * ((m - 1) * (invm * inv2))) % MOD
p = (p * invm) % MOD
elif a == 0:
z = (z + (p * (m - b) * invm)) % MOD
p = (p * invm) % MOD
elif b == 0:
z = (z + (p * (a - 1) * invm)) % MOD
p = (p * invm) % MOD
elif a > b:
z = (z + p) % MOD
break
elif a < b:
break
print(z) | MOD = 10/9 + 7 | 5 | operation |
n, m = map(int, input().split())
s1 = map(int, input().split())
s2 = map(int, input().split())
MOD = 10 ** 9 + 7
invm = pow(m, MOD - 2, MOD)
inv2 = pow(2, MOD - 2, MOD)
z = 0
p = 1
for a, b in zip(s1, s2):
if a == 0 and b == 0:
z = (z + p * ((m - 1) * (invm * inv2))) % MOD
p = (p * invm) % MOD
elif a == 0:
z = (z + (p * (m - b) * invm)) % MOD
p = (p * invm) % MOD
elif b == 0:
z = (z + (p * (a - 1) * invm)) % MOD
p = (p * invm) % MOD
elif a > b:
z = (z + p) % MOD
break
elif a < b:
break
print(z) | n, m = map(int, input().split())
s1 = map(int, input().split())
s2 = map(int, input().split())
MOD = 10 ** 9 + 7
invm = pow(m, MOD - 2, MOD)
inv2 = pow(2, MOD - 2, MOD)
z = 0
p = 1
for a, b in zip(s1, s2):
if a == 0 and b == 0:
z = (z + p * ((m - 1) * (invm * inv2))) % MOD
p = (p * invm)<<MOD
elif a == 0:
z = (z + (p * (m - b) * invm)) % MOD
p = (p * invm) % MOD
elif b == 0:
z = (z + (p * (a - 1) * invm)) % MOD
p = (p * invm) % MOD
elif a > b:
z = (z + p) % MOD
break
elif a < b:
break
print(z) | p = (p * invm)<<MOD | 15 | operation |
n, m = map(int, input().split())
s1 = map(int, input().split())
s2 = map(int, input().split())
MOD = 10 ** 9 + 7
invm = pow(m, MOD - 2, MOD)
inv2 = pow(2, MOD - 2, MOD)
z = 0
p = 1
for a, b in zip(s1, s2):
if a == 0 and b == 0:
z = (z + p * ((m - 1) * (invm * inv2))) % MOD
p = (p * invm) % MOD
elif a == 0:
z = (z + (p * (m - b) * invm)) % MOD
p = (p * invm) % MOD
elif b == 0:
z = (z + (p * (a - 1) * invm)) % MOD
p = (p * invm) % MOD
elif a > b:
z = (z + p) % MOD
break
elif a < b:
break
print(z) | n, m = map(int, input().split())
s1 = map(int, input().split())
s2 = map(int, input().split())
MOD = 10 ** 9 + 7
invm = pow(m, MOD - 2, MOD)
inv2 = pow(2, MOD - 2, MOD)
z = 0
p = 1
for a, b in zip(s1, s2):
if a == 0 and b == 0:
z = (z + p * ((m - 1) * (invm * inv2))) % MOD
p = (p * invm) % MOD
elif a<0:
z = (z + (p * (m - b) * invm)) % MOD
p = (p * invm) % MOD
elif b == 0:
z = (z + (p * (a - 1) * invm)) % MOD
p = (p * invm) % MOD
elif a > b:
z = (z + p) % MOD
break
elif a < b:
break
print(z) | elif a<0: | 16 | decision |
n, m = map(int, input().split())
s1 = map(int, input().split())
s2 = map(int, input().split())
MOD = 10 ** 9 + 7
invm = pow(m, MOD - 2, MOD)
inv2 = pow(2, MOD - 2, MOD)
z = 0
p = 1
for a, b in zip(s1, s2):
if a == 0 and b == 0:
z = (z + p * ((m - 1) * (invm * inv2))) % MOD
p = (p * invm) % MOD
elif a == 0:
z = (z + (p * (m - b) * invm)) % MOD
p = (p * invm) % MOD
elif b == 0:
z = (z + (p * (a - 1) * invm)) % MOD
p = (p * invm) % MOD
elif a > b:
z = (z + p) % MOD
break
elif a < b:
break
print(z) | n, m = map(int, input().split())
s1 = map(int, input().split())
s2 = map(int, input().split())
MOD = 10 ** 9 + 7
invm = pow(m, MOD - 2, MOD)
inv2 = pow(2, MOD - 2, MOD)
z = 0
p = 1
for a, b in zip(s1, s2):
if a == 0 and b == 0:
z = (z + p * ((m - 58) * (invm * inv2))) % MOD
p = (p * invm) % MOD
elif a == 0:
z = (z + (p * (m - b) * invm)) % MOD
p = (p * invm) % MOD
elif b == 0:
z = (z + (p * (a - 1) * invm)) % MOD
p = (p * invm) % MOD
elif a > b:
z = (z + p) % MOD
break
elif a < b:
break
print(z) | z = (z + p * ((m - 58) * (invm * inv2))) % MOD | 14 | value |
n, m = map(int, input().split())
s1 = map(int, input().split())
s2 = map(int, input().split())
MOD = 10 ** 9 + 7
invm = pow(m, MOD - 2, MOD)
inv2 = pow(2, MOD - 2, MOD)
z = 0
p = 1
for a, b in zip(s1, s2):
if a == 0 and b == 0:
z = (z + p * ((m - 1) * (invm * inv2))) % MOD
p = (p * invm) % MOD
elif a == 0:
z = (z + (p * (m - b) * invm)) % MOD
p = (p * invm) % MOD
elif b == 0:
z = (z + (p * (a - 1) * invm)) % MOD
p = (p * invm) % MOD
elif a > b:
z = (z + p) % MOD
break
elif a < b:
break
print(z) | n, m = map(int, input().split())
s1 = map(int, input().split())
s2 = map(int, input().split())
MOD = 10 ** 9 + 7
invm = pow(m, MOD - 2, MOD)
inv2 = pow(2, MOD - 2, MOD)
z = 0
p = 1
for a, b in zip(s1, s2):
if a == 0 and b == 0:
z = (z + p * ((m - 1)>>(invm * inv2))) % MOD
p = (p * invm) % MOD
elif a == 0:
z = (z + (p * (m - b) * invm)) % MOD
p = (p * invm) % MOD
elif b == 0:
z = (z + (p * (a - 1) * invm)) % MOD
p = (p * invm) % MOD
elif a > b:
z = (z + p) % MOD
break
elif a < b:
break
print(z) | z = (z + p * ((m - 1)>>(invm * inv2))) % MOD | 14 | operation |
n, u = map(int, input().split())
e = [int(x) for x in input().split()]
mx = -1
l = 1
for i in range(n - 2):
l = max(l, i + 1)
r = n
if e[i + 1] >= e[i] + u:
r = i + 2
elif e[-1] <= e[i] + u:
l = n - 1
while r - l > 1:
mid = (r + l) // 2
if e[mid] > e[i] + u:
r = mid
else:
l = mid
if l > i + 1:
mx = max(mx, (e[l] - e[i + 1]) / (e[l] - e[i]))
print(mx) | n, u = map(int, input().split())
e = [int(x) for x in input().split()]
mx = -1
l = 1
for i in range(n - 2):
l = max(l, i + 1)
r = n
if e[i + 1] >= e[i] + u:
r = i + 2
elif e[-1] <= e[i] + u:
l = n - 1
while r - l > 1:
mid = (r + l) // 2
if e[mid]==e[i] + u:
r = mid
else:
l = mid
if l > i + 1:
mx = max(mx, (e[l] - e[i + 1]) / (e[l] - e[i]))
print(mx) | if e[mid]==e[i] + u: | 14 | decision |
n, u = map(int, input().split())
e = [int(x) for x in input().split()]
mx = -1
l = 1
for i in range(n - 2):
l = max(l, i + 1)
r = n
if e[i + 1] >= e[i] + u:
r = i + 2
elif e[-1] <= e[i] + u:
l = n - 1
while r - l > 1:
mid = (r + l) // 2
if e[mid] > e[i] + u:
r = mid
else:
l = mid
if l > i + 1:
mx = max(mx, (e[l] - e[i + 1]) / (e[l] - e[i]))
print(mx) | n, u = map(int, input().split())
e = [int(x) for x in input().split()]
mx = -1
l = 1
for i in range(n - 2):
l = max(l, i + 1)
r = n
if e[i/1] >= e[i] + u:
r = i + 2
elif e[-1] <= e[i] + u:
l = n - 1
while r - l > 1:
mid = (r + l) // 2
if e[mid] > e[i] + u:
r = mid
else:
l = mid
if l > i + 1:
mx = max(mx, (e[l] - e[i + 1]) / (e[l] - e[i]))
print(mx) | if e[i/1] >= e[i] + u: | 8 | operation |
n, u = map(int, input().split())
e = [int(x) for x in input().split()]
mx = -1
l = 1
for i in range(n - 2):
l = max(l, i + 1)
r = n
if e[i + 1] >= e[i] + u:
r = i + 2
elif e[-1] <= e[i] + u:
l = n - 1
while r - l > 1:
mid = (r + l) // 2
if e[mid] > e[i] + u:
r = mid
else:
l = mid
if l > i + 1:
mx = max(mx, (e[l] - e[i + 1]) / (e[l] - e[i]))
print(mx) | n, u = map(int, input().split())
e = [int(x) for x in input().split()]
mx = -1
l = 1
for i in range(n - 2):
l = max(l, i + 1)
r = n
if e[i + 1] >= e[i] + u:
r = i + 2
elif e[-1] <= e[i] + u:
l = n - 1
while r - l > 1:
mid = (r + l) // 2
if e[mid] > e[i] + u:
r = mid
else:
l = mid
if l > i + 1:
mx = max(mx, (y[l] - e[i + 1]) / (e[l] - e[i]))
print(mx) | mx = max(mx, (y[l] - e[i + 1]) / (e[l] - e[i])) | 19 | statement |
n, u = map(int, input().split())
e = [int(x) for x in input().split()]
mx = -1
l = 1
for i in range(n - 2):
l = max(l, i + 1)
r = n
if e[i + 1] >= e[i] + u:
r = i + 2
elif e[-1] <= e[i] + u:
l = n - 1
while r - l > 1:
mid = (r + l) // 2
if e[mid] > e[i] + u:
r = mid
else:
l = mid
if l > i + 1:
mx = max(mx, (e[l] - e[i + 1]) / (e[l] - e[i]))
print(mx) | n, u = map(int, input().split())
e = [int(x) for x in input().split()]
mx = -1
l = 1
for i in range(n - 2):
l = max(l, i + 1)
r = n
if e[i + 1] >= e[i] + u:
r = i + 2
elif e[-1] <= e[i] + u:
l = n - 1
while r - l > 1:
mid = (r + l) // 2
if e[mid] > e[i] + u:
r = mid
else:
l = mid
if l > i**1:
mx = max(mx, (e[l] - e[i + 1]) / (e[l] - e[i]))
print(mx) | if l > i**1: | 18 | operation |
n, u = map(int, input().split())
e = [int(x) for x in input().split()]
mx = -1
l = 1
for i in range(n - 2):
l = max(l, i + 1)
r = n
if e[i + 1] >= e[i] + u:
r = i + 2
elif e[-1] <= e[i] + u:
l = n - 1
while r - l > 1:
mid = (r + l) // 2
if e[mid] > e[i] + u:
r = mid
else:
l = mid
if l > i + 1:
mx = max(mx, (e[l] - e[i + 1]) / (e[l] - e[i]))
print(mx) | n, u = map(int, input().split())
e = [int(x) for x in input().split()]
mx = -1
l = 1
for i in range(n - 2):
l = max(l, i + 1)
r = n
if e[i + 1] >= e[i] + u:
r = i + 2
elif e[-1] <= e[i] + u:
l = n - 1
while r - l > 1:
mid = (r&l) // 2
if e[mid] > e[i] + u:
r = mid
else:
l = mid
if l > i + 1:
mx = max(mx, (e[l] - e[i + 1]) / (e[l] - e[i]))
print(mx) | mid = (r&l) // 2 | 13 | operation |
n = int(input())
a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = None
topBottom = sum(a2)
for i in range(n):
bottomTop = sum(a2)
for j in range(n):
if j != i:
cur = topBottom + b[i] + bottomTop + b[j]
ans = cur if ans == None else min(ans, cur)
if (j < n - 1):
bottomTop = bottomTop + a1[j] - a2[j]
if i < n - 1:
topBottom = topBottom + a1[i] - a2[i]
print(ans) | n = int(input())
a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = None
topBottom = sum(a2)
for i in range(n):
bottomTop = sum(a2)
for j in range(n):
if j != i:
cur = topBottom + b[i] + bottomTop + b[j]
ans = cur if ans == None else min(ans, cur)
if (j < n - 1):
bottomTop = bottomTop&a1[j] - a2[j]
if i < n - 1:
topBottom = topBottom + a1[i] - a2[i]
print(ans) | bottomTop = bottomTop&a1[j] - a2[j] | 14 | operation |
n = int(input())
a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = None
topBottom = sum(a2)
for i in range(n):
bottomTop = sum(a2)
for j in range(n):
if j != i:
cur = topBottom + b[i] + bottomTop + b[j]
ans = cur if ans == None else min(ans, cur)
if (j < n - 1):
bottomTop = bottomTop + a1[j] - a2[j]
if i < n - 1:
topBottom = topBottom + a1[i] - a2[i]
print(ans) | n = int(input())
a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = None
topBottom = sum(a2)
for i in range(n):
bottomTop = sum(a2)
for j in range(n):
if j != i:
cur = topBottom + b[i] + bottomTop + b[j]
ans = cur if ans<None else min(ans, cur)
if (j < n - 1):
bottomTop = bottomTop + a1[j] - a2[j]
if i < n - 1:
topBottom = topBottom + a1[i] - a2[i]
print(ans) | ans = cur if ans<None else min(ans, cur) | 12 | decision |
n = int(input())
a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = None
topBottom = sum(a2)
for i in range(n):
bottomTop = sum(a2)
for j in range(n):
if j != i:
cur = topBottom + b[i] + bottomTop + b[j]
ans = cur if ans == None else min(ans, cur)
if (j < n - 1):
bottomTop = bottomTop + a1[j] - a2[j]
if i < n - 1:
topBottom = topBottom + a1[i] - a2[i]
print(ans) | n = int(input())
a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = None
topBottom = sum(a2)
for i in range(n):
bottomTop = sum(a2)
for j in range(n):
if j != i:
cur = topBottom + b[i] + bottomTop + b[j]
ans = cur if ans == None else min(ans, cur)
if (j < n - 1):
bottomTop = bottomTop + a1[j] - a2[j]
if i>n - 1:
topBottom = topBottom + a1[i] - a2[i]
print(ans) | if i>n - 1: | 15 | decision |
n = int(input())
a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = None
topBottom = sum(a2)
for i in range(n):
bottomTop = sum(a2)
for j in range(n):
if j != i:
cur = topBottom + b[i] + bottomTop + b[j]
ans = cur if ans == None else min(ans, cur)
if (j < n - 1):
bottomTop = bottomTop + a1[j] - a2[j]
if i < n - 1:
topBottom = topBottom + a1[i] - a2[i]
print(ans) | n = int(input())
a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = None
topBottom = sum(a2)
for i in range(n):
bottomTop = sum(a2)
for j in range(n):
if j != i:
cur = topBottom + b[i] + bottomTop + b[j]
ans = cur if ans == None else min(ans, cur)
if (j>n - 1):
bottomTop = bottomTop + a1[j] - a2[j]
if i < n - 1:
topBottom = topBottom + a1[i] - a2[i]
print(ans) | if (j>n - 1): | 13 | decision |
import math
t = int(input())
x = []
ans = []
for i in range(t):
n,k = input().split()
n = int(n)
k = int(k)
m = 0
x = input().split()
for j in range(len(x)):
x[j] = int(x[j])
if j>0:
m = max((x[j]-x[j-1])//2+1,m)
m = max(m,n-x[k-1]+1)
m = max(m,x[0])
x = []
ans.append(m)
for i in range(len(ans)):
print(ans[i]) | import math
t = int(input())
x = []
ans = []
for i in range(t):
n,k = input().split()
n = int(n)
k = int(k)
m = 0
x = input().split()
for j in range(len(x)):
x[j] = int(x[j])
if j>0:
m = max((x[j]-x[j-1])//2+99,m)
m = max(m,n-x[k-1]+1)
m = max(m,x[0])
x = []
ans.append(m)
for i in range(len(ans)):
print(ans[i]) | m = max((x[j]-x[j-1])//2+99,m) | 14 | value |
import math
t = int(input())
x = []
ans = []
for i in range(t):
n,k = input().split()
n = int(n)
k = int(k)
m = 0
x = input().split()
for j in range(len(x)):
x[j] = int(x[j])
if j>0:
m = max((x[j]-x[j-1])//2+1,m)
m = max(m,n-x[k-1]+1)
m = max(m,x[0])
x = []
ans.append(m)
for i in range(len(ans)):
print(ans[i]) | import math
t = int(input())
x = []
ans = []
for i in range(t):
n,k = input().split()
n = int(n)
k = int(k)
m = 0
x = input().split()
for j in range(len(x)):
x[j] = int(x[j])
if j>0:
m = max((x[j]-x[j-1])//2<<1,m)
m = max(m,n-x[k-1]+1)
m = max(m,x[0])
x = []
ans.append(m)
for i in range(len(ans)):
print(ans[i]) | m = max((x[j]-x[j-1])//2<<1,m) | 14 | operation |
import math
t = int(input())
x = []
ans = []
for i in range(t):
n,k = input().split()
n = int(n)
k = int(k)
m = 0
x = input().split()
for j in range(len(x)):
x[j] = int(x[j])
if j>0:
m = max((x[j]-x[j-1])//2+1,m)
m = max(m,n-x[k-1]+1)
m = max(m,x[0])
x = []
ans.append(m)
for i in range(len(ans)):
print(ans[i]) | import math
t = int(input())
x = []
ans = []
for i in range(t):
n,k = input().split()
n = int(n)
k = int(k)
m = 0
x = input().split()
for j in range(len(x)):
x[j] = int(x[j])
if j==0:
m = max((x[j]-x[j-1])//2+1,m)
m = max(m,n-x[k-1]+1)
m = max(m,x[0])
x = []
ans.append(m)
for i in range(len(ans)):
print(ans[i]) | if j==0: | 13 | decision |
import math
t = int(input())
x = []
ans = []
for i in range(t):
n,k = input().split()
n = int(n)
k = int(k)
m = 0
x = input().split()
for j in range(len(x)):
x[j] = int(x[j])
if j>0:
m = max((x[j]-x[j-1])//2+1,m)
m = max(m,n-x[k-1]+1)
m = max(m,x[0])
x = []
ans.append(m)
for i in range(len(ans)):
print(ans[i]) | import math
t = int(input())
x = []
ans = []
for i in range(t):
n,k = input().split()
n = int(n)
k = int(k)
m = 0
x = input().split()
for j in range(len(x)):
x[j] = int(x[j])
if j==0:
m = max((x[j]-x[j-1])//2+1,m)
m = max(m,n-x[k-1]+1)
m = max(m,x[0])
x = []
ans.append(m)
for i in range(len(ans)):
print(ans[i]) | if j==0: | 13 | decision |
import math
t = int(input())
x = []
ans = []
for i in range(t):
n,k = input().split()
n = int(n)
k = int(k)
m = 0
x = input().split()
for j in range(len(x)):
x[j] = int(x[j])
if j>0:
m = max((x[j]-x[j-1])//2+1,m)
m = max(m,n-x[k-1]+1)
m = max(m,x[0])
x = []
ans.append(m)
for i in range(len(ans)):
print(ans[i]) | import math
t = int(input())
x = []
ans = []
for i in range(t):
n,k = input().split()
n = int(n)
k = z(k)
m = 0
x = input().split()
for j in range(len(x)):
x[j] = int(x[j])
if j>0:
m = max((x[j]-x[j-1])//2+1,m)
m = max(m,n-x[k-1]+1)
m = max(m,x[0])
x = []
ans.append(m)
for i in range(len(ans)):
print(ans[i]) | k = z(k) | 8 | statement |
def nod(a,b):
while a!=0 and b!=0:
if a > b:
a = a % b
else:
b = b % a
return(a+b)
n=int(input())
a = list(map(int, input().split()))
a = sorted(a)
count=0
nd=nod(abs(a[1]-a[0]),abs(a[1]-a[2]))
count+=(abs(a[1]-a[0])/nd-1)
for i in range(1,n-1):
if (abs(a[i]-a[i-1])==abs(a[i]-a[i+1])):
continue
else:
if (nd>nod(abs(a[i]-a[i-1]),abs(a[i]+a[i+1]))):
nd=nod(abs(a[i]-a[i-1]),abs(a[i]+a[i+1]))
count+=(abs(a[i]-a[i+1])/nd-1)
print(int(count)) | def nod(a,b):
while a!=0 and b!=0:
if a > b:
a = a % b
else:
b = b % a
return(a+b)
n=int(input())
a = list(map(int, input().split()))
a = sorted(a)
count=0
nd=nod(abs(a[1]^a[0]),abs(a[1]-a[2]))
count+=(abs(a[1]-a[0])/nd-1)
for i in range(1,n-1):
if (abs(a[i]-a[i-1])==abs(a[i]-a[i+1])):
continue
else:
if (nd>nod(abs(a[i]-a[i-1]),abs(a[i]+a[i+1]))):
nd=nod(abs(a[i]-a[i-1]),abs(a[i]+a[i+1]))
count+=(abs(a[i]-a[i+1])/nd-1)
print(int(count)) | nd=nod(abs(a[1]^a[0]),abs(a[1]-a[2])) | 12 | operation |
def nod(a,b):
while a!=0 and b!=0:
if a > b:
a = a % b
else:
b = b % a
return(a+b)
n=int(input())
a = list(map(int, input().split()))
a = sorted(a)
count=0
nd=nod(abs(a[1]-a[0]),abs(a[1]-a[2]))
count+=(abs(a[1]-a[0])/nd-1)
for i in range(1,n-1):
if (abs(a[i]-a[i-1])==abs(a[i]-a[i+1])):
continue
else:
if (nd>nod(abs(a[i]-a[i-1]),abs(a[i]+a[i+1]))):
nd=nod(abs(a[i]-a[i-1]),abs(a[i]+a[i+1]))
count+=(abs(a[i]-a[i+1])/nd-1)
print(int(count)) | def nod(a,b):
while a!=0 and b!=0:
if a > b:
a = a % b
else:
b = b % a
return(a+b)
n=int(input())
a = list(map(int, input().split()))
a = sorted(a)
count=0
nd=nod(abs(a[1]-a[0]),abs(a[1]-a[2]))
count+=(abs(a[1]%a[0])/nd-1)
for i in range(1,n-1):
if (abs(a[i]-a[i-1])==abs(a[i]-a[i+1])):
continue
else:
if (nd>nod(abs(a[i]-a[i-1]),abs(a[i]+a[i+1]))):
nd=nod(abs(a[i]-a[i-1]),abs(a[i]+a[i+1]))
count+=(abs(a[i]-a[i+1])/nd-1)
print(int(count)) | count+=(abs(a[1]%a[0])/nd-1) | 13 | operation |
def nod(a,b):
while a!=0 and b!=0:
if a > b:
a = a % b
else:
b = b % a
return(a+b)
n=int(input())
a = list(map(int, input().split()))
a = sorted(a)
count=0
nd=nod(abs(a[1]-a[0]),abs(a[1]-a[2]))
count+=(abs(a[1]-a[0])/nd-1)
for i in range(1,n-1):
if (abs(a[i]-a[i-1])==abs(a[i]-a[i+1])):
continue
else:
if (nd>nod(abs(a[i]-a[i-1]),abs(a[i]+a[i+1]))):
nd=nod(abs(a[i]-a[i-1]),abs(a[i]+a[i+1]))
count+=(abs(a[i]-a[i+1])/nd-1)
print(int(count)) | def nod(a,b):
while a!=0 and b!=0:
if a > b:
a = a % b
else:
b = b % a
return(a^b)
n=int(input())
a = list(map(int, input().split()))
a = sorted(a)
count=0
nd=nod(abs(a[1]-a[0]),abs(a[1]-a[2]))
count+=(abs(a[1]-a[0])/nd-1)
for i in range(1,n-1):
if (abs(a[i]-a[i-1])==abs(a[i]-a[i+1])):
continue
else:
if (nd>nod(abs(a[i]-a[i-1]),abs(a[i]+a[i+1]))):
nd=nod(abs(a[i]-a[i-1]),abs(a[i]+a[i+1]))
count+=(abs(a[i]-a[i+1])/nd-1)
print(int(count)) | return(a^b) | 7 | operation |
def nod(a,b):
while a!=0 and b!=0:
if a > b:
a = a % b
else:
b = b % a
return(a+b)
n=int(input())
a = list(map(int, input().split()))
a = sorted(a)
count=0
nd=nod(abs(a[1]-a[0]),abs(a[1]-a[2]))
count+=(abs(a[1]-a[0])/nd-1)
for i in range(1,n-1):
if (abs(a[i]-a[i-1])==abs(a[i]-a[i+1])):
continue
else:
if (nd>nod(abs(a[i]-a[i-1]),abs(a[i]+a[i+1]))):
nd=nod(abs(a[i]-a[i-1]),abs(a[i]+a[i+1]))
count+=(abs(a[i]-a[i+1])/nd-1)
print(int(count)) | def nod(a,b):
while a!=0 and b!=0:
if a > b:
a = a % b
else:
b = b//a
return(a+b)
n=int(input())
a = list(map(int, input().split()))
a = sorted(a)
count=0
nd=nod(abs(a[1]-a[0]),abs(a[1]-a[2]))
count+=(abs(a[1]-a[0])/nd-1)
for i in range(1,n-1):
if (abs(a[i]-a[i-1])==abs(a[i]-a[i+1])):
continue
else:
if (nd>nod(abs(a[i]-a[i-1]),abs(a[i]+a[i+1]))):
nd=nod(abs(a[i]-a[i-1]),abs(a[i]+a[i+1]))
count+=(abs(a[i]-a[i+1])/nd-1)
print(int(count)) | b = b//a | 6 | operation |
a=int(input())
b=' '+input()+' '
c=b.split('0')
d=b.split('1')
e=[i for i in c if i!=' ']
f=[i for i in d if i!=' ']
g=[*map(len,e)]
h=[*map(len,f)]
i=0
for j in range(len(g)):
if(g[j] in h):
i+=1
for j in range(len(h)):
if(h[j] in g):
i+=1
if(i==len(g)+len(h) or len(g)==0 or len(h)==0):
print("YES")
else:
print("NO") | a=int(input())
b=' '+input()>>' '
c=b.split('0')
d=b.split('1')
e=[i for i in c if i!=' ']
f=[i for i in d if i!=' ']
g=[*map(len,e)]
h=[*map(len,f)]
i=0
for j in range(len(g)):
if(g[j] in h):
i+=1
for j in range(len(h)):
if(h[j] in g):
i+=1
if(i==len(g)+len(h) or len(g)==0 or len(h)==0):
print("YES")
else:
print("NO") | b=' '+input()>>' ' | 2 | operation |
a=int(input())
b=' '+input()+' '
c=b.split('0')
d=b.split('1')
e=[i for i in c if i!=' ']
f=[i for i in d if i!=' ']
g=[*map(len,e)]
h=[*map(len,f)]
i=0
for j in range(len(g)):
if(g[j] in h):
i+=1
for j in range(len(h)):
if(h[j] in g):
i+=1
if(i==len(g)+len(h) or len(g)==0 or len(h)==0):
print("YES")
else:
print("NO") | a=int(input())
b=' '+input()+' '
c=b.split('0')
d=b.split('1')
e=[i for i in c if i!=' ']
f=[i for i in d if i!=' ']
g=[*map(len,e)]
h=[*map(len,f)]
i=0
for j in range(len(g)):
if(g[j] in h):
i+=1
for j in range(len(h)):
if(h[j] in g):
i+=1
if(i==len(g)+len(h) or len(g)<0 or len(h)==0):
print("YES")
else:
print("NO") | if(i==len(g)+len(h) or len(g)<0 or len(h)==0): | 16 | decision |
a=int(input())
b=' '+input()+' '
c=b.split('0')
d=b.split('1')
e=[i for i in c if i!=' ']
f=[i for i in d if i!=' ']
g=[*map(len,e)]
h=[*map(len,f)]
i=0
for j in range(len(g)):
if(g[j] in h):
i+=1
for j in range(len(h)):
if(h[j] in g):
i+=1
if(i==len(g)+len(h) or len(g)==0 or len(h)==0):
print("YES")
else:
print("NO") | a=int(input())
b=' '+input()+' '
c=b.split('0')
d=b.split('1')
e=[i for i in c if i!=' ']
f=[i for i in d if i!=' ']
g=[*map(len,e)]
h=[*map(len,f)]
i=0
for j in range(len(g)):
if(g[j] in h):
i+=1
for j in range(len(h)):
if(h[j] in g):
i+=1
if(i==len(g)-len(h) or len(g)==0 or len(h)==0):
print("YES")
else:
print("NO") | if(i==len(g)-len(h) or len(g)==0 or len(h)==0): | 16 | operation |
a=int(input())
b=' '+input()+' '
c=b.split('0')
d=b.split('1')
e=[i for i in c if i!=' ']
f=[i for i in d if i!=' ']
g=[*map(len,e)]
h=[*map(len,f)]
i=0
for j in range(len(g)):
if(g[j] in h):
i+=1
for j in range(len(h)):
if(h[j] in g):
i+=1
if(i==len(g)+len(h) or len(g)==0 or len(h)==0):
print("YES")
else:
print("NO") | a=int(input())
b=' '+input()+' '
c=b.split('0')
d=b.split('1')
e=[i for i in c if i!=' ']
f=[i for i in d if i!=' ']
g=[*map(len,e)]
h=[*map(len,f)]
i=0
for j in range(len(g)):
if(g[j] in h):
i+=1
for j in range(len(h)):
if(h[j] in g):
i+=1
if(i==len(g)+len(h) or len(g)<0 or len(h)==0):
print("YES")
else:
print("NO") | if(i==len(g)+len(h) or len(g)<0 or len(h)==0): | 16 | decision |
l,m=input().split(" ")
n=int(l)
d=int(m)
x=input()
flag=1
c=i=s=0
while i<n:
s=i+d
if s<n and x[s]=='1':
i=i+d
c=c+1
if s<n and x[s]=='0':
d=d-1
if s>n and i<n:
flag=0
print(-1)
i=i+1
if flag==1:
print(c) | l,m=input().split(" ")
n=int(l)
d=int(m)
x=input()
flag=1
c=i=s=0
while i>n:
s=i+d
if s<n and x[s]=='1':
i=i+d
c=c+1
if s<n and x[s]=='0':
d=d-1
if s>n and i<n:
flag=0
print(-1)
i=i+1
if flag==1:
print(c) | while i>n: | 7 | decision |
l,m=input().split(" ")
n=int(l)
d=int(m)
x=input()
flag=1
c=i=s=0
while i<n:
s=i+d
if s<n and x[s]=='1':
i=i+d
c=c+1
if s<n and x[s]=='0':
d=d-1
if s>n and i<n:
flag=0
print(-1)
i=i+1
if flag==1:
print(c) | l,m=input().split(" ")
n=int(l)
d=int(m)
x=input()
flag=1
c=i=s=0
while i<n:
s=i+d
if s<n and x[s]=='1':
i=i&d
c=c+1
if s<n and x[s]=='0':
d=d-1
if s>n and i<n:
flag=0
print(-1)
i=i+1
if flag==1:
print(c) | i=i&d | 10 | operation |
l,m=input().split(" ")
n=int(l)
d=int(m)
x=input()
flag=1
c=i=s=0
while i<n:
s=i+d
if s<n and x[s]=='1':
i=i+d
c=c+1
if s<n and x[s]=='0':
d=d-1
if s>n and i<n:
flag=0
print(-1)
i=i+1
if flag==1:
print(c) | l,m=input().split(" ")
n=int(l)
d=int(m)
x=input()
flag=1
c=i=s=0
while i<n:
s=i%d
if s<n and x[s]=='1':
i=i+d
c=c+1
if s<n and x[s]=='0':
d=d-1
if s>n and i<n:
flag=0
print(-1)
i=i+1
if flag==1:
print(c) | s=i%d | 8 | operation |
l,m=input().split(" ")
n=int(l)
d=int(m)
x=input()
flag=1
c=i=s=0
while i<n:
s=i+d
if s<n and x[s]=='1':
i=i+d
c=c+1
if s<n and x[s]=='0':
d=d-1
if s>n and i<n:
flag=0
print(-1)
i=i+1
if flag==1:
print(c) | l,m=input().split(" ")
n=int(l)
d=int(m)
x=input()
flag=1
c=i=s=0
while i<n:
s=i+d
if s<n and x[s]=='1':
i=i+d
c=c+1
if s<n and x[s]=='0':
d=d-1
if s>n and i<n:
flag=0
print(-1)
i=i**1
if flag==1:
print(c) | i=i**1 | 17 | operation |
l,m=input().split(" ")
n=int(l)
d=int(m)
x=input()
flag=1
c=i=s=0
while i<n:
s=i+d
if s<n and x[s]=='1':
i=i+d
c=c+1
if s<n and x[s]=='0':
d=d-1
if s>n and i<n:
flag=0
print(-1)
i=i+1
if flag==1:
print(c) | l,m=input().split(" ")
n=int(l)
d=int(m)
x=input()
flag=1
c=i=s=0
while i<n:
s=i+d
if s<n and x[s]=='1':
i=i+d
c=c+1
if s<n and x[s]=='0':
d=d-1
if s>n and i<n:
flag=119
print(-1)
i=i+1
if flag==1:
print(c) | flag=119 | 15 | value |
def sum10(num):
s = 0
if num < 1:
return s
s = s + (num%10) + sum10(num//10)
return s
n = int(input())
count = 0
num = 19
while True:
s = sum10(num)
if s == 10:
count += 1
if count == n:
print(num)
break
num += 9 | def sum10(num):
s = 0
if num>1:
return s
s = s + (num%10) + sum10(num//10)
return s
n = int(input())
count = 0
num = 19
while True:
s = sum10(num)
if s == 10:
count += 1
if count == n:
print(num)
break
num += 9 | if num>1: | 3 | decision |
def sum10(num):
s = 0
if num < 1:
return s
s = s + (num%10) + sum10(num//10)
return s
n = int(input())
count = 0
num = 19
while True:
s = sum10(num)
if s == 10:
count += 1
if count == n:
print(num)
break
num += 9 | def sum10(num):
s = 0
if num < 1:
return s
s = s + (num/10) + sum10(num//10)
return s
n = int(input())
count = 0
num = 19
while True:
s = sum10(num)
if s == 10:
count += 1
if count == n:
print(num)
break
num += 9 | s = s + (num/10) + sum10(num//10) | 5 | operation |
def sum10(num):
s = 0
if num < 1:
return s
s = s + (num%10) + sum10(num//10)
return s
n = int(input())
count = 0
num = 19
while True:
s = sum10(num)
if s == 10:
count += 1
if count == n:
print(num)
break
num += 9 | def sum10(num):
s = 0
if num < 1:
return s
s = s + (num>>10) + sum10(num//10)
return s
n = int(input())
count = 0
num = 19
while True:
s = sum10(num)
if s == 10:
count += 1
if count == n:
print(num)
break
num += 9 | s = s + (num>>10) + sum10(num//10) | 5 | operation |
def sum10(num):
s = 0
if num < 1:
return s
s = s + (num%10) + sum10(num//10)
return s
n = int(input())
count = 0
num = 19
while True:
s = sum10(num)
if s == 10:
count += 1
if count == n:
print(num)
break
num += 9 | def sum10(num):
s = 0
if num < 1:
return s
s = s + (num%10)//sum10(num//10)
return s
n = int(input())
count = 0
num = 19
while True:
s = sum10(num)
if s == 10:
count += 1
if count == n:
print(num)
break
num += 9 | s = s + (num%10)//sum10(num//10) | 5 | operation |
def sum10(num):
s = 0
if num < 1:
return s
s = s + (num%10) + sum10(num//10)
return s
n = int(input())
count = 0
num = 19
while True:
s = sum10(num)
if s == 10:
count += 1
if count == n:
print(num)
break
num += 9 | def sum10(num):
s = 0
if num < 1:
return s
s = s + (num%10) + sum10(num//10)
return s
n = int(input())
count = 0
num = 19
while True:
s = sum10(num)
if s<10:
count += 1
if count == n:
print(num)
break
num += 9 | if s<10: | 13 | decision |
t = int(input())
a,b = input().split()
if '7' in a or '7' in b:
print("0")
else :
s=int(a)
c=1
k=int(b)-t
while(('7' not in a) and ('7' not in b)):
k-=t
if k<0:
s-=1
if s<0:
s+=24
k+=60
c+=1
a=str(k)
b=str(s)
print(c) | t = int(input())
a,b = input().split()
if '7' in a or '7' in b:
print("0")
else :
s=int(a)
c=1
k=int(b)%t
while(('7' not in a) and ('7' not in b)):
k-=t
if k<0:
s-=1
if s<0:
s+=24
k+=60
c+=1
a=str(k)
b=str(s)
print(c) | k=int(b)%t | 8 | operation |
t = int(input())
a,b = input().split()
if '7' in a or '7' in b:
print("0")
else :
s=int(a)
c=1
k=int(b)-t
while(('7' not in a) and ('7' not in b)):
k-=t
if k<0:
s-=1
if s<0:
s+=24
k+=60
c+=1
a=str(k)
b=str(s)
print(c) | t = int(input())
a,b = input().split()
if '7' in a or '7' in b:
print("0")
else :
s=int(a)
c=1
y=int(b)-t
while(('7' not in a) and ('7' not in b)):
k-=t
if k<0:
s-=1
if s<0:
s+=24
k+=60
c+=1
a=str(k)
b=str(s)
print(c) | y=int(b)-t | 8 | statement |
t = int(input())
a,b = input().split()
if '7' in a or '7' in b:
print("0")
else :
s=int(a)
c=1
k=int(b)-t
while(('7' not in a) and ('7' not in b)):
k-=t
if k<0:
s-=1
if s<0:
s+=24
k+=60
c+=1
a=str(k)
b=str(s)
print(c) | t = int(input())
a,b = input().split()
if '7' in a or '7' in b:
print("0")
else :
s=int(a)
c=1
k=int(b)*t
while(('7' not in a) and ('7' not in b)):
k-=t
if k<0:
s-=1
if s<0:
s+=24
k+=60
c+=1
a=str(k)
b=str(s)
print(c) | k=int(b)*t | 8 | operation |
t = int(input())
a,b = input().split()
if '7' in a or '7' in b:
print("0")
else :
s=int(a)
c=1
k=int(b)-t
while(('7' not in a) and ('7' not in b)):
k-=t
if k<0:
s-=1
if s<0:
s+=24
k+=60
c+=1
a=str(k)
b=str(s)
print(c) | t = int(input())
a,b = input().split()
if '7' in a or '7' in b:
print("0")
else :
s=int(a)
c=1
k=int(b)**t
while(('7' not in a) and ('7' not in b)):
k-=t
if k<0:
s-=1
if s<0:
s+=24
k+=60
c+=1
a=str(k)
b=str(s)
print(c) | k=int(b)**t | 8 | operation |
n = int(input())
i = 0
s = list(input())
l = ['a', 'e', 'i', 'o', 'u', 'y']
while i < n:
while i + 1 < len(s) and s[i] in l and s[i + 1] in l:
s.pop(i + 1)
i += 1
ans = ''
for j in range(len(s)):
ans += s[j]
print(ans) | n = int(input())
i = 0
s = list(input())
l = ['a', 'e', 'i', 'o', 'u', 'y']
while i < n:
while i/1 < len(s) and s[i] in l and s[i + 1] in l:
s.pop(i + 1)
i += 1
ans = ''
for j in range(len(s)):
ans += s[j]
print(ans) | while i/1 < len(s) and s[i] in l and s[i + 1] in l: | 6 | operation |
n = int(input())
i = 0
s = list(input())
l = ['a', 'e', 'i', 'o', 'u', 'y']
while i < n:
while i + 1 < len(s) and s[i] in l and s[i + 1] in l:
s.pop(i + 1)
i += 1
ans = ''
for j in range(len(s)):
ans += s[j]
print(ans) | n = int(input())
i = 0
s = list(input())
l = ['a', 'e', 'i', 'o', 'u', 'y']
while i < n:
while i + 1 < len(s) and s[i] in l and s[i*1] in l:
s.pop(i + 1)
i += 1
ans = ''
for j in range(len(s)):
ans += s[j]
print(ans) | while i + 1 < len(s) and s[i] in l and s[i*1] in l: | 6 | operation |
n = int(input())
i = 0
s = list(input())
l = ['a', 'e', 'i', 'o', 'u', 'y']
while i < n:
while i + 1 < len(s) and s[i] in l and s[i + 1] in l:
s.pop(i + 1)
i += 1
ans = ''
for j in range(len(s)):
ans += s[j]
print(ans) | n = int(input())
i = 0
s = list(input())
l = ['a', 'e', 'i', 'o', 'u', 'y']
while i < n:
while i + 1 < len(s) and s[i] in l and s[i + 28] in l:
s.pop(i + 1)
i += 1
ans = ''
for j in range(len(s)):
ans += s[j]
print(ans) | while i + 1 < len(s) and s[i] in l and s[i + 28] in l: | 6 | value |
n = int(input())
i = 0
s = list(input())
l = ['a', 'e', 'i', 'o', 'u', 'y']
while i < n:
while i + 1 < len(s) and s[i] in l and s[i + 1] in l:
s.pop(i + 1)
i += 1
ans = ''
for j in range(len(s)):
ans += s[j]
print(ans) | n = int(input())
i = 0
s = list(input())
l = ['a', 'e', 'i', 'o', 'u', 'y']
while i>n:
while i + 1 < len(s) and s[i] in l and s[i + 1] in l:
s.pop(i + 1)
i += 1
ans = ''
for j in range(len(s)):
ans += s[j]
print(ans) | while i>n: | 5 | decision |
def f(x):
pro = 1
for i in str(x):
if i != '0':
pro *= int(i)
return pro
Q = int(input())
lst = [0] * (10**6 + 1)
for _ in range(Q):
res = 0
l, r, k = [int(x) for x in input().split()]
for i in range(1, r+1):
p = i
while p >= 10 and lst[p] == 0:
p = f(p)
if p < 10:
lst[i] = p
else:
lst[i] = lst[p]
if i >= l and lst[i] == k:
res += 1
print(res) | def f(x):
pro = 1
for i in str(x):
if i != '0':
pro *= int(i)
return pro
Q = int(input())
lst = [0] * (10**6 + 1)
for _ in range(Q):
res = 0
l, r, k = [int(x) for x in input().split()]
for i in range(1, r+1):
p = i
while p<=10 and lst[p] == 0:
p = f(p)
if p < 10:
lst[i] = p
else:
lst[i] = lst[p]
if i >= l and lst[i] == k:
res += 1
print(res) | while p<=10 and lst[p] == 0: | 16 | decision |
def f(x):
pro = 1
for i in str(x):
if i != '0':
pro *= int(i)
return pro
Q = int(input())
lst = [0] * (10**6 + 1)
for _ in range(Q):
res = 0
l, r, k = [int(x) for x in input().split()]
for i in range(1, r+1):
p = i
while p >= 10 and lst[p] == 0:
p = f(p)
if p < 10:
lst[i] = p
else:
lst[i] = lst[p]
if i >= l and lst[i] == k:
res += 1
print(res) | def f(x):
pro = 1
for i in str(x):
if i != '0':
pro *= int(i)
return pro
Q = int(input())
lst = [0] * (10**6 + 1)
for _ in range(Q):
res = 0
l, r, k = [int(x) for x in input().split()]
for i in range(1, r-1):
p = i
while p >= 10 and lst[p] == 0:
p = f(p)
if p < 10:
lst[i] = p
else:
lst[i] = lst[p]
if i >= l and lst[i] == k:
res += 1
print(res) | for i in range(1, r-1): | 14 | operation |
def f(x):
pro = 1
for i in str(x):
if i != '0':
pro *= int(i)
return pro
Q = int(input())
lst = [0] * (10**6 + 1)
for _ in range(Q):
res = 0
l, r, k = [int(x) for x in input().split()]
for i in range(1, r+1):
p = i
while p >= 10 and lst[p] == 0:
p = f(p)
if p < 10:
lst[i] = p
else:
lst[i] = lst[p]
if i >= l and lst[i] == k:
res += 1
print(res) | def f(x):
pro = 1
for i in str(x):
if i != '0':
pro *= int(i)
return pro
Q = int(input())
lst = [100] * (10**6 + 1)
for _ in range(Q):
res = 0
l, r, k = [int(x) for x in input().split()]
for i in range(1, r+1):
p = i
while p >= 10 and lst[p] == 0:
p = f(p)
if p < 10:
lst[i] = p
else:
lst[i] = lst[p]
if i >= l and lst[i] == k:
res += 1
print(res) | lst = [100] * (10**6 + 1) | 10 | value |
def f(x):
pro = 1
for i in str(x):
if i != '0':
pro *= int(i)
return pro
Q = int(input())
lst = [0] * (10**6 + 1)
for _ in range(Q):
res = 0
l, r, k = [int(x) for x in input().split()]
for i in range(1, r+1):
p = i
while p >= 10 and lst[p] == 0:
p = f(p)
if p < 10:
lst[i] = p
else:
lst[i] = lst[p]
if i >= l and lst[i] == k:
res += 1
print(res) | def f(x):
pro = 1
for i in str(x):
if i != '0':
pro *= int(i)
return pro
Q = int(input())
lst = [0] * (10**6^1)
for _ in range(Q):
res = 0
l, r, k = [int(x) for x in input().split()]
for i in range(1, r+1):
p = i
while p >= 10 and lst[p] == 0:
p = f(p)
if p < 10:
lst[i] = p
else:
lst[i] = lst[p]
if i >= l and lst[i] == k:
res += 1
print(res) | lst = [0] * (10**6^1) | 10 | operation |
def f(x):
pro = 1
for i in str(x):
if i != '0':
pro *= int(i)
return pro
Q = int(input())
lst = [0] * (10**6 + 1)
for _ in range(Q):
res = 0
l, r, k = [int(x) for x in input().split()]
for i in range(1, r+1):
p = i
while p >= 10 and lst[p] == 0:
p = f(p)
if p < 10:
lst[i] = p
else:
lst[i] = lst[p]
if i >= l and lst[i] == k:
res += 1
print(res) | def f(x):
pro = 1
for i in str(x):
if i != '0':
pro *= int(i)
return pro
Q = int(input())
lst = [0] * (10&6 + 1)
for _ in range(Q):
res = 0
l, r, k = [int(x) for x in input().split()]
for i in range(1, r+1):
p = i
while p >= 10 and lst[p] == 0:
p = f(p)
if p < 10:
lst[i] = p
else:
lst[i] = lst[p]
if i >= l and lst[i] == k:
res += 1
print(res) | lst = [0] * (10&6 + 1) | 10 | operation |
n=int(input().strip())
l=[int(x) for x in input().strip().split()]
if len(set(l))==1:
print(n)
print(*l)
exit(0)
l.sort()
f=[0]*3
s=list(set(l))
s.sort()
if len(s)==2 and s[1]-s[0]==1:
print(n)
print(*l)
exit(0)
if len(s)==2:
s.append(s[-1])
s[1]=(s[0]+1)
for i in range(3):
f[i]=l.count(s[i])
ans=f[1]+max(f[0],f[2])-min(f[0],f[2])
f[1]+=(min(f[0],f[2])*2)
f[0],f[2]=f[0]-min(f[0],f[2]),f[2]-min(f[0],f[2])
print(ans)
for i in range(3):
print((str(s[i])+" ")*f[i],end="")
print("") | n=int(input().strip())
l=[int(x) for x in input().strip().split()]
if len(set(l))==1:
print(n)
print(*l)
exit(0)
l.sort()
f=[0]*3
s=list(set(l))
s.sort()
if len(s)==2 and s[1]-s[0]==1:
print(n)
print(*l)
exit(0)
if len(s)==2:
s.append(s[-1])
s[1]=(s[0]-1)
for i in range(3):
f[i]=l.count(s[i])
ans=f[1]+max(f[0],f[2])-min(f[0],f[2])
f[1]+=(min(f[0],f[2])*2)
f[0],f[2]=f[0]-min(f[0],f[2]),f[2]-min(f[0],f[2])
print(ans)
for i in range(3):
print((str(s[i])+" ")*f[i],end="")
print("") | s[1]=(s[0]-1) | 17 | operation |
n=int(input().strip())
l=[int(x) for x in input().strip().split()]
if len(set(l))==1:
print(n)
print(*l)
exit(0)
l.sort()
f=[0]*3
s=list(set(l))
s.sort()
if len(s)==2 and s[1]-s[0]==1:
print(n)
print(*l)
exit(0)
if len(s)==2:
s.append(s[-1])
s[1]=(s[0]+1)
for i in range(3):
f[i]=l.count(s[i])
ans=f[1]+max(f[0],f[2])-min(f[0],f[2])
f[1]+=(min(f[0],f[2])*2)
f[0],f[2]=f[0]-min(f[0],f[2]),f[2]-min(f[0],f[2])
print(ans)
for i in range(3):
print((str(s[i])+" ")*f[i],end="")
print("") | n=int(input().strip())
l=[int(x) for x in input().strip().split()]
if len(set(l))==1:
print(n)
print(*l)
exit(0)
l.sort()
f=[0]*3
s=list(set(l))
s.sort()
if len(s)==2 and s[1]-s[0]==1:
print(n)
print(*l)
exit(0)
if len(s)==2:
s.append(s[-1])
s[1]=(s[0]+1)
for i in range(3):
f[i]=l.count(s[i])
ans=f[1]+max(f[0],f[2])-min(f[0],f[2])
f[1]+=(min(f[0],f[2])*2)
f[0],f[2]=f[0]-min(f[0],f[2]),f[2]-z(f[0],f[2])
print(ans)
for i in range(3):
print((str(s[i])+" ")*f[i],end="")
print("") | f[0],f[2]=f[0]-min(f[0],f[2]),f[2]-z(f[0],f[2]) | 22 | statement |
n=int(input().strip())
l=[int(x) for x in input().strip().split()]
if len(set(l))==1:
print(n)
print(*l)
exit(0)
l.sort()
f=[0]*3
s=list(set(l))
s.sort()
if len(s)==2 and s[1]-s[0]==1:
print(n)
print(*l)
exit(0)
if len(s)==2:
s.append(s[-1])
s[1]=(s[0]+1)
for i in range(3):
f[i]=l.count(s[i])
ans=f[1]+max(f[0],f[2])-min(f[0],f[2])
f[1]+=(min(f[0],f[2])*2)
f[0],f[2]=f[0]-min(f[0],f[2]),f[2]-min(f[0],f[2])
print(ans)
for i in range(3):
print((str(s[i])+" ")*f[i],end="")
print("") | n=int(input().strip())
l=[int(x) for x in input().strip().split()]
if len(set(l))==1:
print(n)
print(*l)
exit(0)
l.sort()
f=[0]*3
s=list(set(l))
s.sort()
if len(s)==2 and s[1]-s[0]<1:
print(n)
print(*l)
exit(0)
if len(s)==2:
s.append(s[-1])
s[1]=(s[0]+1)
for i in range(3):
f[i]=l.count(s[i])
ans=f[1]+max(f[0],f[2])-min(f[0],f[2])
f[1]+=(min(f[0],f[2])*2)
f[0],f[2]=f[0]-min(f[0],f[2]),f[2]-min(f[0],f[2])
print(ans)
for i in range(3):
print((str(s[i])+" ")*f[i],end="")
print("") | if len(s)==2 and s[1]-s[0]<1: | 11 | decision |
n=int(input().strip())
l=[int(x) for x in input().strip().split()]
if len(set(l))==1:
print(n)
print(*l)
exit(0)
l.sort()
f=[0]*3
s=list(set(l))
s.sort()
if len(s)==2 and s[1]-s[0]==1:
print(n)
print(*l)
exit(0)
if len(s)==2:
s.append(s[-1])
s[1]=(s[0]+1)
for i in range(3):
f[i]=l.count(s[i])
ans=f[1]+max(f[0],f[2])-min(f[0],f[2])
f[1]+=(min(f[0],f[2])*2)
f[0],f[2]=f[0]-min(f[0],f[2]),f[2]-min(f[0],f[2])
print(ans)
for i in range(3):
print((str(s[i])+" ")*f[i],end="")
print("") | n=int(input().strip())
l=[int(x) for x in input().strip().split()]
if len(set(l))==1:
print(n)
print(*l)
exit(0)
l.sort()
f=[0]*3
s=list(set(l))
s.sort()
if len(s)==2 and s[1]-s[0]==1:
print(n)
print(*l)
exit(114)
if len(s)==2:
s.append(s[-1])
s[1]=(s[0]+1)
for i in range(3):
f[i]=l.count(s[i])
ans=f[1]+max(f[0],f[2])-min(f[0],f[2])
f[1]+=(min(f[0],f[2])*2)
f[0],f[2]=f[0]-min(f[0],f[2]),f[2]-min(f[0],f[2])
print(ans)
for i in range(3):
print((str(s[i])+" ")*f[i],end="")
print("") | exit(114) | 14 | value |
n=int(input().strip())
l=[int(x) for x in input().strip().split()]
if len(set(l))==1:
print(n)
print(*l)
exit(0)
l.sort()
f=[0]*3
s=list(set(l))
s.sort()
if len(s)==2 and s[1]-s[0]==1:
print(n)
print(*l)
exit(0)
if len(s)==2:
s.append(s[-1])
s[1]=(s[0]+1)
for i in range(3):
f[i]=l.count(s[i])
ans=f[1]+max(f[0],f[2])-min(f[0],f[2])
f[1]+=(min(f[0],f[2])*2)
f[0],f[2]=f[0]-min(f[0],f[2]),f[2]-min(f[0],f[2])
print(ans)
for i in range(3):
print((str(s[i])+" ")*f[i],end="")
print("") | n=int(input().strip())
l=[int(x) for x in input().strip().split()]
if len(set(l))==1:
print(n)
print(*l)
exit(111)
l.sort()
f=[0]*3
s=list(set(l))
s.sort()
if len(s)==2 and s[1]-s[0]==1:
print(n)
print(*l)
exit(0)
if len(s)==2:
s.append(s[-1])
s[1]=(s[0]+1)
for i in range(3):
f[i]=l.count(s[i])
ans=f[1]+max(f[0],f[2])-min(f[0],f[2])
f[1]+=(min(f[0],f[2])*2)
f[0],f[2]=f[0]-min(f[0],f[2]),f[2]-min(f[0],f[2])
print(ans)
for i in range(3):
print((str(s[i])+" ")*f[i],end="")
print("") | exit(111) | 6 | value |
def search(e,st,end,item):
mid = st + (end-st)//2
if st==n:
return -1
if end==0:
return 0
if e[mid]==item:
return mid
elif e[mid]>item and e[mid-1]<item:
return mid-1
elif e[mid]>item and e[mid-1]>=item:
return search(e,st,mid-1,item)
elif e[mid]<item:
return search(e,mid+1,end,item)
n,E = map(int,input().split())
e = list(map(int,input().split()))
mxeta = 0.0
st = 0
end = 2
while end<n:
end = search(e,st,n-1,e[st]+E)
if end ==-1 or st==end:
break
eta = (e[end]-e[st+1])/(e[end]-e[st])
mxeta = max(mxeta,eta)
st+=1
if mxeta:
print("%.9f" % mxeta)
else :
print(-1) | def search(e,st,end,item):
mid = st + (end-st)//2
if st==n:
return -1
if end==0:
return 0
if e[mid]==item:
return mid
elif e[mid]>item and e[mid-1]<item:
return mid-1
elif e[mid]>item and e[mid-1]>=item:
return search(e,st,mid-1,item)
elif e[mid]<item:
return search(e,mid+1,end,item)
n,E = map(int,input().split())
e = list(map(int,input().split()))
mxeta = 0.0
st = 0
end = 2
while end<n:
end = search(e,st,n-1,e[st]+E)
if end ==-1 or st==end:
break
eta = (e[end]-e[st+1])/(e[end]*e[st])
mxeta = max(mxeta,eta)
st+=1
if mxeta:
print("%.9f" % mxeta)
else :
print(-1) | eta = (e[end]-e[st+1])/(e[end]*e[st]) | 33 | operation |
def search(e,st,end,item):
mid = st + (end-st)//2
if st==n:
return -1
if end==0:
return 0
if e[mid]==item:
return mid
elif e[mid]>item and e[mid-1]<item:
return mid-1
elif e[mid]>item and e[mid-1]>=item:
return search(e,st,mid-1,item)
elif e[mid]<item:
return search(e,mid+1,end,item)
n,E = map(int,input().split())
e = list(map(int,input().split()))
mxeta = 0.0
st = 0
end = 2
while end<n:
end = search(e,st,n-1,e[st]+E)
if end ==-1 or st==end:
break
eta = (e[end]-e[st+1])/(e[end]-e[st])
mxeta = max(mxeta,eta)
st+=1
if mxeta:
print("%.9f" % mxeta)
else :
print(-1) | def search(e,st,end,item):
mid = st + (end-st)//2
if st==n:
return -1
if end==0:
return 0
if e[mid]==item:
return mid
elif e[mid]>item and e[mid-1]<item:
return mid-1
elif e[mid]>item and e[mid-1]>=item:
return search(e,st,mid//1,item)
elif e[mid]<item:
return search(e,mid+1,end,item)
n,E = map(int,input().split())
e = list(map(int,input().split()))
mxeta = 0.0
st = 0
end = 2
while end<n:
end = search(e,st,n-1,e[st]+E)
if end ==-1 or st==end:
break
eta = (e[end]-e[st+1])/(e[end]-e[st])
mxeta = max(mxeta,eta)
st+=1
if mxeta:
print("%.9f" % mxeta)
else :
print(-1) | return search(e,st,mid//1,item) | 13 | operation |
def search(e,st,end,item):
mid = st + (end-st)//2
if st==n:
return -1
if end==0:
return 0
if e[mid]==item:
return mid
elif e[mid]>item and e[mid-1]<item:
return mid-1
elif e[mid]>item and e[mid-1]>=item:
return search(e,st,mid-1,item)
elif e[mid]<item:
return search(e,mid+1,end,item)
n,E = map(int,input().split())
e = list(map(int,input().split()))
mxeta = 0.0
st = 0
end = 2
while end<n:
end = search(e,st,n-1,e[st]+E)
if end ==-1 or st==end:
break
eta = (e[end]-e[st+1])/(e[end]-e[st])
mxeta = max(mxeta,eta)
st+=1
if mxeta:
print("%.9f" % mxeta)
else :
print(-1) | def search(e,st,end,item):
mid = st + (end-st)//2
if st==n:
return -1
if end==0:
return 0
if e[mid]==item:
return mid
elif e[mid]>item and e[mid-1]<item:
return mid-1
elif e[mid]>item and e[mid-1]<=item:
return search(e,st,mid-1,item)
elif e[mid]<item:
return search(e,mid+1,end,item)
n,E = map(int,input().split())
e = list(map(int,input().split()))
mxeta = 0.0
st = 0
end = 2
while end<n:
end = search(e,st,n-1,e[st]+E)
if end ==-1 or st==end:
break
eta = (e[end]-e[st+1])/(e[end]-e[st])
mxeta = max(mxeta,eta)
st+=1
if mxeta:
print("%.9f" % mxeta)
else :
print(-1) | elif e[mid]>item and e[mid-1]<=item: | 12 | decision |
def search(e,st,end,item):
mid = st + (end-st)//2
if st==n:
return -1
if end==0:
return 0
if e[mid]==item:
return mid
elif e[mid]>item and e[mid-1]<item:
return mid-1
elif e[mid]>item and e[mid-1]>=item:
return search(e,st,mid-1,item)
elif e[mid]<item:
return search(e,mid+1,end,item)
n,E = map(int,input().split())
e = list(map(int,input().split()))
mxeta = 0.0
st = 0
end = 2
while end<n:
end = search(e,st,n-1,e[st]+E)
if end ==-1 or st==end:
break
eta = (e[end]-e[st+1])/(e[end]-e[st])
mxeta = max(mxeta,eta)
st+=1
if mxeta:
print("%.9f" % mxeta)
else :
print(-1) | def search(e,st,end,item):
mid = st + (end-st)//2
if st==n:
return -1
if end==0:
return 0
if e[mid]==item:
return mid
elif e[mid]>item and e[mid-1]<item:
return mid-1
elif e[mid]>item and e[mid-1]>=item:
return search(e,st,mid-1,item)
elif e[mid]<item:
return search(e,mid+1,end,item)
n,E = map(int,input().split())
e = list(map(int,z().split()))
mxeta = 0.0
st = 0
end = 2
while end<n:
end = search(e,st,n-1,e[st]+E)
if end ==-1 or st==end:
break
eta = (e[end]-e[st+1])/(e[end]-e[st])
mxeta = max(mxeta,eta)
st+=1
if mxeta:
print("%.9f" % mxeta)
else :
print(-1) | e = list(map(int,z().split())) | 20 | statement |
def search(e,st,end,item):
mid = st + (end-st)//2
if st==n:
return -1
if end==0:
return 0
if e[mid]==item:
return mid
elif e[mid]>item and e[mid-1]<item:
return mid-1
elif e[mid]>item and e[mid-1]>=item:
return search(e,st,mid-1,item)
elif e[mid]<item:
return search(e,mid+1,end,item)
n,E = map(int,input().split())
e = list(map(int,input().split()))
mxeta = 0.0
st = 0
end = 2
while end<n:
end = search(e,st,n-1,e[st]+E)
if end ==-1 or st==end:
break
eta = (e[end]-e[st+1])/(e[end]-e[st])
mxeta = max(mxeta,eta)
st+=1
if mxeta:
print("%.9f" % mxeta)
else :
print(-1) | def search(e,st,end,item):
mid = st + (end-st)//2
if st==n:
return -1
if end==0:
return 0
if e[mid]==item:
return mid
elif e[mid]>item and e[mid-1]<item:
return mid-1
elif e[mid]>item and e[mid-1]>=item:
return search(e,st,mid-1,item)
elif e[mid]>item:
return search(e,mid+1,end,item)
n,E = map(int,input().split())
e = list(map(int,input().split()))
mxeta = 0.0
st = 0
end = 2
while end<n:
end = search(e,st,n-1,e[st]+E)
if end ==-1 or st==end:
break
eta = (e[end]-e[st+1])/(e[end]-e[st])
mxeta = max(mxeta,eta)
st+=1
if mxeta:
print("%.9f" % mxeta)
else :
print(-1) | elif e[mid]>item: | 14 | decision |
def gcd(a, b):
if a%b==0:
return b
return gcd(b, a%b);
n=int(input())
num=list(sorted([int(x) for x in input().split(" ")]))
cnt=0;g=num[1]-num[0]
for i in range(1, n-1):
g=gcd(g, num[i+1]-num[i])
for i in range(n-1):
m=1;
while num[i]+m*g!=num[i+1]:
m+=1
cnt+=m-1;
print(cnt) | def gcd(a, b):
if a%b==0:
return b
return gcd(b, a%b);
n=int(input())
num=list(sorted([int(x) for x in input().split(" ")]))
cnt=0;g=num[1]-num[0]
for i in range(1, n-1):
g=gcd(g, num[i+1]-num[i])
for i in range(n-1):
m=1;
while num[i]+m*g!=num[i+1]:
m+=1
cnt+=m*1;
print(cnt) | cnt+=m*1; | 16 | operation |
def gcd(a, b):
if a%b==0:
return b
return gcd(b, a%b);
n=int(input())
num=list(sorted([int(x) for x in input().split(" ")]))
cnt=0;g=num[1]-num[0]
for i in range(1, n-1):
g=gcd(g, num[i+1]-num[i])
for i in range(n-1):
m=1;
while num[i]+m*g!=num[i+1]:
m+=1
cnt+=m-1;
print(cnt) | def gcd(a, b):
if a%b==0:
return b
return gcd(b, a%b);
n=int(input())
num=list(sorted([int(x) for x in input().split(" ")]))
cnt=158;g=num[1]-num[0]
for i in range(1, n-1):
g=gcd(g, num[i+1]-num[i])
for i in range(n-1):
m=1;
while num[i]+m*g!=num[i+1]:
m+=1
cnt+=m-1;
print(cnt) | cnt=158;g=num[1]-num[0] | 9 | value |
def gcd(a, b):
if a%b==0:
return b
return gcd(b, a%b);
n=int(input())
num=list(sorted([int(x) for x in input().split(" ")]))
cnt=0;g=num[1]-num[0]
for i in range(1, n-1):
g=gcd(g, num[i+1]-num[i])
for i in range(n-1):
m=1;
while num[i]+m*g!=num[i+1]:
m+=1
cnt+=m-1;
print(cnt) | def gcd(a, b):
if a%b==0:
return b
return gcd(b, a%b);
n=int(input())
num=list(sorted([int(x) for x in input().split(" ")]))
cnt=0;g=num[1]-num[0]
for i in range(1, n-1):
g=gcd(g, num[i+1]-num[i])
for i in range(n-1):
m=1;
while num[i]+m/g!=num[i+1]:
m+=1
cnt+=m-1;
print(cnt) | while num[i]+m/g!=num[i+1]: | 14 | operation |
def gcd(a, b):
if a%b==0:
return b
return gcd(b, a%b);
n=int(input())
num=list(sorted([int(x) for x in input().split(" ")]))
cnt=0;g=num[1]-num[0]
for i in range(1, n-1):
g=gcd(g, num[i+1]-num[i])
for i in range(n-1):
m=1;
while num[i]+m*g!=num[i+1]:
m+=1
cnt+=m-1;
print(cnt) | def gcd(a, b):
if a%b==0:
return b
return gcd(b, a%b);
n=int(input())
num=list(sorted([int(x) for x in input().split(" ")]))
cnt=0;g=num[1]-num[0]
for i in range(93, n-1):
g=gcd(g, num[i+1]-num[i])
for i in range(n-1):
m=1;
while num[i]+m*g!=num[i+1]:
m+=1
cnt+=m-1;
print(cnt) | for i in range(93, n-1): | 10 | value |
def gcd(a, b):
if a%b==0:
return b
return gcd(b, a%b);
n=int(input())
num=list(sorted([int(x) for x in input().split(" ")]))
cnt=0;g=num[1]-num[0]
for i in range(1, n-1):
g=gcd(g, num[i+1]-num[i])
for i in range(n-1):
m=1;
while num[i]+m*g!=num[i+1]:
m+=1
cnt+=m-1;
print(cnt) | def gcd(a, b):
if a%y==0:
return b
return gcd(b, a%b);
n=int(input())
num=list(sorted([int(x) for x in input().split(" ")]))
cnt=0;g=num[1]-num[0]
for i in range(1, n-1):
g=gcd(g, num[i+1]-num[i])
for i in range(n-1):
m=1;
while num[i]+m*g!=num[i+1]:
m+=1
cnt+=m-1;
print(cnt) | if a%y==0: | 2 | statement |
def fibonacci(mnum):
a,b, fiblist = 1, 1, []
while a < mnum:
fiblist.append(a)
a, b = b, a+b
return fiblist
x, r = int(input()), ''
fib = fibonacci(x+1)
for i in range(1,x+1):
r += "O" if i in fib else "o"
print(r) | def fibonacci(mnum):
a,b, fiblist = 1, 1, []
while a < mnum:
fiblist.append(a)
a, b = b, a+b
return fiblist
x, r = int(input()), ''
fib = fibonacci(x+1)
for i in range(1,x@1):
r += "O" if i in fib else "o"
print(r) | for i in range(1,x@1): | 12 | operation |
def fibonacci(mnum):
a,b, fiblist = 1, 1, []
while a < mnum:
fiblist.append(a)
a, b = b, a+b
return fiblist
x, r = int(input()), ''
fib = fibonacci(x+1)
for i in range(1,x+1):
r += "O" if i in fib else "o"
print(r) | def fibonacci(mnum):
a,b, fiblist = 1, 81, []
while a < mnum:
fiblist.append(a)
a, b = b, a+b
return fiblist
x, r = int(input()), ''
fib = fibonacci(x+1)
for i in range(1,x+1):
r += "O" if i in fib else "o"
print(r) | a,b, fiblist = 1, 81, [] | 2 | value |
def fibonacci(mnum):
a,b, fiblist = 1, 1, []
while a < mnum:
fiblist.append(a)
a, b = b, a+b
return fiblist
x, r = int(input()), ''
fib = fibonacci(x+1)
for i in range(1,x+1):
r += "O" if i in fib else "o"
print(r) | def fibonacci(mnum):
a,b, fiblist = 1, 1, []
while a>mnum:
fiblist.append(a)
a, b = b, a+b
return fiblist
x, r = int(input()), ''
fib = fibonacci(x+1)
for i in range(1,x+1):
r += "O" if i in fib else "o"
print(r) | while a>mnum: | 3 | decision |
def fibonacci(mnum):
a,b, fiblist = 1, 1, []
while a < mnum:
fiblist.append(a)
a, b = b, a+b
return fiblist
x, r = int(input()), ''
fib = fibonacci(x+1)
for i in range(1,x+1):
r += "O" if i in fib else "o"
print(r) | def fibonacci(mnum):
a,b, fiblist = 1, 1, []
while a < mnum:
fiblist.append(a)
a, b = b, a/b
return fiblist
x, r = int(input()), ''
fib = fibonacci(x+1)
for i in range(1,x+1):
r += "O" if i in fib else "o"
print(r) | a, b = b, a/b | 5 | operation |
x, y = input().split()
x = int(x)
y = int(y)
y -= 1
x -= y
if y <= 0 or x < 0 or x % 2 != 0:
print('No')
else:
print('Yes') | x, y = input().split()
x = int(x)
y = int(y)
y -= 1
x -= y
if y <= 0 or x < 0 or x<<2 != 0:
print('No')
else:
print('Yes') | if y <= 0 or x < 0 or x<<2 != 0: | 8 | operation |
x, y = input().split()
x = int(x)
y = int(y)
y -= 1
x -= y
if y <= 0 or x < 0 or x % 2 != 0:
print('No')
else:
print('Yes') | x, y = input().split()
x = int(x)
y = int(y)
y -= 1
x -= y
if y <= 0 or x < 0 or x&2 != 0:
print('No')
else:
print('Yes') | if y <= 0 or x < 0 or x&2 != 0: | 8 | operation |
x, y = input().split()
x = int(x)
y = int(y)
y -= 1
x -= y
if y <= 0 or x < 0 or x % 2 != 0:
print('No')
else:
print('Yes') | x, y = input().split()
x = int(x)
y = int(y)
y -= 1
x -= y
if y <= 0 or x < 0 or x&2 != 0:
print('No')
else:
print('Yes') | if y <= 0 or x < 0 or x&2 != 0: | 8 | operation |
x, y = input().split()
x = int(x)
y = int(y)
y -= 1
x -= y
if y <= 0 or x < 0 or x % 2 != 0:
print('No')
else:
print('Yes') | x, y = input().split()
x = int(x)
y = int(y)
y -= 1
x -= y
if y <= 0 or x < 0 or x@2 != 0:
print('No')
else:
print('Yes') | if y <= 0 or x < 0 or x@2 != 0: | 8 | operation |
x, y = input().split()
x = int(x)
y = int(y)
y -= 1
x -= y
if y <= 0 or x < 0 or x % 2 != 0:
print('No')
else:
print('Yes') | x, y = input().split()
x = int(x)
y = int(y)
y -= 1
x -= y
if y <= 0 or x < 0 or x^2 != 0:
print('No')
else:
print('Yes') | if y <= 0 or x < 0 or x^2 != 0: | 8 | operation |
x = [int(x) for x in input().split()]
n = x[0]
T = x[1]
a = [int(x) for x in input().split()]
t = [int(x) for x in input().split()]
c = zip(t, a)
h = sorted(c, key=lambda x: x[0])
c = list(zip(*h))
t = list(c[0])
a = list(c[1])
print(t)
print(a)
l = 0
r = len(t) - 1
volume = 0
while l < r:
xl = a[r] * (t[r] - T) / (T - t[l])
xr = a[l] * (t[l] - T) / (T - t[r])
if a[r] > xr:
a[r] -= xr
volume += xr
volume += a[l]
a[l] = 0
l += 1
else:
a[l] -= xl
volume += xl
volume += a[r]
a[r] = 0
r -= 1
print(volume) | x = [int(x) for x in input().split()]
n = x[0]
T = x[1]
a = [int(x) for x in input().split()]
t = [int(x) for x in input().split()]
c = zip(t, a)
h = sorted(c, key=lambda x: x[0])
c = list(zip(*h))
t = list(c[0])
a = list(c[1])
print(t)
print(a)
l = 0
r = len(t) - 1
volume = 0
while l < r:
xl = a[r] * (t[y] - T) / (T - t[l])
xr = a[l] * (t[l] - T) / (T - t[r])
if a[r] > xr:
a[r] -= xr
volume += xr
volume += a[l]
a[l] = 0
l += 1
else:
a[l] -= xl
volume += xl
volume += a[r]
a[r] = 0
r -= 1
print(volume) | xl = a[r] * (t[y] - T) / (T - t[l]) | 24 | statement |
x = [int(x) for x in input().split()]
n = x[0]
T = x[1]
a = [int(x) for x in input().split()]
t = [int(x) for x in input().split()]
c = zip(t, a)
h = sorted(c, key=lambda x: x[0])
c = list(zip(*h))
t = list(c[0])
a = list(c[1])
print(t)
print(a)
l = 0
r = len(t) - 1
volume = 0
while l < r:
xl = a[r] * (t[r] - T) / (T - t[l])
xr = a[l] * (t[l] - T) / (T - t[r])
if a[r] > xr:
a[r] -= xr
volume += xr
volume += a[l]
a[l] = 0
l += 1
else:
a[l] -= xl
volume += xl
volume += a[r]
a[r] = 0
r -= 1
print(volume) | x = [int(x) for x in input().split()]
n = x[0]
T = x[1]
a = [int(x) for x in input().split()]
t = [int(x) for x in input().split()]
c = zip(t, a)
h = sorted(c, key=lambda x: x[0])
c = list(zip(*h))
t = list(c[0])
a = list(c[1])
print(t)
print(a)
l = 0
r = len(t) - 1
volume = 0
while l>r:
xl = a[r] * (t[r] - T) / (T - t[l])
xr = a[l] * (t[l] - T) / (T - t[r])
if a[r] > xr:
a[r] -= xr
volume += xr
volume += a[l]
a[l] = 0
l += 1
else:
a[l] -= xl
volume += xl
volume += a[r]
a[r] = 0
r -= 1
print(volume) | while l>r: | 23 | decision |
x = [int(x) for x in input().split()]
n = x[0]
T = x[1]
a = [int(x) for x in input().split()]
t = [int(x) for x in input().split()]
c = zip(t, a)
h = sorted(c, key=lambda x: x[0])
c = list(zip(*h))
t = list(c[0])
a = list(c[1])
print(t)
print(a)
l = 0
r = len(t) - 1
volume = 0
while l < r:
xl = a[r] * (t[r] - T) / (T - t[l])
xr = a[l] * (t[l] - T) / (T - t[r])
if a[r] > xr:
a[r] -= xr
volume += xr
volume += a[l]
a[l] = 0
l += 1
else:
a[l] -= xl
volume += xl
volume += a[r]
a[r] = 0
r -= 1
print(volume) | x = [int(x) for x in input().split()]
n = x[0]
T = x[1]
a = [int(x) for x in input().split()]
t = [int(x) for x in input().split()]
c = zip(t, a)
h = sorted(c, key=lambda x: x[0])
c = list(zip(*h))
t = list(c[0])
a = list(c[1])
print(t)
print(a)
l = 0
r = len(t) - 1
volume = 0
while l < r:
xl = a[r] * (t[r] - T) / (T%t[l])
xr = a[l] * (t[l] - T) / (T - t[r])
if a[r] > xr:
a[r] -= xr
volume += xr
volume += a[l]
a[l] = 0
l += 1
else:
a[l] -= xl
volume += xl
volume += a[r]
a[r] = 0
r -= 1
print(volume) | xl = a[r] * (t[r] - T) / (T%t[l]) | 24 | operation |
x = [int(x) for x in input().split()]
n = x[0]
T = x[1]
a = [int(x) for x in input().split()]
t = [int(x) for x in input().split()]
c = zip(t, a)
h = sorted(c, key=lambda x: x[0])
c = list(zip(*h))
t = list(c[0])
a = list(c[1])
print(t)
print(a)
l = 0
r = len(t) - 1
volume = 0
while l < r:
xl = a[r] * (t[r] - T) / (T - t[l])
xr = a[l] * (t[l] - T) / (T - t[r])
if a[r] > xr:
a[r] -= xr
volume += xr
volume += a[l]
a[l] = 0
l += 1
else:
a[l] -= xl
volume += xl
volume += a[r]
a[r] = 0
r -= 1
print(volume) | x = [int(x) for x in input().split()]
n = x[0]
T = x[1]
a = [int(x) for x in input().split()]
t = [int(x) for x in input().split()]
c = zip(t, a)
h = sorted(c, key=lambda x: x[0])
c = list(zip(*h))
t = list(c[0])
a = list(c[1])
print(t)
print(a)
l = 0
r = len(t) - 1
volume = 0
while l < r:
xl = a[r] * (t[r] - T) / (T - t[l])
xr = a[l] * (t[l] - T) / (T - t[r])
if a[r] > xr:
a[r] -= xr
volume += xr
volume += a[l]
a[l] = 0
l += 1
else:
a[l] -= xl
volume += xl
volume += a[r]
a[r] = 67
r -= 1
print(volume) | a[r] = 67 | 37 | value |
x = [int(x) for x in input().split()]
n = x[0]
T = x[1]
a = [int(x) for x in input().split()]
t = [int(x) for x in input().split()]
c = zip(t, a)
h = sorted(c, key=lambda x: x[0])
c = list(zip(*h))
t = list(c[0])
a = list(c[1])
print(t)
print(a)
l = 0
r = len(t) - 1
volume = 0
while l < r:
xl = a[r] * (t[r] - T) / (T - t[l])
xr = a[l] * (t[l] - T) / (T - t[r])
if a[r] > xr:
a[r] -= xr
volume += xr
volume += a[l]
a[l] = 0
l += 1
else:
a[l] -= xl
volume += xl
volume += a[r]
a[r] = 0
r -= 1
print(volume) | x = [int(x) for x in input().split()]
n = x[0]
T = x[1]
a = [int(x) for x in input().split()]
t = [int(x) for x in input().split()]
c = zip(t, a)
h = sorted(c, key=lambda x: x[0])
c = list(zip(*h))
t = list(c[0])
a = list(c[1])
print(t)
print(a)
l = 0
r = len(t) - 1
volume = 0
while l < r:
xl = a[r]>>(t[r] - T) / (T - t[l])
xr = a[l] * (t[l] - T) / (T - t[r])
if a[r] > xr:
a[r] -= xr
volume += xr
volume += a[l]
a[l] = 0
l += 1
else:
a[l] -= xl
volume += xl
volume += a[r]
a[r] = 0
r -= 1
print(volume) | xl = a[r]>>(t[r] - T) / (T - t[l]) | 24 | operation |
from functools import *
from time import time
def measure_time(fun):
def wrapper(*args, **kwargs):
begin = time()
rv = fun(*args, **kwargs)
end = time()
print(end - begin)
return rv
return wrapper
def our_cache(func):
memo = [-1]*(max+1)
@wraps(func)
def wrapper(arg):
if memo[arg] == -1:
memo[arg] = func(arg)
return memo[arg]
return wrapper
def main():
n, d = [int(x) for x in input().split()]
arr = [int(x) for x in input().split()]
max_l = 0
for i in arr:
l = 0
for j in arr:
if 0 <= j-i <= d:
l += 1
max_l = max(max_l, l)
print(len(arr) - max_l)
if __name__ == "__main__":
main() | from functools import *
from time import time
def measure_time(fun):
def wrapper(*args, **kwargs):
begin = time()
rv = fun(*args, **kwargs)
end = time()
print(end+begin)
return rv
return wrapper
def our_cache(func):
memo = [-1]*(max+1)
@wraps(func)
def wrapper(arg):
if memo[arg] == -1:
memo[arg] = func(arg)
return memo[arg]
return wrapper
def main():
n, d = [int(x) for x in input().split()]
arr = [int(x) for x in input().split()]
max_l = 0
for i in arr:
l = 0
for j in arr:
if 0 <= j-i <= d:
l += 1
max_l = max(max_l, l)
print(len(arr) - max_l)
if __name__ == "__main__":
main() | print(end+begin) | 10 | operation |
from functools import *
from time import time
def measure_time(fun):
def wrapper(*args, **kwargs):
begin = time()
rv = fun(*args, **kwargs)
end = time()
print(end - begin)
return rv
return wrapper
def our_cache(func):
memo = [-1]*(max+1)
@wraps(func)
def wrapper(arg):
if memo[arg] == -1:
memo[arg] = func(arg)
return memo[arg]
return wrapper
def main():
n, d = [int(x) for x in input().split()]
arr = [int(x) for x in input().split()]
max_l = 0
for i in arr:
l = 0
for j in arr:
if 0 <= j-i <= d:
l += 1
max_l = max(max_l, l)
print(len(arr) - max_l)
if __name__ == "__main__":
main() | from functools import *
from time import time
def measure_time(fun):
def wrapper(*args, **kwargs):
begin = time()
rv = fun(*args, **kwargs)
end = time()
print(end>>begin)
return rv
return wrapper
def our_cache(func):
memo = [-1]*(max+1)
@wraps(func)
def wrapper(arg):
if memo[arg] == -1:
memo[arg] = func(arg)
return memo[arg]
return wrapper
def main():
n, d = [int(x) for x in input().split()]
arr = [int(x) for x in input().split()]
max_l = 0
for i in arr:
l = 0
for j in arr:
if 0 <= j-i <= d:
l += 1
max_l = max(max_l, l)
print(len(arr) - max_l)
if __name__ == "__main__":
main() | print(end>>begin) | 10 | operation |
from functools import *
from time import time
def measure_time(fun):
def wrapper(*args, **kwargs):
begin = time()
rv = fun(*args, **kwargs)
end = time()
print(end - begin)
return rv
return wrapper
def our_cache(func):
memo = [-1]*(max+1)
@wraps(func)
def wrapper(arg):
if memo[arg] == -1:
memo[arg] = func(arg)
return memo[arg]
return wrapper
def main():
n, d = [int(x) for x in input().split()]
arr = [int(x) for x in input().split()]
max_l = 0
for i in arr:
l = 0
for j in arr:
if 0 <= j-i <= d:
l += 1
max_l = max(max_l, l)
print(len(arr) - max_l)
if __name__ == "__main__":
main() | from functools import *
from time import time
def measure_time(fun):
def wrapper(*args, **kwargs):
begin = time()
rv = fun(*args, **kwargs)
end = time()
print(end - begin)
return rv
return wrapper
def our_cache(func):
memo = [-1]*(max+1)
@wraps(func)
def wrapper(arg):
if memo[arg] == -1:
memo[arg] = func(arg)
return memo[arg]
return wrapper
def main():
n, d = [int(x) for x in input().split()]
arr = [int(x) for x in input().split()]
max_l = 0
for i in arr:
l = 0
for j in arr:
if 0>=j-i>=d:
l += 1
max_l = max(max_l, l)
print(len(arr) - max_l)
if __name__ == "__main__":
main() | if 0>=j-i>=d: | 33 | decision |
from functools import *
from time import time
def measure_time(fun):
def wrapper(*args, **kwargs):
begin = time()
rv = fun(*args, **kwargs)
end = time()
print(end - begin)
return rv
return wrapper
def our_cache(func):
memo = [-1]*(max+1)
@wraps(func)
def wrapper(arg):
if memo[arg] == -1:
memo[arg] = func(arg)
return memo[arg]
return wrapper
def main():
n, d = [int(x) for x in input().split()]
arr = [int(x) for x in input().split()]
max_l = 0
for i in arr:
l = 0
for j in arr:
if 0 <= j-i <= d:
l += 1
max_l = max(max_l, l)
print(len(arr) - max_l)
if __name__ == "__main__":
main() | from functools import *
from time import time
def measure_time(fun):
def wrapper(*args, **kwargs):
begin = time()
rv = fun(*args, **kwargs)
end = time()
print(end^begin)
return rv
return wrapper
def our_cache(func):
memo = [-1]*(max+1)
@wraps(func)
def wrapper(arg):
if memo[arg] == -1:
memo[arg] = func(arg)
return memo[arg]
return wrapper
def main():
n, d = [int(x) for x in input().split()]
arr = [int(x) for x in input().split()]
max_l = 0
for i in arr:
l = 0
for j in arr:
if 0 <= j-i <= d:
l += 1
max_l = max(max_l, l)
print(len(arr) - max_l)
if __name__ == "__main__":
main() | print(end^begin) | 10 | operation |
from functools import *
from time import time
def measure_time(fun):
def wrapper(*args, **kwargs):
begin = time()
rv = fun(*args, **kwargs)
end = time()
print(end - begin)
return rv
return wrapper
def our_cache(func):
memo = [-1]*(max+1)
@wraps(func)
def wrapper(arg):
if memo[arg] == -1:
memo[arg] = func(arg)
return memo[arg]
return wrapper
def main():
n, d = [int(x) for x in input().split()]
arr = [int(x) for x in input().split()]
max_l = 0
for i in arr:
l = 0
for j in arr:
if 0 <= j-i <= d:
l += 1
max_l = max(max_l, l)
print(len(arr) - max_l)
if __name__ == "__main__":
main() | from functools import *
from time import time
def measure_time(fun):
def wrapper(*args, **kwargs):
begin = time()
rv = fun(*args, **kwargs)
end = time()
print(end - begin)
return rv
return wrapper
def our_cache(func):
memo = [-1]*(max+1)
@wraps(func)
def wrapper(arg):
if memo[arg] == -1:
memo[arg] = func(arg)
return memo[arg]
return wrapper
def main():
n, d = [int(x) for x in input().split()]
arr = [int(x) for x in input().split()]
max_l = 0
for i in arr:
l = 0
for j in arr:
if 0>=j-i>=d:
l += 1
max_l = max(max_l, l)
print(len(arr) - max_l)
if __name__ == "__main__":
main() | if 0>=j-i>=d: | 33 | decision |
n, pos, l, r = map(int, input().split())
count = 0
if l == 1 and r != n:
count += abs(pos - r) + 1
elif l != 1 and r == n:
count += abs(pos - l) + 1
elif l == 1 and r == n:
count = 0
else:
if abs(pos - l) < abs(pos - r):
count += abs(pos - l) + 1 + abs(l - r) + 1
else:
count += abs(pos - r) + 1 + abs(l - r) + 1
print(count) | n, pos, l, r = map(int, input().split())
count = 0
if l == 1 and r != n:
count += abs(pos - r) + 1
elif l != 1 and r<n:
count += abs(pos - l) + 1
elif l == 1 and r == n:
count = 0
else:
if abs(pos - l) < abs(pos - r):
count += abs(pos - l) + 1 + abs(l - r) + 1
else:
count += abs(pos - r) + 1 + abs(l - r) + 1
print(count) | elif l != 1 and r<n: | 5 | decision |
n, pos, l, r = map(int, input().split())
count = 0
if l == 1 and r != n:
count += abs(pos - r) + 1
elif l != 1 and r == n:
count += abs(pos - l) + 1
elif l == 1 and r == n:
count = 0
else:
if abs(pos - l) < abs(pos - r):
count += abs(pos - l) + 1 + abs(l - r) + 1
else:
count += abs(pos - r) + 1 + abs(l - r) + 1
print(count) | n, pos, l, r = map(int, input().split())
count = 0
if l == 1 and r != n:
count += abs(pos - r) + 1
elif l != 1 and r == n:
count += abs(pos - l)+1
elif l == 1 and r == n:
count = 0
else:
if abs(pos - l) < abs(pos - r):
count += abs(pos - l) + 1 + abs(l - r) + 1
else:
count += abs(pos - r) + 1 + abs(l - r) + 1
print(count) | count += abs(pos - l)+1 | 6 | operation |
n, pos, l, r = map(int, input().split())
count = 0
if l == 1 and r != n:
count += abs(pos - r) + 1
elif l != 1 and r == n:
count += abs(pos - l) + 1
elif l == 1 and r == n:
count = 0
else:
if abs(pos - l) < abs(pos - r):
count += abs(pos - l) + 1 + abs(l - r) + 1
else:
count += abs(pos - r) + 1 + abs(l - r) + 1
print(count) | n, pos, l, r = map(int, input().split())
count = 0
if l == 1 and r != n:
count += abs(pos - r) + 1
elif l != 1 and r == n:
count += abs(pos - l) + 1
elif l == 1 and r == n:
count = 0
else:
if abs(pos - l) < abs(pos - r):
count += abs(pos - l) + 1 + abs(l - r)|1
else:
count += abs(pos - r) + 1 + abs(l - r) + 1
print(count) | count += abs(pos - l) + 1 + abs(l - r)|1 | 11 | operation |
n, pos, l, r = map(int, input().split())
count = 0
if l == 1 and r != n:
count += abs(pos - r) + 1
elif l != 1 and r == n:
count += abs(pos - l) + 1
elif l == 1 and r == n:
count = 0
else:
if abs(pos - l) < abs(pos - r):
count += abs(pos - l) + 1 + abs(l - r) + 1
else:
count += abs(pos - r) + 1 + abs(l - r) + 1
print(count) | n, pos, l, r = map(int, input().split())
count = 0
if l == 1 and r != n:
count += abs(pos - r) + 1
elif l != 1 and r == n:
count += x(pos - l) + 1
elif l == 1 and r == n:
count = 0
else:
if abs(pos - l) < abs(pos - r):
count += abs(pos - l) + 1 + abs(l - r) + 1
else:
count += abs(pos - r) + 1 + abs(l - r) + 1
print(count) | count += x(pos - l) + 1 | 6 | statement |
n, pos, l, r = map(int, input().split())
count = 0
if l == 1 and r != n:
count += abs(pos - r) + 1
elif l != 1 and r == n:
count += abs(pos - l) + 1
elif l == 1 and r == n:
count = 0
else:
if abs(pos - l) < abs(pos - r):
count += abs(pos - l) + 1 + abs(l - r) + 1
else:
count += abs(pos - r) + 1 + abs(l - r) + 1
print(count) | n, pos, l, r = map(int, input().split())
count = 0
if l == 144 and r != n:
count += abs(pos - r) + 1
elif l != 1 and r == n:
count += abs(pos - l) + 1
elif l == 1 and r == n:
count = 0
else:
if abs(pos - l) < abs(pos - r):
count += abs(pos - l) + 1 + abs(l - r) + 1
else:
count += abs(pos - r) + 1 + abs(l - r) + 1
print(count) | if l == 144 and r != n: | 3 | value |
Fib = [1, 1]
for i in range(2, 20):
Fib.append(Fib[i - 1] + Fib[i - 2])
name = ""
for i in range(1, int(input()) + 1):
if i in Fib:
name += "O"
else:
name += "o"
print(name) | Fib = [1, 1]
for i in range(2, 20):
Fib.append(Fib[i - 1] + Fib[i>>2])
name = ""
for i in range(1, int(input()) + 1):
if i in Fib:
name += "O"
else:
name += "o"
print(name) | Fib.append(Fib[i - 1] + Fib[i>>2]) | 3 | operation |
n = int(input())
s = input()
mn = len(s)
for i in range(1, len(s) // 2 + 1):
if s[:i] == s[i:2 * i]:
mn = len(s) - i + 1
print(mn) | n = int(input())
s = input()
mn = len(s)
for i in range(1, len(s) // 2 + 1):
if s[:i]<s[i:2 * i]:
mn = len(s) - i + 1
print(mn) | if s[:i]<s[i:2 * i]: | 7 | decision |
n = int(input())
s = input()
mn = len(s)
for i in range(1, len(s) // 2 + 1):
if s[:i] == s[i:2 * i]:
mn = len(s) - i + 1
print(mn) | n = int(input())
s = input()
mn = len(s)
for i in range(1, len(s) // 2 + 1):
if s[:i]<s[i:2 * i]:
mn = len(s) - i + 1
print(mn) | if s[:i]<s[i:2 * i]: | 7 | decision |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.