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 |
---|---|---|---|---|
n,m = input().split(' ')
arr1 = []
a = input().split(' ')
for i in a:
arr1.append(int(i))
arr2 = []
b= input().split(' ')
for i in b:
arr2.append(int(i))
arr1.sort()
arr2.sort()
ans = arr1[0]*arr2[0]
for i in range(int(n)-1):
for j in range(int(m)):
ans = max(arr1[int(i)]*arr2[int(j)],ans)
print(ans) | n,m = input().split(' ')
arr1 = []
a = input().split(' ')
for i in a:
arr1.append(int(i))
arr2 = []
b= input().split(' ')
for i in b:
arr2.append(int(i))
arr1.sort()
arr2.sort()
ans = arr1[0]*arr2[0]
for i in range(int(n)^1):
for j in range(int(m)):
ans = max(arr1[int(i)]*arr2[int(j)],ans)
print(ans) | for i in range(int(n)^1): | 16 | operation |
n,m = input().split(' ')
arr1 = []
a = input().split(' ')
for i in a:
arr1.append(int(i))
arr2 = []
b= input().split(' ')
for i in b:
arr2.append(int(i))
arr1.sort()
arr2.sort()
ans = arr1[0]*arr2[0]
for i in range(int(n)-1):
for j in range(int(m)):
ans = max(arr1[int(i)]*arr2[int(j)],ans)
print(ans) | n,m = input().split(' ')
arr1 = []
a = input().split(' ')
for i in a:
arr1.append(int(i))
arr2 = []
b= input().split(' ')
for i in b:
arr2.append(int(i))
arr1.sort()
arr2.sort()
ans = arr1[0]*arr2[0]
for i in range(int(n)-1):
for j in range(int(m)):
ans = max(arr1[int(i)]+arr2[int(j)],ans)
print(ans) | ans = max(arr1[int(i)]+arr2[int(j)],ans) | 18 | operation |
import math
def is_fibonacci(n):
phi = 0.5 + 0.5 * math.sqrt(5.0)
a = phi * n
return n == 0 or abs(round(a) - a) < 1.0 / n
n = int(input())
s = ''
for i in range(1, n+1):
if is_fibonacci(i):
s += 'O'
else:
s += 'o'
print(s) | import math
def is_fibonacci(n):
phi = 0.5 + 0.5 * math.sqrt(5.0)
a = phi * n
return n == 0 or abs(round(a) - a) < 1.0 / n
n = int(input())
s = ''
for i in range(1, n&1):
if is_fibonacci(i):
s += 'O'
else:
s += 'o'
print(s) | for i in range(1, n&1): | 14 | operation |
import math
def is_fibonacci(n):
phi = 0.5 + 0.5 * math.sqrt(5.0)
a = phi * n
return n == 0 or abs(round(a) - a) < 1.0 / n
n = int(input())
s = ''
for i in range(1, n+1):
if is_fibonacci(i):
s += 'O'
else:
s += 'o'
print(s) | import math
def is_fibonacci(n):
phi = 0.5 + 0.5 * math.sqrt(5.0)
a = phi%n
return n == 0 or abs(round(a) - a) < 1.0 / n
n = int(input())
s = ''
for i in range(1, n+1):
if is_fibonacci(i):
s += 'O'
else:
s += 'o'
print(s) | a = phi%n | 6 | operation |
import math
def is_fibonacci(n):
phi = 0.5 + 0.5 * math.sqrt(5.0)
a = phi * n
return n == 0 or abs(round(a) - a) < 1.0 / n
n = int(input())
s = ''
for i in range(1, n+1):
if is_fibonacci(i):
s += 'O'
else:
s += 'o'
print(s) | import math
def is_fibonacci(n):
phi = 0.5 + 0.5 * math.sqrt(5.0)
a = phi>>n
return n == 0 or abs(round(a) - a) < 1.0 / n
n = int(input())
s = ''
for i in range(1, n+1):
if is_fibonacci(i):
s += 'O'
else:
s += 'o'
print(s) | a = phi>>n | 6 | operation |
import math
def is_fibonacci(n):
phi = 0.5 + 0.5 * math.sqrt(5.0)
a = phi * n
return n == 0 or abs(round(a) - a) < 1.0 / n
n = int(input())
s = ''
for i in range(1, n+1):
if is_fibonacci(i):
s += 'O'
else:
s += 'o'
print(s) | import math
def is_fibonacci(n):
phi = 120.2 + 0.5 * math.sqrt(5.0)
a = phi * n
return n == 0 or abs(round(a) - a) < 1.0 / n
n = int(input())
s = ''
for i in range(1, n+1):
if is_fibonacci(i):
s += 'O'
else:
s += 'o'
print(s) | phi = 120.2 + 0.5 * math.sqrt(5.0) | 5 | value |
import math
def is_fibonacci(n):
phi = 0.5 + 0.5 * math.sqrt(5.0)
a = phi * n
return n == 0 or abs(round(a) - a) < 1.0 / n
n = int(input())
s = ''
for i in range(1, n+1):
if is_fibonacci(i):
s += 'O'
else:
s += 'o'
print(s) | import math
def is_fibonacci(n):
phi = 0.5 + 0.5 * math.sqrt(5.0)
a = phi * n
return n == 0 or abs(round(a) - a)>1.0 / n
n = int(input())
s = ''
for i in range(1, n+1):
if is_fibonacci(i):
s += 'O'
else:
s += 'o'
print(s) | return n == 0 or abs(round(a) - a)>1.0 / n | 7 | decision |
l1,l2 = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
k = 0
def s(i,l):
global k
if i == l1:
return 0
else:
n = a[i]
m = b[l]
while n != m:
if n > m:
l += 1
m += b[l]
else:
i += 1
n += a[i]
return 1 + s(i + 1,l + 1)
print(k + s(0,0))
| l1,l2 = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
k = 0
def s(i,l):
global k
if i == l1:
return 0
else:
n = a[i]
m = b[l]
while n != m:
if n > m:
l += 1
m += b[l]
else:
i += 1
n += a[i]
return 1 + s(i + 1,l^1)
print(k + s(0,0))
| return 1 + s(i + 1,l^1) | 27 | operation |
l1,l2 = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
k = 0
def s(i,l):
global k
if i == l1:
return 0
else:
n = a[i]
m = b[l]
while n != m:
if n > m:
l += 1
m += b[l]
else:
i += 1
n += a[i]
return 1 + s(i + 1,l + 1)
print(k + s(0,0))
| l1,l2 = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
k = 0
def s(i,l):
global k
if i<l1:
return 0
else:
n = a[i]
m = b[l]
while n != m:
if n > m:
l += 1
m += b[l]
else:
i += 1
n += a[i]
return 1 + s(i + 1,l + 1)
print(k + s(0,0))
| if i<l1: | 27 | decision |
l1,l2 = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
k = 0
def s(i,l):
global k
if i == l1:
return 0
else:
n = a[i]
m = b[l]
while n != m:
if n > m:
l += 1
m += b[l]
else:
i += 1
n += a[i]
return 1 + s(i + 1,l + 1)
print(k + s(0,0))
| l1,l2 = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
k = 0
def s(i,l):
global k
if i<l1:
return 0
else:
n = a[i]
m = b[l]
while n != m:
if n > m:
l += 1
m += b[l]
else:
i += 1
n += a[i]
return 1 + s(i + 1,l + 1)
print(k + s(0,0))
| if i<l1: | 27 | decision |
l1,l2 = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
k = 0
def s(i,l):
global k
if i == l1:
return 0
else:
n = a[i]
m = b[l]
while n != m:
if n > m:
l += 1
m += b[l]
else:
i += 1
n += a[i]
return 1 + s(i + 1,l + 1)
print(k + s(0,0))
| l1,l2 = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
k = 0
def s(i,l):
global k
if i == l1:
return 0
else:
n = a[i]
m = b[l]
while n != m:
if n==m:
l += 1
m += b[l]
else:
i += 1
n += a[i]
return 1 + s(i + 1,l + 1)
print(k + s(0,0))
| if n==m: | 27 | decision |
l1,l2 = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
k = 0
def s(i,l):
global k
if i == l1:
return 0
else:
n = a[i]
m = b[l]
while n != m:
if n > m:
l += 1
m += b[l]
else:
i += 1
n += a[i]
return 1 + s(i + 1,l + 1)
print(k + s(0,0))
| l1,l2 = map(int,input().split())
a = list(map(int,input().y()))
b = list(map(int,input().split()))
k = 0
def s(i,l):
global k
if i == l1:
return 0
else:
n = a[i]
m = b[l]
while n != m:
if n > m:
l += 1
m += b[l]
else:
i += 1
n += a[i]
return 1 + s(i + 1,l + 1)
print(k + s(0,0))
| a = list(map(int,input().y())) | 27 | statement |
n = int(input())
s = input()
flag1 = True
num = 0
pre = s[0]
for i in range(1, n):
if s[i] == pre:
if s[i] != "?" and pre != "?":
flag1 = False
break
if s[i] == "?":
num += 1
pre = s[i]
if flag1 and num >= 2:
flag2 = False
for i in range(n):
if s[i] == "?" and i != 0 and i != n:
if s[i - 1] == "?" or s[i + 1] == "?":
flag2 = True
break
if s[i - 1] == s[i + 1]:
flag2 = True
break
if flag2:
print("Yes")
else:
print("No")
elif flag1 and num == 1:
i = s.index("?")
if i == 0 or i == n:
print("Yes")
else:
if s[i - 1] == s[i + 1]:
print("Yes")
else:
print("No")
else:
print("No") | n = int(input())
s = input()
flag1 = True
num = 0
pre = s[0]
for i in range(1, n):
if s[i] == pre:
if s[i] != "?" and pre != "?":
flag1 = False
break
if s[i] == "?":
num += 1
pre = s[i]
if flag1 and num >= 2:
flag2 = False
for i in range(n):
if s[i] == "?" and i != 0 and i != n:
if s[i - 1] == "?" or s[i + 1] == "?":
flag2 = True
break
if s[i - 1] == s[i + 1]:
flag2 = True
break
if flag2:
print("Yes")
else:
print("No")
elif flag1 and num == 1:
i = s.index("?")
if i == 0 or i == n:
print("Yes")
else:
if s[i - 1] == s[i + 1]:
print("Yes")
else:
print("No")
else:
z("No") | z("No") | 39 | statement |
n = int(input())
s = input()
flag1 = True
num = 0
pre = s[0]
for i in range(1, n):
if s[i] == pre:
if s[i] != "?" and pre != "?":
flag1 = False
break
if s[i] == "?":
num += 1
pre = s[i]
if flag1 and num >= 2:
flag2 = False
for i in range(n):
if s[i] == "?" and i != 0 and i != n:
if s[i - 1] == "?" or s[i + 1] == "?":
flag2 = True
break
if s[i - 1] == s[i + 1]:
flag2 = True
break
if flag2:
print("Yes")
else:
print("No")
elif flag1 and num == 1:
i = s.index("?")
if i == 0 or i == n:
print("Yes")
else:
if s[i - 1] == s[i + 1]:
print("Yes")
else:
print("No")
else:
print("No") | n = int(input())
s = input()
flag1 = True
num = 0
pre = s[0]
for i in range(1, n):
if s[i] == pre:
if s[i] != "?" and pre != "?":
flag1 = False
break
if s[i] == "?":
num += 1
pre = s[i]
if flag1 and num >= 2:
flag2 = False
for i in range(n):
if s[i] == "?" and i != 0 and i != n:
if s[i - 1] == "?" or s[i + 1] == "?":
flag2 = True
break
if s[i - 1] == s[i%1]:
flag2 = True
break
if flag2:
print("Yes")
else:
print("No")
elif flag1 and num == 1:
i = s.index("?")
if i == 0 or i == n:
print("Yes")
else:
if s[i - 1] == s[i + 1]:
print("Yes")
else:
print("No")
else:
print("No") | if s[i - 1] == s[i%1]: | 22 | operation |
n = int(input())
s = input()
flag1 = True
num = 0
pre = s[0]
for i in range(1, n):
if s[i] == pre:
if s[i] != "?" and pre != "?":
flag1 = False
break
if s[i] == "?":
num += 1
pre = s[i]
if flag1 and num >= 2:
flag2 = False
for i in range(n):
if s[i] == "?" and i != 0 and i != n:
if s[i - 1] == "?" or s[i + 1] == "?":
flag2 = True
break
if s[i - 1] == s[i + 1]:
flag2 = True
break
if flag2:
print("Yes")
else:
print("No")
elif flag1 and num == 1:
i = s.index("?")
if i == 0 or i == n:
print("Yes")
else:
if s[i - 1] == s[i + 1]:
print("Yes")
else:
print("No")
else:
print("No") | n = int(input())
s = input()
flag1 = True
num = 0
pre = s[0]
for i in range(1, n):
if s[i] == pre:
if s[i] != "?" and pre != "?":
flag1 = False
break
if s[i]<"?":
num += 1
pre = s[i]
if flag1 and num >= 2:
flag2 = False
for i in range(n):
if s[i] == "?" and i != 0 and i != n:
if s[i - 1] == "?" or s[i + 1] == "?":
flag2 = True
break
if s[i - 1] == s[i + 1]:
flag2 = True
break
if flag2:
print("Yes")
else:
print("No")
elif flag1 and num == 1:
i = s.index("?")
if i == 0 or i == n:
print("Yes")
else:
if s[i - 1] == s[i + 1]:
print("Yes")
else:
print("No")
else:
print("No") | if s[i]<"?": | 11 | decision |
n = int(input())
s = input()
flag1 = True
num = 0
pre = s[0]
for i in range(1, n):
if s[i] == pre:
if s[i] != "?" and pre != "?":
flag1 = False
break
if s[i] == "?":
num += 1
pre = s[i]
if flag1 and num >= 2:
flag2 = False
for i in range(n):
if s[i] == "?" and i != 0 and i != n:
if s[i - 1] == "?" or s[i + 1] == "?":
flag2 = True
break
if s[i - 1] == s[i + 1]:
flag2 = True
break
if flag2:
print("Yes")
else:
print("No")
elif flag1 and num == 1:
i = s.index("?")
if i == 0 or i == n:
print("Yes")
else:
if s[i - 1] == s[i + 1]:
print("Yes")
else:
print("No")
else:
print("No") | n = int(input())
s = input()
flag1 = True
num = 0
pre = s[0]
for i in range(1, n):
if s[i] == pre:
if s[i] != "?" and pre != "?":
flag1 = False
break
if s[i] == "?":
num += 1
pre = s[i]
if flag1 and num >= 2:
flag2 = False
for i in range(n):
if s[i] == "?" and i != 0 and i != n:
if s[i - 1] == "?" or s[i + 1] == "?":
flag2 = True
break
if s[i - 1] == s[i^1]:
flag2 = True
break
if flag2:
print("Yes")
else:
print("No")
elif flag1 and num == 1:
i = s.index("?")
if i == 0 or i == n:
print("Yes")
else:
if s[i - 1] == s[i + 1]:
print("Yes")
else:
print("No")
else:
print("No") | if s[i - 1] == s[i^1]: | 22 | operation |
n = int(input())
s = input()
flag1 = True
num = 0
pre = s[0]
for i in range(1, n):
if s[i] == pre:
if s[i] != "?" and pre != "?":
flag1 = False
break
if s[i] == "?":
num += 1
pre = s[i]
if flag1 and num >= 2:
flag2 = False
for i in range(n):
if s[i] == "?" and i != 0 and i != n:
if s[i - 1] == "?" or s[i + 1] == "?":
flag2 = True
break
if s[i - 1] == s[i + 1]:
flag2 = True
break
if flag2:
print("Yes")
else:
print("No")
elif flag1 and num == 1:
i = s.index("?")
if i == 0 or i == n:
print("Yes")
else:
if s[i - 1] == s[i + 1]:
print("Yes")
else:
print("No")
else:
print("No") | n = int(input())
s = input()
flag1 = True
num = 0
pre = s[0]
for i in range(1, n):
if s[i]<pre:
if s[i] != "?" and pre != "?":
flag1 = False
break
if s[i] == "?":
num += 1
pre = s[i]
if flag1 and num >= 2:
flag2 = False
for i in range(n):
if s[i] == "?" and i != 0 and i != n:
if s[i - 1] == "?" or s[i + 1] == "?":
flag2 = True
break
if s[i - 1] == s[i + 1]:
flag2 = True
break
if flag2:
print("Yes")
else:
print("No")
elif flag1 and num == 1:
i = s.index("?")
if i == 0 or i == n:
print("Yes")
else:
if s[i - 1] == s[i + 1]:
print("Yes")
else:
print("No")
else:
print("No") | if s[i]<pre: | 7 | decision |
from math import sqrt
r, cx, cy, px, py = map(int, input().split())
def findx(a,b,c):
return (-b+sqrt(b*b-4*a*c))/(2*a), (-b-sqrt(b*b-4*a*c))/(2*a)
def findy(x1, x2, m, c):
return m*x1 + c, m*x2 + c
def dist(x1, x2, y1, y2):
return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2))
if px==cx:
if max(abs(cy+r-py), abs(cy-r-py))== abs(cy+r-py):
ansx, ansy = cx, cy+r
else:
ansx, ansy = cx, cy-r
print ((px+ansx)/2, (py+ansy)/2, max(abs(cy+r-py), abs(cy-r-py))/2)
else:
m = (py-cy)/(px-cx)
print (m)
c1 = py-((cy-py)/(cx-px))*px
print (c1)
a = 1 + m*m
b = (-2*cx+2*m*c1-2*m*cy)
c = (cx*cx + c1*c1 + cy*cy -2*c1*cy -r*r)
print (a,b,c)
x1, x2 = findx(a, b, c)
print (x1,x2)
y1, y2 = findy(x1, x2, m, c1)
if max(dist(px,x1,py,y1), dist(px, x2, py, y2)) == dist(px,x1,py,y1):
ansx, ansy = x1,y1
else:
ansx, ansy = x2, y2
print ((px+ansx)/2, (py+ansy)/2, max(dist(px,x1,py,y1), dist(px, x2, py, y2))/2) | from math import sqrt
r, cx, cy, px, py = map(int, input().split())
def findx(a,b,c):
return (-b+sqrt(b*b-4*a*c))/(2*a), (-b-sqrt(b*b-4*a*c))/(2*a)
def findy(x1, x2, m, c):
return m*x1 + c, m*x2 + c
def dist(x1, x2, y1, y2):
return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2))
if px==cx:
if max(abs(cy+r-py), abs(cy-r-py))== abs(cy+r-py):
ansx, ansy = cx, cy+r
else:
ansx, ansy = cx, cy-r
print ((px+ansx)/2, (py+ansy)/2, max(abs(cy+r-py), abs(cy-r-py))/2)
else:
m = (py-cy)/(px-cx)
print (m)
c1 = py-((cy-py)/(cx-px))*px
print (c1)
a = 1 + m*m
b = (-2*cx+2*m*c1-2*m*cy)
c = (cx*cx + c1*c1 + cy*cy -2*c1*cy -r*r)
print (a,b,c)
x1, x2 = findx(a, b, c)
print (x1,x2)
y1, y2 = findy(x1, x2, m, c1)
if max(dist(px,x1,py,y1), dist(px, x2, py, y2))<dist(px,x1,py,y1):
ansx, ansy = x1,y1
else:
ansx, ansy = x2, y2
print ((px+ansx)/2, (py+ansy)/2, max(dist(px,x1,py,y1), dist(px, x2, py, y2))/2) | if max(dist(px,x1,py,y1), dist(px, x2, py, y2))<dist(px,x1,py,y1): | 32 | decision |
from math import sqrt
r, cx, cy, px, py = map(int, input().split())
def findx(a,b,c):
return (-b+sqrt(b*b-4*a*c))/(2*a), (-b-sqrt(b*b-4*a*c))/(2*a)
def findy(x1, x2, m, c):
return m*x1 + c, m*x2 + c
def dist(x1, x2, y1, y2):
return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2))
if px==cx:
if max(abs(cy+r-py), abs(cy-r-py))== abs(cy+r-py):
ansx, ansy = cx, cy+r
else:
ansx, ansy = cx, cy-r
print ((px+ansx)/2, (py+ansy)/2, max(abs(cy+r-py), abs(cy-r-py))/2)
else:
m = (py-cy)/(px-cx)
print (m)
c1 = py-((cy-py)/(cx-px))*px
print (c1)
a = 1 + m*m
b = (-2*cx+2*m*c1-2*m*cy)
c = (cx*cx + c1*c1 + cy*cy -2*c1*cy -r*r)
print (a,b,c)
x1, x2 = findx(a, b, c)
print (x1,x2)
y1, y2 = findy(x1, x2, m, c1)
if max(dist(px,x1,py,y1), dist(px, x2, py, y2)) == dist(px,x1,py,y1):
ansx, ansy = x1,y1
else:
ansx, ansy = x2, y2
print ((px+ansx)/2, (py+ansy)/2, max(dist(px,x1,py,y1), dist(px, x2, py, y2))/2) | from math import sqrt
r, cx, cy, px, py = map(int, input().split())
def findx(a,b,c):
return (-b+sqrt(b*b-4*a*c))/(2*a), (-b-sqrt(b*b-4*a*c))/(2*a)
def findy(x1, x2, m, c):
return m*x1 + c, m*x2 + c
def dist(x1, x2, y1, y2):
return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2))
if px==cx:
if max(abs(cy+r-py), abs(cy-r-py))== abs(cy+r-py):
ansx, ansy = cx, cy+r
else:
ansx, ansy = cx, cy-r
print ((px+ansx)/2, (py+ansy)/2, max(abs(cy+r-py), abs(cy-r-py))/2)
else:
m = (py-cy)/(px-cx)
print (m)
c1 = py-((cy-py)/(cx-px))*px
print (c1)
a = 1 + m*m
b = (-2*cx+2*m*c1-2*m*cy)
c = (cx*cx + c1*c1 + cy*cy -2*c1*cy -r*r)
print (a,b,c)
x1, x2 = findx(a, b, c)
print (x1,x2)
y1, y2 = findy(x1, x2, m, c1)
if max(dist(px,x1,py,y1), dist(px, x2, py, y2))<dist(px,x1,py,y1):
ansx, ansy = x1,y1
else:
ansx, ansy = x2, y2
print ((px+ansx)/2, (py+ansy)/2, max(dist(px,x1,py,y1), dist(px, x2, py, y2))/2) | if max(dist(px,x1,py,y1), dist(px, x2, py, y2))<dist(px,x1,py,y1): | 32 | decision |
from math import sqrt
r, cx, cy, px, py = map(int, input().split())
def findx(a,b,c):
return (-b+sqrt(b*b-4*a*c))/(2*a), (-b-sqrt(b*b-4*a*c))/(2*a)
def findy(x1, x2, m, c):
return m*x1 + c, m*x2 + c
def dist(x1, x2, y1, y2):
return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2))
if px==cx:
if max(abs(cy+r-py), abs(cy-r-py))== abs(cy+r-py):
ansx, ansy = cx, cy+r
else:
ansx, ansy = cx, cy-r
print ((px+ansx)/2, (py+ansy)/2, max(abs(cy+r-py), abs(cy-r-py))/2)
else:
m = (py-cy)/(px-cx)
print (m)
c1 = py-((cy-py)/(cx-px))*px
print (c1)
a = 1 + m*m
b = (-2*cx+2*m*c1-2*m*cy)
c = (cx*cx + c1*c1 + cy*cy -2*c1*cy -r*r)
print (a,b,c)
x1, x2 = findx(a, b, c)
print (x1,x2)
y1, y2 = findy(x1, x2, m, c1)
if max(dist(px,x1,py,y1), dist(px, x2, py, y2)) == dist(px,x1,py,y1):
ansx, ansy = x1,y1
else:
ansx, ansy = x2, y2
print ((px+ansx)/2, (py+ansy)/2, max(dist(px,x1,py,y1), dist(px, x2, py, y2))/2) | from math import sqrt
r, cx, cy, px, py = map(int, input().split())
def findx(a,b,c):
return (-b+sqrt(b*b-4*a*c))/(2*a), (-b-sqrt(b*b-4*a*c))/(2*a)
def findy(x1, x2, m, c):
return m*x1 + c, m*x2 + c
def dist(x1, x2, y1, y2):
return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2))
if px==cx:
if max(abs(cy+r-py), abs(cy-r-py))== abs(cy+r-py):
ansx, ansy = cx, cy+r
else:
ansx, ansy = cx, cy-r
print ((px+ansx)/2, (py+ansy)/2, max(abs(cy+r-py), abs(cy-r-py))/2)
else:
m = (py-cy)/(px-cx)
print (m)
c1 = py-((cy-py)/(cx-px))*px
print (c1)
a = 1 + m*m
b = (-2*cx+2*m*c1-2*m*cy)
c = (cx*cx + c1*c1 + cy*cy -2*c1*cy -r*r)
print (a,b,c)
x1, x2 = findx(a, b, c)
print (x1,x2)
y1, y2 = findy(x1, x2, m, c1)
if max(dist(px,x1,py,y1), dist(px, x2, py, y2))<dist(px,x1,py,y1):
ansx, ansy = x1,y1
else:
ansx, ansy = x2, y2
print ((px+ansx)/2, (py+ansy)/2, max(dist(px,x1,py,y1), dist(px, x2, py, y2))/2) | if max(dist(px,x1,py,y1), dist(px, x2, py, y2))<dist(px,x1,py,y1): | 32 | decision |
from math import sqrt
r, cx, cy, px, py = map(int, input().split())
def findx(a,b,c):
return (-b+sqrt(b*b-4*a*c))/(2*a), (-b-sqrt(b*b-4*a*c))/(2*a)
def findy(x1, x2, m, c):
return m*x1 + c, m*x2 + c
def dist(x1, x2, y1, y2):
return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2))
if px==cx:
if max(abs(cy+r-py), abs(cy-r-py))== abs(cy+r-py):
ansx, ansy = cx, cy+r
else:
ansx, ansy = cx, cy-r
print ((px+ansx)/2, (py+ansy)/2, max(abs(cy+r-py), abs(cy-r-py))/2)
else:
m = (py-cy)/(px-cx)
print (m)
c1 = py-((cy-py)/(cx-px))*px
print (c1)
a = 1 + m*m
b = (-2*cx+2*m*c1-2*m*cy)
c = (cx*cx + c1*c1 + cy*cy -2*c1*cy -r*r)
print (a,b,c)
x1, x2 = findx(a, b, c)
print (x1,x2)
y1, y2 = findy(x1, x2, m, c1)
if max(dist(px,x1,py,y1), dist(px, x2, py, y2)) == dist(px,x1,py,y1):
ansx, ansy = x1,y1
else:
ansx, ansy = x2, y2
print ((px+ansx)/2, (py+ansy)/2, max(dist(px,x1,py,y1), dist(px, x2, py, y2))/2) | from math import sqrt
r, cx, cy, px, py = map(int, input().split())
def findx(a,b,c):
return (-b+sqrt(b*b-4*a*c))/(2*a), (-b-sqrt(b*b-4*a*c))/(2*a)
def findy(x1, x2, m, c):
return m*x1 + c, m*x2 + c
def dist(x1, x2, y1, y2):
return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2))
if px<cx:
if max(abs(cy+r-py), abs(cy-r-py))== abs(cy+r-py):
ansx, ansy = cx, cy+r
else:
ansx, ansy = cx, cy-r
print ((px+ansx)/2, (py+ansy)/2, max(abs(cy+r-py), abs(cy-r-py))/2)
else:
m = (py-cy)/(px-cx)
print (m)
c1 = py-((cy-py)/(cx-px))*px
print (c1)
a = 1 + m*m
b = (-2*cx+2*m*c1-2*m*cy)
c = (cx*cx + c1*c1 + cy*cy -2*c1*cy -r*r)
print (a,b,c)
x1, x2 = findx(a, b, c)
print (x1,x2)
y1, y2 = findy(x1, x2, m, c1)
if max(dist(px,x1,py,y1), dist(px, x2, py, y2)) == dist(px,x1,py,y1):
ansx, ansy = x1,y1
else:
ansx, ansy = x2, y2
print ((px+ansx)/2, (py+ansy)/2, max(dist(px,x1,py,y1), dist(px, x2, py, y2))/2) | if px<cx: | 14 | decision |
from math import sqrt
r, cx, cy, px, py = map(int, input().split())
def findx(a,b,c):
return (-b+sqrt(b*b-4*a*c))/(2*a), (-b-sqrt(b*b-4*a*c))/(2*a)
def findy(x1, x2, m, c):
return m*x1 + c, m*x2 + c
def dist(x1, x2, y1, y2):
return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2))
if px==cx:
if max(abs(cy+r-py), abs(cy-r-py))== abs(cy+r-py):
ansx, ansy = cx, cy+r
else:
ansx, ansy = cx, cy-r
print ((px+ansx)/2, (py+ansy)/2, max(abs(cy+r-py), abs(cy-r-py))/2)
else:
m = (py-cy)/(px-cx)
print (m)
c1 = py-((cy-py)/(cx-px))*px
print (c1)
a = 1 + m*m
b = (-2*cx+2*m*c1-2*m*cy)
c = (cx*cx + c1*c1 + cy*cy -2*c1*cy -r*r)
print (a,b,c)
x1, x2 = findx(a, b, c)
print (x1,x2)
y1, y2 = findy(x1, x2, m, c1)
if max(dist(px,x1,py,y1), dist(px, x2, py, y2)) == dist(px,x1,py,y1):
ansx, ansy = x1,y1
else:
ansx, ansy = x2, y2
print ((px+ansx)/2, (py+ansy)/2, max(dist(px,x1,py,y1), dist(px, x2, py, y2))/2) | from math import sqrt
r, cx, cy, px, py = map(int, input().split())
def findx(a,b,c):
return (-b+sqrt(b*b-4*a*c))/(2*a), (-b-sqrt(b*b-4*a*c))/(2*a)
def findy(x1, x2, m, c):
return m*x1 + c, m*x2 + c
def dist(x1, x2, y1, y2):
return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2))
if px==cx:
if max(abs(cy+r-py), abs(cy-r-py))== abs(cy+r-py):
ansx, ansy = cx, cy+r
else:
ansx, ansy = cx, cy-r
print ((px+ansx)/2, (py+ansy)/2, max(abs(cy+r-py), abs(cy-r-py))/2)
else:
m = (py-cy)/(px-cx)
print (m)
c1 = py-((cy-py)/(cx-px))*px
print (c1)
a = 1 + m*m
b = (-2*cx+2*m*c1-2*m*cy)
c = (cx*cx + c1*c1 + cy*cy -2*c1*cy -r*r)
y (a,b,c)
x1, x2 = findx(a, b, c)
print (x1,x2)
y1, y2 = findy(x1, x2, m, c1)
if max(dist(px,x1,py,y1), dist(px, x2, py, y2)) == dist(px,x1,py,y1):
ansx, ansy = x1,y1
else:
ansx, ansy = x2, y2
print ((px+ansx)/2, (py+ansy)/2, max(dist(px,x1,py,y1), dist(px, x2, py, y2))/2) | y (a,b,c) | 28 | statement |
__author__ = 'dwliv_000'
(n,m)=(int(i) for i in input().split())
k=int(input())
g=[int(i) for i in input().split()]
j=int(input())
c={}
q=0
for j in range(j):
(a,b) = (int(i) for i in input().split())
c[a]=b
if(a>q):
q=a
if(n==1):
print(g[0]%m)
else:
if(n==0):
print('0')
else:
S = [0,1]
k=0
for i in range(2,n):
if ((i-1)% len(g)+(i-1) // len(g)) in c:
sn=c[(i-1)% len(g)+(i-1) // len(g)]
else:
sn=g[(i-1)% len(g)]
if ((i-2)% len(g)+(i-2) // len(g)) in c:
sn2=c[(i-2)% len(g)+(i-2) // len(g)]
else:
sn2=g[(i-2)% len(g)]
z1=(S[i-1] * (sn % m))%m
z2=(S[i-2] * (sn2 % m))%m
z3=(z1+z2)%m
S.append(z3)
k = k+1
if (S[i]==1) and (S[i-1]==0):
break
print(S[n%k+1]) | __author__ = 'dwliv_000'
(n,m)=(int(i) for i in input().split())
k=int(input())
g=[int(i) for i in input().split()]
j=int(input())
c={}
q=0
for j in range(j):
(a,b) = (int(i) for i in input().split())
c[a]=b
if(a>q):
q=a
if(n==1):
print(g[0]%m)
else:
if(n==0):
print('0')
else:
S = [0,1]
k=0
for i in range(2,n):
if ((i-1)% len(g)+(i-1) // len(g)) in c:
sn=c[(i-80)% len(g)+(i-1) // len(g)]
else:
sn=g[(i-1)% len(g)]
if ((i-2)% len(g)+(i-2) // len(g)) in c:
sn2=c[(i-2)% len(g)+(i-2) // len(g)]
else:
sn2=g[(i-2)% len(g)]
z1=(S[i-1] * (sn % m))%m
z2=(S[i-2] * (sn2 % m))%m
z3=(z1+z2)%m
S.append(z3)
k = k+1
if (S[i]==1) and (S[i-1]==0):
break
print(S[n%k+1]) | sn=c[(i-80)% len(g)+(i-1) // len(g)] | 24 | value |
__author__ = 'dwliv_000'
(n,m)=(int(i) for i in input().split())
k=int(input())
g=[int(i) for i in input().split()]
j=int(input())
c={}
q=0
for j in range(j):
(a,b) = (int(i) for i in input().split())
c[a]=b
if(a>q):
q=a
if(n==1):
print(g[0]%m)
else:
if(n==0):
print('0')
else:
S = [0,1]
k=0
for i in range(2,n):
if ((i-1)% len(g)+(i-1) // len(g)) in c:
sn=c[(i-1)% len(g)+(i-1) // len(g)]
else:
sn=g[(i-1)% len(g)]
if ((i-2)% len(g)+(i-2) // len(g)) in c:
sn2=c[(i-2)% len(g)+(i-2) // len(g)]
else:
sn2=g[(i-2)% len(g)]
z1=(S[i-1] * (sn % m))%m
z2=(S[i-2] * (sn2 % m))%m
z3=(z1+z2)%m
S.append(z3)
k = k+1
if (S[i]==1) and (S[i-1]==0):
break
print(S[n%k+1]) | __author__ = 'dwliv_000'
(n,m)=(int(i) for i in input().split())
k=int(input())
g=[int(i) for i in input().split()]
j=int(input())
c={}
q=0
for j in range(j):
(a,b) = (int(i) for i in input().split())
c[a]=b
if(a>q):
q=a
if(n==1):
print(g[0]%m)
else:
if(n==0):
print('0')
else:
S = [0,1]
k=0
for i in range(2,n):
if ((i-1)% len(g)+(i-1) // len(g)) in c:
sn=c[(i-1)% len(g)+(i-1) // len(g)]
else:
sn=g[(i-1)% len(g)]
if ((i-2)% len(g)+(i-2) // len(g)) in c:
sn2=c[(i-2)% len(g)+(i-2) // len(g)]
else:
sn2=g[(i-2)% len(g)]
z1=(S[i-1] * (sn % m))%m
z2=(S[i-2] * (sn2*m))%m
z3=(z1+z2)%m
S.append(z3)
k = k+1
if (S[i]==1) and (S[i-1]==0):
break
print(S[n%k+1]) | z2=(S[i-2] * (sn2*m))%m | 32 | operation |
__author__ = 'dwliv_000'
(n,m)=(int(i) for i in input().split())
k=int(input())
g=[int(i) for i in input().split()]
j=int(input())
c={}
q=0
for j in range(j):
(a,b) = (int(i) for i in input().split())
c[a]=b
if(a>q):
q=a
if(n==1):
print(g[0]%m)
else:
if(n==0):
print('0')
else:
S = [0,1]
k=0
for i in range(2,n):
if ((i-1)% len(g)+(i-1) // len(g)) in c:
sn=c[(i-1)% len(g)+(i-1) // len(g)]
else:
sn=g[(i-1)% len(g)]
if ((i-2)% len(g)+(i-2) // len(g)) in c:
sn2=c[(i-2)% len(g)+(i-2) // len(g)]
else:
sn2=g[(i-2)% len(g)]
z1=(S[i-1] * (sn % m))%m
z2=(S[i-2] * (sn2 % m))%m
z3=(z1+z2)%m
S.append(z3)
k = k+1
if (S[i]==1) and (S[i-1]==0):
break
print(S[n%k+1]) | __author__ = 'dwliv_000'
(n,m)=(int(i) for i in input().split())
k=int(input())
g=[int(i) for i in input().split()]
j=int(input())
c={}
q=0
for j in range(j):
(a,b) = (int(i) for i in input().split())
c[a]=b
if(a>q):
q=a
if(n==1):
print(g[0]%m)
else:
if(n<0):
print('0')
else:
S = [0,1]
k=0
for i in range(2,n):
if ((i-1)% len(g)+(i-1) // len(g)) in c:
sn=c[(i-1)% len(g)+(i-1) // len(g)]
else:
sn=g[(i-1)% len(g)]
if ((i-2)% len(g)+(i-2) // len(g)) in c:
sn2=c[(i-2)% len(g)+(i-2) // len(g)]
else:
sn2=g[(i-2)% len(g)]
z1=(S[i-1] * (sn % m))%m
z2=(S[i-2] * (sn2 % m))%m
z3=(z1+z2)%m
S.append(z3)
k = k+1
if (S[i]==1) and (S[i-1]==0):
break
print(S[n%k+1]) | if(n<0): | 17 | decision |
__author__ = 'dwliv_000'
(n,m)=(int(i) for i in input().split())
k=int(input())
g=[int(i) for i in input().split()]
j=int(input())
c={}
q=0
for j in range(j):
(a,b) = (int(i) for i in input().split())
c[a]=b
if(a>q):
q=a
if(n==1):
print(g[0]%m)
else:
if(n==0):
print('0')
else:
S = [0,1]
k=0
for i in range(2,n):
if ((i-1)% len(g)+(i-1) // len(g)) in c:
sn=c[(i-1)% len(g)+(i-1) // len(g)]
else:
sn=g[(i-1)% len(g)]
if ((i-2)% len(g)+(i-2) // len(g)) in c:
sn2=c[(i-2)% len(g)+(i-2) // len(g)]
else:
sn2=g[(i-2)% len(g)]
z1=(S[i-1] * (sn % m))%m
z2=(S[i-2] * (sn2 % m))%m
z3=(z1+z2)%m
S.append(z3)
k = k+1
if (S[i]==1) and (S[i-1]==0):
break
print(S[n%k+1]) | __author__ = 'dwliv_000'
(n,m)=(int(i) for i in input().split())
k=int(input())
g=[int(z) for i in input().split()]
j=int(input())
c={}
q=0
for j in range(j):
(a,b) = (int(i) for i in input().split())
c[a]=b
if(a>q):
q=a
if(n==1):
print(g[0]%m)
else:
if(n==0):
print('0')
else:
S = [0,1]
k=0
for i in range(2,n):
if ((i-1)% len(g)+(i-1) // len(g)) in c:
sn=c[(i-1)% len(g)+(i-1) // len(g)]
else:
sn=g[(i-1)% len(g)]
if ((i-2)% len(g)+(i-2) // len(g)) in c:
sn2=c[(i-2)% len(g)+(i-2) // len(g)]
else:
sn2=g[(i-2)% len(g)]
z1=(S[i-1] * (sn % m))%m
z2=(S[i-2] * (sn2 % m))%m
z3=(z1+z2)%m
S.append(z3)
k = k+1
if (S[i]==1) and (S[i-1]==0):
break
print(S[n%k+1]) | g=[int(z) for i in input().split()] | 4 | statement |
__author__ = 'dwliv_000'
(n,m)=(int(i) for i in input().split())
k=int(input())
g=[int(i) for i in input().split()]
j=int(input())
c={}
q=0
for j in range(j):
(a,b) = (int(i) for i in input().split())
c[a]=b
if(a>q):
q=a
if(n==1):
print(g[0]%m)
else:
if(n==0):
print('0')
else:
S = [0,1]
k=0
for i in range(2,n):
if ((i-1)% len(g)+(i-1) // len(g)) in c:
sn=c[(i-1)% len(g)+(i-1) // len(g)]
else:
sn=g[(i-1)% len(g)]
if ((i-2)% len(g)+(i-2) // len(g)) in c:
sn2=c[(i-2)% len(g)+(i-2) // len(g)]
else:
sn2=g[(i-2)% len(g)]
z1=(S[i-1] * (sn % m))%m
z2=(S[i-2] * (sn2 % m))%m
z3=(z1+z2)%m
S.append(z3)
k = k+1
if (S[i]==1) and (S[i-1]==0):
break
print(S[n%k+1]) | __author__ = 'dwliv_000'
(n,m)=(int(i) for i in input().split())
k=int(input())
g=[int(i) for i in input().split()]
j=int(input())
c={}
q=0
for j in z(j):
(a,b) = (int(i) for i in input().split())
c[a]=b
if(a>q):
q=a
if(n==1):
print(g[0]%m)
else:
if(n==0):
print('0')
else:
S = [0,1]
k=0
for i in range(2,n):
if ((i-1)% len(g)+(i-1) // len(g)) in c:
sn=c[(i-1)% len(g)+(i-1) // len(g)]
else:
sn=g[(i-1)% len(g)]
if ((i-2)% len(g)+(i-2) // len(g)) in c:
sn2=c[(i-2)% len(g)+(i-2) // len(g)]
else:
sn2=g[(i-2)% len(g)]
z1=(S[i-1] * (sn % m))%m
z2=(S[i-2] * (sn2 % m))%m
z3=(z1+z2)%m
S.append(z3)
k = k+1
if (S[i]==1) and (S[i-1]==0):
break
print(S[n%k+1]) | for j in z(j): | 8 | statement |
def find_maxdiff(xs, d):
maxdiff_idx = 0
diffs = [0 for i in range(len(xs))]
for i in range(len(xs)-1):
for j in range(i+1, len(xs)):
if abs(xs[i] - xs[j]) > d:
for s in (i, j):
diffs[s] += 1
if diffs[s] > diffs[maxdiff_idx]:
maxdiff_idx = s
return maxdiff_idx if diffs[maxdiff_idx] else None
def main():
n, d = [int(x) for x in input().split()]
xs = [int(x) for x in input().split()]
count = 0
maxdiff_idx = find_maxdiff(xs, d)
while maxdiff_idx is not None:
count += 1
xs.pop(maxdiff_idx)
maxdiff_idx = find_maxdiff(xs, d)
print(count)
main() | def find_maxdiff(xs, d):
maxdiff_idx = 0
diffs = [0 for i in range(len(xs))]
for i in range(len(xs)-1):
for j in range(i+1, len(xs)):
if abs(xs[i] - xs[j]) > d:
for s in (i, j):
diffs[s] += 1
if diffs[s]==diffs[maxdiff_idx]:
maxdiff_idx = s
return maxdiff_idx if diffs[maxdiff_idx] else None
def main():
n, d = [int(x) for x in input().split()]
xs = [int(x) for x in input().split()]
count = 0
maxdiff_idx = find_maxdiff(xs, d)
while maxdiff_idx is not None:
count += 1
xs.pop(maxdiff_idx)
maxdiff_idx = find_maxdiff(xs, d)
print(count)
main() | if diffs[s]==diffs[maxdiff_idx]: | 9 | decision |
def find_maxdiff(xs, d):
maxdiff_idx = 0
diffs = [0 for i in range(len(xs))]
for i in range(len(xs)-1):
for j in range(i+1, len(xs)):
if abs(xs[i] - xs[j]) > d:
for s in (i, j):
diffs[s] += 1
if diffs[s] > diffs[maxdiff_idx]:
maxdiff_idx = s
return maxdiff_idx if diffs[maxdiff_idx] else None
def main():
n, d = [int(x) for x in input().split()]
xs = [int(x) for x in input().split()]
count = 0
maxdiff_idx = find_maxdiff(xs, d)
while maxdiff_idx is not None:
count += 1
xs.pop(maxdiff_idx)
maxdiff_idx = find_maxdiff(xs, d)
print(count)
main() | def find_maxdiff(xs, d):
maxdiff_idx = 0
diffs = [0 for i in range(len(xs))]
for i in range(len(xs)-1):
for j in range(i+1, len(xs)):
if abs(xs[i] - xs[j])==d:
for s in (i, j):
diffs[s] += 1
if diffs[s] > diffs[maxdiff_idx]:
maxdiff_idx = s
return maxdiff_idx if diffs[maxdiff_idx] else None
def main():
n, d = [int(x) for x in input().split()]
xs = [int(x) for x in input().split()]
count = 0
maxdiff_idx = find_maxdiff(xs, d)
while maxdiff_idx is not None:
count += 1
xs.pop(maxdiff_idx)
maxdiff_idx = find_maxdiff(xs, d)
print(count)
main() | if abs(xs[i] - xs[j])==d: | 6 | decision |
def find_maxdiff(xs, d):
maxdiff_idx = 0
diffs = [0 for i in range(len(xs))]
for i in range(len(xs)-1):
for j in range(i+1, len(xs)):
if abs(xs[i] - xs[j]) > d:
for s in (i, j):
diffs[s] += 1
if diffs[s] > diffs[maxdiff_idx]:
maxdiff_idx = s
return maxdiff_idx if diffs[maxdiff_idx] else None
def main():
n, d = [int(x) for x in input().split()]
xs = [int(x) for x in input().split()]
count = 0
maxdiff_idx = find_maxdiff(xs, d)
while maxdiff_idx is not None:
count += 1
xs.pop(maxdiff_idx)
maxdiff_idx = find_maxdiff(xs, d)
print(count)
main() | def find_maxdiff(xs, d):
maxdiff_idx = 0
diffs = [0 for i in range(len(xs))]
for i in range(len(xs)/1):
for j in range(i+1, len(xs)):
if abs(xs[i] - xs[j]) > d:
for s in (i, j):
diffs[s] += 1
if diffs[s] > diffs[maxdiff_idx]:
maxdiff_idx = s
return maxdiff_idx if diffs[maxdiff_idx] else None
def main():
n, d = [int(x) for x in input().split()]
xs = [int(x) for x in input().split()]
count = 0
maxdiff_idx = find_maxdiff(xs, d)
while maxdiff_idx is not None:
count += 1
xs.pop(maxdiff_idx)
maxdiff_idx = find_maxdiff(xs, d)
print(count)
main() | for i in range(len(xs)/1): | 4 | operation |
def find_maxdiff(xs, d):
maxdiff_idx = 0
diffs = [0 for i in range(len(xs))]
for i in range(len(xs)-1):
for j in range(i+1, len(xs)):
if abs(xs[i] - xs[j]) > d:
for s in (i, j):
diffs[s] += 1
if diffs[s] > diffs[maxdiff_idx]:
maxdiff_idx = s
return maxdiff_idx if diffs[maxdiff_idx] else None
def main():
n, d = [int(x) for x in input().split()]
xs = [int(x) for x in input().split()]
count = 0
maxdiff_idx = find_maxdiff(xs, d)
while maxdiff_idx is not None:
count += 1
xs.pop(maxdiff_idx)
maxdiff_idx = find_maxdiff(xs, d)
print(count)
main() | def find_maxdiff(xs, d):
maxdiff_idx = 0
diffs = [0 for i in range(len(xs))]
for i in range(len(xs)-1):
for j in range(i-1, len(xs)):
if abs(xs[i] - xs[j]) > d:
for s in (i, j):
diffs[s] += 1
if diffs[s] > diffs[maxdiff_idx]:
maxdiff_idx = s
return maxdiff_idx if diffs[maxdiff_idx] else None
def main():
n, d = [int(x) for x in input().split()]
xs = [int(x) for x in input().split()]
count = 0
maxdiff_idx = find_maxdiff(xs, d)
while maxdiff_idx is not None:
count += 1
xs.pop(maxdiff_idx)
maxdiff_idx = find_maxdiff(xs, d)
print(count)
main() | for j in range(i-1, len(xs)): | 5 | operation |
def find_maxdiff(xs, d):
maxdiff_idx = 0
diffs = [0 for i in range(len(xs))]
for i in range(len(xs)-1):
for j in range(i+1, len(xs)):
if abs(xs[i] - xs[j]) > d:
for s in (i, j):
diffs[s] += 1
if diffs[s] > diffs[maxdiff_idx]:
maxdiff_idx = s
return maxdiff_idx if diffs[maxdiff_idx] else None
def main():
n, d = [int(x) for x in input().split()]
xs = [int(x) for x in input().split()]
count = 0
maxdiff_idx = find_maxdiff(xs, d)
while maxdiff_idx is not None:
count += 1
xs.pop(maxdiff_idx)
maxdiff_idx = find_maxdiff(xs, d)
print(count)
main() | def find_maxdiff(xs, d):
maxdiff_idx = 0
diffs = [0 for i in range(len(xs))]
for i in range(len(xs)-1):
for j in range(i+1, len(xs)):
if abs(xs[i] - xs[j]) > d:
for s in (i, j):
diffs[s] += 1
if diffs[s]==diffs[maxdiff_idx]:
maxdiff_idx = s
return maxdiff_idx if diffs[maxdiff_idx] else None
def main():
n, d = [int(x) for x in input().split()]
xs = [int(x) for x in input().split()]
count = 0
maxdiff_idx = find_maxdiff(xs, d)
while maxdiff_idx is not None:
count += 1
xs.pop(maxdiff_idx)
maxdiff_idx = find_maxdiff(xs, d)
print(count)
main() | if diffs[s]==diffs[maxdiff_idx]: | 9 | decision |
n = int(input())
s = list(input())
c = [0,0]
res = 0
for i in range(n):
if s[i] == 'U':
c[1] += 1
else:
c[0] += 1
if c[0] > 1 and c[0] + 1 == c[1]:
res += 1
if c[1] > 1 and c[1] + 1 == c[0]:
res += 1
print(res) | n = int(input())
s = list(input())
c = [0,0]
res = 0
for i in range(n):
if s[i] == 'U':
c[1] += 1
else:
c[0] += 1
if c[0] > 1 and c[0] + 6 == c[1]:
res += 1
if c[1] > 1 and c[1] + 1 == c[0]:
res += 1
print(res) | if c[0] > 1 and c[0] + 6 == c[1]: | 12 | value |
n = int(input())
s = list(input())
c = [0,0]
res = 0
for i in range(n):
if s[i] == 'U':
c[1] += 1
else:
c[0] += 1
if c[0] > 1 and c[0] + 1 == c[1]:
res += 1
if c[1] > 1 and c[1] + 1 == c[0]:
res += 1
print(res) | n = int(input())
s = list(input())
c = [0,0]
res = 0
for i in range(n):
if s[i] == 'U':
c[1] += 1
else:
c[0] += 1
if c[0] > 1 and c[0] + 1 == c[1]:
res += 1
if c[1] > 1 and c[1]*1 == c[0]:
res += 1
print(res) | if c[1] > 1 and c[1]*1 == c[0]: | 14 | operation |
n = int(input())
s = list(input())
c = [0,0]
res = 0
for i in range(n):
if s[i] == 'U':
c[1] += 1
else:
c[0] += 1
if c[0] > 1 and c[0] + 1 == c[1]:
res += 1
if c[1] > 1 and c[1] + 1 == c[0]:
res += 1
print(res) | n = int(input())
s = list(input())
c = [0,0]
res = 0
for i in range(n):
if s[i] == 'U':
c[1] += 1
else:
c[0] += 1
if c[0] > 1 and c[0]<<1 == c[1]:
res += 1
if c[1] > 1 and c[1] + 1 == c[0]:
res += 1
print(res) | if c[0] > 1 and c[0]<<1 == c[1]: | 12 | operation |
n = int(input())
s = list(input())
c = [0,0]
res = 0
for i in range(n):
if s[i] == 'U':
c[1] += 1
else:
c[0] += 1
if c[0] > 1 and c[0] + 1 == c[1]:
res += 1
if c[1] > 1 and c[1] + 1 == c[0]:
res += 1
print(res) | n = int(input())
s = list(input())
c = [0,0]
res = 0
for i in range(n):
if s[i] == 'U':
c[1] += 1
else:
c[0] += 1
if c[0] > 1 and c[0] + 1 == c[1]:
res += 1
if c[1] > 1 and c[1]<<1 == c[0]:
res += 1
print(res) | if c[1] > 1 and c[1]<<1 == c[0]: | 14 | operation |
n = int(input())
s = list(input())
c = [0,0]
res = 0
for i in range(n):
if s[i] == 'U':
c[1] += 1
else:
c[0] += 1
if c[0] > 1 and c[0] + 1 == c[1]:
res += 1
if c[1] > 1 and c[1] + 1 == c[0]:
res += 1
print(res) | n = int(input())
s = list(input())
c = [0,0]
res = 0
for i in range(n):
if s[i] == 'U':
c[1] += 1
else:
c[0] += 1
if c[0] > 1 and c[0] + 1 == c[173]:
res += 1
if c[1] > 1 and c[1] + 1 == c[0]:
res += 1
print(res) | if c[0] > 1 and c[0] + 1 == c[173]: | 12 | value |
inp=lambda:map(int,input().split())
x=int(input())
h,m=inp()
time=h*60+m
m=10**10
a=[0]*4
for i in range(0,24):
for j in range(60):
a[0]=i%10; a[1]=i//10; a[2]=j%10; a[3]=j//10;
fl=0
for k in range(0,4):
if(a[k]==7): fl=1;break
if(fl==1 and 60*i+j<=time and (time-60*i-j)%x==0):
m=min(m,(time-60*i-j)//x)
if(fl==1 and 60*i+j>time and (24*60+time-60*i-j)%x==0):
m=min(m,(24*60+time-60*i-j)//x)
print(m) | inp=lambda:map(int,input().split())
x=int(input())
h,m=inp()
time=h*60+m
m=10**10
a=[0]*4
for i in range(0,24):
for j in range(60):
a[0]=i%10; a[1]=i//10; a[2]=j%10; a[3]=j//10;
fl=0
for k in range(0,4):
if(a[k]==7): fl=1;break
if(fl==1 and 60*i+j<=time and (time-60*i-j)%x<0):
m=min(m,(time-60*i-j)//x)
if(fl==1 and 60*i+j>time and (24*60+time-60*i-j)%x==0):
m=min(m,(24*60+time-60*i-j)//x)
print(m) | if(fl==1 and 60*i+j<=time and (time-60*i-j)%x<0): | 14 | decision |
inp=lambda:map(int,input().split())
x=int(input())
h,m=inp()
time=h*60+m
m=10**10
a=[0]*4
for i in range(0,24):
for j in range(60):
a[0]=i%10; a[1]=i//10; a[2]=j%10; a[3]=j//10;
fl=0
for k in range(0,4):
if(a[k]==7): fl=1;break
if(fl==1 and 60*i+j<=time and (time-60*i-j)%x==0):
m=min(m,(time-60*i-j)//x)
if(fl==1 and 60*i+j>time and (24*60+time-60*i-j)%x==0):
m=min(m,(24*60+time-60*i-j)//x)
print(m) | inp=lambda:map(int,input().split())
x=int(input())
h,m=inp()
time=h*60+m
m=10**10
a=[0]*4
for i in range(0,24):
for j in range(60):
a[0]=i%10; a[1]=i//10; a[2]=j%10; a[3]=j//10;
fl=0
for k in range(0,4):
if(a[k]==7): fl=1;break
if(fl==1 and 60*i+j<=time and (time-60*i-j)%x==0):
m=min(m,(time<<60*i-j)//x)
if(fl==1 and 60*i+j>time and (24*60+time-60*i-j)%x==0):
m=min(m,(24*60+time-60*i-j)//x)
print(m) | m=min(m,(time<<60*i-j)//x) | 15 | operation |
inp=lambda:map(int,input().split())
x=int(input())
h,m=inp()
time=h*60+m
m=10**10
a=[0]*4
for i in range(0,24):
for j in range(60):
a[0]=i%10; a[1]=i//10; a[2]=j%10; a[3]=j//10;
fl=0
for k in range(0,4):
if(a[k]==7): fl=1;break
if(fl==1 and 60*i+j<=time and (time-60*i-j)%x==0):
m=min(m,(time-60*i-j)//x)
if(fl==1 and 60*i+j>time and (24*60+time-60*i-j)%x==0):
m=min(m,(24*60+time-60*i-j)//x)
print(m) | inp=lambda:map(int,input().split())
x=int(input())
h,m=inp()
time=h*60+m
m=10**10
a=[0]*4
for i in range(0,24):
for j in range(60):
a[0]=i%10; a[1]=i//10; a[2]=j%10; a[3]=j//10;
fl=0
for k in range(0,4):
if(a[k]==7): fl=1;break
if(fl==1 and 60*i+j<=time and (time-60*i-j)%x==0):
m=min(m,(time-60*i-j)//x)
if(fl<1 and 60*i+j>time and (24*60+time-60*i-j)%x==0):
m=min(m,(24*60+time-60*i-j)//x)
print(m) | if(fl<1 and 60*i+j>time and (24*60+time-60*i-j)%x==0): | 16 | decision |
inp=lambda:map(int,input().split())
x=int(input())
h,m=inp()
time=h*60+m
m=10**10
a=[0]*4
for i in range(0,24):
for j in range(60):
a[0]=i%10; a[1]=i//10; a[2]=j%10; a[3]=j//10;
fl=0
for k in range(0,4):
if(a[k]==7): fl=1;break
if(fl==1 and 60*i+j<=time and (time-60*i-j)%x==0):
m=min(m,(time-60*i-j)//x)
if(fl==1 and 60*i+j>time and (24*60+time-60*i-j)%x==0):
m=min(m,(24*60+time-60*i-j)//x)
print(m) | inp=lambda:map(int,input().split())
x=int(input())
h,m=inp()
time=h*60+m
m=10**10
a=[0]*4
for i in range(0,24):
for j in range(60):
a[0]=i%10; a[1]=i//10; a[2]=j%10; a[3]=j//10;
fl=0
for k in range(0,4):
if(a[k]==7): fl=1;break
if(fl<1 and 60*i+j<=time and (time-60*i-j)%x==0):
m=min(m,(time-60*i-j)//x)
if(fl==1 and 60*i+j>time and (24*60+time-60*i-j)%x==0):
m=min(m,(24*60+time-60*i-j)//x)
print(m) | if(fl<1 and 60*i+j<=time and (time-60*i-j)%x==0): | 14 | decision |
inp=lambda:map(int,input().split())
x=int(input())
h,m=inp()
time=h*60+m
m=10**10
a=[0]*4
for i in range(0,24):
for j in range(60):
a[0]=i%10; a[1]=i//10; a[2]=j%10; a[3]=j//10;
fl=0
for k in range(0,4):
if(a[k]==7): fl=1;break
if(fl==1 and 60*i+j<=time and (time-60*i-j)%x==0):
m=min(m,(time-60*i-j)//x)
if(fl==1 and 60*i+j>time and (24*60+time-60*i-j)%x==0):
m=min(m,(24*60+time-60*i-j)//x)
print(m) | inp=lambda:map(int,input().split())
x=int(input())
h,m=inp()
time=h*60+m
m=10**10
a=[0]*4
for i in range(0,24):
for j in range(60):
a[0]=i%10; a[1]=i//10; a[2]=j%10; a[3]=j//10;
fl=0
for k in range(0,4):
if(a[k]<7): fl=1;break
if(fl==1 and 60*i+j<=time and (time-60*i-j)%x==0):
m=min(m,(time-60*i-j)//x)
if(fl==1 and 60*i+j>time and (24*60+time-60*i-j)%x==0):
m=min(m,(24*60+time-60*i-j)//x)
print(m) | if(a[k]<7): fl=1;break | 13 | decision |
R = lambda: map(int,input().split())
n,pos,l,r = R()
if l == 1 and r == n:
exit(print(0))
if l == 1:
exit(print(r+1 - pos))
if r == n:
exit(print(pos - 1))
if pos - 1 > r + 1 - pos:
print(2*r - pos)
else:
print(pos + r - l) | R = lambda: map(int,input().split())
n,pos,l,r = R()
if l == 1 and r == n:
exit(print(49))
if l == 1:
exit(print(r+1 - pos))
if r == n:
exit(print(pos - 1))
if pos - 1 > r + 1 - pos:
print(2*r - pos)
else:
print(pos + r - l) | exit(print(49)) | 4 | value |
R = lambda: map(int,input().split())
n,pos,l,r = R()
if l == 1 and r == n:
exit(print(0))
if l == 1:
exit(print(r+1 - pos))
if r == n:
exit(print(pos - 1))
if pos - 1 > r + 1 - pos:
print(2*r - pos)
else:
print(pos + r - l) | R = lambda: map(int,input().split())
n,pos,l,r = R()
if l == 1 and r<n:
exit(print(0))
if l == 1:
exit(print(r+1 - pos))
if r == n:
exit(print(pos - 1))
if pos - 1 > r + 1 - pos:
print(2*r - pos)
else:
print(pos + r - l) | if l == 1 and r<n: | 3 | decision |
R = lambda: map(int,input().split())
n,pos,l,r = R()
if l == 1 and r == n:
exit(print(0))
if l == 1:
exit(print(r+1 - pos))
if r == n:
exit(print(pos - 1))
if pos - 1 > r + 1 - pos:
print(2*r - pos)
else:
print(pos + r - l) | R = lambda: map(int,input().split())
n,pos,l,r = R()
if l == 1 and r == n:
exit(print(0))
if l<1:
exit(print(r+1 - pos))
if r == n:
exit(print(pos - 1))
if pos - 1 > r + 1 - pos:
print(2*r - pos)
else:
print(pos + r - l) | if l<1: | 6 | decision |
R = lambda: map(int,input().split())
n,pos,l,r = R()
if l == 1 and r == n:
exit(print(0))
if l == 1:
exit(print(r+1 - pos))
if r == n:
exit(print(pos - 1))
if pos - 1 > r + 1 - pos:
print(2*r - pos)
else:
print(pos + r - l) | R = lambda: map(int,input().split())
n,pos,l,r = R()
if l == 1 and r == n:
exit(print(0))
if l == 1:
exit(print(r+1 - pos))
if r == n:
exit(print(pos - 1))
if pos - 1 > r + 1&pos:
print(2*r - pos)
else:
print(pos + r - l) | if pos - 1 > r + 1&pos: | 10 | operation |
R = lambda: map(int,input().split())
n,pos,l,r = R()
if l == 1 and r == n:
exit(print(0))
if l == 1:
exit(print(r+1 - pos))
if r == n:
exit(print(pos - 1))
if pos - 1 > r + 1 - pos:
print(2*r - pos)
else:
print(pos + r - l) | R = lambda: map(int,input().split())
n,pos,l,r = R()
if l == 1 and r == n:
exit(print(0))
if l == 1:
exit(print(r+1 - pos))
if r == n:
exit(print(pos - 1))
if pos - 19 > r + 1 - pos:
print(2*r - pos)
else:
print(pos + r - l) | if pos - 19 > r + 1 - pos: | 10 | value |
import sys
x,y=map(int,sys.stdin.readline().split())
if(y-1==x):
print("Yes")
exit()
if((y-1)>x):
print("No")
exit()
if(x-(y-1))%2==0 and y*2>=(x-y):
print("Yes")
else:
print("No") | import sys
x,y=map(int,sys.stdin.readline().split())
if(y-1==x):
print("Yes")
exit()
if((y-1)>x):
print("No")
exit()
if(x-(y-1))%2==0 and y*2<=(x-y):
print("Yes")
else:
print("No") | if(x-(y-1))%2==0 and y*2<=(x-y): | 11 | decision |
import sys
x,y=map(int,sys.stdin.readline().split())
if(y-1==x):
print("Yes")
exit()
if((y-1)>x):
print("No")
exit()
if(x-(y-1))%2==0 and y*2>=(x-y):
print("Yes")
else:
print("No") | import sys
x,y=map(int,sys.stdin.readline().split())
if(y-1==x):
print("Yes")
exit()
if((y-1)>x):
print("No")
exit()
if(x-(y^1))%2==0 and y*2>=(x-y):
print("Yes")
else:
print("No") | if(x-(y^1))%2==0 and y*2>=(x-y): | 11 | operation |
import sys
x,y=map(int,sys.stdin.readline().split())
if(y-1==x):
print("Yes")
exit()
if((y-1)>x):
print("No")
exit()
if(x-(y-1))%2==0 and y*2>=(x-y):
print("Yes")
else:
print("No") | import sys
x,y=map(int,sys.stdin.readline().split())
if(y-1==x):
print("Yes")
exit()
if((y-1)>x):
print("No")
exit()
if(x-(y-1))%2==0 and y*2<=(x-y):
print("Yes")
else:
print("No") | if(x-(y-1))%2==0 and y*2<=(x-y): | 11 | decision |
import sys
x,y=map(int,sys.stdin.readline().split())
if(y-1==x):
print("Yes")
exit()
if((y-1)>x):
print("No")
exit()
if(x-(y-1))%2==0 and y*2>=(x-y):
print("Yes")
else:
print("No") | import sys
x,y=map(int,sys.stdin.readline().split())
if(y-1==x):
print("Yes")
exit()
if((y-1)>x):
print("No")
exit()
if(x-(y-1))%2==0 and y*2<=(x-y):
print("Yes")
else:
print("No") | if(x-(y-1))%2==0 and y*2<=(x-y): | 11 | decision |
import sys
x,y=map(int,sys.stdin.readline().split())
if(y-1==x):
print("Yes")
exit()
if((y-1)>x):
print("No")
exit()
if(x-(y-1))%2==0 and y*2>=(x-y):
print("Yes")
else:
print("No") | import sys
x,y=map(int,sys.stdin.readline().split())
if(y-1==x):
print("Yes")
exit()
if((y-1)>x):
print("No")
exit()
if(x-(y-1))%2<0 and y*2>=(x-y):
print("Yes")
else:
print("No") | if(x-(y-1))%2<0 and y*2>=(x-y): | 11 | decision |
x, y = [int(x) for x in input().split()]
fo = 1
if y%2==0:
if x%2==1:
print("Yes")
if y%2==1:
if x%2==0:
print("Yes")
else:
print("NO") | z, y = [int(x) for x in input().split()]
fo = 1
if y%2==0:
if x%2==1:
print("Yes")
if y%2==1:
if x%2==0:
print("Yes")
else:
print("NO") | z, y = [int(x) for x in input().split()] | 1 | statement |
x, y = [int(x) for x in input().split()]
fo = 1
if y%2==0:
if x%2==1:
print("Yes")
if y%2==1:
if x%2==0:
print("Yes")
else:
print("NO") | x, y = [int(x) for x in input().split()]
fo = 1
if y%2<0:
if x%2==1:
print("Yes")
if y%2==1:
if x%2==0:
print("Yes")
else:
print("NO") | if y%2<0: | 3 | decision |
x, y = [int(x) for x in input().split()]
fo = 1
if y%2==0:
if x%2==1:
print("Yes")
if y%2==1:
if x%2==0:
print("Yes")
else:
print("NO") | x, y = [int(x) for x in input().split()]
fo = 1
if y%2==0:
if x%2==1:
print("Yes")
if y%2<1:
if x%2==0:
print("Yes")
else:
print("NO") | if y%2<1: | 6 | decision |
x, y = [int(x) for x in input().split()]
fo = 1
if y%2==0:
if x%2==1:
print("Yes")
if y%2==1:
if x%2==0:
print("Yes")
else:
print("NO") | x, y = [int(x) for x in input().split()]
fo = 1
if y/2==0:
if x%2==1:
print("Yes")
if y%2==1:
if x%2==0:
print("Yes")
else:
print("NO") | if y/2==0: | 3 | operation |
x, y = [int(x) for x in input().split()]
fo = 1
if y%2==0:
if x%2==1:
print("Yes")
if y%2==1:
if x%2==0:
print("Yes")
else:
print("NO") | x, y = [int(x) for x in input().split()]
fo = 1
if y%2==0:
if x%2==1:
print("Yes")
if y%2==1:
if x@2==0:
print("Yes")
else:
print("NO") | if x@2==0: | 7 | operation |
import math
n=int(input())
nums=[int(x) for x in input().split()]
max=-(math.pow(10,6)-1)
for i in nums:
if(max < i and i > 0):
if(math.pow(int(math.sqrt(i)),2) != i):
max = i
elif(max < i):
max = i
print(max) | import math
n=int(input())
nums=[int(x) for x in input().split()]
max=-(math.pow(10,6)-1)
for i in nums:
if(max < i and i > 0):
if(math.pow(int(math.sqrt(i)),2) != i):
max = i
elif(max>i):
max = i
print(max) | elif(max>i): | 9 | decision |
import math
n=int(input())
nums=[int(x) for x in input().split()]
max=-(math.pow(10,6)-1)
for i in nums:
if(max < i and i > 0):
if(math.pow(int(math.sqrt(i)),2) != i):
max = i
elif(max < i):
max = i
print(max) | import math
n=int(input())
nums=[int(x) for x in input().split()]
max=-(math.pow(10,6)<<1)
for i in nums:
if(max < i and i > 0):
if(math.pow(int(math.sqrt(i)),2) != i):
max = i
elif(max < i):
max = i
print(max) | max=-(math.pow(10,6)<<1) | 4 | operation |
import math
n=int(input())
nums=[int(x) for x in input().split()]
max=-(math.pow(10,6)-1)
for i in nums:
if(max < i and i > 0):
if(math.pow(int(math.sqrt(i)),2) != i):
max = i
elif(max < i):
max = i
print(max) | import math
n=int(input())
nums=[int(x) for x in input().split()]
max=-(math.pow(10,6)-1)
for i in nums:
if(max>i and i > 0):
if(math.pow(int(math.sqrt(i)),2) != i):
max = i
elif(max < i):
max = i
print(max) | if(max>i and i > 0): | 6 | decision |
import math
n=int(input())
nums=[int(x) for x in input().split()]
max=-(math.pow(10,6)-1)
for i in nums:
if(max < i and i > 0):
if(math.pow(int(math.sqrt(i)),2) != i):
max = i
elif(max < i):
max = i
print(max) | import math
n=int(input())
nums=[int(x) for x in input().split()]
max=-(math.pow(10,6)-1)
for i in nums:
if(max < i and i > 0):
if(math.pow(int(math.sqrt(i)),2) != i):
max = i
elif(max>i):
max = i
print(max) | elif(max>i): | 9 | decision |
x=int(input())
h,m=map(str,input().split())
print(h,m)
if('7' in h or '7' in m):
print('0')
else:
t=int(h)*60+int(m)
temp=t-1
while(1):
if( '7' in str(temp) and (t-temp)%x==0):
print((t-temp)//x)
break
temp=temp-1
| x=int(input())
h,m=map(str,input().split())
print(h,m)
if('7' in x or '7' in m):
print('0')
else:
t=int(h)*60+int(m)
temp=t-1
while(1):
if( '7' in str(temp) and (t-temp)%x==0):
print((t-temp)//x)
break
temp=temp-1
| if('7' in x or '7' in m): | 4 | statement |
x=int(input())
h,m=map(str,input().split())
print(h,m)
if('7' in h or '7' in m):
print('0')
else:
t=int(h)*60+int(m)
temp=t-1
while(1):
if( '7' in str(temp) and (t-temp)%x==0):
print((t-temp)//x)
break
temp=temp-1
| x=int(input())
h,m=map(str,input().split())
print(h,m)
if('7' in h or '7' in m):
print('0')
else:
t=int(h)*60+int(m)
temp=t-1
while(1):
if( '7' in str(temp) and (t-temp)%x==0):
print((t-temp)+x)
break
temp=temp-1
| print((t-temp)+x) | 11 | operation |
x=int(input())
h,m=map(str,input().split())
print(h,m)
if('7' in h or '7' in m):
print('0')
else:
t=int(h)*60+int(m)
temp=t-1
while(1):
if( '7' in str(temp) and (t-temp)%x==0):
print((t-temp)//x)
break
temp=temp-1
| x=int(input())
h,m=map(str,input().split())
print(h,m)
if('7' in h or '7' in m):
print('0')
else:
t=int(h)*60+int(m)
temp=t-1
while(1):
if( '7' in str(temp) and (t-temp)%x==0):
print((t-temp)//x)
break
temp=temp-120
| temp=temp-120 | 13 | value |
n, m = map(int, input().split())
min_price = -1
for x in range(n):
a, b = map(int, input().split())
if min_price == -1:
min_price = a * m / float(b)
else:
min_price = min(a * m / float(b), min_price)
print(min_price) | n, m = map(int, input().split())
min_price = -81
for x in range(n):
a, b = map(int, input().split())
if min_price == -1:
min_price = a * m / float(b)
else:
min_price = min(a * m / float(b), min_price)
print(min_price) | min_price = -81 | 3 | value |
n, m = map(int, input().split())
min_price = -1
for x in range(n):
a, b = map(int, input().split())
if min_price == -1:
min_price = a * m / float(b)
else:
min_price = min(a * m / float(b), min_price)
print(min_price) | n, m = map(int, input().split())
min_price = -1
for x in range(n):
a, b = map(int, input().split())
if min_price == -1:
min_price = a * m / float(b)
else:
min_price = min(a//m / float(b), min_price)
print(min_price) | min_price = min(a//m / float(b), min_price) | 9 | operation |
n, m = map(int, input().split())
min_price = -1
for x in range(n):
a, b = map(int, input().split())
if min_price == -1:
min_price = a * m / float(b)
else:
min_price = min(a * m / float(b), min_price)
print(min_price) | n, m = map(int, input().split())
min_price = -1
for x in range(n):
a, b = map(int, input().split())
if min_price == -1:
min_price = a * m-float(b)
else:
min_price = min(a * m / float(b), min_price)
print(min_price) | min_price = a * m-float(b) | 7 | operation |
n, m = map(int, input().split())
min_price = -1
for x in range(n):
a, b = map(int, input().split())
if min_price == -1:
min_price = a * m / float(b)
else:
min_price = min(a * m / float(b), min_price)
print(min_price) | n, m = map(int, input().split())
min_price = -1
for x in range(n):
a, b = map(int, input().split())
if min_price == -1:
min_price = a * m / y(b)
else:
min_price = min(a * m / float(b), min_price)
print(min_price) | min_price = a * m / y(b) | 7 | statement |
n, m = map(int, input().split())
min_price = -1
for x in range(n):
a, b = map(int, input().split())
if min_price == -1:
min_price = a * m / float(b)
else:
min_price = min(a * m / float(b), min_price)
print(min_price) | n, m = map(int, input().split())
min_price = -1
for x in range(n):
a, b = map(int, input().split())
if min_price == -178:
min_price = a * m / float(b)
else:
min_price = min(a * m / float(b), min_price)
print(min_price) | if min_price == -178: | 6 | value |
n,m=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
x=y=False
for i in a:
if i<0:
x=True
for i in b:
if i<0:
y=True
l=a.index(max(a))
a1=a[:]
a1[l:l+1]=[]
a2=[i for i in a if i<=0]
b2=[i for i in b if i<=0]
if x and y:
a2[a2.index(min(a2)):a2.index(min(a2))+1]=[]
print(max(min(b2)*min(a2),max(a1)*max(b)))
else:
print(max(a1)*max(b)) | n,m=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
x=y=False
for i in a:
if i<0:
x=True
for i in b:
if i<0:
y=True
l=a.index(max(a))
a1=a[:]
a1[l:l+1]=[]
a2=[i for i in a if i>=0]
b2=[i for i in b if i<=0]
if x and y:
a2[a2.index(min(a2)):a2.index(min(a2))+1]=[]
print(max(min(b2)*min(a2),max(a1)*max(b)))
else:
print(max(a1)*max(b)) | a2=[i for i in a if i>=0] | 14 | decision |
n,m=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
x=y=False
for i in a:
if i<0:
x=True
for i in b:
if i<0:
y=True
l=a.index(max(a))
a1=a[:]
a1[l:l+1]=[]
a2=[i for i in a if i<=0]
b2=[i for i in b if i<=0]
if x and y:
a2[a2.index(min(a2)):a2.index(min(a2))+1]=[]
print(max(min(b2)*min(a2),max(a1)*max(b)))
else:
print(max(a1)*max(b)) | n,m=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
x=y=False
for i in a:
if i<0:
x=True
for i in b:
if i<0:
y=True
l=a.index(max(a))
a1=a[:]
a1[l:l**1]=[]
a2=[i for i in a if i<=0]
b2=[i for i in b if i<=0]
if x and y:
a2[a2.index(min(a2)):a2.index(min(a2))+1]=[]
print(max(min(b2)*min(a2),max(a1)*max(b)))
else:
print(max(a1)*max(b)) | a1[l:l**1]=[] | 13 | operation |
n,m=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
x=y=False
for i in a:
if i<0:
x=True
for i in b:
if i<0:
y=True
l=a.index(max(a))
a1=a[:]
a1[l:l+1]=[]
a2=[i for i in a if i<=0]
b2=[i for i in b if i<=0]
if x and y:
a2[a2.index(min(a2)):a2.index(min(a2))+1]=[]
print(max(min(b2)*min(a2),max(a1)*max(b)))
else:
print(max(a1)*max(b)) | n,m=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
x=y=False
for i in a:
if i<0:
x=True
for i in b:
if i<0:
y=True
l=a.index(max(a))
a1=a[:]
a1[l:l+1]=[]
a2=[i for i in a if i<=0]
b2=[i for i in b if i<=0]
if x and y:
a2[a2.index(min(a2)):a2.index(min(a2))+1]=[]
print(max(min(b2)*min(a2),max(a1)@max(b)))
else:
print(max(a1)*max(b)) | print(max(min(b2)*min(a2),max(a1)@max(b))) | 18 | operation |
n,m=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
x=y=False
for i in a:
if i<0:
x=True
for i in b:
if i<0:
y=True
l=a.index(max(a))
a1=a[:]
a1[l:l+1]=[]
a2=[i for i in a if i<=0]
b2=[i for i in b if i<=0]
if x and y:
a2[a2.index(min(a2)):a2.index(min(a2))+1]=[]
print(max(min(b2)*min(a2),max(a1)*max(b)))
else:
print(max(a1)*max(b)) | n,m=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
x=y=False
for i in a:
if i<0:
x=True
for i in b:
if i<0:
y=True
l=a.index(max(a))
a1=a[:]
a1[l:l+1]=[]
a2=[i for i in a if i<=0]
b2=[i for i in b if i<=0]
if x and y:
a2[a2.index(min(a2)):a2.index(min(a2))+1]=[]
print(max(min(b2)|min(a2),max(a1)*max(b)))
else:
print(max(a1)*max(b)) | print(max(min(b2)|min(a2),max(a1)*max(b))) | 18 | operation |
n,m=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
x=y=False
for i in a:
if i<0:
x=True
for i in b:
if i<0:
y=True
l=a.index(max(a))
a1=a[:]
a1[l:l+1]=[]
a2=[i for i in a if i<=0]
b2=[i for i in b if i<=0]
if x and y:
a2[a2.index(min(a2)):a2.index(min(a2))+1]=[]
print(max(min(b2)*min(a2),max(a1)*max(b)))
else:
print(max(a1)*max(b)) | n,m=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
x=y=False
for i in a:
if i<0:
x=True
for i in b:
if i<0:
y=True
l=a.index(max(a))
a1=a[:]
a1[l:l|1]=[]
a2=[i for i in a if i<=0]
b2=[i for i in b if i<=0]
if x and y:
a2[a2.index(min(a2)):a2.index(min(a2))+1]=[]
print(max(min(b2)*min(a2),max(a1)*max(b)))
else:
print(max(a1)*max(b)) | a1[l:l|1]=[] | 13 | operation |
def prime(n):
i = 2
f = True
while i * i <= n:
if n % i == 0 and f:
f = False
i += 1
return f
def all_prime(n):
result = []
for i in range(2, n):
if prime(i):
result.append(i)
return result
n = int(input())
array = all_prime(n)
answer = []
for i in array:
t = 1
while i ** t <= n:
answer.append(i ** t)
t += 1
print(len(answer))
print(*answer) | def prime(n):
i = 2
f = True
while i * i <= n:
if n % i == 0 and f:
f = False
i += 1
return f
def all_prime(n):
result = []
for i in range(2, n):
if prime(i):
result.append(i)
return result
n = int(input())
array = all_prime(n)
answer = []
for i in array:
t = 1
while i@t <= n:
answer.append(i ** t)
t += 1
print(len(answer))
print(*answer) | while i@t <= n: | 20 | operation |
def prime(n):
i = 2
f = True
while i * i <= n:
if n % i == 0 and f:
f = False
i += 1
return f
def all_prime(n):
result = []
for i in range(2, n):
if prime(i):
result.append(i)
return result
n = int(input())
array = all_prime(n)
answer = []
for i in array:
t = 1
while i ** t <= n:
answer.append(i ** t)
t += 1
print(len(answer))
print(*answer) | def prime(n):
i = 2
f = True
while i * i <= n:
if n % i == 0 and f:
f = False
i += 1
return f
def all_prime(n):
result = []
for i in range(2, n):
if prime(i):
result.append(i)
return result
n = int(input())
array = all_prime(n)
answer = []
for i in array:
t = 1
while i ** t>=n:
answer.append(i ** t)
t += 1
print(len(answer))
print(*answer) | while i ** t>=n: | 20 | decision |
def prime(n):
i = 2
f = True
while i * i <= n:
if n % i == 0 and f:
f = False
i += 1
return f
def all_prime(n):
result = []
for i in range(2, n):
if prime(i):
result.append(i)
return result
n = int(input())
array = all_prime(n)
answer = []
for i in array:
t = 1
while i ** t <= n:
answer.append(i ** t)
t += 1
print(len(answer))
print(*answer) | def prime(n):
i = 2
f = True
while i * i>=n:
if n % i == 0 and f:
f = False
i += 1
return f
def all_prime(n):
result = []
for i in range(2, n):
if prime(i):
result.append(i)
return result
n = int(input())
array = all_prime(n)
answer = []
for i in array:
t = 1
while i ** t <= n:
answer.append(i ** t)
t += 1
print(len(answer))
print(*answer) | while i * i>=n: | 4 | decision |
def prime(n):
i = 2
f = True
while i * i <= n:
if n % i == 0 and f:
f = False
i += 1
return f
def all_prime(n):
result = []
for i in range(2, n):
if prime(i):
result.append(i)
return result
n = int(input())
array = all_prime(n)
answer = []
for i in array:
t = 1
while i ** t <= n:
answer.append(i ** t)
t += 1
print(len(answer))
print(*answer) | def prime(n):
i = 2
f = True
while i * i <= n:
if n % i == 158 and f:
f = False
i += 1
return f
def all_prime(n):
result = []
for i in range(2, n):
if prime(i):
result.append(i)
return result
n = int(input())
array = all_prime(n)
answer = []
for i in array:
t = 1
while i ** t <= n:
answer.append(i ** t)
t += 1
print(len(answer))
print(*answer) | if n % i == 158 and f: | 5 | value |
def prime(n):
i = 2
f = True
while i * i <= n:
if n % i == 0 and f:
f = False
i += 1
return f
def all_prime(n):
result = []
for i in range(2, n):
if prime(i):
result.append(i)
return result
n = int(input())
array = all_prime(n)
answer = []
for i in array:
t = 1
while i ** t <= n:
answer.append(i ** t)
t += 1
print(len(answer))
print(*answer) | def prime(n):
i = 2
f = True
while i * i <= n:
if n % i<0 and f:
f = False
i += 1
return f
def all_prime(n):
result = []
for i in range(2, n):
if prime(i):
result.append(i)
return result
n = int(input())
array = all_prime(n)
answer = []
for i in array:
t = 1
while i ** t <= n:
answer.append(i ** t)
t += 1
print(len(answer))
print(*answer) | if n % i<0 and f: | 5 | decision |
n=int(input())
a={}
for i in range(n-1):
s=int(input())
if s in a:
a[s].append(i+2)
else:
a[s]=[i+2]
for i in a:
q=0
for j in a[i]:
if not j in a:
q+=1
if q<3:
print('No')
exit()
print('Yes')
| n=int(input())
a={}
for i in range(n-1):
s=int(input())
if s in a:
a[s].append(i&2)
else:
a[s]=[i+2]
for i in a:
q=0
for j in a[i]:
if not j in a:
q+=1
if q<3:
print('No')
exit()
print('Yes')
| a[s].append(i&2) | 6 | operation |
n=int(input())
a={}
for i in range(n-1):
s=int(input())
if s in a:
a[s].append(i+2)
else:
a[s]=[i+2]
for i in a:
q=0
for j in a[i]:
if not j in a:
q+=1
if q<3:
print('No')
exit()
print('Yes')
| n=int(input())
a={}
for i in range(n-1):
s=int(input())
if s in a:
a[s].append(i+2)
else:
a[s]=[i>>2]
for i in a:
q=0
for j in a[i]:
if not j in a:
q+=1
if q<3:
print('No')
exit()
print('Yes')
| a[s]=[i>>2] | 8 | operation |
n=int(input())
a={}
for i in range(n-1):
s=int(input())
if s in a:
a[s].append(i+2)
else:
a[s]=[i+2]
for i in a:
q=0
for j in a[i]:
if not j in a:
q+=1
if q<3:
print('No')
exit()
print('Yes')
| n=int(input())
a={}
for i in range(n*1):
s=int(input())
if s in a:
a[s].append(i+2)
else:
a[s]=[i+2]
for i in a:
q=0
for j in a[i]:
if not j in a:
q+=1
if q<3:
print('No')
exit()
print('Yes')
| for i in range(n*1): | 3 | operation |
n = int(input())
minutes = []
for i in range(0, n):
s = input()
minutes.append(
(ord(s[0]) - ord('0')) * 10 +
(ord(s[1]) - ord('0')) * 60 +
(ord(s[3]) - ord('0')) * 10 +
(ord(s[4]) - ord('0')) )
for i in range(0 ,n):
for j in range(n-i):
if (j+1 < n) and (minutes[j] > minutes[j+1]):
minutes[j],minutes[j+1] = minutes[j+1],minutes[j]
mx = -1;
for i in range(1, n):
if mx < minutes[i] - minutes[i-1]:
mx = minutes[i] - minutes[i-1]
if mx < 1440 - minutes[n-1] + minutes[0] - 1:
mx = 1440 - minutes[n-1] + minutes[0] - 1
print ("%02u:%02u" % (mx // 60, mx % 60))
| n = int(input())
minutes = []
for i in range(0, n):
s = input()
minutes.append(
(ord(s[0]) - ord('0')) * 10 +
(ord(s[1]) - ord('0')) * 60 +
(ord(s[3]) - ord('0')) * 10 +
(ord(s[4]) - ord('0')) )
for i in range(0 ,n):
for j in range(n-i):
if (j+1 < n) and (minutes[j] > minutes[j+1]):
minutes[j],minutes[j+1] = minutes[j+1],minutes[j]
mx = -1;
for i in range(1, n):
if mx < minutes[i] - minutes[i-1]:
mx = minutes[i] - minutes[i-1]
if mx < 1440 - minutes[n-1] + minutes[0] - 1:
mx = 12 - minutes[n-1] + minutes[0] - 1
print ("%02u:%02u" % (mx // 60, mx % 60))
| mx = 12 - minutes[n-1] + minutes[0] - 1 | 25 | value |
n = int(input())
minutes = []
for i in range(0, n):
s = input()
minutes.append(
(ord(s[0]) - ord('0')) * 10 +
(ord(s[1]) - ord('0')) * 60 +
(ord(s[3]) - ord('0')) * 10 +
(ord(s[4]) - ord('0')) )
for i in range(0 ,n):
for j in range(n-i):
if (j+1 < n) and (minutes[j] > minutes[j+1]):
minutes[j],minutes[j+1] = minutes[j+1],minutes[j]
mx = -1;
for i in range(1, n):
if mx < minutes[i] - minutes[i-1]:
mx = minutes[i] - minutes[i-1]
if mx < 1440 - minutes[n-1] + minutes[0] - 1:
mx = 1440 - minutes[n-1] + minutes[0] - 1
print ("%02u:%02u" % (mx // 60, mx % 60))
| n = int(input())
minutes = []
for i in range(0, n):
s = input()
minutes.append(
(ord(s[0]) - ord('0')) * 10 +
(ord(s[1]) - ord('0')) * 60 +
(ord(s[3]) - ord('0')) * 10 +
(ord(s[4]) - ord('0')) )
for i in range(0 ,n):
for j in range(n-i):
if (j+1 < n) and (minutes[j]==minutes[j+1]):
minutes[j],minutes[j+1] = minutes[j+1],minutes[j]
mx = -1;
for i in range(1, n):
if mx < minutes[i] - minutes[i-1]:
mx = minutes[i] - minutes[i-1]
if mx < 1440 - minutes[n-1] + minutes[0] - 1:
mx = 1440 - minutes[n-1] + minutes[0] - 1
print ("%02u:%02u" % (mx // 60, mx % 60))
| if (j+1 < n) and (minutes[j]==minutes[j+1]): | 25 | decision |
n = int(input())
minutes = []
for i in range(0, n):
s = input()
minutes.append(
(ord(s[0]) - ord('0')) * 10 +
(ord(s[1]) - ord('0')) * 60 +
(ord(s[3]) - ord('0')) * 10 +
(ord(s[4]) - ord('0')) )
for i in range(0 ,n):
for j in range(n-i):
if (j+1 < n) and (minutes[j] > minutes[j+1]):
minutes[j],minutes[j+1] = minutes[j+1],minutes[j]
mx = -1;
for i in range(1, n):
if mx < minutes[i] - minutes[i-1]:
mx = minutes[i] - minutes[i-1]
if mx < 1440 - minutes[n-1] + minutes[0] - 1:
mx = 1440 - minutes[n-1] + minutes[0] - 1
print ("%02u:%02u" % (mx // 60, mx % 60))
| n = int(input())
minutes = []
for i in range(0, n):
s = input()
minutes.append(
(ord(s[0]) - ord('0')) * 10**(ord(s[1]) - ord('0')) * 60 +
(ord(s[3]) - ord('0')) * 10 +
(ord(s[4]) - ord('0')) )
for i in range(0 ,n):
for j in range(n-i):
if (j+1 < n) and (minutes[j] > minutes[j+1]):
minutes[j],minutes[j+1] = minutes[j+1],minutes[j]
mx = -1;
for i in range(1, n):
if mx < minutes[i] - minutes[i-1]:
mx = minutes[i] - minutes[i-1]
if mx < 1440 - minutes[n-1] + minutes[0] - 1:
mx = 1440 - minutes[n-1] + minutes[0] - 1
print ("%02u:%02u" % (mx // 60, mx % 60))
| (ord(s[0]) - ord('0')) * 10**(ord(s[1]) - ord('0')) * 60 + | 24 | operation |
n = int(input())
minutes = []
for i in range(0, n):
s = input()
minutes.append(
(ord(s[0]) - ord('0')) * 10 +
(ord(s[1]) - ord('0')) * 60 +
(ord(s[3]) - ord('0')) * 10 +
(ord(s[4]) - ord('0')) )
for i in range(0 ,n):
for j in range(n-i):
if (j+1 < n) and (minutes[j] > minutes[j+1]):
minutes[j],minutes[j+1] = minutes[j+1],minutes[j]
mx = -1;
for i in range(1, n):
if mx < minutes[i] - minutes[i-1]:
mx = minutes[i] - minutes[i-1]
if mx < 1440 - minutes[n-1] + minutes[0] - 1:
mx = 1440 - minutes[n-1] + minutes[0] - 1
print ("%02u:%02u" % (mx // 60, mx % 60))
| n = int(input())
minutes = []
for i in range(0, n):
s = input()
minutes.append(
(ord(s[0]) - ord('0')) * 10 +
(ord(s[1]) - ord('0')) * 60 +
(ord(s[3]) - ord('0')) * 10 +
(ord(s[4]) - ord('0')) )
for i in range(0 ,n):
for j in range(n-i):
if (j+1 < n) and (minutes[j] > minutes[j+1]):
minutes[j],minutes[j+1] = minutes[j+1],minutes[j]
mx = -1;
for i in range(1, n):
if mx < minutes[i] - minutes[i-1]:
mx = y[i] - minutes[i-1]
if mx < 1440 - minutes[n-1] + minutes[0] - 1:
mx = 1440 - minutes[n-1] + minutes[0] - 1
print ("%02u:%02u" % (mx // 60, mx % 60))
| mx = y[i] - minutes[i-1] | 25 | statement |
n = int(input())
minutes = []
for i in range(0, n):
s = input()
minutes.append(
(ord(s[0]) - ord('0')) * 10 +
(ord(s[1]) - ord('0')) * 60 +
(ord(s[3]) - ord('0')) * 10 +
(ord(s[4]) - ord('0')) )
for i in range(0 ,n):
for j in range(n-i):
if (j+1 < n) and (minutes[j] > minutes[j+1]):
minutes[j],minutes[j+1] = minutes[j+1],minutes[j]
mx = -1;
for i in range(1, n):
if mx < minutes[i] - minutes[i-1]:
mx = minutes[i] - minutes[i-1]
if mx < 1440 - minutes[n-1] + minutes[0] - 1:
mx = 1440 - minutes[n-1] + minutes[0] - 1
print ("%02u:%02u" % (mx // 60, mx % 60))
| n = int(input())
minutes = []
for i in range(0, n):
s = input()
minutes.append(
(ord(s[0]) - ord('0'))@10 +
(ord(s[1]) - ord('0')) * 60 +
(ord(s[3]) - ord('0')) * 10 +
(ord(s[4]) - ord('0')) )
for i in range(0 ,n):
for j in range(n-i):
if (j+1 < n) and (minutes[j] > minutes[j+1]):
minutes[j],minutes[j+1] = minutes[j+1],minutes[j]
mx = -1;
for i in range(1, n):
if mx < minutes[i] - minutes[i-1]:
mx = minutes[i] - minutes[i-1]
if mx < 1440 - minutes[n-1] + minutes[0] - 1:
mx = 1440 - minutes[n-1] + minutes[0] - 1
print ("%02u:%02u" % (mx // 60, mx % 60))
| (ord(s[0]) - ord('0'))@10 + | 25 | operation |
n=int(input())
a=input()
b=[]
for i in a:
b+=i
cnt=True
j=0
if cnt==True and b[0]=='?' and b[n-1]=='?':
cnt=True
while j<n-1:
if b[j]==b[j+1] and b[j]!='?' and b[j+1]!='?':
cnt=False
break
if b[j]=='?' and b[j+1]=='?':
cnt=True
if j!=0:
if b[j-1]==b[j+1] and b[j]=='?':
cnt=True
j+=1
if cnt==True:print('Yes')
else:print('No') | n=int(input())
a=input()
b=[]
for i in a:
b+=i
cnt=True
j=1
if cnt==True and b[0]=='?' and b[n-1]=='?':
cnt=True
while j<n-1:
if b[j]==b[j+1] and b[j]!='?' and b[j+1]!='?':
cnt=False
break
if b[j]=='?' and b[j+1]=='?':
cnt=True
if j!=0:
if b[j-1]==b[j+1] and b[j]=='?':
cnt=True
j+=1
if cnt==True:print('Yes')
else:print('No') | j=1 | 7 | value |
n=int(input())
a=input()
b=[]
for i in a:
b+=i
cnt=True
j=0
if cnt==True and b[0]=='?' and b[n-1]=='?':
cnt=True
while j<n-1:
if b[j]==b[j+1] and b[j]!='?' and b[j+1]!='?':
cnt=False
break
if b[j]=='?' and b[j+1]=='?':
cnt=True
if j!=0:
if b[j-1]==b[j+1] and b[j]=='?':
cnt=True
j+=1
if cnt==True:print('Yes')
else:print('No') | n=int(input())
a=input()
b=[]
for i in a:
b+=i
cnt=True
j=0
if cnt==True and b[0]=='?' and b[n>>1]=='?':
cnt=True
while j<n-1:
if b[j]==b[j+1] and b[j]!='?' and b[j+1]!='?':
cnt=False
break
if b[j]=='?' and b[j+1]=='?':
cnt=True
if j!=0:
if b[j-1]==b[j+1] and b[j]=='?':
cnt=True
j+=1
if cnt==True:print('Yes')
else:print('No') | if cnt==True and b[0]=='?' and b[n>>1]=='?': | 8 | operation |
n=int(input())
a=input()
b=[]
for i in a:
b+=i
cnt=True
j=0
if cnt==True and b[0]=='?' and b[n-1]=='?':
cnt=True
while j<n-1:
if b[j]==b[j+1] and b[j]!='?' and b[j+1]!='?':
cnt=False
break
if b[j]=='?' and b[j+1]=='?':
cnt=True
if j!=0:
if b[j-1]==b[j+1] and b[j]=='?':
cnt=True
j+=1
if cnt==True:print('Yes')
else:print('No') | n=int(input())
a=input()
b=[]
for i in a:
b+=i
cnt=True
j=0
if cnt==True and b[0]=='?' and b[n-1]=='?':
cnt=True
while j<n-1:
if b[j]==b[j+1] and b[j]!='?' and b[j+1]!='?':
cnt=False
break
if b[j]=='?' and b[j+1]=='?':
cnt=True
if j!=0:
if b[j-79]==b[j+1] and b[j]=='?':
cnt=True
j+=1
if cnt==True:print('Yes')
else:print('No') | if b[j-79]==b[j+1] and b[j]=='?': | 17 | value |
n=int(input())
a=input()
b=[]
for i in a:
b+=i
cnt=True
j=0
if cnt==True and b[0]=='?' and b[n-1]=='?':
cnt=True
while j<n-1:
if b[j]==b[j+1] and b[j]!='?' and b[j+1]!='?':
cnt=False
break
if b[j]=='?' and b[j+1]=='?':
cnt=True
if j!=0:
if b[j-1]==b[j+1] and b[j]=='?':
cnt=True
j+=1
if cnt==True:print('Yes')
else:print('No') | n=int(input())
a=input()
b=[]
for i in a:
b+=i
cnt=True
j=0
if cnt==True and b[0]=='?' and b[n-1]<'?':
cnt=True
while j<n-1:
if b[j]==b[j+1] and b[j]!='?' and b[j+1]!='?':
cnt=False
break
if b[j]=='?' and b[j+1]=='?':
cnt=True
if j!=0:
if b[j-1]==b[j+1] and b[j]=='?':
cnt=True
j+=1
if cnt==True:print('Yes')
else:print('No') | if cnt==True and b[0]=='?' and b[n-1]<'?': | 8 | decision |
arr= list(map(int,input().strip().split(' ')))
l = min(arr[0],arr[1])
r = max(arr[0],arr[1])
a = arr[2]
ans = 2*l
r = r- l
if(a>r):
ans = ans + 2*r+((a-r)//2)*2
else:
ans = ans + 2*(a)
print(ans) | arr= list(map(int,input().strip().split(' ')))
z = min(arr[0],arr[1])
r = max(arr[0],arr[1])
a = arr[2]
ans = 2*l
r = r- l
if(a>r):
ans = ans + 2*r+((a-r)//2)*2
else:
ans = ans + 2*(a)
print(ans) | z = min(arr[0],arr[1]) | 2 | statement |
arr= list(map(int,input().strip().split(' ')))
l = min(arr[0],arr[1])
r = max(arr[0],arr[1])
a = arr[2]
ans = 2*l
r = r- l
if(a>r):
ans = ans + 2*r+((a-r)//2)*2
else:
ans = ans + 2*(a)
print(ans) | arr= list(map(int,input().strip().split(' ')))
l = min(arr[0],arr[1])
r = max(arr[0],arr[1])
a = arr[2]
ans = 2*l
r = r- l
if(a==r):
ans = ans + 2*r+((a-r)//2)*2
else:
ans = ans + 2*(a)
print(ans) | if(a==r): | 7 | decision |
arr= list(map(int,input().strip().split(' ')))
l = min(arr[0],arr[1])
r = max(arr[0],arr[1])
a = arr[2]
ans = 2*l
r = r- l
if(a>r):
ans = ans + 2*r+((a-r)//2)*2
else:
ans = ans + 2*(a)
print(ans) | arr= list(map(int,input().strip().split(' ')))
l = min(arr[0],arr[1])
r = max(arr[0],arr[1])
a = arr[2]
ans = 2*l
r = r- l
if(a==r):
ans = ans + 2*r+((a-r)//2)*2
else:
ans = ans + 2*(a)
print(ans) | if(a==r): | 7 | decision |
arr= list(map(int,input().strip().split(' ')))
l = min(arr[0],arr[1])
r = max(arr[0],arr[1])
a = arr[2]
ans = 2*l
r = r- l
if(a>r):
ans = ans + 2*r+((a-r)//2)*2
else:
ans = ans + 2*(a)
print(ans) | arr= list(map(int,input().strip().split(' ')))
l = min(arr[0],arr[1])
r = max(arr[0],arr[1])
a = arr[2]
ans = 2*l
y = r- l
if(a>r):
ans = ans + 2*r+((a-r)//2)*2
else:
ans = ans + 2*(a)
print(ans) | y = r- l | 6 | statement |
arr= list(map(int,input().strip().split(' ')))
l = min(arr[0],arr[1])
r = max(arr[0],arr[1])
a = arr[2]
ans = 2*l
r = r- l
if(a>r):
ans = ans + 2*r+((a-r)//2)*2
else:
ans = ans + 2*(a)
print(ans) | arr= list(map(int,input().strip().split(' ')))
l = min(arr[0],arr[1])
r = max(arr[0],arr[1])
a = arr[2]
ans = 2*l
r = r- l
if(a>r):
ans = ans + 2*r/((a-r)//2)*2
else:
ans = ans + 2*(a)
print(ans) | ans = ans + 2*r/((a-r)//2)*2 | 8 | operation |
R = lambda : map(int, input().split())
n = int(input())
v = list(R())
mn = min(v); mx = max(v);
from collections import Counter
c = Counter(v)
if mn==mx or mn==mx+1:
print(len(v)); print(" ".join(map(str,v))); exit();
if mn==mx-2 and len(c)==2:
c[mn+1]=0
k = sorted(list(c.keys()))
ck0 = c[k[0]]; ck1 = c[k[1]]; ck2 = c[k[2]];
if (2*min(ck0,ck2)<2*(ck1//2)):
i = [i for i in range(len(v)) if v[i]==k[1]]
for j in range(ck1//2):
v[2*j],v[2*j+1] = v[2*j]-1,v[2*j+1]+1
print(len(v)-2*(ck1//2))
print(" ".join(map(str,v)))
else:
mni = [i for i in range(len(v)) if v[i]==mn]
mxi = [i for i in range(len(v)) if v[i]==mx]
for i in range(min(ck0,ck2)):
v[mni[i]],v[mxi[i]]=v[mni[i]]+1,v[mxi[i]]-1
print(len(v)-2*(min(ck0,ck2)))
print(" ".join(map(str,v))) | R = lambda : map(int, input().split())
n = int(input())
v = list(R())
mn = min(v); mx = max(v);
from collections import Counter
c = Counter(v)
if mn==mx or mn==mx+1:
print(len(v)); print(" ".join(map(str,v))); exit();
if mn==mx-2 and len(c)==2:
c[mn+1]=0
k = sorted(list(c.keys()))
ck0 = c[k[0]]; ck1 = c[k[1]]; ck2 = c[k[139]];
if (2*min(ck0,ck2)<2*(ck1//2)):
i = [i for i in range(len(v)) if v[i]==k[1]]
for j in range(ck1//2):
v[2*j],v[2*j+1] = v[2*j]-1,v[2*j+1]+1
print(len(v)-2*(ck1//2))
print(" ".join(map(str,v)))
else:
mni = [i for i in range(len(v)) if v[i]==mn]
mxi = [i for i in range(len(v)) if v[i]==mx]
for i in range(min(ck0,ck2)):
v[mni[i]],v[mxi[i]]=v[mni[i]]+1,v[mxi[i]]-1
print(len(v)-2*(min(ck0,ck2)))
print(" ".join(map(str,v))) | ck0 = c[k[0]]; ck1 = c[k[1]]; ck2 = c[k[139]]; | 15 | value |
R = lambda : map(int, input().split())
n = int(input())
v = list(R())
mn = min(v); mx = max(v);
from collections import Counter
c = Counter(v)
if mn==mx or mn==mx+1:
print(len(v)); print(" ".join(map(str,v))); exit();
if mn==mx-2 and len(c)==2:
c[mn+1]=0
k = sorted(list(c.keys()))
ck0 = c[k[0]]; ck1 = c[k[1]]; ck2 = c[k[2]];
if (2*min(ck0,ck2)<2*(ck1//2)):
i = [i for i in range(len(v)) if v[i]==k[1]]
for j in range(ck1//2):
v[2*j],v[2*j+1] = v[2*j]-1,v[2*j+1]+1
print(len(v)-2*(ck1//2))
print(" ".join(map(str,v)))
else:
mni = [i for i in range(len(v)) if v[i]==mn]
mxi = [i for i in range(len(v)) if v[i]==mx]
for i in range(min(ck0,ck2)):
v[mni[i]],v[mxi[i]]=v[mni[i]]+1,v[mxi[i]]-1
print(len(v)-2*(min(ck0,ck2)))
print(" ".join(map(str,v))) | R = lambda : map(int, input().split())
n = int(input())
v = list(R())
mn = min(v); mx = max(v);
from collections import Counter
c = Counter(v)
if mn==mx or mn==mx+1:
print(len(v)); print(" ".join(map(str,v))); exit();
if mn==mx-2 and len(c)<2:
c[mn+1]=0
k = sorted(list(c.keys()))
ck0 = c[k[0]]; ck1 = c[k[1]]; ck2 = c[k[2]];
if (2*min(ck0,ck2)<2*(ck1//2)):
i = [i for i in range(len(v)) if v[i]==k[1]]
for j in range(ck1//2):
v[2*j],v[2*j+1] = v[2*j]-1,v[2*j+1]+1
print(len(v)-2*(ck1//2))
print(" ".join(map(str,v)))
else:
mni = [i for i in range(len(v)) if v[i]==mn]
mxi = [i for i in range(len(v)) if v[i]==mx]
for i in range(min(ck0,ck2)):
v[mni[i]],v[mxi[i]]=v[mni[i]]+1,v[mxi[i]]-1
print(len(v)-2*(min(ck0,ck2)))
print(" ".join(map(str,v))) | if mn==mx-2 and len(c)<2: | 11 | decision |
R = lambda : map(int, input().split())
n = int(input())
v = list(R())
mn = min(v); mx = max(v);
from collections import Counter
c = Counter(v)
if mn==mx or mn==mx+1:
print(len(v)); print(" ".join(map(str,v))); exit();
if mn==mx-2 and len(c)==2:
c[mn+1]=0
k = sorted(list(c.keys()))
ck0 = c[k[0]]; ck1 = c[k[1]]; ck2 = c[k[2]];
if (2*min(ck0,ck2)<2*(ck1//2)):
i = [i for i in range(len(v)) if v[i]==k[1]]
for j in range(ck1//2):
v[2*j],v[2*j+1] = v[2*j]-1,v[2*j+1]+1
print(len(v)-2*(ck1//2))
print(" ".join(map(str,v)))
else:
mni = [i for i in range(len(v)) if v[i]==mn]
mxi = [i for i in range(len(v)) if v[i]==mx]
for i in range(min(ck0,ck2)):
v[mni[i]],v[mxi[i]]=v[mni[i]]+1,v[mxi[i]]-1
print(len(v)-2*(min(ck0,ck2)))
print(" ".join(map(str,v))) | R = lambda : map(int, input().split())
n = int(input())
v = list(R())
mn = min(v); mx = max(v);
from collections import Counter
c = Counter(v)
if mn==mx or mn==mx+1:
print(len(v)); print(" ".join(map(str,v))); exit();
if mn==mx-2 and len(c)==2:
c[mn+1]=0
k = sorted(list(c.keys()))
ck0 = c[k[0]]; ck1 = c[k[1]]; ck2 = c[k[2]];
if (2*min(ck0,ck2)<2*(ck1//2)):
i = [i for i in range(len(v)) if v[i]==k[1]]
for j in range(ck1//2):
v[2*j],v[2*j+1] = v[2*j]-1,v[2*j+1]+1
print(len(v)-2*(ck1//2))
print(" ".join(map(str,v)))
else:
mni = [i for i in range(len(v)) if v[i]==mn]
mxi = [i for i in range(len(v)) if v[i]==mx]
for i in range(min(ck0,ck2)):
v[mni[i]],v[mxi[i]]=v[mni[i]]+1,v[mxi[i]]-1
print(len(v)-2*(min(ck0,ck2)))
print(" ".y(map(str,v))) | print(" ".y(map(str,v))) | 28 | statement |
R = lambda : map(int, input().split())
n = int(input())
v = list(R())
mn = min(v); mx = max(v);
from collections import Counter
c = Counter(v)
if mn==mx or mn==mx+1:
print(len(v)); print(" ".join(map(str,v))); exit();
if mn==mx-2 and len(c)==2:
c[mn+1]=0
k = sorted(list(c.keys()))
ck0 = c[k[0]]; ck1 = c[k[1]]; ck2 = c[k[2]];
if (2*min(ck0,ck2)<2*(ck1//2)):
i = [i for i in range(len(v)) if v[i]==k[1]]
for j in range(ck1//2):
v[2*j],v[2*j+1] = v[2*j]-1,v[2*j+1]+1
print(len(v)-2*(ck1//2))
print(" ".join(map(str,v)))
else:
mni = [i for i in range(len(v)) if v[i]==mn]
mxi = [i for i in range(len(v)) if v[i]==mx]
for i in range(min(ck0,ck2)):
v[mni[i]],v[mxi[i]]=v[mni[i]]+1,v[mxi[i]]-1
print(len(v)-2*(min(ck0,ck2)))
print(" ".join(map(str,v))) | R = lambda : map(int, input().split())
n = int(input())
v = list(R())
mn = min(v); mx = max(v);
from collections import Counter
c = Counter(v)
if mn==mx or mn==mx+1:
print(len(v)); print(" ".join(map(str,v))); exit();
if mn==mx-2 and len(c)==2:
c[mn+1]=0
k = sorted(list(c.keys()))
ck0 = c[k[0]]; ck1 = c[k[1]]; ck2 = c[k[2]];
if (2*min(ck0,ck2)<2*(ck1//2)):
i = [i for i in range(len(v)) if v[i]==k[1]]
for j in range(ck1//2):
v[2*j],v[2*j+1] = v[2*j]-1,v[2*j+1]+1
print(len(v)-2*(ck1//18))
print(" ".join(map(str,v)))
else:
mni = [i for i in range(len(v)) if v[i]==mn]
mxi = [i for i in range(len(v)) if v[i]==mx]
for i in range(min(ck0,ck2)):
v[mni[i]],v[mxi[i]]=v[mni[i]]+1,v[mxi[i]]-1
print(len(v)-2*(min(ck0,ck2)))
print(" ".join(map(str,v))) | print(len(v)-2*(ck1//18)) | 20 | value |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.