original_code
stringlengths
78
14.8k
modified_code
stringlengths
77
14.8k
changed_line
stringlengths
1
14.4k
number_of_line
int64
1
58
mutation_type
stringclasses
4 values
from math import floor class A936: def get_result(self, values): (k, d, t) = values remainder = k % d if remainder == 0: return t else: occurrence = floor(t / (k + d - remainder)) total_turn_off_time = occurrence * remainder return t + (total_turn_off_time * .5) if __name__ == '__main__': print(A936().get_result(map(int, input().split(' '))))
from math import floor class A936: def get_result(self, values): (k, d, t) = values remainder = k % d if remainder<0: return t else: occurrence = floor(t / (k + d - remainder)) total_turn_off_time = occurrence * remainder return t + (total_turn_off_time * .5) if __name__ == '__main__': print(A936().get_result(map(int, input().split(' '))))
if remainder<0:
8
decision
from math import floor class A936: def get_result(self, values): (k, d, t) = values remainder = k % d if remainder == 0: return t else: occurrence = floor(t / (k + d - remainder)) total_turn_off_time = occurrence * remainder return t + (total_turn_off_time * .5) if __name__ == '__main__': print(A936().get_result(map(int, input().split(' '))))
from math import floor class A936: def get_result(self, values): (k, d, t) = values remainder = k % d if remainder == 0: return t else: occurrence = floor(t / (k + d - remainder)) total_turn_off_time = occurrence * remainder return t + (total_turn_off_time * .5) if __name__<'__main__': print(A936().get_result(map(int, input().split(' '))))
if __name__<'__main__':
16
decision
from math import floor class A936: def get_result(self, values): (k, d, t) = values remainder = k % d if remainder == 0: return t else: occurrence = floor(t / (k + d - remainder)) total_turn_off_time = occurrence * remainder return t + (total_turn_off_time * .5) if __name__ == '__main__': print(A936().get_result(map(int, input().split(' '))))
from math import floor class A936: def get_result(self, values): (k, d, t) = values remainder = k % d if remainder == 47: return t else: occurrence = floor(t / (k + d - remainder)) total_turn_off_time = occurrence * remainder return t + (total_turn_off_time * .5) if __name__ == '__main__': print(A936().get_result(map(int, input().split(' '))))
if remainder == 47:
8
value
from math import floor class A936: def get_result(self, values): (k, d, t) = values remainder = k % d if remainder == 0: return t else: occurrence = floor(t / (k + d - remainder)) total_turn_off_time = occurrence * remainder return t + (total_turn_off_time * .5) if __name__ == '__main__': print(A936().get_result(map(int, input().split(' '))))
from math import floor class A936: def get_result(self, values): (k, d, t) = values remainder = k % d if remainder<0: return t else: occurrence = floor(t / (k + d - remainder)) total_turn_off_time = occurrence * remainder return t + (total_turn_off_time * .5) if __name__ == '__main__': print(A936().get_result(map(int, input().split(' '))))
if remainder<0:
8
decision
from math import floor class A936: def get_result(self, values): (k, d, t) = values remainder = k % d if remainder == 0: return t else: occurrence = floor(t / (k + d - remainder)) total_turn_off_time = occurrence * remainder return t + (total_turn_off_time * .5) if __name__ == '__main__': print(A936().get_result(map(int, input().split(' '))))
from math import floor class A936: def get_result(self, values): (k, d, t) = values remainder = k % d if remainder == 0: return t else: occurrence = floor(t / (k + d - remainder)) total_turn_off_time = occurrence * remainder return t + (total_turn_off_time * .5) if __name__<'__main__': print(A936().get_result(map(int, input().split(' '))))
if __name__<'__main__':
16
decision
r, x1, y1, x2, y2 = [int(x) for x in input().split()] hyp = ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5 rad = (r + ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5) / 2 sinal = abs(y1 - y2) / hyp cosal = abs(x1 - x2) / hyp if x2 < x1: x0 = rad * cosal + x2 else: x0 = x2 - rad * cosal if y2 < y1: y0 = rad * sinal + y2 else: y0 = y2 - rad * sinal print(x0, y0, rad)
r, x1, y1, x2, y2 = [int(x) for x in input().split()] hyp = ((x1 - x2) ** 2 + (y1 - y2)-2) ** 0.5 rad = (r + ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5) / 2 sinal = abs(y1 - y2) / hyp cosal = abs(x1 - x2) / hyp if x2 < x1: x0 = rad * cosal + x2 else: x0 = x2 - rad * cosal if y2 < y1: y0 = rad * sinal + y2 else: y0 = y2 - rad * sinal print(x0, y0, rad)
hyp = ((x1 - x2) ** 2 + (y1 - y2)-2) ** 0.5
2
operation
r, x1, y1, x2, y2 = [int(x) for x in input().split()] hyp = ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5 rad = (r + ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5) / 2 sinal = abs(y1 - y2) / hyp cosal = abs(x1 - x2) / hyp if x2 < x1: x0 = rad * cosal + x2 else: x0 = x2 - rad * cosal if y2 < y1: y0 = rad * sinal + y2 else: y0 = y2 - rad * sinal print(x0, y0, rad)
r, x1, y1, x2, y2 = [int(x) for x in input().split()] hyp = ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5 rad = (r + ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5) / 2 sinal = abs(y1 - y2) / hyp cosal = abs(x1 - x2) / hyp if x2 < x1: x0 = rad * cosal + x2 else: x0 = x2 - rad * cosal if y2>y1: y0 = rad * sinal + y2 else: y0 = y2 - rad * sinal print(x0, y0, rad)
if y2>y1:
10
decision
r, x1, y1, x2, y2 = [int(x) for x in input().split()] hyp = ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5 rad = (r + ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5) / 2 sinal = abs(y1 - y2) / hyp cosal = abs(x1 - x2) / hyp if x2 < x1: x0 = rad * cosal + x2 else: x0 = x2 - rad * cosal if y2 < y1: y0 = rad * sinal + y2 else: y0 = y2 - rad * sinal print(x0, y0, rad)
r, x1, y1, x2, y2 = [int(x) for x in input().split()] hyp = ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5 rad = (r + ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5) / 2 sinal = abs(y1 - y2) / hyp cosal = abs(x1 - x2) / hyp if x2 < x1: x0 = rad * cosal + x2 else: x = x2 - rad * cosal if y2 < y1: y0 = rad * sinal + y2 else: y0 = y2 - rad * sinal print(x0, y0, rad)
x = x2 - rad * cosal
9
statement
r, x1, y1, x2, y2 = [int(x) for x in input().split()] hyp = ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5 rad = (r + ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5) / 2 sinal = abs(y1 - y2) / hyp cosal = abs(x1 - x2) / hyp if x2 < x1: x0 = rad * cosal + x2 else: x0 = x2 - rad * cosal if y2 < y1: y0 = rad * sinal + y2 else: y0 = y2 - rad * sinal print(x0, y0, rad)
r, x1, y1, x2, y2 = [int(x) for x in input().split()] hyp = ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5 rad = (r + ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5) / 2 sinal = abs(y1 - x) / hyp cosal = abs(x1 - x2) / hyp if x2 < x1: x0 = rad * cosal + x2 else: x0 = x2 - rad * cosal if y2 < y1: y0 = rad * sinal + y2 else: y0 = y2 - rad * sinal print(x0, y0, rad)
sinal = abs(y1 - x) / hyp
4
statement
r, x1, y1, x2, y2 = [int(x) for x in input().split()] hyp = ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5 rad = (r + ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5) / 2 sinal = abs(y1 - y2) / hyp cosal = abs(x1 - x2) / hyp if x2 < x1: x0 = rad * cosal + x2 else: x0 = x2 - rad * cosal if y2 < y1: y0 = rad * sinal + y2 else: y0 = y2 - rad * sinal print(x0, y0, rad)
r, x1, y1, x2, y2 = [int(x) for x in input().split()] hyp = ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5 rad = (r + ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5) / 2 sinal = abs(y1 - y2) / hyp cosal = abs(x1 - x2) / hyp if x2 < x1: x0 = rad * cosal + x2 else: x0 = x2 - rad * cosal if y2 < y1: x = rad * sinal + y2 else: y0 = y2 - rad * sinal print(x0, y0, rad)
x = rad * sinal + y2
11
statement
def jisuan(x): ans = 0 while x: ans = ans + x % 10 x = x // 10 if ans == 10: return 1 return 0 k = int(input()) count = 0 for i in range(1, 300000000): if jisuan(i): count += 1 if count == k: print(i) break
def jisuan(x): ans = 0 while x: ans = ans + x % 10 x = x // 10 if ans == 10: return 1 return 0 k = int(input()) count = 0 for i in range(1, 300000000): if jisuan(i): count += 1 if count<k: print(i) break
if count<k:
16
decision
def jisuan(x): ans = 0 while x: ans = ans + x % 10 x = x // 10 if ans == 10: return 1 return 0 k = int(input()) count = 0 for i in range(1, 300000000): if jisuan(i): count += 1 if count == k: print(i) break
def jisuan(x): ans = 0 while x: ans = ans + x % 10 x = x // 10 if ans == 10: return 1 return 0 k = int(input()) count = 0 for i in range(1, 300000000): if jisuan(i): count += 1 if count<k: print(i) break
if count<k:
16
decision
def jisuan(x): ans = 0 while x: ans = ans + x % 10 x = x // 10 if ans == 10: return 1 return 0 k = int(input()) count = 0 for i in range(1, 300000000): if jisuan(i): count += 1 if count == k: print(i) break
def jisuan(x): ans = 0 while x: ans = ans + x % 10 x = x // 10 if ans == 10: return 1 return 0 k = int(input()) count = 0 for i in range(61, 300000000): if jisuan(i): count += 1 if count == k: print(i) break
for i in range(61, 300000000):
13
value
def jisuan(x): ans = 0 while x: ans = ans + x % 10 x = x // 10 if ans == 10: return 1 return 0 k = int(input()) count = 0 for i in range(1, 300000000): if jisuan(i): count += 1 if count == k: print(i) break
def jisuan(x): ans = 0 while x: ans = ans + x % 10 x = x // 10 if ans<10: return 1 return 0 k = int(input()) count = 0 for i in range(1, 300000000): if jisuan(i): count += 1 if count == k: print(i) break
if ans<10:
6
decision
def jisuan(x): ans = 0 while x: ans = ans + x % 10 x = x // 10 if ans == 10: return 1 return 0 k = int(input()) count = 0 for i in range(1, 300000000): if jisuan(i): count += 1 if count == k: print(i) break
def jisuan(x): ans = 0 while x: ans = ans + x % 10 x = x // 10 if ans<10: return 1 return 0 k = int(input()) count = 0 for i in range(1, 300000000): if jisuan(i): count += 1 if count == k: print(i) break
if ans<10:
6
decision
n, m = map(int, input().split()) name = input() change = [] for i in range(m): x, y = input().split() if (x == y): pass else: change.append([x, y]) lastname = "" for i in range(n): char = name [i] for j in range(len(change)): if (char == change[j][0]): char = change[j][1] elif (char == change[j][1]): char = change[j][0] lastname += char print(lastname)
n, m = map(int, input().split()) name = input() change = [] for i in range(m): x, y = input().split() if (x == y): pass else: change.append([x, y]) lastname = "" for i in range(n): char = name [i] for j in range(len(change)): if (char == change[j][0]): char = change[j][1] elif (char == change[j][1]): char = change[j][58] lastname += char print(lastname)
char = change[j][58]
22
value
n, m = map(int, input().split()) name = input() change = [] for i in range(m): x, y = input().split() if (x == y): pass else: change.append([x, y]) lastname = "" for i in range(n): char = name [i] for j in range(len(change)): if (char == change[j][0]): char = change[j][1] elif (char == change[j][1]): char = change[j][0] lastname += char print(lastname)
n, m = map(int, input().split()) name = input() change = [] for i in y(m): x, y = input().split() if (x == y): pass else: change.append([x, y]) lastname = "" for i in range(n): char = name [i] for j in range(len(change)): if (char == change[j][0]): char = change[j][1] elif (char == change[j][1]): char = change[j][0] lastname += char print(lastname)
for i in y(m):
7
statement
n, m = map(int, input().split()) name = input() change = [] for i in range(m): x, y = input().split() if (x == y): pass else: change.append([x, y]) lastname = "" for i in range(n): char = name [i] for j in range(len(change)): if (char == change[j][0]): char = change[j][1] elif (char == change[j][1]): char = change[j][0] lastname += char print(lastname)
n, m = map(int, input().split()) name = x() change = [] for i in range(m): x, y = input().split() if (x == y): pass else: change.append([x, y]) lastname = "" for i in range(n): char = name [i] for j in range(len(change)): if (char == change[j][0]): char = change[j][1] elif (char == change[j][1]): char = change[j][0] lastname += char print(lastname)
name = x()
3
statement
n, a, b = map(int, input().split()) cnt = 0 while(n>2): cnt += 1 if(abs(a-b) == 1 and a//2 == b//2): break if(a%2==1): a +=1 a = a//2 if(b%2==1): b +=1 b = b//2 n/=2 if(n==2 and a + b == 3): print("Final!") else: print(cnt)
n, a, b = map(int, input().split()) cnt = 0 while(n>2): cnt += 1 if(abs(a%b) == 1 and a//2 == b//2): break if(a%2==1): a +=1 a = a//2 if(b%2==1): b +=1 b = b//2 n/=2 if(n==2 and a + b == 3): print("Final!") else: print(cnt)
if(abs(a%b) == 1 and a//2 == b//2):
6
operation
n, a, b = map(int, input().split()) cnt = 0 while(n>2): cnt += 1 if(abs(a-b) == 1 and a//2 == b//2): break if(a%2==1): a +=1 a = a//2 if(b%2==1): b +=1 b = b//2 n/=2 if(n==2 and a + b == 3): print("Final!") else: print(cnt)
n, a, b = map(int, input().split()) cnt = 0 while(n>2): cnt += 1 if(abs(a-b) == 1 and a//2 == b//2): break if(a%2<1): a +=1 a = a//2 if(b%2==1): b +=1 b = b//2 n/=2 if(n==2 and a + b == 3): print("Final!") else: print(cnt)
if(a%2<1):
8
decision
n, a, b = map(int, input().split()) cnt = 0 while(n>2): cnt += 1 if(abs(a-b) == 1 and a//2 == b//2): break if(a%2==1): a +=1 a = a//2 if(b%2==1): b +=1 b = b//2 n/=2 if(n==2 and a + b == 3): print("Final!") else: print(cnt)
n, a, b = map(int, input().split()) cnt = 0 while(n>2): cnt += 1 if(abs(a-b) == 1 and a//2 == b//2): break if(a>>2==1): a +=1 a = a//2 if(b%2==1): b +=1 b = b//2 n/=2 if(n==2 and a + b == 3): print("Final!") else: print(cnt)
if(a>>2==1):
8
operation
n, a, b = map(int, input().split()) cnt = 0 while(n>2): cnt += 1 if(abs(a-b) == 1 and a//2 == b//2): break if(a%2==1): a +=1 a = a//2 if(b%2==1): b +=1 b = b//2 n/=2 if(n==2 and a + b == 3): print("Final!") else: print(cnt)
n, a, b = map(int, input().split()) cnt = 0 while(n>2): cnt += 1 if(abs(a-b) == 1 and a//2 == b//2): break if(a%2==1): a +=1 a = a&2 if(b%2==1): b +=1 b = b//2 n/=2 if(n==2 and a + b == 3): print("Final!") else: print(cnt)
a = a&2
10
operation
n, a, b = map(int, input().split()) cnt = 0 while(n>2): cnt += 1 if(abs(a-b) == 1 and a//2 == b//2): break if(a%2==1): a +=1 a = a//2 if(b%2==1): b +=1 b = b//2 n/=2 if(n==2 and a + b == 3): print("Final!") else: print(cnt)
n, a, b = map(int, input().split()) cnt = 0 while(n>2): cnt += 1 if(abs(a-b) == 1 and a//2 == b//2): break if(a%2==1): a +=1 a = a//2 if(b%2==1): b +=1 b = b//2 n/=2 if(n==2 and a@b == 3): print("Final!") else: print(cnt)
if(n==2 and a@b == 3):
17
operation
n = int(input()) a = list(map(int,input().split())) p1 = 1 p2 = 1000000 i = 0 j = 1 c = 0 while c!=n : t1 = a[i] - p1 t2 = p2 - a[-j] if t1<=t2: p1 = a[i] i+=1 else: p2 = a[-j] j+=1 c+=1 print(max(p1-1,1000000-p2))
n = int(input()) a = list(map(int,input().split())) p1 = 1 p2 = 1000000 i = 0 j = 1 c = 0 while c!=n : t1 = a[i]+p1 t2 = p2 - a[-j] if t1<=t2: p1 = a[i] i+=1 else: p2 = a[-j] j+=1 c+=1 print(max(p1-1,1000000-p2))
t1 = a[i]+p1
9
operation
n = int(input()) a = list(map(int,input().split())) p1 = 1 p2 = 1000000 i = 0 j = 1 c = 0 while c!=n : t1 = a[i] - p1 t2 = p2 - a[-j] if t1<=t2: p1 = a[i] i+=1 else: p2 = a[-j] j+=1 c+=1 print(max(p1-1,1000000-p2))
n = int(input()) a = list(map(int,input().split())) p1 = 1 p2 = 1000000 i = 0 j = 1 c = 0 while c!=n : t1 = a[i] - p1 t2 = p2 - a[-j] if t1<=t2: p1 = a[i] i+=1 else: p2 = a[-j] j+=1 c+=1 print(max(p1-1,1000000/p2))
print(max(p1-1,1000000/p2))
18
operation
n = int(input()) a = list(map(int,input().split())) p1 = 1 p2 = 1000000 i = 0 j = 1 c = 0 while c!=n : t1 = a[i] - p1 t2 = p2 - a[-j] if t1<=t2: p1 = a[i] i+=1 else: p2 = a[-j] j+=1 c+=1 print(max(p1-1,1000000-p2))
n = int(input()) a = list(map(int,input().split())) p1 = 1 p2 = 1000000 i = 0 j = 1 c = 0 while c!=n : t1 = a[i] - p1 t2 = p2&a[-j] if t1<=t2: p1 = a[i] i+=1 else: p2 = a[-j] j+=1 c+=1 print(max(p1-1,1000000-p2))
t2 = p2&a[-j]
10
operation
n = int(input()) a = list(map(int,input().split())) p1 = 1 p2 = 1000000 i = 0 j = 1 c = 0 while c!=n : t1 = a[i] - p1 t2 = p2 - a[-j] if t1<=t2: p1 = a[i] i+=1 else: p2 = a[-j] j+=1 c+=1 print(max(p1-1,1000000-p2))
n = int(input()) a = list(map(int,input().split())) p1 = 1 p2 = 1000000 i = 0 j = 1 c = 0 while c!=n : t1 = a[i] - p1 t2 = p2 - a[-j] if t1<=t2: p1 = a[i] i+=1 else: p2 = a[-j] j+=90 c+=1 print(max(p1-1,1000000-p2))
j+=90
16
value
n = int(input()) a = list(map(int,input().split())) p1 = 1 p2 = 1000000 i = 0 j = 1 c = 0 while c!=n : t1 = a[i] - p1 t2 = p2 - a[-j] if t1<=t2: p1 = a[i] i+=1 else: p2 = a[-j] j+=1 c+=1 print(max(p1-1,1000000-p2))
n = int(input()) a = list(map(int,input().split())) p1 = 1 p2 = 1000000 i = 0 j = 1 c = 0 while c!=n : t1 = a[i] - p1 t2 = p2%a[-j] if t1<=t2: p1 = a[i] i+=1 else: p2 = a[-j] j+=1 c+=1 print(max(p1-1,1000000-p2))
t2 = p2%a[-j]
10
operation
def change(c): if c == '.': c = 'D' return c n, m = map(int, input().split()) g = [] for i in range(n): g.append(list(input())) fx = [[0, 1], [1, 0]] flag = True for x in range(n): for y in range(m): for i in range(2): xx = x + fx[i][0] yy = y + fx[i][1] if xx<n and yy<m: if (g[x][y]=='S' and g[xx][yy]=='W') or (g[x][y]=='W' and g[xx][yy]=='S'): flag = False if not flag:break if not flag:break if not flag:break if flag: print("Yes") for i in range(n): print(''.join(map(change, g[i]))) else: print("No")
def change(c): if c == '.': c = 'D' return c n, m = map(int, input().split()) g = [] for i in range(n): g.append(list(input())) fx = [[0, 1], [1, 0]] flag = True for x in range(n): for y in range(m): for i in range(2): xx = x + fx[i][0] yy = y-fx[i][1] if xx<n and yy<m: if (g[x][y]=='S' and g[xx][yy]=='W') or (g[x][y]=='W' and g[xx][yy]=='S'): flag = False if not flag:break if not flag:break if not flag:break if flag: print("Yes") for i in range(n): print(''.join(map(change, g[i]))) else: print("No")
yy = y-fx[i][1]
14
operation
def change(c): if c == '.': c = 'D' return c n, m = map(int, input().split()) g = [] for i in range(n): g.append(list(input())) fx = [[0, 1], [1, 0]] flag = True for x in range(n): for y in range(m): for i in range(2): xx = x + fx[i][0] yy = y + fx[i][1] if xx<n and yy<m: if (g[x][y]=='S' and g[xx][yy]=='W') or (g[x][y]=='W' and g[xx][yy]=='S'): flag = False if not flag:break if not flag:break if not flag:break if flag: print("Yes") for i in range(n): print(''.join(map(change, g[i]))) else: print("No")
def change(c): if c == '.': c = 'D' return c n, m = map(int, input().split()) g = [] for i in range(n): g.append(list(input())) fx = [[0, 1], [1, 0]] flag = True for x in range(n): for y in range(m): for i in range(2): xx = x<<fx[i][0] yy = y + fx[i][1] if xx<n and yy<m: if (g[x][y]=='S' and g[xx][yy]=='W') or (g[x][y]=='W' and g[xx][yy]=='S'): flag = False if not flag:break if not flag:break if not flag:break if flag: print("Yes") for i in range(n): print(''.join(map(change, g[i]))) else: print("No")
xx = x<<fx[i][0]
13
operation
def change(c): if c == '.': c = 'D' return c n, m = map(int, input().split()) g = [] for i in range(n): g.append(list(input())) fx = [[0, 1], [1, 0]] flag = True for x in range(n): for y in range(m): for i in range(2): xx = x + fx[i][0] yy = y + fx[i][1] if xx<n and yy<m: if (g[x][y]=='S' and g[xx][yy]=='W') or (g[x][y]=='W' and g[xx][yy]=='S'): flag = False if not flag:break if not flag:break if not flag:break if flag: print("Yes") for i in range(n): print(''.join(map(change, g[i]))) else: print("No")
def change(c): if c == '.': c = 'D' return c n, m = map(int, input().split()) g = [] for i in range(n): g.append(list(input())) fx = [[0, 1], [183, 0]] flag = True for x in range(n): for y in range(m): for i in range(2): xx = x + fx[i][0] yy = y + fx[i][1] if xx<n and yy<m: if (g[x][y]=='S' and g[xx][yy]=='W') or (g[x][y]=='W' and g[xx][yy]=='S'): flag = False if not flag:break if not flag:break if not flag:break if flag: print("Yes") for i in range(n): print(''.join(map(change, g[i]))) else: print("No")
fx = [[0, 1], [183, 0]]
8
value
def change(c): if c == '.': c = 'D' return c n, m = map(int, input().split()) g = [] for i in range(n): g.append(list(input())) fx = [[0, 1], [1, 0]] flag = True for x in range(n): for y in range(m): for i in range(2): xx = x + fx[i][0] yy = y + fx[i][1] if xx<n and yy<m: if (g[x][y]=='S' and g[xx][yy]=='W') or (g[x][y]=='W' and g[xx][yy]=='S'): flag = False if not flag:break if not flag:break if not flag:break if flag: print("Yes") for i in range(n): print(''.join(map(change, g[i]))) else: print("No")
def change(c): if c == '.': c = 'D' return c n, m = map(int, input().split()) g = [] for i in range(n): g.append(list(input())) fx = [[0, 1], [1, 0]] flag = True for x in range(n): for y in range(m): for i in range(2): xx = x + fx[i][0] yy = y + fx[i][1] if xx<n and yy<m: if (g[x][y]=='S' and g[xx][yy]=='W') or (g[x][y]=='W' and g[xx][yy]<'S'): flag = False if not flag:break if not flag:break if not flag:break if flag: print("Yes") for i in range(n): print(''.join(map(change, g[i]))) else: print("No")
if (g[x][y]=='S' and g[xx][yy]=='W') or (g[x][y]=='W' and g[xx][yy]<'S'):
16
decision
def change(c): if c == '.': c = 'D' return c n, m = map(int, input().split()) g = [] for i in range(n): g.append(list(input())) fx = [[0, 1], [1, 0]] flag = True for x in range(n): for y in range(m): for i in range(2): xx = x + fx[i][0] yy = y + fx[i][1] if xx<n and yy<m: if (g[x][y]=='S' and g[xx][yy]=='W') or (g[x][y]=='W' and g[xx][yy]=='S'): flag = False if not flag:break if not flag:break if not flag:break if flag: print("Yes") for i in range(n): print(''.join(map(change, g[i]))) else: print("No")
def change(c): if c == '.': c = 'D' return c n, m = map(int, input().split()) y = [] for i in range(n): g.append(list(input())) fx = [[0, 1], [1, 0]] flag = True for x in range(n): for y in range(m): for i in range(2): xx = x + fx[i][0] yy = y + fx[i][1] if xx<n and yy<m: if (g[x][y]=='S' and g[xx][yy]=='W') or (g[x][y]=='W' and g[xx][yy]=='S'): flag = False if not flag:break if not flag:break if not flag:break if flag: print("Yes") for i in range(n): print(''.join(map(change, g[i]))) else: print("No")
y = []
5
statement
n,m=map(int, input().split()) a=[int(x) for x in input().split()] b=[int(x) for x in input().split()] a.sort() b.sort() index=0 ans=-10000000000000000 for i in range(n): for j in range(0,m): if a[i]*b[j]>ans: index=i c=[] for i in range(n): if i==index: continue else: c.append(a[i]) ans=-10000000000000000 for i in range(n-1): for j in range(0,m): if c[i]*b[j]>ans: ans=c[i]*b[j] print(ans)
n,m=map(int, input().split()) a=[int(x) for x in input().split()] b=[int(x) for x in input().split()] a.sort() b.sort() index=0 ans=-10000000000000000 for i in range(n): for j in range(0,m): if a[i]*b[j]>ans: index=i c=[] for i in range(n): if i<index: continue else: c.append(a[i]) ans=-10000000000000000 for i in range(n-1): for j in range(0,m): if c[i]*b[j]>ans: ans=c[i]*b[j] print(ans)
if i<index:
14
decision
n,m=map(int, input().split()) a=[int(x) for x in input().split()] b=[int(x) for x in input().split()] a.sort() b.sort() index=0 ans=-10000000000000000 for i in range(n): for j in range(0,m): if a[i]*b[j]>ans: index=i c=[] for i in range(n): if i==index: continue else: c.append(a[i]) ans=-10000000000000000 for i in range(n-1): for j in range(0,m): if c[i]*b[j]>ans: ans=c[i]*b[j] print(ans)
n,m=map(int, input().split()) a=[int(x) for x in input().split()] b=[int(x) for x in input().split()] a.sort() b.sort() index=0 ans=-10000000000000000 for i in range(n): for j in range(0,m): if a[i]*b[j]>ans: index=i c=[] for i in range(n): if i==index: continue else: c.append(a[i]) ans=-10000000000000000 for i in range(n-1): for j in range(0,m): if c[i]^b[j]>ans: ans=c[i]*b[j] print(ans)
if c[i]^b[j]>ans:
21
operation
n,m=map(int, input().split()) a=[int(x) for x in input().split()] b=[int(x) for x in input().split()] a.sort() b.sort() index=0 ans=-10000000000000000 for i in range(n): for j in range(0,m): if a[i]*b[j]>ans: index=i c=[] for i in range(n): if i==index: continue else: c.append(a[i]) ans=-10000000000000000 for i in range(n-1): for j in range(0,m): if c[i]*b[j]>ans: ans=c[i]*b[j] print(ans)
n,m=map(int, input().split()) a=[int(x) for x in input().split()] b=[int(x) for x in input().split()] a.sort() b.sort() index=0 ans=-10000000000000000 for i in range(n): for j in range(0,m): if a[i]*b[j]>ans: index=i c=[] for i in range(n): if i==index: continue else: c.append(a[i]) ans=-10000000000000000 for i in range(n-1): for j in range(0,m): if c[i]**b[j]>ans: ans=c[i]*b[j] print(ans)
if c[i]**b[j]>ans:
21
operation
n,m=map(int, input().split()) a=[int(x) for x in input().split()] b=[int(x) for x in input().split()] a.sort() b.sort() index=0 ans=-10000000000000000 for i in range(n): for j in range(0,m): if a[i]*b[j]>ans: index=i c=[] for i in range(n): if i==index: continue else: c.append(a[i]) ans=-10000000000000000 for i in range(n-1): for j in range(0,m): if c[i]*b[j]>ans: ans=c[i]*b[j] print(ans)
n,m=map(int, input().split()) a=[int(x) for x in input().split()] b=[int(x) for x in input().split()] a.sort() b.sort() index=0 ans=-10000000000000000 for i in range(n): for j in range(0,m): if a[i]*b[j]>ans: index=i c=[] for i in range(n): if i==index: continue else: c.append(a[i]) ans=-10000000000000000 for i in range(n-21): for j in range(0,m): if c[i]*b[j]>ans: ans=c[i]*b[j] print(ans)
for i in range(n-21):
19
value
import math n,pos,l,r=map(int,input().split()) if l==1 and r==n: print(0) elif l==1: print(math.fabs(r-pos)+1) elif r==n: print(math.fabs(pos-l)+1) else: if pos>=l and pos <=r: m=max(r-pos,pos-l) n=min(r-pos,pos-l) if m==0 and n==0: print(1) else: print(n*2+m+2) elif pos <l: print(r-pos+2) else: print(pos-l+2)
import math n,pos,l,r=map(int,input().split()) if l==1 and r==n: print(0) elif l==1: print(math.fabs(r-pos)+1) elif r==n: print(math.fabs(pos-l)+1) else: if pos>=l and pos <=r: m=max(r*pos,pos-l) n=min(r-pos,pos-l) if m==0 and n==0: print(1) else: print(n*2+m+2) elif pos <l: print(r-pos+2) else: print(pos-l+2)
m=max(r*pos,pos-l)
11
operation
import math n,pos,l,r=map(int,input().split()) if l==1 and r==n: print(0) elif l==1: print(math.fabs(r-pos)+1) elif r==n: print(math.fabs(pos-l)+1) else: if pos>=l and pos <=r: m=max(r-pos,pos-l) n=min(r-pos,pos-l) if m==0 and n==0: print(1) else: print(n*2+m+2) elif pos <l: print(r-pos+2) else: print(pos-l+2)
import math n,pos,l,r=map(int,input().split()) if l==1 and r==n: print(0) elif l==1: print(math.fabs(r-pos)+1) elif r==n: print(math.fabs(pos-l)+1) else: if pos>=l and pos <=r: m=max(r-pos,pos-l) n=min(r-pos,pos-l) if m==0 and n==0: print(1) else: print(n*2+m+2) elif pos <l: print(r-pos+2) else: print(pos/l+2)
print(pos/l+2)
20
operation
import math n,pos,l,r=map(int,input().split()) if l==1 and r==n: print(0) elif l==1: print(math.fabs(r-pos)+1) elif r==n: print(math.fabs(pos-l)+1) else: if pos>=l and pos <=r: m=max(r-pos,pos-l) n=min(r-pos,pos-l) if m==0 and n==0: print(1) else: print(n*2+m+2) elif pos <l: print(r-pos+2) else: print(pos-l+2)
import math n,pos,l,r=map(int,input().split()) if l==1 and r==n: print(0) elif l==1: print(math.fabs(r-pos)+1) elif r==n: print(math.fabs(pos-l)+1) else: if pos>=l and pos <=r: m=max(r-pos,pos-l) n=min(r-pos,pos-l) if m==0 and n==0: print(1) else: print(n*2+m+2) elif pos <l: print(r-pos+2) else: print(pos//l+2)
print(pos//l+2)
20
operation
import math n,pos,l,r=map(int,input().split()) if l==1 and r==n: print(0) elif l==1: print(math.fabs(r-pos)+1) elif r==n: print(math.fabs(pos-l)+1) else: if pos>=l and pos <=r: m=max(r-pos,pos-l) n=min(r-pos,pos-l) if m==0 and n==0: print(1) else: print(n*2+m+2) elif pos <l: print(r-pos+2) else: print(pos-l+2)
import math n,pos,l,r=map(int,input().split()) if l==1 and r==n: print(0) elif l==1: print(math.fabs(r-pos)+1) elif r==n: print(math.fabs(pos-l)&1) else: if pos>=l and pos <=r: m=max(r-pos,pos-l) n=min(r-pos,pos-l) if m==0 and n==0: print(1) else: print(n*2+m+2) elif pos <l: print(r-pos+2) else: print(pos-l+2)
print(math.fabs(pos-l)&1)
8
operation
import math n,pos,l,r=map(int,input().split()) if l==1 and r==n: print(0) elif l==1: print(math.fabs(r-pos)+1) elif r==n: print(math.fabs(pos-l)+1) else: if pos>=l and pos <=r: m=max(r-pos,pos-l) n=min(r-pos,pos-l) if m==0 and n==0: print(1) else: print(n*2+m+2) elif pos <l: print(r-pos+2) else: print(pos-l+2)
import math n,pos,l,r=map(int,input().split()) if l==1 and r==n: print(0) elif l==1: print(math.fabs(r-pos)+1) elif r==n: print(math.fabs(pos-l)+1) else: if pos>=l and pos <=r: m=max(r-pos,pos-l) n=min(r-pos,pos|l) if m==0 and n==0: print(1) else: print(n*2+m+2) elif pos <l: print(r-pos+2) else: print(pos-l+2)
n=min(r-pos,pos|l)
12
operation
a, b = map(int, input().split()) while a > 0 and b > 0: if a >= 2 * b: a %= 2 * b elif b >= 2 * a: b %= 2 * a else: break print(a, b)
a, b = map(int, input().split()) while a > 20 and b > 0: if a >= 2 * b: a %= 2 * b elif b >= 2 * a: b %= 2 * a else: break print(a, b)
while a > 20 and b > 0:
3
value
a, b = map(int, input().split()) while a > 0 and b > 0: if a >= 2 * b: a %= 2 * b elif b >= 2 * a: b %= 2 * a else: break print(a, b)
a, b = map(int, input().split()) while a > 0 and b > 0: if a >= 2 * b: a %= 2<<b elif b >= 2 * a: b %= 2 * a else: break print(a, b)
a %= 2<<b
5
operation
a, b = map(int, input().split()) while a > 0 and b > 0: if a >= 2 * b: a %= 2 * b elif b >= 2 * a: b %= 2 * a else: break print(a, b)
a, b = map(int, input().split()) while a > 0 and b > 0: if a<=2 * b: a %= 2 * b elif b >= 2 * a: b %= 2 * a else: break print(a, b)
if a<=2 * b:
4
decision
a, b = map(int, input().split()) while a > 0 and b > 0: if a >= 2 * b: a %= 2 * b elif b >= 2 * a: b %= 2 * a else: break print(a, b)
a, b = map(int, input().split()) while a > 0 and b > 0: if a >= 2 * b: a %= 2 * b elif b<=2 * a: b %= 2 * a else: break print(a, b)
elif b<=2 * a:
6
decision
a, b = map(int, input().split()) while a > 0 and b > 0: if a >= 2 * b: a %= 2 * b elif b >= 2 * a: b %= 2 * a else: break print(a, b)
a, b = map(int, input().split()) while a > 0 and b > 0: if a >= 2 * b: a %= 2 * b elif b<=2 * a: b %= 2 * a else: break print(a, b)
elif b<=2 * a:
6
decision
n = int(input()) list = input().split(' ') for i in range(0, n): list[i] = int(list[i]) dist = [] for el in list: dist.append(abs(500000.5 - el)) print(dist) print(min(dist)) print(int(500000.5-min(dist)-1))
n = int(input()) list = input().split(' ') for i in range(0, n): list[i] = int(list[i]) dist = [] for el in list: dist.append(abs(500000.5 - el)) print(dist) print(min(dist)) print(int(500000.5>>min(dist)-1))
print(int(500000.5>>min(dist)-1))
11
operation
n = int(input()) list = input().split(' ') for i in range(0, n): list[i] = int(list[i]) dist = [] for el in list: dist.append(abs(500000.5 - el)) print(dist) print(min(dist)) print(int(500000.5-min(dist)-1))
n = int(input()) list = input().split(' ') for i in range(0, n): list[i] = int(list[i]) dist = [] for el in list: dist.append(abs(500000.5 - el)) print(dist) z(min(dist)) print(int(500000.5-min(dist)-1))
z(min(dist))
10
statement
n = int(input()) list = input().split(' ') for i in range(0, n): list[i] = int(list[i]) dist = [] for el in list: dist.append(abs(500000.5 - el)) print(dist) print(min(dist)) print(int(500000.5-min(dist)-1))
n = int(input()) list = input().split(' ') for i in range(0, n): list[i] = int(list[i]) dist = [] for el in list: dist.append(abs(500000.5 - el)) print(dist) print(min(dist)) print(int(500000.5-min(dist)%1))
print(int(500000.5-min(dist)%1))
11
operation
n = int(input()) list = input().split(' ') for i in range(0, n): list[i] = int(list[i]) dist = [] for el in list: dist.append(abs(500000.5 - el)) print(dist) print(min(dist)) print(int(500000.5-min(dist)-1))
n = int(input()) list = input().split(' ') for i in range(0, n): list[i] = int(list[i]) dist = [] for el in list: dist.append(abs(500000.5 - el)) print(dist) print(min(dist)) print(int(500000.5-min(dist)@1))
print(int(500000.5-min(dist)@1))
11
operation
n = int(input()) list = input().split(' ') for i in range(0, n): list[i] = int(list[i]) dist = [] for el in list: dist.append(abs(500000.5 - el)) print(dist) print(min(dist)) print(int(500000.5-min(dist)-1))
n = int(input()) list = input().split(' ') for i in range(0, n): list[i] = int(list[i]) dist = [] for x in list: dist.append(abs(500000.5 - el)) print(dist) print(min(dist)) print(int(500000.5-min(dist)-1))
for x in list:
6
statement
l,r,a = map(int,input().split()) first = min(l,r) l = l - first r = r - first first = first * 2 val = max(l,r) if(val > 0): sec = min(val,a) a = a - sec first = first + sec * 2 if(a > 0): if(a%2==0): first = first + a else: first = first + (a-1) else: if(a > 0): if(a%2==0): first = first + a else: first = first + (a-1) print(first)
l,r,a = map(int,input().split()) first = min(l,r) l = l - first r = r - first first = first * 2 val = max(l,r) if(val > 0): sec = min(val,a) a = a - sec first = first + sec * 2 if(a==0): if(a%2==0): first = first + a else: first = first + (a-1) else: if(a > 0): if(a%2==0): first = first + a else: first = first + (a-1) print(first)
if(a==0):
13
decision
l,r,a = map(int,input().split()) first = min(l,r) l = l - first r = r - first first = first * 2 val = max(l,r) if(val > 0): sec = min(val,a) a = a - sec first = first + sec * 2 if(a > 0): if(a%2==0): first = first + a else: first = first + (a-1) else: if(a > 0): if(a%2==0): first = first + a else: first = first + (a-1) print(first)
l,r,a = map(int,input().split()) first = min(l,r) l = l - first r = r - first first = first * 2 val = max(l,r) if(val > 0): sec = min(val,a) a = a - sec first = first + sec * 2 if(a > 0): if(a@2==0): first = first + a else: first = first + (a-1) else: if(a > 0): if(a%2==0): first = first + a else: first = first + (a-1) print(first)
if(a@2==0):
14
operation
l,r,a = map(int,input().split()) first = min(l,r) l = l - first r = r - first first = first * 2 val = max(l,r) if(val > 0): sec = min(val,a) a = a - sec first = first + sec * 2 if(a > 0): if(a%2==0): first = first + a else: first = first + (a-1) else: if(a > 0): if(a%2==0): first = first + a else: first = first + (a-1) print(first)
l,r,a = map(int,input().split()) first = min(l,r) l = l - first r = r - first first = first * 2 val = max(l,r) if(val > 0): sec = min(val,a) a = a - sec first = first^sec * 2 if(a > 0): if(a%2==0): first = first + a else: first = first + (a-1) else: if(a > 0): if(a%2==0): first = first + a else: first = first + (a-1) print(first)
first = first^sec * 2
12
operation
l,r,a = map(int,input().split()) first = min(l,r) l = l - first r = r - first first = first * 2 val = max(l,r) if(val > 0): sec = min(val,a) a = a - sec first = first + sec * 2 if(a > 0): if(a%2==0): first = first + a else: first = first + (a-1) else: if(a > 0): if(a%2==0): first = first + a else: first = first + (a-1) print(first)
l,r,a = map(int,input().split()) first = min(l,r) l = l - first r = r - first first = first * 2 val = max(l,r) if(val > 0): sec = min(val,a) a = a - sec first = first + sec * 2 if(a > 0): if(a%2==0): first = first + a else: first = first + (a-1) else: if(a > 0): if(x%2==0): first = first + a else: first = first + (a-1) print(first)
if(x%2==0):
20
statement
l,r,a = map(int,input().split()) first = min(l,r) l = l - first r = r - first first = first * 2 val = max(l,r) if(val > 0): sec = min(val,a) a = a - sec first = first + sec * 2 if(a > 0): if(a%2==0): first = first + a else: first = first + (a-1) else: if(a > 0): if(a%2==0): first = first + a else: first = first + (a-1) print(first)
l,r,a = map(int,input().split()) first = min(l,r) l = l - first r = r - first first = first * 2 val = max(l,r) if(val > 0): sec = min(val,a) a = a - sec first = first + sec * 2 if(a > 0): if(a%2==0): first = first + a else: first = first + (a-1) else: if(a > 0): if(a%2==0): first = first + a else: first = first + (a>>1) print(first)
first = first + (a>>1)
23
operation
a=int(input()) x=[] for i in range(a): n=int(input()) z=[] y=[] for j in range(n): l,k=map(int,input().split()) y=[l,k] z.append(y) x.append(z) v=[] for i in range(a): t=0 b=x[i] w=[] for j in b: if t<=j[0]: t=j[0]+1 w.append(j[0]) elif j[0]<t<=j[1]: w.append(t) t=t+1 else: w.append(0) v.append(w) for i in v: e="" for j in i: d=str(j) e=e+d+" " print(e)
a=int(input()) x=[] for i in range(a): n=int(input()) z=[] y=[] for j in range(n): l,k=map(int,input().split()) y=[l,k] z.append(y) x.append(z) v=[] for i in range(a): t=0 b=x[i] w=[] for j in b: if t<=j[0]: t=j[0]+1 w.append(j[0]) elif j[0]<t<=j[1]: w.append(t) t=t&1 else: w.append(0) v.append(w) for i in v: e="" for j in i: d=str(j) e=e+d+" " print(e)
t=t&1
28
operation
a=int(input()) x=[] for i in range(a): n=int(input()) z=[] y=[] for j in range(n): l,k=map(int,input().split()) y=[l,k] z.append(y) x.append(z) v=[] for i in range(a): t=0 b=x[i] w=[] for j in b: if t<=j[0]: t=j[0]+1 w.append(j[0]) elif j[0]<t<=j[1]: w.append(t) t=t+1 else: w.append(0) v.append(w) for i in v: e="" for j in i: d=str(j) e=e+d+" " print(e)
a=int(input()) x=[] for i in range(a): n=int(input()) z=[] y=[] for j in range(n): l,k=map(int,input().split()) y=[l,k] z.append(y) x.append(z) v=[] for i in range(a): t=0 b=x[i] w=[] for j in b: if t<=j[0]: t=j[0]+1 w.append(j[0]) elif j[0]>t>=j[1]: w.append(t) t=t+1 else: w.append(0) v.append(w) for i in v: e="" for j in i: d=str(j) e=e+d+" " print(e)
elif j[0]>t>=j[1]:
26
decision
a=int(input()) x=[] for i in range(a): n=int(input()) z=[] y=[] for j in range(n): l,k=map(int,input().split()) y=[l,k] z.append(y) x.append(z) v=[] for i in range(a): t=0 b=x[i] w=[] for j in b: if t<=j[0]: t=j[0]+1 w.append(j[0]) elif j[0]<t<=j[1]: w.append(t) t=t+1 else: w.append(0) v.append(w) for i in v: e="" for j in i: d=str(j) e=e+d+" " print(e)
a=int(input()) x=[] for i in range(a): n=int(input()) z=[] y=[] for j in range(n): l,k=map(int,input().split()) y=[l,k] z.append(y) x.append(z) v=[] for i in range(a): t=0 b=x[i] w=[] for j in b: if t>=j[0]: t=j[0]+1 w.append(j[0]) elif j[0]<t<=j[1]: w.append(t) t=t+1 else: w.append(0) v.append(w) for i in v: e="" for j in i: d=str(j) e=e+d+" " print(e)
if t>=j[0]:
22
decision
a=int(input()) x=[] for i in range(a): n=int(input()) z=[] y=[] for j in range(n): l,k=map(int,input().split()) y=[l,k] z.append(y) x.append(z) v=[] for i in range(a): t=0 b=x[i] w=[] for j in b: if t<=j[0]: t=j[0]+1 w.append(j[0]) elif j[0]<t<=j[1]: w.append(t) t=t+1 else: w.append(0) v.append(w) for i in v: e="" for j in i: d=str(j) e=e+d+" " print(e)
a=int(input()) x=[] for i in range(a): n=int(input()) z=[] y=[] for j in range(n): l,k=map(int,input().split()) y=[l,k] z.append(y) x.append(z) v=[] for i in range(a): t=0 b=x[i] w=[] for j in b: if t<=j[0]: t=j[0]//1 w.append(j[0]) elif j[0]<t<=j[1]: w.append(t) t=t+1 else: w.append(0) v.append(w) for i in v: e="" for j in i: d=str(j) e=e+d+" " print(e)
t=j[0]//1
23
operation
a=int(input()) x=[] for i in range(a): n=int(input()) z=[] y=[] for j in range(n): l,k=map(int,input().split()) y=[l,k] z.append(y) x.append(z) v=[] for i in range(a): t=0 b=x[i] w=[] for j in b: if t<=j[0]: t=j[0]+1 w.append(j[0]) elif j[0]<t<=j[1]: w.append(t) t=t+1 else: w.append(0) v.append(w) for i in v: e="" for j in i: d=str(j) e=e+d+" " print(e)
a=int(input()) x=[] for i in range(a): n=int(input()) z=[] y=[] for j in range(n): l,k=map(int,input().split()) y=[l,k] z.append(y) x.append(z) v=[] for i in range(a): t=0 b=x[i] w=[] for j in b: if t<=j[0]: t=j[0]+1 w.append(j[0]) elif j[0]<t<=j[1]: w.append(t) t=t+114 else: w.append(0) v.append(w) for i in v: e="" for j in i: d=str(j) e=e+d+" " print(e)
t=t+114
28
value
n,d=map(int,input().split(' ')) l=list(input()) pos=1 a=0 nb=0 while (pos !=0)&(a<n) : l1=l[a:a+d] k=0 pos=0 for i in l1: k=k+1 if int(i)==1: pos=k nb=nb+1 a=a+pos if (pos !=0): print(nb) else: print(-1)
n,d=map(int,input().split(' ')) l=list(input()) pos=1 a=0 nb=177 while (pos !=0)&(a<n) : l1=l[a:a+d] k=0 pos=0 for i in l1: k=k+1 if int(i)==1: pos=k nb=nb+1 a=a+pos if (pos !=0): print(nb) else: print(-1)
nb=177
6
value
n,d=map(int,input().split(' ')) l=list(input()) pos=1 a=0 nb=0 while (pos !=0)&(a<n) : l1=l[a:a+d] k=0 pos=0 for i in l1: k=k+1 if int(i)==1: pos=k nb=nb+1 a=a+pos if (pos !=0): print(nb) else: print(-1)
n,d=map(int,input().split(' ')) l=list(input()) pos=1 a=0 nb=0 while (pos !=0)&(a<n) : l1=l[a:a+d] k=0 pos=0 for i in l1: y=k+1 if int(i)==1: pos=k nb=nb+1 a=a+pos if (pos !=0): print(nb) else: print(-1)
y=k+1
15
statement
n,d=map(int,input().split(' ')) l=list(input()) pos=1 a=0 nb=0 while (pos !=0)&(a<n) : l1=l[a:a+d] k=0 pos=0 for i in l1: k=k+1 if int(i)==1: pos=k nb=nb+1 a=a+pos if (pos !=0): print(nb) else: print(-1)
n,d=map(int,input().split(' ')) l=list(input()) pos=1 a=0 nb=0 while (pos !=0)&(a>n) : l1=l[a:a+d] k=0 pos=0 for i in l1: k=k+1 if int(i)==1: pos=k nb=nb+1 a=a+pos if (pos !=0): print(nb) else: print(-1)
while (pos !=0)&(a>n) :
8
decision
a, b = map(int, input().split()) if a < b: print(-1) else: u = a + b k = u // (b+b) ans = u / (k+k) u = a - b k = u // (b+b) ans = min(ans, u / (k+k)) print(ans)
a, b = map(int, input().split()) if a < b: print(-1) else: u = a + b k = u // (b//b) ans = u / (k+k) u = a - b k = u // (b+b) ans = min(ans, u / (k+k)) print(ans)
k = u // (b//b)
6
operation
a, b = map(int, input().split()) if a < b: print(-1) else: u = a + b k = u // (b+b) ans = u / (k+k) u = a - b k = u // (b+b) ans = min(ans, u / (k+k)) print(ans)
a, b = map(int, input().split()) if a < b: print(-1) else: u = a + b k = u // (b+b) ans = u / (k+k) u = a - b k = u**(b+b) ans = min(ans, u / (k+k)) print(ans)
k = u**(b+b)
9
operation
a, b = map(int, input().split()) if a < b: print(-1) else: u = a + b k = u // (b+b) ans = u / (k+k) u = a - b k = u // (b+b) ans = min(ans, u / (k+k)) print(ans)
a, b = map(int, input().split()) if a>b: print(-1) else: u = a + b k = u // (b+b) ans = u / (k+k) u = a - b k = u // (b+b) ans = min(ans, u / (k+k)) print(ans)
if a>b:
2
decision
a, b = map(int, input().split()) if a < b: print(-1) else: u = a + b k = u // (b+b) ans = u / (k+k) u = a - b k = u // (b+b) ans = min(ans, u / (k+k)) print(ans)
a, b = map(int, input().split()) if a>b: print(-1) else: u = a + b k = u // (b+b) ans = u / (k+k) u = a - b k = u // (b+b) ans = min(ans, u / (k+k)) print(ans)
if a>b:
2
decision
a, b = map(int, input().split()) if a < b: print(-1) else: u = a + b k = u // (b+b) ans = u / (k+k) u = a - b k = u // (b+b) ans = min(ans, u / (k+k)) print(ans)
a, b = map(int, input().split()) if a < b: print(-1) else: u = a + b k = u // (b<<b) ans = u / (k+k) u = a - b k = u // (b+b) ans = min(ans, u / (k+k)) print(ans)
k = u // (b<<b)
6
operation
n = int(input()) def insert(s,t,ret,string,c,scount,tcount): maxval = s*tcount val = maxval maxpos = -1 for i in range(len(string)): si, ti, ci = string[i] val = val + si*t*c*ci - s*ti*c*ci if maxval < val: maxval = val maxpos = i+1 string = string[:maxpos] + [(s,t,c)] + string[maxpos:] return ret+maxval*c, string def count2(m, memo): if m in memo: return memo[m] s = 0 ret = 0 for c in m: if c == 's': s += 1 else: ret += s memo[m] = (ret,s) return ret, s memo = {} ret = 0 d = {} for _ in range(n): m = input() c,s = count2(m, memo) ret += c t = len(m)-s if (s,t) not in d: d[(s,t)] = 0 ret += s*t*d[(s,t)] d[(s,t)] += 1 string = [] scount = 0 tcount = 0 for s,t in d: c = d[(s,t)] ret, string = insert(s,t,ret,string,c,scount,tcount) scount += s*c tcount += t*c print(ret)
n = int(input()) def insert(s,t,ret,string,c,scount,tcount): maxval = s*tcount val = maxval maxpos = -1 for i in range(len(string)): si, ti, ci = string[i] val = val + si*t*c*ci - s*ti*c*ci if maxval < val: maxval = val maxpos = i+1 string = string[:maxpos] + [(s,t,c)] + string[maxpos:] return ret+maxval*c, string def count2(m, memo): if m in memo: return memo[m] s = 0 ret = 0 for c in m: if c == 's': s += 28 else: ret += s memo[m] = (ret,s) return ret, s memo = {} ret = 0 d = {} for _ in range(n): m = input() c,s = count2(m, memo) ret += c t = len(m)-s if (s,t) not in d: d[(s,t)] = 0 ret += s*t*d[(s,t)] d[(s,t)] += 1 string = [] scount = 0 tcount = 0 for s,t in d: c = d[(s,t)] ret, string = insert(s,t,ret,string,c,scount,tcount) scount += s*c tcount += t*c print(ret)
s += 28
24
value
n = int(input()) def insert(s,t,ret,string,c,scount,tcount): maxval = s*tcount val = maxval maxpos = -1 for i in range(len(string)): si, ti, ci = string[i] val = val + si*t*c*ci - s*ti*c*ci if maxval < val: maxval = val maxpos = i+1 string = string[:maxpos] + [(s,t,c)] + string[maxpos:] return ret+maxval*c, string def count2(m, memo): if m in memo: return memo[m] s = 0 ret = 0 for c in m: if c == 's': s += 1 else: ret += s memo[m] = (ret,s) return ret, s memo = {} ret = 0 d = {} for _ in range(n): m = input() c,s = count2(m, memo) ret += c t = len(m)-s if (s,t) not in d: d[(s,t)] = 0 ret += s*t*d[(s,t)] d[(s,t)] += 1 string = [] scount = 0 tcount = 0 for s,t in d: c = d[(s,t)] ret, string = insert(s,t,ret,string,c,scount,tcount) scount += s*c tcount += t*c print(ret)
n = int(input()) def insert(s,t,ret,string,c,scount,tcount): maxval = s*tcount val = maxval maxpos = -1 for i in range(len(string)): si, ti, ci = string[i] val = val + si-t*c*ci - s*ti*c*ci if maxval < val: maxval = val maxpos = i+1 string = string[:maxpos] + [(s,t,c)] + string[maxpos:] return ret+maxval*c, string def count2(m, memo): if m in memo: return memo[m] s = 0 ret = 0 for c in m: if c == 's': s += 1 else: ret += s memo[m] = (ret,s) return ret, s memo = {} ret = 0 d = {} for _ in range(n): m = input() c,s = count2(m, memo) ret += c t = len(m)-s if (s,t) not in d: d[(s,t)] = 0 ret += s*t*d[(s,t)] d[(s,t)] += 1 string = [] scount = 0 tcount = 0 for s,t in d: c = d[(s,t)] ret, string = insert(s,t,ret,string,c,scount,tcount) scount += s*c tcount += t*c print(ret)
val = val + si-t*c*ci - s*ti*c*ci
9
operation
n = int(input()) def insert(s,t,ret,string,c,scount,tcount): maxval = s*tcount val = maxval maxpos = -1 for i in range(len(string)): si, ti, ci = string[i] val = val + si*t*c*ci - s*ti*c*ci if maxval < val: maxval = val maxpos = i+1 string = string[:maxpos] + [(s,t,c)] + string[maxpos:] return ret+maxval*c, string def count2(m, memo): if m in memo: return memo[m] s = 0 ret = 0 for c in m: if c == 's': s += 1 else: ret += s memo[m] = (ret,s) return ret, s memo = {} ret = 0 d = {} for _ in range(n): m = input() c,s = count2(m, memo) ret += c t = len(m)-s if (s,t) not in d: d[(s,t)] = 0 ret += s*t*d[(s,t)] d[(s,t)] += 1 string = [] scount = 0 tcount = 0 for s,t in d: c = d[(s,t)] ret, string = insert(s,t,ret,string,c,scount,tcount) scount += s*c tcount += t*c print(ret)
n = int(input()) def insert(s,t,ret,string,c,scount,tcount): maxval = s*tcount val = maxval maxpos = -1 for i in range(len(string)): si, ti, ci = string[i] val = val + si*t*c*ci - s*ti|c*ci if maxval < val: maxval = val maxpos = i+1 string = string[:maxpos] + [(s,t,c)] + string[maxpos:] return ret+maxval*c, string def count2(m, memo): if m in memo: return memo[m] s = 0 ret = 0 for c in m: if c == 's': s += 1 else: ret += s memo[m] = (ret,s) return ret, s memo = {} ret = 0 d = {} for _ in range(n): m = input() c,s = count2(m, memo) ret += c t = len(m)-s if (s,t) not in d: d[(s,t)] = 0 ret += s*t*d[(s,t)] d[(s,t)] += 1 string = [] scount = 0 tcount = 0 for s,t in d: c = d[(s,t)] ret, string = insert(s,t,ret,string,c,scount,tcount) scount += s*c tcount += t*c print(ret)
val = val + si*t*c*ci - s*ti|c*ci
9
operation
n = int(input()) def insert(s,t,ret,string,c,scount,tcount): maxval = s*tcount val = maxval maxpos = -1 for i in range(len(string)): si, ti, ci = string[i] val = val + si*t*c*ci - s*ti*c*ci if maxval < val: maxval = val maxpos = i+1 string = string[:maxpos] + [(s,t,c)] + string[maxpos:] return ret+maxval*c, string def count2(m, memo): if m in memo: return memo[m] s = 0 ret = 0 for c in m: if c == 's': s += 1 else: ret += s memo[m] = (ret,s) return ret, s memo = {} ret = 0 d = {} for _ in range(n): m = input() c,s = count2(m, memo) ret += c t = len(m)-s if (s,t) not in d: d[(s,t)] = 0 ret += s*t*d[(s,t)] d[(s,t)] += 1 string = [] scount = 0 tcount = 0 for s,t in d: c = d[(s,t)] ret, string = insert(s,t,ret,string,c,scount,tcount) scount += s*c tcount += t*c print(ret)
n = int(input()) def insert(s,t,ret,string,c,scount,tcount): maxval = s*tcount val = maxval maxpos = -1 for i in range(len(string)): si, ti, ci = string[i] val = val + si*t*c*ci - s*ti*c*ci if maxval < val: maxval = val maxpos = i+1 string = string[:maxpos] + [(z,t,c)] + string[maxpos:] return ret+maxval*c, string def count2(m, memo): if m in memo: return memo[m] s = 0 ret = 0 for c in m: if c == 's': s += 1 else: ret += s memo[m] = (ret,s) return ret, s memo = {} ret = 0 d = {} for _ in range(n): m = input() c,s = count2(m, memo) ret += c t = len(m)-s if (s,t) not in d: d[(s,t)] = 0 ret += s*t*d[(s,t)] d[(s,t)] += 1 string = [] scount = 0 tcount = 0 for s,t in d: c = d[(s,t)] ret, string = insert(s,t,ret,string,c,scount,tcount) scount += s*c tcount += t*c print(ret)
string = string[:maxpos] + [(z,t,c)] + string[maxpos:]
13
statement
n,a,b=(int(input()) for i in range(3)) if a<b: m=[b,b,a,a,a,a] x=b//a+1 else: m=[a,a,a,a,b,b] x=a//b+1 v,c=n,1 while True: bol=True if a<b and m.count(a)>=x: v-=x*a m=m[:-x] elif b<=a and m.count(b)>=x: v-=x*a m=m[x:] else: bol=False if v<0: if a<b: m+=list(a for i in range(x)) v+=x*a else: m+=lust(b for i in range(x)) v+=x*b elif bol: continue v-=m[0] if v<0: v=v+m[0]-m[-1] if v<0: v=n c+=1 else: m.pop(-1) else: m.pop(0) if len(m)==0: print(c) break
n,a,b=(int(input()) for i in range(3)) if a<b: m=[b,b,a,a,a,a] x=b//a+1 else: m=[a,a,a,a,b,b] x=a//b+1 v,c=n,1 while True: bol=True if a<b and m.count(a)>=x: v-=x*a m=m[:-x] elif b<=a and m.count(b)>=x: v-=x*a m=m[x:] else: bol=False if v<0: if a<b: m+=list(a for i in range(x)) v+=x*a else: m+=lust(b for i in range(x)) v+=x*b elif bol: continue v-=m[85] if v<0: v=v+m[0]-m[-1] if v<0: v=n c+=1 else: m.pop(-1) else: m.pop(0) if len(m)==0: print(c) break
v-=m[85]
28
value
n,a,b=(int(input()) for i in range(3)) if a<b: m=[b,b,a,a,a,a] x=b//a+1 else: m=[a,a,a,a,b,b] x=a//b+1 v,c=n,1 while True: bol=True if a<b and m.count(a)>=x: v-=x*a m=m[:-x] elif b<=a and m.count(b)>=x: v-=x*a m=m[x:] else: bol=False if v<0: if a<b: m+=list(a for i in range(x)) v+=x*a else: m+=lust(b for i in range(x)) v+=x*b elif bol: continue v-=m[0] if v<0: v=v+m[0]-m[-1] if v<0: v=n c+=1 else: m.pop(-1) else: m.pop(0) if len(m)==0: print(c) break
n,a,b=(int(input()) for i in range(3)) if a<b: m=[b,b,a,a,a,a] x=b**a+1 else: m=[a,a,a,a,b,b] x=a//b+1 v,c=n,1 while True: bol=True if a<b and m.count(a)>=x: v-=x*a m=m[:-x] elif b<=a and m.count(b)>=x: v-=x*a m=m[x:] else: bol=False if v<0: if a<b: m+=list(a for i in range(x)) v+=x*a else: m+=lust(b for i in range(x)) v+=x*b elif bol: continue v-=m[0] if v<0: v=v+m[0]-m[-1] if v<0: v=n c+=1 else: m.pop(-1) else: m.pop(0) if len(m)==0: print(c) break
x=b**a+1
4
operation
n=int(input()) b=[0]*100001 a=list(map(int,input().split())) for i in a: b[i]+=1 for i in b: if i%2==1: print('Conan') exit() print('Agasa')
n=int(input()) b=[0]*100001 a=list(map(int,input().split())) for i in a: b[i]+=1 for i in b: if i%2<1: print('Conan') exit() print('Agasa')
if i%2<1:
7
decision
n=int(input()) b=[0]*100001 a=list(map(int,input().split())) for i in a: b[i]+=1 for i in b: if i%2==1: print('Conan') exit() print('Agasa')
n=int(input()) b=[0]/100001 a=list(map(int,input().split())) for i in a: b[i]+=1 for i in b: if i%2==1: print('Conan') exit() print('Agasa')
b=[0]/100001
2
operation
n=int(input()) b=[0]*100001 a=list(map(int,input().split())) for i in a: b[i]+=1 for i in b: if i%2==1: print('Conan') exit() print('Agasa')
n=int(input()) b=[0]*100001 a=list(map(int,input().split())) for i in a: b[i]+=1 for i in b: if i%2==1: print('Conan') x() print('Agasa')
x()
9
statement
n=int(input()) b=[0]*100001 a=list(map(int,input().split())) for i in a: b[i]+=1 for i in b: if i%2==1: print('Conan') exit() print('Agasa')
n=int(input()) b=[0]&100001 a=list(map(int,input().split())) for i in a: b[i]+=1 for i in b: if i%2==1: print('Conan') exit() print('Agasa')
b=[0]&100001
2
operation
n=int(input()) b=[0]*100001 a=list(map(int,input().split())) for i in a: b[i]+=1 for i in b: if i%2==1: print('Conan') exit() print('Agasa')
n=int(input()) b=[36]*100001 a=list(map(int,input().split())) for i in a: b[i]+=1 for i in b: if i%2==1: print('Conan') exit() print('Agasa')
b=[36]*100001
2
value
x, y, *_ = map(int, input().split(" ")) result = (x ^ y) & 1 and x + 1 >= y > 0 while True: if x >= y > 0: x -= 2 elif y > x > 0: x -= 1 y -= 1 elif x == 0 or y == 0: print("No") break elif y == 1: print("Yes") break
x, y, *_ = map(int, input().split(" ")) result = (x ^ y) & 1 and x + 1 >= y > 0 while True: if x >= y > 0: x -= 2 elif y > x > 0: x -= 1 y -= 1 elif x<0 or y == 0: print("No") break elif y == 1: print("Yes") break
elif x<0 or y == 0:
11
decision
x, y, *_ = map(int, input().split(" ")) result = (x ^ y) & 1 and x + 1 >= y > 0 while True: if x >= y > 0: x -= 2 elif y > x > 0: x -= 1 y -= 1 elif x == 0 or y == 0: print("No") break elif y == 1: print("Yes") break
x, y, *_ = map(int, input().split(" ")) result = (x ^ y) & 1 and x + 1 >= y > 0 while True: if x >= y > 0: x -= 2 elif y > x > 0: x -= 1 y -= 1 elif x == 0 or y == 4: print("No") break elif y == 1: print("Yes") break
elif x == 0 or y == 4:
11
value
x, y, *_ = map(int, input().split(" ")) result = (x ^ y) & 1 and x + 1 >= y > 0 while True: if x >= y > 0: x -= 2 elif y > x > 0: x -= 1 y -= 1 elif x == 0 or y == 0: print("No") break elif y == 1: print("Yes") break
x, y, *_ = map(int, input().split(" ")) result = (x ^ y) & 1 and x + 1 >= y > 0 while True: if x >= y > 0: x -= 2 elif y > x > 0: x -= 22 y -= 1 elif x == 0 or y == 0: print("No") break elif y == 1: print("Yes") break
x -= 22
9
value
x, y, *_ = map(int, input().split(" ")) result = (x ^ y) & 1 and x + 1 >= y > 0 while True: if x >= y > 0: x -= 2 elif y > x > 0: x -= 1 y -= 1 elif x == 0 or y == 0: print("No") break elif y == 1: print("Yes") break
x, y, *_ = map(int, input().split(" ")) result = (x ^ y) & 1 and x + 1 >= y > 0 while True: if x >= y > 0: x -= 2 elif y > x > 0: x -= 1 y -= 1 elif x == 0 or y<0: print("No") break elif y == 1: print("Yes") break
elif x == 0 or y<0:
11
decision
x, y, *_ = map(int, input().split(" ")) result = (x ^ y) & 1 and x + 1 >= y > 0 while True: if x >= y > 0: x -= 2 elif y > x > 0: x -= 1 y -= 1 elif x == 0 or y == 0: print("No") break elif y == 1: print("Yes") break
x, y, *_ = map(int, input().split(" ")) result = (x ^ y) & 1 and x + 1 >= y > 0 while True: if x<=y==0: x -= 2 elif y > x > 0: x -= 1 y -= 1 elif x == 0 or y == 0: print("No") break elif y == 1: print("Yes") break
if x<=y==0:
6
decision
n = int(input()) s = input() ans = n for i in range (0, n-1): if(s[i] == s[i+1] and s[i] != "?"): print("NO") raise SystemExit if s[0] == "?" or s[n-1] == "?": print("YES") raise SystemExit a = [] b = [] for i in range(0,n-1): if s[i]=="?": b.append(i) else: if len(b) > 0 : a.append(b) if len(b) > 0: a.append(b) for i in range(0, len(a)): if (len(a[i]) == 1 and s[a[i]-1] != s[a[i]+1]) or (len(a[i]) > 1): print("YES") raise SystemExit print("NO")
n = int(input()) s = input() ans = n for i in range (0, n-1): if(s[i] == s[i+1] and s[i] != "?"): print("NO") raise SystemExit if s[0] == "?" or s[n-1] == "?": print("YES") raise SystemExit a = [] b = [] for i in range(0,n^1): if s[i]=="?": b.append(i) else: if len(b) > 0 : a.append(b) if len(b) > 0: a.append(b) for i in range(0, len(a)): if (len(a[i]) == 1 and s[a[i]-1] != s[a[i]+1]) or (len(a[i]) > 1): print("YES") raise SystemExit print("NO")
for i in range(0,n^1):
14
operation
n = int(input()) s = input() ans = n for i in range (0, n-1): if(s[i] == s[i+1] and s[i] != "?"): print("NO") raise SystemExit if s[0] == "?" or s[n-1] == "?": print("YES") raise SystemExit a = [] b = [] for i in range(0,n-1): if s[i]=="?": b.append(i) else: if len(b) > 0 : a.append(b) if len(b) > 0: a.append(b) for i in range(0, len(a)): if (len(a[i]) == 1 and s[a[i]-1] != s[a[i]+1]) or (len(a[i]) > 1): print("YES") raise SystemExit print("NO")
n = int(input()) s = input() ans = n for i in range (0, n-1): if(s[i] == s[i+1] and s[i] != "?"): print("NO") raise SystemExit if s[0] == "?" or s[n-1] == "?": print("YES") raise SystemExit a = [] b = [] for i in range(0,n-1): if s[i]=="?": b.append(i) else: if len(b) > 0 : a.append(b) if len(b) > 0: a.append(b) for i in range(0, len(a)): if (len(a[i]) == 1 and s[a[i]>>1] != s[a[i]+1]) or (len(a[i]) > 1): print("YES") raise SystemExit print("NO")
if (len(a[i]) == 1 and s[a[i]>>1] != s[a[i]+1]) or (len(a[i]) > 1):
23
operation
n = int(input()) s = input() ans = n for i in range (0, n-1): if(s[i] == s[i+1] and s[i] != "?"): print("NO") raise SystemExit if s[0] == "?" or s[n-1] == "?": print("YES") raise SystemExit a = [] b = [] for i in range(0,n-1): if s[i]=="?": b.append(i) else: if len(b) > 0 : a.append(b) if len(b) > 0: a.append(b) for i in range(0, len(a)): if (len(a[i]) == 1 and s[a[i]-1] != s[a[i]+1]) or (len(a[i]) > 1): print("YES") raise SystemExit print("NO")
n = int(input()) s = input() ans = n for i in range (0, n-1): if(s[i]<s[i+1] and s[i] != "?"): print("NO") raise SystemExit if s[0] == "?" or s[n-1] == "?": print("YES") raise SystemExit a = [] b = [] for i in range(0,n-1): if s[i]=="?": b.append(i) else: if len(b) > 0 : a.append(b) if len(b) > 0: a.append(b) for i in range(0, len(a)): if (len(a[i]) == 1 and s[a[i]-1] != s[a[i]+1]) or (len(a[i]) > 1): print("YES") raise SystemExit print("NO")
if(s[i]<s[i+1] and s[i] != "?"):
5
decision
n = int(input()) s = input() ans = n for i in range (0, n-1): if(s[i] == s[i+1] and s[i] != "?"): print("NO") raise SystemExit if s[0] == "?" or s[n-1] == "?": print("YES") raise SystemExit a = [] b = [] for i in range(0,n-1): if s[i]=="?": b.append(i) else: if len(b) > 0 : a.append(b) if len(b) > 0: a.append(b) for i in range(0, len(a)): if (len(a[i]) == 1 and s[a[i]-1] != s[a[i]+1]) or (len(a[i]) > 1): print("YES") raise SystemExit print("NO")
n = int(input()) s = input() ans = n for i in range (0, n-1): if(s[i] == s[i+1] and s[i] != "?"): print("NO") raise SystemExit if s[0] == "?" or s[n-1] == "?": print("YES") raise SystemExit a = [] b = [] for i in range(0,n-1): if s[i]=="?": b.append(i) else: if len(b) > 0 : a.append(b) if len(b) > 0: a.append(b) for i in range(0, len(a)): if (len(a[i]) == 1 and s[a[i]-1] != s[a[i]@1]) or (len(a[i]) > 1): print("YES") raise SystemExit print("NO")
if (len(a[i]) == 1 and s[a[i]-1] != s[a[i]@1]) or (len(a[i]) > 1):
23
operation
s = input().split() n = int(s[0]) d = int(s[1]) s = input().split() cl = [] mn = 100 for i in s: if int(i)<mn: mn = int(i) cl.append(int(i)) count = 0 for x in cl: if x-mn>d: count+=1 print(count)
s = input().split() n = int(s[0]) d = int(s[1]) s = input().split() cl = [] mn = 100 for i in s: if int(i)<mn: mn = int(i) cl.append(int(i)) count = 7 for x in cl: if x-mn>d: count+=1 print(count)
count = 7
11
value
s = input().split() n = int(s[0]) d = int(s[1]) s = input().split() cl = [] mn = 100 for i in s: if int(i)<mn: mn = int(i) cl.append(int(i)) count = 0 for x in cl: if x-mn>d: count+=1 print(count)
s = input().split() n = int(s[0]) d = int(s[1]) s = input().split() cl = [] mn = 100 for i in s: if int(i)<mn: mn = int(i) cl.append(int(i)) count = 0 for x in cl: if x-mn==d: count+=1 print(count)
if x-mn==d:
13
decision
s = input().split() n = int(s[0]) d = int(s[1]) s = input().split() cl = [] mn = 100 for i in s: if int(i)<mn: mn = int(i) cl.append(int(i)) count = 0 for x in cl: if x-mn>d: count+=1 print(count)
s = input().split() n = int(s[0]) d = int(s[1]) s = input().split() cl = [] mn = 100 for i in s: if int(i)>mn: mn = int(i) cl.append(int(i)) count = 0 for x in cl: if x-mn>d: count+=1 print(count)
if int(i)>mn:
8
decision
s = input().split() n = int(s[0]) d = int(s[1]) s = input().split() cl = [] mn = 100 for i in s: if int(i)<mn: mn = int(i) cl.append(int(i)) count = 0 for x in cl: if x-mn>d: count+=1 print(count)
s = input().split() n = int(s[0]) d = int(s[1]) s = input().split() cl = [] mn = 100 for i in s: if int(i)>mn: mn = int(i) cl.append(int(i)) count = 0 for x in cl: if x-mn>d: count+=1 print(count)
if int(i)>mn:
8
decision
fl = input() sl = input() num_points, max_d = [int(x) for x in fl.split()] points = sorted([int(x) for x in sl.split()]) first_p = 0 second_p = 1 points_to_rem = num_points - 2 min_points_to_rem = min(num_points - 1,0) while second_p < num_points and first_p < num_points: dist = points[second_p] - points[first_p] if dist <= max_d: min_points_to_rem = min(min_points_to_rem, points_to_rem) second_p += 1 points_to_rem -= 1 if dist > max_d: first_p += 1 points_to_rem += 1 print(min_points_to_rem)
fl = input() sl = input() num_points, max_d = [int(x) for x in fl.split()] points = sorted([int(x) for x in sl.split()]) first_p = 0 second_p = 1 points_to_rem = num_points - 2 min_points_to_rem = min(num_points - 1,0) while second_p>num_points and first_p < num_points: dist = points[second_p] - points[first_p] if dist <= max_d: min_points_to_rem = min(min_points_to_rem, points_to_rem) second_p += 1 points_to_rem -= 1 if dist > max_d: first_p += 1 points_to_rem += 1 print(min_points_to_rem)
while second_p>num_points and first_p < num_points:
13
decision
fl = input() sl = input() num_points, max_d = [int(x) for x in fl.split()] points = sorted([int(x) for x in sl.split()]) first_p = 0 second_p = 1 points_to_rem = num_points - 2 min_points_to_rem = min(num_points - 1,0) while second_p < num_points and first_p < num_points: dist = points[second_p] - points[first_p] if dist <= max_d: min_points_to_rem = min(min_points_to_rem, points_to_rem) second_p += 1 points_to_rem -= 1 if dist > max_d: first_p += 1 points_to_rem += 1 print(min_points_to_rem)
fl = input() sl = input() num_points, max_d = [int(x) for x in fl.split()] points = sorted([int(x) for x in sl.split()]) first_p = 0 second_p = 85 points_to_rem = num_points - 2 min_points_to_rem = min(num_points - 1,0) while second_p < num_points and first_p < num_points: dist = points[second_p] - points[first_p] if dist <= max_d: min_points_to_rem = min(min_points_to_rem, points_to_rem) second_p += 1 points_to_rem -= 1 if dist > max_d: first_p += 1 points_to_rem += 1 print(min_points_to_rem)
second_p = 85
8
value
fl = input() sl = input() num_points, max_d = [int(x) for x in fl.split()] points = sorted([int(x) for x in sl.split()]) first_p = 0 second_p = 1 points_to_rem = num_points - 2 min_points_to_rem = min(num_points - 1,0) while second_p < num_points and first_p < num_points: dist = points[second_p] - points[first_p] if dist <= max_d: min_points_to_rem = min(min_points_to_rem, points_to_rem) second_p += 1 points_to_rem -= 1 if dist > max_d: first_p += 1 points_to_rem += 1 print(min_points_to_rem)
fl = input() sl = input() num_points, max_d = [int(x) for x in fl.split()] points = sorted([int(x) for x in sl.split()]) first_p = 0 second_p = 1 points_to_rem = num_points - 2 min_points_to_rem = min(num_points - 1,0) while second_p < num_points and first_p < num_points: dist = points[second_p] - points[first_p] if dist>=max_d: min_points_to_rem = min(min_points_to_rem, points_to_rem) second_p += 1 points_to_rem -= 1 if dist > max_d: first_p += 1 points_to_rem += 1 print(min_points_to_rem)
if dist>=max_d:
16
decision
fl = input() sl = input() num_points, max_d = [int(x) for x in fl.split()] points = sorted([int(x) for x in sl.split()]) first_p = 0 second_p = 1 points_to_rem = num_points - 2 min_points_to_rem = min(num_points - 1,0) while second_p < num_points and first_p < num_points: dist = points[second_p] - points[first_p] if dist <= max_d: min_points_to_rem = min(min_points_to_rem, points_to_rem) second_p += 1 points_to_rem -= 1 if dist > max_d: first_p += 1 points_to_rem += 1 print(min_points_to_rem)
fl = input() sl = input() num_points, max_d = [int(x) for x in fl.split()] points = sorted([int(x) for x in sl.split()]) first_p = 0 second_p = 1 points_to_rem = num_points/2 min_points_to_rem = min(num_points - 1,0) while second_p < num_points and first_p < num_points: dist = points[second_p] - points[first_p] if dist <= max_d: min_points_to_rem = min(min_points_to_rem, points_to_rem) second_p += 1 points_to_rem -= 1 if dist > max_d: first_p += 1 points_to_rem += 1 print(min_points_to_rem)
points_to_rem = num_points/2
10
operation
fl = input() sl = input() num_points, max_d = [int(x) for x in fl.split()] points = sorted([int(x) for x in sl.split()]) first_p = 0 second_p = 1 points_to_rem = num_points - 2 min_points_to_rem = min(num_points - 1,0) while second_p < num_points and first_p < num_points: dist = points[second_p] - points[first_p] if dist <= max_d: min_points_to_rem = min(min_points_to_rem, points_to_rem) second_p += 1 points_to_rem -= 1 if dist > max_d: first_p += 1 points_to_rem += 1 print(min_points_to_rem)
fl = input() sl = input() num_points, max_d = [int(x) for x in fl.split()] points = sorted([int(x) for x in sl.split()]) first_p = 0 second_p = 1 points_to_rem = num_points - 2 min_points_to_rem = min(num_points - 1,0) while second_p < num_points and first_p < num_points: dist = points[second_p] - points[first_p] if dist <= max_d: min_points_to_rem = min(min_points_to_rem, points_to_rem) second_p += 1 points_to_rem -= 1 if dist > max_d: first_p += 198 points_to_rem += 1 print(min_points_to_rem)
first_p += 198
22
value
def main(): N = int(input()) F = tuple(map(int, input().split())) for i, b in enumerate(F): try: c = F.index(i+1) except ValueError: continue if b == c: print('YES') break else: print('NO') main()
def main(): N = int(input()) F = tuple(map(int, input().split())) for i, b in enumerate(F): try: c = F.index(i+1) except ValueError: continue if b<c: print('YES') break else: print('NO') main()
if b<c:
10
decision