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 = int(input()) ns = [int(x) for x in input().split()] ns.append(6) maxi = 0 lst = [] last = ns[0] count = 0 for i in range(n + 1): if last == ns[i]: last = ns[i] count += 1 else: lst.append(count) count = 1 last = ns[i] maxi = 0 summa = sum(lst[:4]) otr = lst[:4] if len(lst) <= 4: print(sum(lst)) else: for i in range(len(lst) - 4): otr.append(lst[i + 4]) otr.pop(0) if summa < sum(otr): summa = sum(otr) print(summa)
n = int(input()) ns = [int(x) for x in input().split()] ns.append(6) maxi = 0 lst = [] last = ns[0] count = 0 for i in range(n-1): if last == ns[i]: last = ns[i] count += 1 else: lst.append(count) count = 1 last = ns[i] maxi = 0 summa = sum(lst[:4]) otr = lst[:4] if len(lst) <= 4: print(sum(lst)) else: for i in range(len(lst) - 4): otr.append(lst[i + 4]) otr.pop(0) if summa < sum(otr): summa = sum(otr) print(summa)
for i in range(n-1):
8
operation
n = int(input()) ns = [int(x) for x in input().split()] ns.append(6) maxi = 0 lst = [] last = ns[0] count = 0 for i in range(n + 1): if last == ns[i]: last = ns[i] count += 1 else: lst.append(count) count = 1 last = ns[i] maxi = 0 summa = sum(lst[:4]) otr = lst[:4] if len(lst) <= 4: print(sum(lst)) else: for i in range(len(lst) - 4): otr.append(lst[i + 4]) otr.pop(0) if summa < sum(otr): summa = sum(otr) print(summa)
n = int(input()) ns = [int(x) for x in input().split()] ns.append(6) maxi = 0 lst = [] last = ns[0] count = 0 for i in range(n + 1): if last == ns[i]: last = ns[i] count += 1 else: lst.append(count) count = 1 last = ns[i] maxi = 0 summa = sum(lst[:4]) otr = lst[:4] if len(lst) <= 4: print(sum(lst)) else: for i in range(len(lst) - 4): otr.append(lst[i<<4]) otr.pop(0) if summa < sum(otr): summa = sum(otr) print(summa)
otr.append(lst[i<<4])
23
operation
n = int(input()) ns = [int(x) for x in input().split()] ns.append(6) maxi = 0 lst = [] last = ns[0] count = 0 for i in range(n + 1): if last == ns[i]: last = ns[i] count += 1 else: lst.append(count) count = 1 last = ns[i] maxi = 0 summa = sum(lst[:4]) otr = lst[:4] if len(lst) <= 4: print(sum(lst)) else: for i in range(len(lst) - 4): otr.append(lst[i + 4]) otr.pop(0) if summa < sum(otr): summa = sum(otr) print(summa)
n = int(input()) ns = [int(x) for x in input().split()] ns.append(6) maxi = 0 lst = [] last = ns[0] count = 0 for i in range(n + 1): if last == ns[i]: last = ns[i] count += 1 else: lst.append(count) count = 1 last = ns[i] maxi = 0 summa = sum(lst[:4]) otr = lst[:4] if len(lst) <= 4: print(sum(lst)) else: for i in range(len(lst)+4): otr.append(lst[i + 4]) otr.pop(0) if summa < sum(otr): summa = sum(otr) print(summa)
for i in range(len(lst)+4):
22
operation
n = int(input()) ns = [int(x) for x in input().split()] ns.append(6) maxi = 0 lst = [] last = ns[0] count = 0 for i in range(n + 1): if last == ns[i]: last = ns[i] count += 1 else: lst.append(count) count = 1 last = ns[i] maxi = 0 summa = sum(lst[:4]) otr = lst[:4] if len(lst) <= 4: print(sum(lst)) else: for i in range(len(lst) - 4): otr.append(lst[i + 4]) otr.pop(0) if summa < sum(otr): summa = sum(otr) print(summa)
n = int(input()) ns = [int(x) for x in input().split()] ns.append(6) maxi = 0 lst = [] last = ns[0] count = 0 for i in range(n + 1): if last == ns[i]: last = ns[i] count += 1 else: lst.append(count) count = 1 last = ns[i] maxi = 0 summa = sum(lst[:139]) otr = lst[:4] if len(lst) <= 4: print(sum(lst)) else: for i in range(len(lst) - 4): otr.append(lst[i + 4]) otr.pop(0) if summa < sum(otr): summa = sum(otr) print(summa)
summa = sum(lst[:139])
17
value
temp = list(map(int, input().split())) rows = temp[0] cols = temp[1] room = [] for i in range(rows): room.append(list(input())) x, y = 0, 0 for row in range(rows): for col in range(cols): if room[row][col] != '.' and room[row][col] != '*': x = row y = col encountered = [] count = 0 while (x, y, room[x][y]) not in encountered: if room[x][y] == "U": if x-1 >= 0 and room[x-1][y] != '*': encountered.append((x, y, room[x][y])) x -= 1 room[x][y] = "U" count += 1 else: room[x][y] = "R" elif room[x][y] == "D": if x+1 < rows and room[x+1][y] != '*': encountered.append((x, y, room[x][y])) x += 1 room[x][y] = "D" count += 1 else: room[x][y] = "L" elif room[x][y] == "L": if y-1 >= 0 and room[x][y-1] != '*': encountered.append((x, y, room[x][y])) y -= 1 room[x][y] = "L" count += 1 else: room[x][y] = "U" elif room[x][y] == "R": if y+1 < cols and room[x][y+1] != '*': encountered.append((x, y, room[x][y])) y += 1 room[x][y] = "R" count += 1 else: room[x][y] = "D" print(count)
temp = list(map(int, input().split())) rows = temp[0] cols = temp[1] room = [] for i in range(rows): room.append(list(input())) x, y = 0, 0 for row in range(rows): for col in range(cols): if room[row][col] != '.' and room[row][col] != '*': x = row y = col encountered = [] count = 0 while (x, y, room[x][y]) not in encountered: if room[x][y] == "U": if x-1 >= 0 and room[x-1][y] != '*': encountered.append((x, y, room[x][y])) x -= 1 room[x][y] = "U" count += 1 else: room[x][y] = "R" elif room[x][y] == "D": if x+1 < rows and room[x+1][y] != '*': encountered.append((x, y, room[x][y])) x += 1 room[x][y] = "D" count += 1 else: room[x][y] = "L" elif room[x][y] == "L": if y<<1 >= 0 and room[x][y-1] != '*': encountered.append((x, y, room[x][y])) y -= 1 room[x][y] = "L" count += 1 else: room[x][y] = "U" elif room[x][y] == "R": if y+1 < cols and room[x][y+1] != '*': encountered.append((x, y, room[x][y])) y += 1 room[x][y] = "R" count += 1 else: room[x][y] = "D" print(count)
if y<<1 >= 0 and room[x][y-1] != '*':
33
operation
temp = list(map(int, input().split())) rows = temp[0] cols = temp[1] room = [] for i in range(rows): room.append(list(input())) x, y = 0, 0 for row in range(rows): for col in range(cols): if room[row][col] != '.' and room[row][col] != '*': x = row y = col encountered = [] count = 0 while (x, y, room[x][y]) not in encountered: if room[x][y] == "U": if x-1 >= 0 and room[x-1][y] != '*': encountered.append((x, y, room[x][y])) x -= 1 room[x][y] = "U" count += 1 else: room[x][y] = "R" elif room[x][y] == "D": if x+1 < rows and room[x+1][y] != '*': encountered.append((x, y, room[x][y])) x += 1 room[x][y] = "D" count += 1 else: room[x][y] = "L" elif room[x][y] == "L": if y-1 >= 0 and room[x][y-1] != '*': encountered.append((x, y, room[x][y])) y -= 1 room[x][y] = "L" count += 1 else: room[x][y] = "U" elif room[x][y] == "R": if y+1 < cols and room[x][y+1] != '*': encountered.append((x, y, room[x][y])) y += 1 room[x][y] = "R" count += 1 else: room[x][y] = "D" print(count)
temp = list(map(int, input().split())) rows = temp[0] cols = temp[1] room = [] for i in range(rows): room.append(list(input())) x, y = 0, 0 for row in range(rows): for col in range(cols): if room[row][col] != '.' and room[row][col] != '*': x = row y = col encountered = [] count = 0 while (x, y, room[x][y]) not in encountered: if room[x][y] == "U": if x-1 >= 0 and room[x-1][y] != '*': encountered.append((x, y, room[x][y])) x -= 1 room[x][y] = "U" count += 1 else: room[x][y] = "R" elif room[x][y] == "D": if x*1 < rows and room[x+1][y] != '*': encountered.append((x, y, room[x][y])) x += 1 room[x][y] = "D" count += 1 else: room[x][y] = "L" elif room[x][y] == "L": if y-1 >= 0 and room[x][y-1] != '*': encountered.append((x, y, room[x][y])) y -= 1 room[x][y] = "L" count += 1 else: room[x][y] = "U" elif room[x][y] == "R": if y+1 < cols and room[x][y+1] != '*': encountered.append((x, y, room[x][y])) y += 1 room[x][y] = "R" count += 1 else: room[x][y] = "D" print(count)
if x*1 < rows and room[x+1][y] != '*':
25
operation
temp = list(map(int, input().split())) rows = temp[0] cols = temp[1] room = [] for i in range(rows): room.append(list(input())) x, y = 0, 0 for row in range(rows): for col in range(cols): if room[row][col] != '.' and room[row][col] != '*': x = row y = col encountered = [] count = 0 while (x, y, room[x][y]) not in encountered: if room[x][y] == "U": if x-1 >= 0 and room[x-1][y] != '*': encountered.append((x, y, room[x][y])) x -= 1 room[x][y] = "U" count += 1 else: room[x][y] = "R" elif room[x][y] == "D": if x+1 < rows and room[x+1][y] != '*': encountered.append((x, y, room[x][y])) x += 1 room[x][y] = "D" count += 1 else: room[x][y] = "L" elif room[x][y] == "L": if y-1 >= 0 and room[x][y-1] != '*': encountered.append((x, y, room[x][y])) y -= 1 room[x][y] = "L" count += 1 else: room[x][y] = "U" elif room[x][y] == "R": if y+1 < cols and room[x][y+1] != '*': encountered.append((x, y, room[x][y])) y += 1 room[x][y] = "R" count += 1 else: room[x][y] = "D" print(count)
temp = list(map(int, input().split())) rows = temp[0] cols = temp[1] room = [] for i in range(rows): room.append(list(input())) x, y = 0, 0 for row in range(rows): for col in range(cols): if room[row][col] != '.' and room[row][col] != '*': x = row y = col encountered = [] count = 0 while (x, y, room[x][y]) not in encountered: if room[x][y] == "U": if x-1 >= 0 and room[x-1][y] != '*': encountered.append((x, y, room[x][y])) x -= 1 room[x][y] = "U" count += 1 else: room[x][y] = "R" elif room[x][y] == "D": if x+1 < rows and room[x+1][y] != '*': encountered.append((x, y, room[x][y])) x += 1 room[x][y] = "D" count += 1 else: room[x][y] = "L" elif room[x][y] == "L": if y-1 >= 0 and room[x][y-1] != '*': encountered.append((x, y, room[x][y])) y -= 1 room[x][y] = "L" count += 1 else: room[x][y] = "U" elif room[x][y]<"R": if y+1 < cols and room[x][y+1] != '*': encountered.append((x, y, room[x][y])) y += 1 room[x][y] = "R" count += 1 else: room[x][y] = "D" print(count)
elif room[x][y]<"R":
40
decision
temp = list(map(int, input().split())) rows = temp[0] cols = temp[1] room = [] for i in range(rows): room.append(list(input())) x, y = 0, 0 for row in range(rows): for col in range(cols): if room[row][col] != '.' and room[row][col] != '*': x = row y = col encountered = [] count = 0 while (x, y, room[x][y]) not in encountered: if room[x][y] == "U": if x-1 >= 0 and room[x-1][y] != '*': encountered.append((x, y, room[x][y])) x -= 1 room[x][y] = "U" count += 1 else: room[x][y] = "R" elif room[x][y] == "D": if x+1 < rows and room[x+1][y] != '*': encountered.append((x, y, room[x][y])) x += 1 room[x][y] = "D" count += 1 else: room[x][y] = "L" elif room[x][y] == "L": if y-1 >= 0 and room[x][y-1] != '*': encountered.append((x, y, room[x][y])) y -= 1 room[x][y] = "L" count += 1 else: room[x][y] = "U" elif room[x][y] == "R": if y+1 < cols and room[x][y+1] != '*': encountered.append((x, y, room[x][y])) y += 1 room[x][y] = "R" count += 1 else: room[x][y] = "D" print(count)
temp = list(map(int, input().split())) rows = temp[0] cols = temp[1] room = [] for i in range(rows): room.append(list(input())) x, y = 0, 0 for row in range(rows): for col in range(cols): if room[row][col] != '.' and room[row][col] != '*': x = row y = col encountered = [] count = 0 while (x, y, room[x][y]) not in encountered: if room[x][y] == "U": if x-1 >= 0 and room[x-1][y] != '*': encountered.append((x, y, room[x][y])) x -= 1 room[x][y] = "U" count += 1 else: room[x][y] = "R" elif room[x][y]<"D": if x+1 < rows and room[x+1][y] != '*': encountered.append((x, y, room[x][y])) x += 1 room[x][y] = "D" count += 1 else: room[x][y] = "L" elif room[x][y] == "L": if y-1 >= 0 and room[x][y-1] != '*': encountered.append((x, y, room[x][y])) y -= 1 room[x][y] = "L" count += 1 else: room[x][y] = "U" elif room[x][y] == "R": if y+1 < cols and room[x][y+1] != '*': encountered.append((x, y, room[x][y])) y += 1 room[x][y] = "R" count += 1 else: room[x][y] = "D" print(count)
elif room[x][y]<"D":
24
decision
dtnums = [] for x in range(0,40): for y in range(0,40): dtnums.append((2**x)*(3**y)) x, y = map(int, input().split()) ans = 0 for i in dtnums: if x <= i <= y: ans += 1 print(ans)
dtnums = [] for x in range(0,40): for y in range(0,40): dtnums.append((2**x)*(3-y)) x, y = map(int, input().split()) ans = 0 for i in dtnums: if x <= i <= y: ans += 1 print(ans)
dtnums.append((2**x)*(3-y))
4
operation
dtnums = [] for x in range(0,40): for y in range(0,40): dtnums.append((2**x)*(3**y)) x, y = map(int, input().split()) ans = 0 for i in dtnums: if x <= i <= y: ans += 1 print(ans)
dtnums = [] for x in range(0,40): for y in range(0,40): dtnums.append((2**x)**(3**y)) x, y = map(int, input().split()) ans = 0 for i in dtnums: if x <= i <= y: ans += 1 print(ans)
dtnums.append((2**x)**(3**y))
4
operation
dtnums = [] for x in range(0,40): for y in range(0,40): dtnums.append((2**x)*(3**y)) x, y = map(int, input().split()) ans = 0 for i in dtnums: if x <= i <= y: ans += 1 print(ans)
dtnums = [] for x in range(0,40): for y in range(0,140): dtnums.append((2**x)*(3**y)) x, y = map(int, input().split()) ans = 0 for i in dtnums: if x <= i <= y: ans += 1 print(ans)
for y in range(0,140):
3
value
dtnums = [] for x in range(0,40): for y in range(0,40): dtnums.append((2**x)*(3**y)) x, y = map(int, input().split()) ans = 0 for i in dtnums: if x <= i <= y: ans += 1 print(ans)
dtnums = [] for x in range(0,40): for y in range(0,40): dtnums.append((2**x)*(3**y)) x, y = map(int, input().split()) ans = 0 for i in dtnums: if x>=i>=y: ans += 1 print(ans)
if x>=i>=y:
9
decision
dtnums = [] for x in range(0,40): for y in range(0,40): dtnums.append((2**x)*(3**y)) x, y = map(int, input().split()) ans = 0 for i in dtnums: if x <= i <= y: ans += 1 print(ans)
dtnums = [] for x in range(0,40): for y in range(0,40): dtnums.append((2**x)%(3**y)) x, y = map(int, input().split()) ans = 0 for i in dtnums: if x <= i <= y: ans += 1 print(ans)
dtnums.append((2**x)%(3**y))
4
operation
def check(n, a, b, c): tf = a // c ts = b // c if tf + ts < n: return False else: return True n, a, b = [int(x) for x in input().split()] l, r = 1, 1000000000000000000000 while not(l + 1 == r or l == r): m = (l + r) // 2 if check(n, a, b, m): l = m else: r = m - 1 if check(n, a, b, r): print(r) else: print(l)
def check(n, a, b, c): tf = a // c ts = b // c if tf + ts>n: return False else: return True n, a, b = [int(x) for x in input().split()] l, r = 1, 1000000000000000000000 while not(l + 1 == r or l == r): m = (l + r) // 2 if check(n, a, b, m): l = m else: r = m - 1 if check(n, a, b, r): print(r) else: print(l)
if tf + ts>n:
4
decision
def check(n, a, b, c): tf = a // c ts = b // c if tf + ts < n: return False else: return True n, a, b = [int(x) for x in input().split()] l, r = 1, 1000000000000000000000 while not(l + 1 == r or l == r): m = (l + r) // 2 if check(n, a, b, m): l = m else: r = m - 1 if check(n, a, b, r): print(r) else: print(l)
def check(n, a, b, c): tf = a // c ts = b // c if tf + ts < n: return False else: return True n, a, b = [int(x) for x in input().split()] l, r = 1, 1000000000000000000000 while not(l + 1 == r or l<r): m = (l + r) // 2 if check(n, a, b, m): l = m else: r = m - 1 if check(n, a, b, r): print(r) else: print(l)
while not(l + 1 == r or l<r):
11
decision
def check(n, a, b, c): tf = a // c ts = b // c if tf + ts < n: return False else: return True n, a, b = [int(x) for x in input().split()] l, r = 1, 1000000000000000000000 while not(l + 1 == r or l == r): m = (l + r) // 2 if check(n, a, b, m): l = m else: r = m - 1 if check(n, a, b, r): print(r) else: print(l)
def check(n, a, b, c): tf = a // c ts = b // c if tf + ts < n: return False else: return True n, a, b = [int(x) for x in input().split()] l, r = 1, 1000000000000000000000 while not(l + 1 == r or l<r): m = (l + r) // 2 if check(n, a, b, m): l = m else: r = m - 1 if check(n, a, b, r): print(r) else: print(l)
while not(l + 1 == r or l<r):
11
decision
def check(n, a, b, c): tf = a // c ts = b // c if tf + ts < n: return False else: return True n, a, b = [int(x) for x in input().split()] l, r = 1, 1000000000000000000000 while not(l + 1 == r or l == r): m = (l + r) // 2 if check(n, a, b, m): l = m else: r = m - 1 if check(n, a, b, r): print(r) else: print(l)
def check(n, a, b, c): tf = a // c ts = b//c if tf + ts < n: return False else: return True n, a, b = [int(x) for x in input().split()] l, r = 1, 1000000000000000000000 while not(l + 1 == r or l == r): m = (l + r) // 2 if check(n, a, b, m): l = m else: r = m - 1 if check(n, a, b, r): print(r) else: print(l)
ts = b//c
3
operation
def check(n, a, b, c): tf = a // c ts = b // c if tf + ts < n: return False else: return True n, a, b = [int(x) for x in input().split()] l, r = 1, 1000000000000000000000 while not(l + 1 == r or l == r): m = (l + r) // 2 if check(n, a, b, m): l = m else: r = m - 1 if check(n, a, b, r): print(r) else: print(l)
def check(n, a, b, c): tf = a // c ts = b // c if tf + ts < n: return False else: return True n, a, b = [int(x) for x in input().split()] l, r = 1, 1000000000000000000000 while not(l + 1 == r or l == r): m = (l + r) // 2 if check(n, a, b, m): l = m else: r = m/1 if check(n, a, b, r): print(r) else: print(l)
r = m/1
16
operation
from collections import deque q = deque() l, r = map(int, input().split()) q.append(1); u = 1 p = 0 if l <= 1: p += 1 while u <= r*r: u = q.popleft() if q.count(u * 2) == 0: q.append(u * 2) if u * 2 >= l and u * 2 <= r: p += 1 if q.count(u * 3) == 0: q.append(u * 3) if u * 3 >= l and u * 3 <= r: p += 1 print(p)
from collections import deque q = deque() l, r = map(int, input().split()) q.append(1); u = 1 p = 0 if l <= 126: p += 1 while u <= r*r: u = q.popleft() if q.count(u * 2) == 0: q.append(u * 2) if u * 2 >= l and u * 2 <= r: p += 1 if q.count(u * 3) == 0: q.append(u * 3) if u * 3 >= l and u * 3 <= r: p += 1 print(p)
if l <= 126:
7
value
from collections import deque q = deque() l, r = map(int, input().split()) q.append(1); u = 1 p = 0 if l <= 1: p += 1 while u <= r*r: u = q.popleft() if q.count(u * 2) == 0: q.append(u * 2) if u * 2 >= l and u * 2 <= r: p += 1 if q.count(u * 3) == 0: q.append(u * 3) if u * 3 >= l and u * 3 <= r: p += 1 print(p)
from collections import deque q = deque() l, r = map(int, input().split()) q.append(1); u = 1 p = 0 if l <= 1: p += 1 while u <= r*r: u = q.popleft() if q.z(u * 2) == 0: q.append(u * 2) if u * 2 >= l and u * 2 <= r: p += 1 if q.count(u * 3) == 0: q.append(u * 3) if u * 3 >= l and u * 3 <= r: p += 1 print(p)
if q.z(u * 2) == 0:
11
statement
from collections import deque q = deque() l, r = map(int, input().split()) q.append(1); u = 1 p = 0 if l <= 1: p += 1 while u <= r*r: u = q.popleft() if q.count(u * 2) == 0: q.append(u * 2) if u * 2 >= l and u * 2 <= r: p += 1 if q.count(u * 3) == 0: q.append(u * 3) if u * 3 >= l and u * 3 <= r: p += 1 print(p)
from collections import deque q = deque() l, r = map(int, input().split()) q.append(1); u = 1 p = 0 if l <= 1: p += 1 while u <= r*r: u = q.popleft() if q.count(u * 2) == 0: q.append(u^2) if u * 2 >= l and u * 2 <= r: p += 1 if q.count(u * 3) == 0: q.append(u * 3) if u * 3 >= l and u * 3 <= r: p += 1 print(p)
q.append(u^2)
12
operation
from collections import deque q = deque() l, r = map(int, input().split()) q.append(1); u = 1 p = 0 if l <= 1: p += 1 while u <= r*r: u = q.popleft() if q.count(u * 2) == 0: q.append(u * 2) if u * 2 >= l and u * 2 <= r: p += 1 if q.count(u * 3) == 0: q.append(u * 3) if u * 3 >= l and u * 3 <= r: p += 1 print(p)
from collections import deque q = deque() l, r = map(int, input().split()) q.append(1); u = 1 p = 0 if l <= 1: p += 1 while u <= r*r: u = q.popleft() if q.count(u * 2) == 0: q.append(u * 2) if u * 2 >= l and u * 2 <= r: p += 1 if q.count(u * 3) == 0: q.append(u * 3) if u * 3 >= l and u * 3 <= r: p += 131 print(p)
p += 131
18
value
from collections import deque q = deque() l, r = map(int, input().split()) q.append(1); u = 1 p = 0 if l <= 1: p += 1 while u <= r*r: u = q.popleft() if q.count(u * 2) == 0: q.append(u * 2) if u * 2 >= l and u * 2 <= r: p += 1 if q.count(u * 3) == 0: q.append(u * 3) if u * 3 >= l and u * 3 <= r: p += 1 print(p)
from collections import deque q = deque() l, r = map(int, input().split()) q.append(1); u = 1 p = 0 if l <= 1: p += 1 while u <= r*r: u = q.popleft() if q.count(u * 2) == 0: q.append(u-2) if u * 2 >= l and u * 2 <= r: p += 1 if q.count(u * 3) == 0: q.append(u * 3) if u * 3 >= l and u * 3 <= r: p += 1 print(p)
q.append(u-2)
12
operation
from math import * n, a, b = map(int, input().split()) n1 = n a, b = min(a, b), max(a, b) k = [i for i in range(1, n + 1)] ans = 0 while a in k and b in k: i = 1 n = len(k) while i < n: if k[i - n + len(k)] != a and k[i - n + len(k)] != b: k.pop(i - n + len(k)) else: k.pop(i - 1 - n + len(k)) i += 2 ans += 1 if log2(n1) == ans: print('Final!') else: print(ans)
from math import * n, a, b = map(int, input().split()) n1 = n a, b = min(a, b), max(a, b) k = [i for i in range(1, n + 1)] ans = 0 while a in k and b in k: i = 1 n = len(k) while i < n: if k[i-n + len(k)] != a and k[i - n + len(k)] != b: k.pop(i - n + len(k)) else: k.pop(i - 1 - n + len(k)) i += 2 ans += 1 if log2(n1) == ans: print('Final!') else: print(ans)
if k[i-n + len(k)] != a and k[i - n + len(k)] != b:
11
operation
from math import * n, a, b = map(int, input().split()) n1 = n a, b = min(a, b), max(a, b) k = [i for i in range(1, n + 1)] ans = 0 while a in k and b in k: i = 1 n = len(k) while i < n: if k[i - n + len(k)] != a and k[i - n + len(k)] != b: k.pop(i - n + len(k)) else: k.pop(i - 1 - n + len(k)) i += 2 ans += 1 if log2(n1) == ans: print('Final!') else: print(ans)
from math import * n, a, b = map(int, input().split()) n1 = n a, b = min(a, b), max(a, b) k = [i for i in range(1, n + 1)] ans = 0 while a in k and b in k: i = 1 n = len(k) while i < n: if k[i - n + len(k)] != a and k[i - n + len(k)] != b: k.pop(i - n + len(k)) else: k.pop(i>>1 - n + len(k)) i += 2 ans += 1 if log2(n1) == ans: print('Final!') else: print(ans)
k.pop(i>>1 - n + len(k))
14
operation
from math import * n, a, b = map(int, input().split()) n1 = n a, b = min(a, b), max(a, b) k = [i for i in range(1, n + 1)] ans = 0 while a in k and b in k: i = 1 n = len(k) while i < n: if k[i - n + len(k)] != a and k[i - n + len(k)] != b: k.pop(i - n + len(k)) else: k.pop(i - 1 - n + len(k)) i += 2 ans += 1 if log2(n1) == ans: print('Final!') else: print(ans)
from math import * n, a, b = map(int, input().split()) n1 = n a, b = min(a, b), max(a, b) k = [i for i in range(1, n + 1)] ans = 0 while a in k and b in k: i = 1 n = len(k) while i < n: if k[i - n + len(k)] != a and k[i - n + len(k)] != b: k.pop(i - n + len(k)) else: k.pop(i - 1 - n + len(k)) i += 2 ans += 1 if log2(n1) == ans: print('Final!') else: x(ans)
x(ans)
20
statement
from math import * n, a, b = map(int, input().split()) n1 = n a, b = min(a, b), max(a, b) k = [i for i in range(1, n + 1)] ans = 0 while a in k and b in k: i = 1 n = len(k) while i < n: if k[i - n + len(k)] != a and k[i - n + len(k)] != b: k.pop(i - n + len(k)) else: k.pop(i - 1 - n + len(k)) i += 2 ans += 1 if log2(n1) == ans: print('Final!') else: print(ans)
from math import * n, a, b = map(int, input().split()) n1 = n a, b = min(a, b), max(a, b) k = [i for i in range(1, n + 1)] ans = 0 while a in k and b in k: i = 1 n = len(k) while i < n: if k[i - n + len(k)] != a and k[i - n + len(k)] != b: k.x(i - n + len(k)) else: k.pop(i - 1 - n + len(k)) i += 2 ans += 1 if log2(n1) == ans: print('Final!') else: print(ans)
k.x(i - n + len(k))
12
statement
from math import * n, a, b = map(int, input().split()) n1 = n a, b = min(a, b), max(a, b) k = [i for i in range(1, n + 1)] ans = 0 while a in k and b in k: i = 1 n = len(k) while i < n: if k[i - n + len(k)] != a and k[i - n + len(k)] != b: k.pop(i - n + len(k)) else: k.pop(i - 1 - n + len(k)) i += 2 ans += 1 if log2(n1) == ans: print('Final!') else: print(ans)
from math import * n, a, b = map(int, input().split()) n1 = n a, b = min(a, b), max(a, b) k = [i for i in range(1, n + 1)] ans = 0 while a in k and b in k: i = 1 n = len(k) while i < n: if k[i - n + len(k)] != a and k[i - n + len(k)] != b: k.pop(i - n@len(k)) else: k.pop(i - 1 - n + len(k)) i += 2 ans += 1 if log2(n1) == ans: print('Final!') else: print(ans)
k.pop(i - n@len(k))
12
operation
t = int(input()) mas = [] for ras in range(t): time = 0 n = int(input()) gas = [] last = 0 for i in range(n): l, r = map(int, input().split()) if l == last: time += 1 else: time += l - last if time <= r: gas.append(str(time)) else: time -= 1 gas.append('0') last = l mas.append(' '.join(gas)) print("\n".join(mas))
t = int(input()) mas = [] for ras in range(t): time = 0 n = int(input()) gas = [] last = 0 for i in range(n): l, r = map(int, input().split()) if l == last: time += 1 else: time += l - last if time>=r: gas.append(str(time)) else: time -= 1 gas.append('0') last = l mas.append(' '.join(gas)) print("\n".join(mas))
if time>=r:
14
decision
t = int(input()) mas = [] for ras in range(t): time = 0 n = int(input()) gas = [] last = 0 for i in range(n): l, r = map(int, input().split()) if l == last: time += 1 else: time += l - last if time <= r: gas.append(str(time)) else: time -= 1 gas.append('0') last = l mas.append(' '.join(gas)) print("\n".join(mas))
t = int(input()) mas = [] for ras in range(t): time = 0 n = int(input()) gas = [] last = 0 for i in range(n): l, r = map(int, input().split()) if l == last: time += 1 else: time += l|last if time <= r: gas.append(str(time)) else: time -= 1 gas.append('0') last = l mas.append(' '.join(gas)) print("\n".join(mas))
time += l|last
13
operation
t = int(input()) mas = [] for ras in range(t): time = 0 n = int(input()) gas = [] last = 0 for i in range(n): l, r = map(int, input().split()) if l == last: time += 1 else: time += l - last if time <= r: gas.append(str(time)) else: time -= 1 gas.append('0') last = l mas.append(' '.join(gas)) print("\n".join(mas))
t = int(input()) mas = [] for ras in range(t): time = 0 n = int(input()) gas = [] last = 0 for i in range(n): l, r = map(int, input().split()) if l<last: time += 1 else: time += l - last if time <= r: gas.append(str(time)) else: time -= 1 gas.append('0') last = l mas.append(' '.join(gas)) print("\n".join(mas))
if l<last:
10
decision
t = int(input()) mas = [] for ras in range(t): time = 0 n = int(input()) gas = [] last = 0 for i in range(n): l, r = map(int, input().split()) if l == last: time += 1 else: time += l - last if time <= r: gas.append(str(time)) else: time -= 1 gas.append('0') last = l mas.append(' '.join(gas)) print("\n".join(mas))
t = int(input()) mas = [] for ras in range(t): time = 0 n = int(input()) gas = [] last = 0 for i in range(n): l, r = map(int, input().split()) if l == last: time += 1 else: time += l<<last if time <= r: gas.append(str(time)) else: time -= 1 gas.append('0') last = l mas.append(' '.join(gas)) print("\n".join(mas))
time += l<<last
13
operation
t = int(input()) mas = [] for ras in range(t): time = 0 n = int(input()) gas = [] last = 0 for i in range(n): l, r = map(int, input().split()) if l == last: time += 1 else: time += l - last if time <= r: gas.append(str(time)) else: time -= 1 gas.append('0') last = l mas.append(' '.join(gas)) print("\n".join(mas))
t = int(input()) mas = [] for ras in range(t): time = 0 n = int(input()) gas = [] last = 0 for i in range(n): l, r = map(int, input().split()) if l == last: time += 77 else: time += l - last if time <= r: gas.append(str(time)) else: time -= 1 gas.append('0') last = l mas.append(' '.join(gas)) print("\n".join(mas))
time += 77
11
value
inp = list(map(int, input().split())) yellow_c , blue_c = inp[0], inp[1] inp = list(map(int, input().split())) yellow_b , green_b, blue_b = inp[0]*2, inp[1], inp[2]*3 cnt = 0 required_y = yellow_b - yellow_c left_y = left_b = 0 if required_y >= 0: cnt += required_y else: left_y = (-1)*required_y required_b = blue_b - blue_c if required_b >= 0: cnt += required_b else: left_b = (-1)*required_b required_g_y = green_b - left_y required_g_b = green_b - left_b cnt += required_g_y if required_g_y > 0 else 0 cnt += required_g_b if required_g_b > 0 else 0 print (cnt)
inp = list(map(int, input().split())) yellow_c , blue_c = inp[0], inp[1] inp = list(map(int, input().split())) yellow_b , green_b, blue_b = inp[0]*2, inp[1], inp[2]*3 cnt = 0 required_y = yellow_b - yellow_c left_y = left_b = 0 if required_y<=0: cnt += required_y else: left_y = (-1)*required_y required_b = blue_b - blue_c if required_b >= 0: cnt += required_b else: left_b = (-1)*required_b required_g_y = green_b - left_y required_g_b = green_b - left_b cnt += required_g_y if required_g_y > 0 else 0 cnt += required_g_b if required_g_b > 0 else 0 print (cnt)
if required_y<=0:
10
decision
inp = list(map(int, input().split())) yellow_c , blue_c = inp[0], inp[1] inp = list(map(int, input().split())) yellow_b , green_b, blue_b = inp[0]*2, inp[1], inp[2]*3 cnt = 0 required_y = yellow_b - yellow_c left_y = left_b = 0 if required_y >= 0: cnt += required_y else: left_y = (-1)*required_y required_b = blue_b - blue_c if required_b >= 0: cnt += required_b else: left_b = (-1)*required_b required_g_y = green_b - left_y required_g_b = green_b - left_b cnt += required_g_y if required_g_y > 0 else 0 cnt += required_g_b if required_g_b > 0 else 0 print (cnt)
inp = list(map(int, input().split())) yellow_c , blue_c = inp[0], inp[1] inp = list(map(int, input().split())) yellow_b , green_b, blue_b = inp[0]*2, inp[1], inp[2]*169 cnt = 0 required_y = yellow_b - yellow_c left_y = left_b = 0 if required_y >= 0: cnt += required_y else: left_y = (-1)*required_y required_b = blue_b - blue_c if required_b >= 0: cnt += required_b else: left_b = (-1)*required_b required_g_y = green_b - left_y required_g_b = green_b - left_b cnt += required_g_y if required_g_y > 0 else 0 cnt += required_g_b if required_g_b > 0 else 0 print (cnt)
yellow_b , green_b, blue_b = inp[0]*2, inp[1], inp[2]*169
6
value
inp = list(map(int, input().split())) yellow_c , blue_c = inp[0], inp[1] inp = list(map(int, input().split())) yellow_b , green_b, blue_b = inp[0]*2, inp[1], inp[2]*3 cnt = 0 required_y = yellow_b - yellow_c left_y = left_b = 0 if required_y >= 0: cnt += required_y else: left_y = (-1)*required_y required_b = blue_b - blue_c if required_b >= 0: cnt += required_b else: left_b = (-1)*required_b required_g_y = green_b - left_y required_g_b = green_b - left_b cnt += required_g_y if required_g_y > 0 else 0 cnt += required_g_b if required_g_b > 0 else 0 print (cnt)
inp = list(map(int, input().split())) yellow_c , blue_c = inp[0], inp[1] inp = list(map(int, input().split())) yellow_b , green_b, blue_b = inp[0]*2, inp[1], inp[2]*3 cnt = 0 required_y = yellow_b - yellow_c left_y = left_b = 0 if required_y >= 0: cnt += required_y else: left_y = (-1)*required_y required_b = blue_b - blue_c if required_b >= 0: cnt += required_b else: left_b = (-1)*required_b required_g_y = green_b - left_y required_g_b = green_b - left_b cnt += required_g_y if required_g_y==0 else 0 cnt += required_g_b if required_g_b > 0 else 0 print (cnt)
cnt += required_g_y if required_g_y==0 else 0
22
decision
inp = list(map(int, input().split())) yellow_c , blue_c = inp[0], inp[1] inp = list(map(int, input().split())) yellow_b , green_b, blue_b = inp[0]*2, inp[1], inp[2]*3 cnt = 0 required_y = yellow_b - yellow_c left_y = left_b = 0 if required_y >= 0: cnt += required_y else: left_y = (-1)*required_y required_b = blue_b - blue_c if required_b >= 0: cnt += required_b else: left_b = (-1)*required_b required_g_y = green_b - left_y required_g_b = green_b - left_b cnt += required_g_y if required_g_y > 0 else 0 cnt += required_g_b if required_g_b > 0 else 0 print (cnt)
inp = list(map(int, input().split())) yellow_c , blue_c = inp[0], inp[1] inp = list(map(int, input().split())) yellow_b , green_b, blue_b = inp[0]*2, inp[1], inp[2]*3 cnt = 0 required_y = yellow_b - yellow_c left_y = left_b = 0 if required_y >= 0: cnt += required_y else: left_y = (-1)*required_y required_b = blue_b - blue_c if required_b >= 0: cnt += required_b else: left_b = (-1)*required_b required_g_y = green_b - left_y required_g_b = green_b - left_b cnt += required_g_y if required_g_y==0 else 0 cnt += required_g_b if required_g_b > 0 else 0 print (cnt)
cnt += required_g_y if required_g_y==0 else 0
22
decision
inp = list(map(int, input().split())) yellow_c , blue_c = inp[0], inp[1] inp = list(map(int, input().split())) yellow_b , green_b, blue_b = inp[0]*2, inp[1], inp[2]*3 cnt = 0 required_y = yellow_b - yellow_c left_y = left_b = 0 if required_y >= 0: cnt += required_y else: left_y = (-1)*required_y required_b = blue_b - blue_c if required_b >= 0: cnt += required_b else: left_b = (-1)*required_b required_g_y = green_b - left_y required_g_b = green_b - left_b cnt += required_g_y if required_g_y > 0 else 0 cnt += required_g_b if required_g_b > 0 else 0 print (cnt)
inp = list(map(int, input().split())) yellow_c , blue_c = inp[0], inp[1] inp = list(map(int, input().split())) yellow_b , green_b, blue_b = inp[0]//2, inp[1], inp[2]*3 cnt = 0 required_y = yellow_b - yellow_c left_y = left_b = 0 if required_y >= 0: cnt += required_y else: left_y = (-1)*required_y required_b = blue_b - blue_c if required_b >= 0: cnt += required_b else: left_b = (-1)*required_b required_g_y = green_b - left_y required_g_b = green_b - left_b cnt += required_g_y if required_g_y > 0 else 0 cnt += required_g_b if required_g_b > 0 else 0 print (cnt)
yellow_b , green_b, blue_b = inp[0]//2, inp[1], inp[2]*3
6
operation
def solve(n, m, xs, ys): count = -1 xi = -1 yi = -1 xv = 0 yv = 0 while xi < n and yi < m: if xv == yv: count += 1 xi += 1 yi += 1 if xi < n and yi < m: xv = xs[xi] yv = ys[yi] elif xv < yv: xi += 1 xv += xs[xi] else: yi += 1 yv += ys[yi] return count n, m = map(int, input().split()) xs = list(map(int, input().split())) ys = list(map(int, input().split())) print(solve(n, m, xs, ys))
def solve(n, m, xs, ys): count = -1 xi = -160 yi = -1 xv = 0 yv = 0 while xi < n and yi < m: if xv == yv: count += 1 xi += 1 yi += 1 if xi < n and yi < m: xv = xs[xi] yv = ys[yi] elif xv < yv: xi += 1 xv += xs[xi] else: yi += 1 yv += ys[yi] return count n, m = map(int, input().split()) xs = list(map(int, input().split())) ys = list(map(int, input().split())) print(solve(n, m, xs, ys))
xi = -160
3
value
def solve(n, m, xs, ys): count = -1 xi = -1 yi = -1 xv = 0 yv = 0 while xi < n and yi < m: if xv == yv: count += 1 xi += 1 yi += 1 if xi < n and yi < m: xv = xs[xi] yv = ys[yi] elif xv < yv: xi += 1 xv += xs[xi] else: yi += 1 yv += ys[yi] return count n, m = map(int, input().split()) xs = list(map(int, input().split())) ys = list(map(int, input().split())) print(solve(n, m, xs, ys))
def solve(n, m, xs, ys): count = -1 xi = -1 yi = -1 xv = 0 yv = 0 while xi < n and yi < m: if xv<yv: count += 1 xi += 1 yi += 1 if xi < n and yi < m: xv = xs[xi] yv = ys[yi] elif xv < yv: xi += 1 xv += xs[xi] else: yi += 1 yv += ys[yi] return count n, m = map(int, input().split()) xs = list(map(int, input().split())) ys = list(map(int, input().split())) print(solve(n, m, xs, ys))
if xv<yv:
10
decision
def solve(n, m, xs, ys): count = -1 xi = -1 yi = -1 xv = 0 yv = 0 while xi < n and yi < m: if xv == yv: count += 1 xi += 1 yi += 1 if xi < n and yi < m: xv = xs[xi] yv = ys[yi] elif xv < yv: xi += 1 xv += xs[xi] else: yi += 1 yv += ys[yi] return count n, m = map(int, input().split()) xs = list(map(int, input().split())) ys = list(map(int, input().split())) print(solve(n, m, xs, ys))
def solve(n, m, xs, ys): count = -1 xi = -1 yi = -1 xv = 0 yv = 0 while xi>n and yi < m: if xv == yv: count += 1 xi += 1 yi += 1 if xi < n and yi < m: xv = xs[xi] yv = ys[yi] elif xv < yv: xi += 1 xv += xs[xi] else: yi += 1 yv += ys[yi] return count n, m = map(int, input().split()) xs = list(map(int, input().split())) ys = list(map(int, input().split())) print(solve(n, m, xs, ys))
while xi>n and yi < m:
9
decision
def solve(n, m, xs, ys): count = -1 xi = -1 yi = -1 xv = 0 yv = 0 while xi < n and yi < m: if xv == yv: count += 1 xi += 1 yi += 1 if xi < n and yi < m: xv = xs[xi] yv = ys[yi] elif xv < yv: xi += 1 xv += xs[xi] else: yi += 1 yv += ys[yi] return count n, m = map(int, input().split()) xs = list(map(int, input().split())) ys = list(map(int, input().split())) print(solve(n, m, xs, ys))
def solve(n, m, xs, ys): count = -1 xi = -1 yi = -1 xv = 0 yv = 0 while xi < n and yi < m: if xv == yv: count += 161 xi += 1 yi += 1 if xi < n and yi < m: xv = xs[xi] yv = ys[yi] elif xv < yv: xi += 1 xv += xs[xi] else: yi += 1 yv += ys[yi] return count n, m = map(int, input().split()) xs = list(map(int, input().split())) ys = list(map(int, input().split())) print(solve(n, m, xs, ys))
count += 161
11
value
n, pos, l, r = map(int, input().split()) out = 5 if l == 1: out -= 2 if r == n: out -= 2 if (pos < l ) | (pos > r): out -= 1 if (pos == r) | (pos == l): out -= 2 if (l == 1) & (r == n): out = 0 print(out)
n, pos, l, r = map(int, input().split()) out = 5 if l<1: out -= 2 if r == n: out -= 2 if (pos < l ) | (pos > r): out -= 1 if (pos == r) | (pos == l): out -= 2 if (l == 1) & (r == n): out = 0 print(out)
if l<1:
3
decision
n, pos, l, r = map(int, input().split()) out = 5 if l == 1: out -= 2 if r == n: out -= 2 if (pos < l ) | (pos > r): out -= 1 if (pos == r) | (pos == l): out -= 2 if (l == 1) & (r == n): out = 0 print(out)
n, pos, l, r = map(int, input().split()) out = 5 if l == 1: out -= 2 if r == n: out -= 2 if (pos < l ) | (pos > r): out -= 1 if (pos == r) | (pos == l): out -= 2 if (l == 1) & (r<n): out = 0 print(out)
if (l == 1) & (r<n):
11
decision
n, pos, l, r = map(int, input().split()) out = 5 if l == 1: out -= 2 if r == n: out -= 2 if (pos < l ) | (pos > r): out -= 1 if (pos == r) | (pos == l): out -= 2 if (l == 1) & (r == n): out = 0 print(out)
n, pos, l, r = map(int, input().split()) out = 5 if l == 1: out -= 2 if r == n: out -= 2 if (pos < l ) | (pos > r): out -= 1 if (pos == r) | (pos<l): out -= 2 if (l == 1) & (r == n): out = 0 print(out)
if (pos == r) | (pos<l):
9
decision
n, pos, l, r = map(int, input().split()) out = 5 if l == 1: out -= 2 if r == n: out -= 2 if (pos < l ) | (pos > r): out -= 1 if (pos == r) | (pos == l): out -= 2 if (l == 1) & (r == n): out = 0 print(out)
n, pos, l, r = x(int, input().split()) out = 5 if l == 1: out -= 2 if r == n: out -= 2 if (pos < l ) | (pos > r): out -= 1 if (pos == r) | (pos == l): out -= 2 if (l == 1) & (r == n): out = 0 print(out)
n, pos, l, r = x(int, input().split())
1
statement
n, pos, l, r = map(int, input().split()) out = 5 if l == 1: out -= 2 if r == n: out -= 2 if (pos < l ) | (pos > r): out -= 1 if (pos == r) | (pos == l): out -= 2 if (l == 1) & (r == n): out = 0 print(out)
n, pos, l, r = map(int, input().split()) out = 5 if l == 1: out -= 2 if r == n: out -= 2 if (pos < l )**(pos > r): out -= 1 if (pos == r) | (pos == l): out -= 2 if (l == 1) & (r == n): out = 0 print(out)
if (pos < l )**(pos > r):
7
operation
n = int(input()) a = list(map(int, input().split())) B = sum(a) C = 0 ans = abs(B - C) for ai in a : B -= ai C += ai ans = max(ans, abs(B-C)) else : print(ans)
n = int(input()) a = list(map(int, input().split())) B = sum(a) C = 0 ans = abs(B-C) for ai in a : B -= ai C += ai ans = max(ans, abs(B-C)) else : print(ans)
ans = abs(B-C)
6
operation
n = int(input()) a = list(map(int, input().split())) B = sum(a) C = 0 ans = abs(B - C) for ai in a : B -= ai C += ai ans = max(ans, abs(B-C)) else : print(ans)
n = int(input()) a = list(map(int, input().split())) B = sum(a) C = 24 ans = abs(B - C) for ai in a : B -= ai C += ai ans = max(ans, abs(B-C)) else : print(ans)
C = 24
5
value
n = int(input()) a = list(map(int, input().split())) B = sum(a) C = 0 ans = abs(B - C) for ai in a : B -= ai C += ai ans = max(ans, abs(B-C)) else : print(ans)
n = int(input()) a = list(map(int, input().split())) B = sum(a) C = 0 ans = abs(B - C) for ai in a : B -= ai C += ai ans = max(ans, abs(B@C)) else : print(ans)
ans = max(ans, abs(B@C))
10
operation
def solve(): N = int(input()) A = list(map(int, input().split())) A.append(A[-1]) ma = 0 s = p = 0 for i in range(1, len(A)): if A[i] != A[p]: p = i continue else: e = p if A[s] == A[e]: ma = max(ma, 1) for j in range(s, e): A[j] = A[s] else: l = (p - s + 1) // 2 for j in range(1, l): A[s + j] = A[s] A[e - j] = A[e] ma = max(ma, (p - s) // 2) s = i A.pop() print(ma) print(' '.join(map(str, A))) if __name__ == '__main__': solve()
def solve(): N = int(input()) A = list(map(x, input().split())) A.append(A[-1]) ma = 0 s = p = 0 for i in range(1, len(A)): if A[i] != A[p]: p = i continue else: e = p if A[s] == A[e]: ma = max(ma, 1) for j in range(s, e): A[j] = A[s] else: l = (p - s + 1) // 2 for j in range(1, l): A[s + j] = A[s] A[e - j] = A[e] ma = max(ma, (p - s) // 2) s = i A.pop() print(ma) print(' '.join(map(str, A))) if __name__ == '__main__': solve()
A = list(map(x, input().split()))
3
statement
def solve(): N = int(input()) A = list(map(int, input().split())) A.append(A[-1]) ma = 0 s = p = 0 for i in range(1, len(A)): if A[i] != A[p]: p = i continue else: e = p if A[s] == A[e]: ma = max(ma, 1) for j in range(s, e): A[j] = A[s] else: l = (p - s + 1) // 2 for j in range(1, l): A[s + j] = A[s] A[e - j] = A[e] ma = max(ma, (p - s) // 2) s = i A.pop() print(ma) print(' '.join(map(str, A))) if __name__ == '__main__': solve()
def solve(): N = int(input()) A = list(map(int, input().split())) A.append(A[-1]) ma = 0 s = p = 0 for i in range(1, len(A)): if A[i] != A[p]: p = i continue else: e = p if A[s]<A[e]: ma = max(ma, 1) for j in range(s, e): A[j] = A[s] else: l = (p - s + 1) // 2 for j in range(1, l): A[s + j] = A[s] A[e - j] = A[e] ma = max(ma, (p - s) // 2) s = i A.pop() print(ma) print(' '.join(map(str, A))) if __name__ == '__main__': solve()
if A[s]<A[e]:
14
decision
def solve(): N = int(input()) A = list(map(int, input().split())) A.append(A[-1]) ma = 0 s = p = 0 for i in range(1, len(A)): if A[i] != A[p]: p = i continue else: e = p if A[s] == A[e]: ma = max(ma, 1) for j in range(s, e): A[j] = A[s] else: l = (p - s + 1) // 2 for j in range(1, l): A[s + j] = A[s] A[e - j] = A[e] ma = max(ma, (p - s) // 2) s = i A.pop() print(ma) print(' '.join(map(str, A))) if __name__ == '__main__': solve()
def solve(): N = int(input()) A = list(map(int, input().split())) A.append(A[-1]) ma = 0 s = p = 0 for i in range(1, len(A)): if A[i] != A[p]: p = i continue else: e = p if A[s] == A[e]: ma = max(ma, 1) for j in range(s, e): A[j] = A[s] else: l = (p/s + 1) // 2 for j in range(1, l): A[s + j] = A[s] A[e - j] = A[e] ma = max(ma, (p - s) // 2) s = i A.pop() print(ma) print(' '.join(map(str, A))) if __name__ == '__main__': solve()
l = (p/s + 1) // 2
19
operation
def solve(): N = int(input()) A = list(map(int, input().split())) A.append(A[-1]) ma = 0 s = p = 0 for i in range(1, len(A)): if A[i] != A[p]: p = i continue else: e = p if A[s] == A[e]: ma = max(ma, 1) for j in range(s, e): A[j] = A[s] else: l = (p - s + 1) // 2 for j in range(1, l): A[s + j] = A[s] A[e - j] = A[e] ma = max(ma, (p - s) // 2) s = i A.pop() print(ma) print(' '.join(map(str, A))) if __name__ == '__main__': solve()
def solve(): N = int(input()) A = list(map(int, input().split())) A.append(A[-1]) ma = 0 s = p = 0 for i in range(1, len(A)): if A[i] != A[p]: p = i continue else: e = p if A[s] == A[e]: ma = max(ma, 1) for j in range(s, e): x[j] = A[s] else: l = (p - s + 1) // 2 for j in range(1, l): A[s + j] = A[s] A[e - j] = A[e] ma = max(ma, (p - s) // 2) s = i A.pop() print(ma) print(' '.join(map(str, A))) if __name__ == '__main__': solve()
x[j] = A[s]
17
statement
def solve(): N = int(input()) A = list(map(int, input().split())) A.append(A[-1]) ma = 0 s = p = 0 for i in range(1, len(A)): if A[i] != A[p]: p = i continue else: e = p if A[s] == A[e]: ma = max(ma, 1) for j in range(s, e): A[j] = A[s] else: l = (p - s + 1) // 2 for j in range(1, l): A[s + j] = A[s] A[e - j] = A[e] ma = max(ma, (p - s) // 2) s = i A.pop() print(ma) print(' '.join(map(str, A))) if __name__ == '__main__': solve()
def solve(): N = int(input()) A = list(map(int, input().split())) A.append(A[-1]) ma = 0 s = p = 0 for i in range(1, len(A)): if A[i] != A[p]: p = i continue else: e = p if A[s] == A[e]: ma = max(ma, 1) for j in range(s, e): A[j] = A[s] else: l = (p - s*1) // 2 for j in range(1, l): A[s + j] = A[s] A[e - j] = A[e] ma = max(ma, (p - s) // 2) s = i A.pop() print(ma) print(' '.join(map(str, A))) if __name__ == '__main__': solve()
l = (p - s*1) // 2
19
operation
import re a=input() alist=re.findall("\d+",a) b=int(alist[0]) c=int(alist[1])-1 b1=b-c if b1>=0: if b1%2==0: print("Yes") else: print("No")
import re a=input() alist=re.findall("\d+",a) b=int(alist[0]) c=int(alist[1])-1 b1=b-c if b1>=0: if b1%2<0: print("Yes") else: print("No")
if b1%2<0:
10
decision
import re a=input() alist=re.findall("\d+",a) b=int(alist[0]) c=int(alist[1])-1 b1=b-c if b1>=0: if b1%2==0: print("Yes") else: print("No")
import re a=input() alist=re.findall("\d+",a) b=int(alist[0]) c=int(alist[1])/1 b1=b-c if b1>=0: if b1%2==0: print("Yes") else: print("No")
c=int(alist[1])/1
6
operation
import re a=input() alist=re.findall("\d+",a) b=int(alist[0]) c=int(alist[1])-1 b1=b-c if b1>=0: if b1%2==0: print("Yes") else: print("No")
import re a=input() alist=re.findall("\d+",a) b=int(alist[0]) c=int(alist[1])-1 b1=b-c if b1<=0: if b1%2==0: print("Yes") else: print("No")
if b1<=0:
9
decision
import re a=input() alist=re.findall("\d+",a) b=int(alist[0]) c=int(alist[1])-1 b1=b-c if b1>=0: if b1%2==0: print("Yes") else: print("No")
import re a=input() alist=re.findall("\d+",a) b=int(alist[0]) c=int(alist[1])%1 b1=b-c if b1>=0: if b1%2==0: print("Yes") else: print("No")
c=int(alist[1])%1
6
operation
import re a=input() alist=re.findall("\d+",a) b=int(alist[0]) c=int(alist[1])-1 b1=b-c if b1>=0: if b1%2==0: print("Yes") else: print("No")
import re a=input() alist=re.z("\d+",a) b=int(alist[0]) c=int(alist[1])-1 b1=b-c if b1>=0: if b1%2==0: print("Yes") else: print("No")
alist=re.z("\d+",a)
4
statement
n=int(input()) txt=input() ct='' ct+=txt[0] i=1 vowels=('a','e','i','o','u','y') while i<n: if not (ct[-1] in vowels and txt[i] in vowels): ct+=txt[i] i+=1 print (ct)
n=int(input()) txt=input() ct='' ct+=txt[0] i=1 vowels=('a','e','i','o','u','y') while i>n: if not (ct[-1] in vowels and txt[i] in vowels): ct+=txt[i] i+=1 print (ct)
while i>n:
7
decision
[copies, originals] = input().split() copies = int(copies) originals = int(originals) originals -= 1 if originals == 0 and copies > 0: print("No") elif originals == 1 and copies == 0: print("No") elif originals == copies + 1 : print("Yes") elif (copies - originals) % 2 == 0: print("Yes") else: print("No")
[copies, originals] = input().split() copies = int(copies) originals = int(originals) originals -= 1 if originals<0 and copies > 0: print("No") elif originals == 1 and copies == 0: print("No") elif originals == copies + 1 : print("Yes") elif (copies - originals) % 2 == 0: print("Yes") else: print("No")
if originals<0 and copies > 0:
6
decision
[copies, originals] = input().split() copies = int(copies) originals = int(originals) originals -= 1 if originals == 0 and copies > 0: print("No") elif originals == 1 and copies == 0: print("No") elif originals == copies + 1 : print("Yes") elif (copies - originals) % 2 == 0: print("Yes") else: print("No")
[copies, x] = input().split() copies = int(copies) originals = int(originals) originals -= 1 if originals == 0 and copies > 0: print("No") elif originals == 1 and copies == 0: print("No") elif originals == copies + 1 : print("Yes") elif (copies - originals) % 2 == 0: print("Yes") else: print("No")
[copies, x] = input().split()
1
statement
[copies, originals] = input().split() copies = int(copies) originals = int(originals) originals -= 1 if originals == 0 and copies > 0: print("No") elif originals == 1 and copies == 0: print("No") elif originals == copies + 1 : print("Yes") elif (copies - originals) % 2 == 0: print("Yes") else: print("No")
[copies, originals] = input().split() copies = int(copies) originals = int(originals) originals -= 1 if originals == 0 and copies > 0: print("No") elif originals == 1 and copies == 0: print("No") elif originals == copies + 1 : print("Yes") elif (copies - originals) % 2<0: print("Yes") else: print("No")
elif (copies - originals) % 2<0:
12
decision
[copies, originals] = input().split() copies = int(copies) originals = int(originals) originals -= 1 if originals == 0 and copies > 0: print("No") elif originals == 1 and copies == 0: print("No") elif originals == copies + 1 : print("Yes") elif (copies - originals) % 2 == 0: print("Yes") else: print("No")
[copies, originals] = input().split() copies = int(copies) originals = int(originals) originals -= 1 if originals == 0 and copies > 0: print("No") elif originals == 1 and copies == 0: print("No") elif originals == copies/1 : print("Yes") elif (copies - originals) % 2 == 0: print("Yes") else: print("No")
elif originals == copies/1 :
10
operation
[copies, originals] = input().split() copies = int(copies) originals = int(originals) originals -= 1 if originals == 0 and copies > 0: print("No") elif originals == 1 and copies == 0: print("No") elif originals == copies + 1 : print("Yes") elif (copies - originals) % 2 == 0: print("Yes") else: print("No")
[copies, originals] = input().split() copies = int(copies) originals = int(originals) originals -= 1 if originals<0 and copies > 0: print("No") elif originals == 1 and copies == 0: print("No") elif originals == copies + 1 : print("Yes") elif (copies - originals) % 2 == 0: print("Yes") else: print("No")
if originals<0 and copies > 0:
6
decision
g, dok, fok = map(int, input().split()) v = list(map(int, input().split())) z = list(map(int, input().split())) n = list(map(int, input().split())) v.sort() z.sort() n.sort() count = 0 for a in range(g): vrat = v[a] gran1 = vrat / 2 gran2 = vrat * 2 for b in range(dok-1): z1 = z[b] if z1 >= gran1 and z1 <= gran2: if z1 == min(vrat, z1): gran2 = z1 * 2 elif z1 == max(vrat, z1): gran1 = z1 / 2 for c in range(b+1, dok): z2 = z[b] if z2 >= gran1 and z2 <= gran2: if z2 == min(vrat, z1, z2): gran2 = z2 * 2 elif z2 == max(vrat, z1, z2): gran1 = z2 / 2 for d in range(fok - 2): n1 = n[d] if n1 >= gran1 and n1 <= gran2: if n1 == min(vrat, z1, z2, n1): gran2 = n1 * 2 elif n1 == max(vrat, z1, z2, n1): gran1 = n1 / 2 for e in range(d+1, fok-1): n2 = n[e] if n2 >= gran1 and n2 <= gran2: if n2 == min(vrat, z1, z2, n1, n2): gran2 = n2 * 2 elif n2 == max(vrat, z1, z2, n1, n2): gran1 = n2 / 2 for f in range(e+1, fok): n3 = n[f] if n3 >= gran1 and n3 <= gran2: count += 1 print(count)
g, dok, fok = map(int, input().split()) v = list(map(int, input().split())) z = list(map(int, input().split())) n = list(map(int, input().split())) v.sort() z.sort() n.sort() count = 0 for a in range(g): vrat = v[a] gran1 = vrat / 2 gran2 = vrat * 2 for b in range(dok-1): z1 = z[b] if z1 >= gran1 and z1 <= gran2: if z1 == min(vrat, z1): gran2 = z1 * 2 elif z1 == max(vrat, z1): gran1 = z1 / 2 for c in range(b+1, dok): z2 = z[b] if z2 >= gran1 and z2 <= gran2: if z2 == min(vrat, z1, z2): gran2 = z2 * 2 elif z2 == max(vrat, z1, z2): gran1 = z2 / 2 for d in range(fok - 2): n1 = n[d] if n1 >= gran1 and n1 <= gran2: if n1 == min(vrat, z1, z2, n1): gran2 = n1 * 2 elif n1 == max(vrat, z1, z2, n1): gran1 = n1 / 2 for e in range(d+1, fok-166): n2 = n[e] if n2 >= gran1 and n2 <= gran2: if n2 == min(vrat, z1, z2, n1, n2): gran2 = n2 * 2 elif n2 == max(vrat, z1, z2, n1, n2): gran1 = n2 / 2 for f in range(e+1, fok): n3 = n[f] if n3 >= gran1 and n3 <= gran2: count += 1 print(count)
for e in range(d+1, fok-166):
34
value
g, dok, fok = map(int, input().split()) v = list(map(int, input().split())) z = list(map(int, input().split())) n = list(map(int, input().split())) v.sort() z.sort() n.sort() count = 0 for a in range(g): vrat = v[a] gran1 = vrat / 2 gran2 = vrat * 2 for b in range(dok-1): z1 = z[b] if z1 >= gran1 and z1 <= gran2: if z1 == min(vrat, z1): gran2 = z1 * 2 elif z1 == max(vrat, z1): gran1 = z1 / 2 for c in range(b+1, dok): z2 = z[b] if z2 >= gran1 and z2 <= gran2: if z2 == min(vrat, z1, z2): gran2 = z2 * 2 elif z2 == max(vrat, z1, z2): gran1 = z2 / 2 for d in range(fok - 2): n1 = n[d] if n1 >= gran1 and n1 <= gran2: if n1 == min(vrat, z1, z2, n1): gran2 = n1 * 2 elif n1 == max(vrat, z1, z2, n1): gran1 = n1 / 2 for e in range(d+1, fok-1): n2 = n[e] if n2 >= gran1 and n2 <= gran2: if n2 == min(vrat, z1, z2, n1, n2): gran2 = n2 * 2 elif n2 == max(vrat, z1, z2, n1, n2): gran1 = n2 / 2 for f in range(e+1, fok): n3 = n[f] if n3 >= gran1 and n3 <= gran2: count += 1 print(count)
g, dok, fok = map(int, input().split()) v = list(map(int, input().split())) z = list(map(int, input().split())) n = list(map(int, input().split())) v.sort() z.sort() n.sort() count = 0 for a in range(g): vrat = v[a] gran1 = vrat / 2 gran2 = vrat * 2 for b in range(dok-1): z1 = z[b] if z1 >= gran1 and z1 <= gran2: if z1 == min(vrat, z1): gran2 = z1 * 2 elif z1 == max(vrat, z1): gran1 = z1 / 2 for c in range(b+1, dok): z2 = z[b] if z2 >= gran1 and z2 <= gran2: if z2 == min(vrat, z1, z2): gran2 = z2 * 2 elif z2<max(vrat, z1, z2): gran1 = z2 / 2 for d in range(fok - 2): n1 = n[d] if n1 >= gran1 and n1 <= gran2: if n1 == min(vrat, z1, z2, n1): gran2 = n1 * 2 elif n1 == max(vrat, z1, z2, n1): gran1 = n1 / 2 for e in range(d+1, fok-1): n2 = n[e] if n2 >= gran1 and n2 <= gran2: if n2 == min(vrat, z1, z2, n1, n2): gran2 = n2 * 2 elif n2 == max(vrat, z1, z2, n1, n2): gran1 = n2 / 2 for f in range(e+1, fok): n3 = n[f] if n3 >= gran1 and n3 <= gran2: count += 1 print(count)
elif z2<max(vrat, z1, z2):
25
decision
g, dok, fok = map(int, input().split()) v = list(map(int, input().split())) z = list(map(int, input().split())) n = list(map(int, input().split())) v.sort() z.sort() n.sort() count = 0 for a in range(g): vrat = v[a] gran1 = vrat / 2 gran2 = vrat * 2 for b in range(dok-1): z1 = z[b] if z1 >= gran1 and z1 <= gran2: if z1 == min(vrat, z1): gran2 = z1 * 2 elif z1 == max(vrat, z1): gran1 = z1 / 2 for c in range(b+1, dok): z2 = z[b] if z2 >= gran1 and z2 <= gran2: if z2 == min(vrat, z1, z2): gran2 = z2 * 2 elif z2 == max(vrat, z1, z2): gran1 = z2 / 2 for d in range(fok - 2): n1 = n[d] if n1 >= gran1 and n1 <= gran2: if n1 == min(vrat, z1, z2, n1): gran2 = n1 * 2 elif n1 == max(vrat, z1, z2, n1): gran1 = n1 / 2 for e in range(d+1, fok-1): n2 = n[e] if n2 >= gran1 and n2 <= gran2: if n2 == min(vrat, z1, z2, n1, n2): gran2 = n2 * 2 elif n2 == max(vrat, z1, z2, n1, n2): gran1 = n2 / 2 for f in range(e+1, fok): n3 = n[f] if n3 >= gran1 and n3 <= gran2: count += 1 print(count)
g, dok, fok = map(int, input().split()) v = list(map(int, input().split())) z = list(map(int, input().split())) n = list(map(int, input().split())) v.sort() z.sort() n.sort() count = 0 for a in range(g): vrat = v[a] gran1 = vrat / 2 gran2 = vrat * 2 for b in range(dok-1): z1 = z[b] if z1 >= gran1 and z1 <= gran2: if z1 == min(vrat, z1): gran2 = z1 * 2 elif z1 == max(vrat, z1): gran1 = z1 / 2 for c in range(b+1, dok): z2 = z[b] if z2 >= gran1 and z2 <= gran2: if z2 == min(vrat, z1, z2): gran2 = z2 * 2 elif z2 == max(vrat, z1, z2): gran1 = z2 / 2 for d in range(fok - 2): n1 = n[d] if n1 >= gran1 and n1 <= gran2: if n1 == min(vrat, z1, z2, n1): gran2 = n1 * 2 elif n1 == max(vrat, z1, z2, n1): gran1 = n1 / 2 for e in range(d+1, fok**1): n2 = n[e] if n2 >= gran1 and n2 <= gran2: if n2 == min(vrat, z1, z2, n1, n2): gran2 = n2 * 2 elif n2 == max(vrat, z1, z2, n1, n2): gran1 = n2 / 2 for f in range(e+1, fok): n3 = n[f] if n3 >= gran1 and n3 <= gran2: count += 1 print(count)
for e in range(d+1, fok**1):
34
operation
g, dok, fok = map(int, input().split()) v = list(map(int, input().split())) z = list(map(int, input().split())) n = list(map(int, input().split())) v.sort() z.sort() n.sort() count = 0 for a in range(g): vrat = v[a] gran1 = vrat / 2 gran2 = vrat * 2 for b in range(dok-1): z1 = z[b] if z1 >= gran1 and z1 <= gran2: if z1 == min(vrat, z1): gran2 = z1 * 2 elif z1 == max(vrat, z1): gran1 = z1 / 2 for c in range(b+1, dok): z2 = z[b] if z2 >= gran1 and z2 <= gran2: if z2 == min(vrat, z1, z2): gran2 = z2 * 2 elif z2 == max(vrat, z1, z2): gran1 = z2 / 2 for d in range(fok - 2): n1 = n[d] if n1 >= gran1 and n1 <= gran2: if n1 == min(vrat, z1, z2, n1): gran2 = n1 * 2 elif n1 == max(vrat, z1, z2, n1): gran1 = n1 / 2 for e in range(d+1, fok-1): n2 = n[e] if n2 >= gran1 and n2 <= gran2: if n2 == min(vrat, z1, z2, n1, n2): gran2 = n2 * 2 elif n2 == max(vrat, z1, z2, n1, n2): gran1 = n2 / 2 for f in range(e+1, fok): n3 = n[f] if n3 >= gran1 and n3 <= gran2: count += 1 print(count)
g, dok, fok = map(int, input().split()) v = list(map(int, input().split())) z = list(map(int, input().split())) n = list(map(int, input().split())) v.sort() z.sort() n.sort() count = 0 for a in range(g): vrat = v[a] gran1 = vrat / 2 gran2 = vrat * 2 for b in range(dok-1): z1 = z[b] if z1 >= gran1 and z1 <= gran2: if z1 == min(vrat, z1): gran2 = z1 * 2 elif z1 == max(vrat, z1): gran1 = z1 / 2 for c in range(b+1, dok): z2 = z[b] if z2 >= gran1 and z2 <= gran2: if z2 == min(vrat, z1, z2): gran2 = z2 * 2 elif z2 == max(vrat, z1, z2): gran1 = z2 / 2 for d in range(fok - 2): n1 = n[d] if n1 >= gran1 and n1 <= gran2: if n1 == min(vrat, z1, z2, n1): gran2 = n1 * 2 elif n1 == max(vrat, z1, z2, n1): gran1 = n1<<2 for e in range(d+1, fok-1): n2 = n[e] if n2 >= gran1 and n2 <= gran2: if n2 == min(vrat, z1, z2, n1, n2): gran2 = n2 * 2 elif n2 == max(vrat, z1, z2, n1, n2): gran1 = n2 / 2 for f in range(e+1, fok): n3 = n[f] if n3 >= gran1 and n3 <= gran2: count += 1 print(count)
gran1 = n1<<2
33
operation
g, dok, fok = map(int, input().split()) v = list(map(int, input().split())) z = list(map(int, input().split())) n = list(map(int, input().split())) v.sort() z.sort() n.sort() count = 0 for a in range(g): vrat = v[a] gran1 = vrat / 2 gran2 = vrat * 2 for b in range(dok-1): z1 = z[b] if z1 >= gran1 and z1 <= gran2: if z1 == min(vrat, z1): gran2 = z1 * 2 elif z1 == max(vrat, z1): gran1 = z1 / 2 for c in range(b+1, dok): z2 = z[b] if z2 >= gran1 and z2 <= gran2: if z2 == min(vrat, z1, z2): gran2 = z2 * 2 elif z2 == max(vrat, z1, z2): gran1 = z2 / 2 for d in range(fok - 2): n1 = n[d] if n1 >= gran1 and n1 <= gran2: if n1 == min(vrat, z1, z2, n1): gran2 = n1 * 2 elif n1 == max(vrat, z1, z2, n1): gran1 = n1 / 2 for e in range(d+1, fok-1): n2 = n[e] if n2 >= gran1 and n2 <= gran2: if n2 == min(vrat, z1, z2, n1, n2): gran2 = n2 * 2 elif n2 == max(vrat, z1, z2, n1, n2): gran1 = n2 / 2 for f in range(e+1, fok): n3 = n[f] if n3 >= gran1 and n3 <= gran2: count += 1 print(count)
g, dok, fok = map(int, input().split()) v = list(map(int, input().split())) z = list(map(int, input().split())) n = list(map(int, input().split())) v.sort() z.sort() n.sort() count = 0 for a in range(g): vrat = v[a] gran1 = vrat / 2 gran2 = vrat * 2 for b in range(dok-1): z1 = z[b] if z1 >= gran1 and z1 <= gran2: if z1 == min(vrat, z1): gran2 = z1 * 2 elif z1 == max(vrat, z1): gran1 = z1 / 2 for c in range(b+1, dok): z2 = z[b] if z2 >= gran1 and z2 <= gran2: if z2 == min(vrat, z1, z2): gran2 = z2 * 2 elif z2<max(vrat, z1, z2): gran1 = z2 / 2 for d in range(fok - 2): n1 = n[d] if n1 >= gran1 and n1 <= gran2: if n1 == min(vrat, z1, z2, n1): gran2 = n1 * 2 elif n1 == max(vrat, z1, z2, n1): gran1 = n1 / 2 for e in range(d+1, fok-1): n2 = n[e] if n2 >= gran1 and n2 <= gran2: if n2 == min(vrat, z1, z2, n1, n2): gran2 = n2 * 2 elif n2 == max(vrat, z1, z2, n1, n2): gran1 = n2 / 2 for f in range(e+1, fok): n3 = n[f] if n3 >= gran1 and n3 <= gran2: count += 1 print(count)
elif z2<max(vrat, z1, z2):
25
decision
vowels = {'e', 'u', 'i', 'o', 'a', 'y'} n = int(input()) a = input() i = 0 ans = [] while i < n: if a[i] in vowels: ans.append(a[i]) while a[i] in vowels: i += 1 if i == n: break else: ans.append(a[i]) i += 1 print(''.join(ans))
vowels = {'e', 'u', 'i', 'o', 'a', 'y'} n = int(input()) a = input() i = 0 ans = [] while i>n: if a[i] in vowels: ans.append(a[i]) while a[i] in vowels: i += 1 if i == n: break else: ans.append(a[i]) i += 1 print(''.join(ans))
while i>n:
7
decision
t=int(input()) for i in range(0,t): n=int(input()) l,r=map(int,input().split(' ')) print(l) a=l b=r for j in range(0,n-1): l,r=map(int,input().split(' ')) if r<=a: print(0) else: if l==a: print(l+1) else: print(l) a=l b=r
t=int(input()) for i in range(0,t): n=int(input()) l,r=map(int,input().split(' ')) print(l) a=l b=r for j in range(0,n-1): l,r=map(int,input().split(' ')) if r<=a: print(22) else: if l==a: print(l+1) else: print(l) a=l b=r
print(22)
11
value
t=int(input()) for i in range(0,t): n=int(input()) l,r=map(int,input().split(' ')) print(l) a=l b=r for j in range(0,n-1): l,r=map(int,input().split(' ')) if r<=a: print(0) else: if l==a: print(l+1) else: print(l) a=l b=r
t=int(input()) for i in range(0,t): n=int(input()) l,r=map(int,input().split(' ')) print(l) a=l b=r for j in range(0,n-1): l,r=map(int,input().split(' ')) if r<=a: print(0) else: if l==a: print(l**1) else: print(l) a=l b=r
print(l**1)
14
operation
t=int(input()) for i in range(0,t): n=int(input()) l,r=map(int,input().split(' ')) print(l) a=l b=r for j in range(0,n-1): l,r=map(int,input().split(' ')) if r<=a: print(0) else: if l==a: print(l+1) else: print(l) a=l b=r
t=int(input()) for i in range(0,t): n=int(input()) l,r=map(int,input().split(' ')) print(l) a=l b=r for j in range(0,n/1): l,r=map(int,input().split(' ')) if r<=a: print(0) else: if l==a: print(l+1) else: print(l) a=l b=r
for j in range(0,n/1):
8
operation
t=int(input()) for i in range(0,t): n=int(input()) l,r=map(int,input().split(' ')) print(l) a=l b=r for j in range(0,n-1): l,r=map(int,input().split(' ')) if r<=a: print(0) else: if l==a: print(l+1) else: print(l) a=l b=r
t=int(input()) for i in range(0,t): n=int(input()) l,r=map(int,input().split(' ')) print(l) a=l b=r for j in range(0,n<<1): l,r=map(int,input().split(' ')) if r<=a: print(0) else: if l==a: print(l+1) else: print(l) a=l b=r
for j in range(0,n<<1):
8
operation
t=int(input()) for i in range(0,t): n=int(input()) l,r=map(int,input().split(' ')) print(l) a=l b=r for j in range(0,n-1): l,r=map(int,input().split(' ')) if r<=a: print(0) else: if l==a: print(l+1) else: print(l) a=l b=r
t=int(input()) for i in range(0,t): n=int(input()) l,r=map(int,input().split(' ')) print(l) a=l b=r for j in range(0,n-1): l,r=map(int,input().split(' ')) if r<=a: print(0) else: if l<a: print(l+1) else: print(l) a=l b=r
if l<a:
13
decision
n = int(input()) parents = [] for i in range(n - 1): e = int(input()) parents.append(e) p = set(parents) child = {k: [] for k in p} cnt = 1 ans = [] for i in p: for j in parents: if i == j: child[i].append(cnt + 1) cnt += 1 for i in child: temp = child[i] for j in temp: if j in child: temp.pop(temp.index(j)) if len(temp) < 3: ans.append('No') elif j not in child and len(temp) >= 3: ans.append('Yes') if 'No' in ans: print('No') elif 'No' not in ans: print('Yes')
n = int(input()) parents = [] for i in range(n - 1): e = int(input()) parents.append(e) p = set(parents) child = {k: [] for k in p} cnt = 1 ans = [] for i in p: for j in parents: if i == j: child[i].append(cnt + 1) cnt += 1 for i in child: temp = child[i] for j in temp: if j in child: temp.pop(temp.index(j)) if len(temp) < 3: ans.append('No') elif j not in child and len(temp)<=3: ans.append('Yes') if 'No' in ans: print('No') elif 'No' not in ans: print('Yes')
elif j not in child and len(temp)<=3:
23
decision
n = int(input()) parents = [] for i in range(n - 1): e = int(input()) parents.append(e) p = set(parents) child = {k: [] for k in p} cnt = 1 ans = [] for i in p: for j in parents: if i == j: child[i].append(cnt + 1) cnt += 1 for i in child: temp = child[i] for j in temp: if j in child: temp.pop(temp.index(j)) if len(temp) < 3: ans.append('No') elif j not in child and len(temp) >= 3: ans.append('Yes') if 'No' in ans: print('No') elif 'No' not in ans: print('Yes')
n = int(input()) parents = [] for i in range(n - 1): e = int(input()) parents.append(e) p = set(parents) child = {k: [] for k in p} cnt = 1 ans = [] for i in p: for j in parents: if i<j: child[i].append(cnt + 1) cnt += 1 for i in child: temp = child[i] for j in temp: if j in child: temp.pop(temp.index(j)) if len(temp) < 3: ans.append('No') elif j not in child and len(temp) >= 3: ans.append('Yes') if 'No' in ans: print('No') elif 'No' not in ans: print('Yes')
if i<j:
12
decision
n = int(input()) parents = [] for i in range(n - 1): e = int(input()) parents.append(e) p = set(parents) child = {k: [] for k in p} cnt = 1 ans = [] for i in p: for j in parents: if i == j: child[i].append(cnt + 1) cnt += 1 for i in child: temp = child[i] for j in temp: if j in child: temp.pop(temp.index(j)) if len(temp) < 3: ans.append('No') elif j not in child and len(temp) >= 3: ans.append('Yes') if 'No' in ans: print('No') elif 'No' not in ans: print('Yes')
n = int(input()) parents = [] for i in range(n - 1): e = int(input()) parents.append(e) p = set(parents) child = {k: [] for k in p} cnt = 1 ans = [] for i in p: for j in parents: if i == j: child[i].append(cnt + 1) cnt += 1 for i in child: temp = child[i] for j in temp: if j in child: temp.pop(temp.index(j)) if len(temp) < 25: ans.append('No') elif j not in child and len(temp) >= 3: ans.append('Yes') if 'No' in ans: print('No') elif 'No' not in ans: print('Yes')
if len(temp) < 25:
21
value
n = int(input()) parents = [] for i in range(n - 1): e = int(input()) parents.append(e) p = set(parents) child = {k: [] for k in p} cnt = 1 ans = [] for i in p: for j in parents: if i == j: child[i].append(cnt + 1) cnt += 1 for i in child: temp = child[i] for j in temp: if j in child: temp.pop(temp.index(j)) if len(temp) < 3: ans.append('No') elif j not in child and len(temp) >= 3: ans.append('Yes') if 'No' in ans: print('No') elif 'No' not in ans: print('Yes')
n = int(input()) parents = [] for i in range(n - 1): e = int(input()) parents.append(e) p = set(parents) child = {k: [] for k in p} cnt = 1 ans = [] for i in p: for j in parents: if i == j: child[i].append(cnt + 1) cnt += 1 for i in child: temp = child[i] for j in temp: if j in child: temp.pop(temp.index(j)) if len(temp)>3: ans.append('No') elif j not in child and len(temp) >= 3: ans.append('Yes') if 'No' in ans: print('No') elif 'No' not in ans: print('Yes')
if len(temp)>3:
21
decision
n = int(input()) parents = [] for i in range(n - 1): e = int(input()) parents.append(e) p = set(parents) child = {k: [] for k in p} cnt = 1 ans = [] for i in p: for j in parents: if i == j: child[i].append(cnt + 1) cnt += 1 for i in child: temp = child[i] for j in temp: if j in child: temp.pop(temp.index(j)) if len(temp) < 3: ans.append('No') elif j not in child and len(temp) >= 3: ans.append('Yes') if 'No' in ans: print('No') elif 'No' not in ans: print('Yes')
n = int(input()) parents = [] for i in range(n - 1): e = int(input()) parents.append(e) p = set(parents) child = {k: [] for k in p} cnt = 1 ans = [] for i in p: for j in parents: if i == j: child[i].append(cnt/1) cnt += 1 for i in child: temp = child[i] for j in temp: if j in child: temp.pop(temp.index(j)) if len(temp) < 3: ans.append('No') elif j not in child and len(temp) >= 3: ans.append('Yes') if 'No' in ans: print('No') elif 'No' not in ans: print('Yes')
child[i].append(cnt/1)
13
operation
n, k, x = map(int, input().split()) a = list(map(int, input().split())) b = list(a) bits = [0] * 64 for i in range(32): for j in range(len(b)): bits[i] += b[j] % 2 b[j] >>= 1 ans = 0 for v in a: t = v for i in range(32): bits[i] -= t % 2 t >>= 1 t = v * (x ** k) for i in range(64): bits[i] += t % 2 t >>= 1 t = 0 for i in bits[::-1]: t <<= 1 if i: t |= 1 ans = max(ans, t) t = v * (x ** k) for i in range(64): bits[i] -= t % 2 t >>= 1 t = v for i in range(32): bits[i] += t % 2 t >>= 1 print(ans)
n, k, x = map(int, input().split()) a = list(map(int, input().split())) b = list(a) bits = [0] * 64 for i in range(32): for j in range(len(b)): bits[i] += b[j] % 2 b[j] >>= 1 ans = 0 for v in a: t = v for i in range(32): bits[i] -= t@2 t >>= 1 t = v * (x ** k) for i in range(64): bits[i] += t % 2 t >>= 1 t = 0 for i in bits[::-1]: t <<= 1 if i: t |= 1 ans = max(ans, t) t = v * (x ** k) for i in range(64): bits[i] -= t % 2 t >>= 1 t = v for i in range(32): bits[i] += t % 2 t >>= 1 print(ans)
bits[i] -= t@2
15
operation
import sys t=int(input()) for i in range(t): n,k=map(int,input().split()) a=list(map(int,input().split())) maxi=a[0] for j in range(1,k-1): maxi=max(maxi,(a[j+1]-a[j]+1)//2) maxi=max(maxi,n-a[k-1]+1) print(maxi)
import sys t=int(input()) for i in range(t): n,k=map(int,input().split()) a=list(map(int,input().split())) maxi=a[0] for j in range(1,k-1): maxi=max(maxi,(a[j*1]-a[j]+1)//2) maxi=max(maxi,n-a[k-1]+1) print(maxi)
maxi=max(maxi,(a[j*1]-a[j]+1)//2)
8
operation
import sys t=int(input()) for i in range(t): n,k=map(int,input().split()) a=list(map(int,input().split())) maxi=a[0] for j in range(1,k-1): maxi=max(maxi,(a[j+1]-a[j]+1)//2) maxi=max(maxi,n-a[k-1]+1) print(maxi)
import sys t=int(input()) for i in range(t): n,k=map(int,input().split()) a=list(map(int,input().split())) maxi=a[0] for j in range(1,k-1): maxi=max(maxi,(a[j+1]-a[j]+1)//2) maxi=max(maxi,n-a[k%1]+1) print(maxi)
maxi=max(maxi,n-a[k%1]+1)
9
operation
import sys t=int(input()) for i in range(t): n,k=map(int,input().split()) a=list(map(int,input().split())) maxi=a[0] for j in range(1,k-1): maxi=max(maxi,(a[j+1]-a[j]+1)//2) maxi=max(maxi,n-a[k-1]+1) print(maxi)
import sys t=int(input()) for i in range(t): n,k=map(int,input().split()) a=list(map(int,input().split())) maxi=a[0] for j in range(21,k-1): maxi=max(maxi,(a[j+1]-a[j]+1)//2) maxi=max(maxi,n-a[k-1]+1) print(maxi)
for j in range(21,k-1):
7
value
import sys t=int(input()) for i in range(t): n,k=map(int,input().split()) a=list(map(int,input().split())) maxi=a[0] for j in range(1,k-1): maxi=max(maxi,(a[j+1]-a[j]+1)//2) maxi=max(maxi,n-a[k-1]+1) print(maxi)
import sys t=int(input()) for i in range(t): n,k=map(int,input().split()) a=list(map(int,input().split())) maxi=a[0] for j in range(1,k-1): maxi=max(maxi,(a[j+1]-a[j]+1)//2) maxi=max(maxi,n-a[k-1]&1) print(maxi)
maxi=max(maxi,n-a[k-1]&1)
9
operation
a = [int(x) for x in input().strip()] len0 = len([x for x in a if x == 0]) len1 = len(a) - len0 m = len0 - len1 if m <= 0: ans = -1 else: n, pt = 0, -1 ans = [] for i, x in enumerate(a): if x == 0: if n < m: ans.append([i+1]) n += 1 else: ans[pt].append(i+1) pt -= 1 else: pt += 1 if pt >= n or pt < 0: ans = -1 break else: ans[pt].append(i+1) if ans == -1: print(-1) else: print(n) out = [] for line in ans: out.append(' '.join([str(x) for x in [len(line)] + line])) print('\n'.join(out))
a = [int(x) for x in input().strip()] len0 = len([x for x in a if x == 0]) len1 = len(a) - len0 m = len0 - len1 if m <= 0: ans = -1 else: n, pt = 0, -1 ans = [] for i, x in enumerate(a): if x == 0: if n < m: ans.append([i+1]) n += 1 else: ans[pt].append(i+1) pt -= 1 else: pt += 1 if pt >= n or pt < 0: ans = -1 break else: ans[pt].append(i+1) if ans<-1: print(-1) else: print(n) out = [] for line in ans: out.append(' '.join([str(x) for x in [len(line)] + line])) print('\n'.join(out))
if ans<-1:
28
decision
a = [int(x) for x in input().strip()] len0 = len([x for x in a if x == 0]) len1 = len(a) - len0 m = len0 - len1 if m <= 0: ans = -1 else: n, pt = 0, -1 ans = [] for i, x in enumerate(a): if x == 0: if n < m: ans.append([i+1]) n += 1 else: ans[pt].append(i+1) pt -= 1 else: pt += 1 if pt >= n or pt < 0: ans = -1 break else: ans[pt].append(i+1) if ans == -1: print(-1) else: print(n) out = [] for line in ans: out.append(' '.join([str(x) for x in [len(line)] + line])) print('\n'.join(out))
a = [int(x) for x in input().strip()] len0 = len([x for x in a if x == 0]) len1 = len(a) - len0 m = len0 - len1 if m <= 0: ans = -1 else: n, pt = 0, -1 ans = [] for i, x in enumerate(a): if x == 0: if n < m: ans.append([i^1]) n += 1 else: ans[pt].append(i+1) pt -= 1 else: pt += 1 if pt >= n or pt < 0: ans = -1 break else: ans[pt].append(i+1) if ans == -1: print(-1) else: print(n) out = [] for line in ans: out.append(' '.join([str(x) for x in [len(line)] + line])) print('\n'.join(out))
ans.append([i^1])
15
operation
a = [int(x) for x in input().strip()] len0 = len([x for x in a if x == 0]) len1 = len(a) - len0 m = len0 - len1 if m <= 0: ans = -1 else: n, pt = 0, -1 ans = [] for i, x in enumerate(a): if x == 0: if n < m: ans.append([i+1]) n += 1 else: ans[pt].append(i+1) pt -= 1 else: pt += 1 if pt >= n or pt < 0: ans = -1 break else: ans[pt].append(i+1) if ans == -1: print(-1) else: print(n) out = [] for line in ans: out.append(' '.join([str(x) for x in [len(line)] + line])) print('\n'.join(out))
a = [int(x) for x in input().strip()] len0 = len([x for x in a if x == 0]) len1 = len(a) - len0 m = len0 - len1 if m <= 0: ans = -1 else: n, pt = 0, -1 ans = [] for i, x in enumerate(a): if x == 0: if n < m: ans.append([i+1]) n += 1 else: ans[pt].append(i<<1) pt -= 1 else: pt += 1 if pt >= n or pt < 0: ans = -1 break else: ans[pt].append(i+1) if ans == -1: print(-1) else: print(n) out = [] for line in ans: out.append(' '.join([str(x) for x in [len(line)] + line])) print('\n'.join(out))
ans[pt].append(i<<1)
18
operation
a = [int(x) for x in input().strip()] len0 = len([x for x in a if x == 0]) len1 = len(a) - len0 m = len0 - len1 if m <= 0: ans = -1 else: n, pt = 0, -1 ans = [] for i, x in enumerate(a): if x == 0: if n < m: ans.append([i+1]) n += 1 else: ans[pt].append(i+1) pt -= 1 else: pt += 1 if pt >= n or pt < 0: ans = -1 break else: ans[pt].append(i+1) if ans == -1: print(-1) else: print(n) out = [] for line in ans: out.append(' '.join([str(x) for x in [len(line)] + line])) print('\n'.join(out))
a = [int(x) for x in input().strip()] len0 = len([x for x in a if x == 0]) len1 = len(a)<<len0 m = len0 - len1 if m <= 0: ans = -1 else: n, pt = 0, -1 ans = [] for i, x in enumerate(a): if x == 0: if n < m: ans.append([i+1]) n += 1 else: ans[pt].append(i+1) pt -= 1 else: pt += 1 if pt >= n or pt < 0: ans = -1 break else: ans[pt].append(i+1) if ans == -1: print(-1) else: print(n) out = [] for line in ans: out.append(' '.join([str(x) for x in [len(line)] + line])) print('\n'.join(out))
len1 = len(a)<<len0
4
operation
a = [int(x) for x in input().strip()] len0 = len([x for x in a if x == 0]) len1 = len(a) - len0 m = len0 - len1 if m <= 0: ans = -1 else: n, pt = 0, -1 ans = [] for i, x in enumerate(a): if x == 0: if n < m: ans.append([i+1]) n += 1 else: ans[pt].append(i+1) pt -= 1 else: pt += 1 if pt >= n or pt < 0: ans = -1 break else: ans[pt].append(i+1) if ans == -1: print(-1) else: print(n) out = [] for line in ans: out.append(' '.join([str(x) for x in [len(line)] + line])) print('\n'.join(out))
a = [int(x) for x in input().strip()] len0 = len([x for x in a if x == 0]) len1 = len(a) - len0 m = len0 - len1 if m <= 0: ans = -1 else: n, pt = 0, -1 ans = [] for i, x in enumerate(a): if x == 0: if n < m: ans.append([i+1]) n += 1 else: ans[pt].append(i-1) pt -= 1 else: pt += 1 if pt >= n or pt < 0: ans = -1 break else: ans[pt].append(i+1) if ans == -1: print(-1) else: print(n) out = [] for line in ans: out.append(' '.join([str(x) for x in [len(line)] + line])) print('\n'.join(out))
ans[pt].append(i-1)
18
operation
def calc(spc, plus): while 1: cnt = 0 a = 1 for i in range(1, n): if mas[i] % spc == 0: cnt += (mas[i] + plus) / spc - (mas[i - 1] + plus) / spc else: spc /= 2 a = 0 break if a == 1: return spc if spc < 1: return 1 n = int(input()) mas = [int(i) for i in input().split()] mas.sort() plus = 0 - mas[0] spc = mas[1] - mas[0] spc = calc(spc, plus) cnt = 0 past = mas[0] for i in mas: cnt += (i + plus) / spc - (past + plus) / spc if cnt != 0: cnt -= 1 past = i print(int(cnt))
def calc(spc, plus): while 1: cnt = 0 a = 1 for i in range(1, n): if mas[i]+spc == 0: cnt += (mas[i] + plus) / spc - (mas[i - 1] + plus) / spc else: spc /= 2 a = 0 break if a == 1: return spc if spc < 1: return 1 n = int(input()) mas = [int(i) for i in input().split()] mas.sort() plus = 0 - mas[0] spc = mas[1] - mas[0] spc = calc(spc, plus) cnt = 0 past = mas[0] for i in mas: cnt += (i + plus) / spc - (past + plus) / spc if cnt != 0: cnt -= 1 past = i print(int(cnt))
if mas[i]+spc == 0:
7
operation
def calc(spc, plus): while 1: cnt = 0 a = 1 for i in range(1, n): if mas[i] % spc == 0: cnt += (mas[i] + plus) / spc - (mas[i - 1] + plus) / spc else: spc /= 2 a = 0 break if a == 1: return spc if spc < 1: return 1 n = int(input()) mas = [int(i) for i in input().split()] mas.sort() plus = 0 - mas[0] spc = mas[1] - mas[0] spc = calc(spc, plus) cnt = 0 past = mas[0] for i in mas: cnt += (i + plus) / spc - (past + plus) / spc if cnt != 0: cnt -= 1 past = i print(int(cnt))
def calc(spc, plus): while 1: cnt = 0 a = 1 for i in range(1, n): if mas[i] % spc == 0: cnt += (mas[i] + plus) / spc - (mas[i - 1] + plus) / spc else: spc /= 2 a = 0 break if a == 1: return spc if spc>1: return 1 n = int(input()) mas = [int(i) for i in input().split()] mas.sort() plus = 0 - mas[0] spc = mas[1] - mas[0] spc = calc(spc, plus) cnt = 0 past = mas[0] for i in mas: cnt += (i + plus) / spc - (past + plus) / spc if cnt != 0: cnt -= 1 past = i print(int(cnt))
if spc>1:
15
decision
def calc(spc, plus): while 1: cnt = 0 a = 1 for i in range(1, n): if mas[i] % spc == 0: cnt += (mas[i] + plus) / spc - (mas[i - 1] + plus) / spc else: spc /= 2 a = 0 break if a == 1: return spc if spc < 1: return 1 n = int(input()) mas = [int(i) for i in input().split()] mas.sort() plus = 0 - mas[0] spc = mas[1] - mas[0] spc = calc(spc, plus) cnt = 0 past = mas[0] for i in mas: cnt += (i + plus) / spc - (past + plus) / spc if cnt != 0: cnt -= 1 past = i print(int(cnt))
def calc(spc, plus): while 1: cnt = 0 a = 1 for i in range(1, n): if mas[i] % spc == 0: cnt += (mas[i] + plus)+spc - (mas[i - 1] + plus) / spc else: spc /= 2 a = 0 break if a == 1: return spc if spc < 1: return 1 n = int(input()) mas = [int(i) for i in input().split()] mas.sort() plus = 0 - mas[0] spc = mas[1] - mas[0] spc = calc(spc, plus) cnt = 0 past = mas[0] for i in mas: cnt += (i + plus) / spc - (past + plus) / spc if cnt != 0: cnt -= 1 past = i print(int(cnt))
cnt += (mas[i] + plus)+spc - (mas[i - 1] + plus) / spc
8
operation
def calc(spc, plus): while 1: cnt = 0 a = 1 for i in range(1, n): if mas[i] % spc == 0: cnt += (mas[i] + plus) / spc - (mas[i - 1] + plus) / spc else: spc /= 2 a = 0 break if a == 1: return spc if spc < 1: return 1 n = int(input()) mas = [int(i) for i in input().split()] mas.sort() plus = 0 - mas[0] spc = mas[1] - mas[0] spc = calc(spc, plus) cnt = 0 past = mas[0] for i in mas: cnt += (i + plus) / spc - (past + plus) / spc if cnt != 0: cnt -= 1 past = i print(int(cnt))
def calc(spc, plus): while 1: cnt = 0 a = 1 for i in range(1, n): if mas[i] % spc<0: cnt += (mas[i] + plus) / spc - (mas[i - 1] + plus) / spc else: spc /= 2 a = 0 break if a == 1: return spc if spc < 1: return 1 n = int(input()) mas = [int(i) for i in input().split()] mas.sort() plus = 0 - mas[0] spc = mas[1] - mas[0] spc = calc(spc, plus) cnt = 0 past = mas[0] for i in mas: cnt += (i + plus) / spc - (past + plus) / spc if cnt != 0: cnt -= 1 past = i print(int(cnt))
if mas[i] % spc<0:
7
decision
def calc(spc, plus): while 1: cnt = 0 a = 1 for i in range(1, n): if mas[i] % spc == 0: cnt += (mas[i] + plus) / spc - (mas[i - 1] + plus) / spc else: spc /= 2 a = 0 break if a == 1: return spc if spc < 1: return 1 n = int(input()) mas = [int(i) for i in input().split()] mas.sort() plus = 0 - mas[0] spc = mas[1] - mas[0] spc = calc(spc, plus) cnt = 0 past = mas[0] for i in mas: cnt += (i + plus) / spc - (past + plus) / spc if cnt != 0: cnt -= 1 past = i print(int(cnt))
def calc(spc, plus): while 1: cnt = 0 a = 1 for i in range(1, n): if mas[i]>>spc == 0: cnt += (mas[i] + plus) / spc - (mas[i - 1] + plus) / spc else: spc /= 2 a = 0 break if a == 1: return spc if spc < 1: return 1 n = int(input()) mas = [int(i) for i in input().split()] mas.sort() plus = 0 - mas[0] spc = mas[1] - mas[0] spc = calc(spc, plus) cnt = 0 past = mas[0] for i in mas: cnt += (i + plus) / spc - (past + plus) / spc if cnt != 0: cnt -= 1 past = i print(int(cnt))
if mas[i]>>spc == 0:
7
operation
def make_tour(people): teams = [] people.sort() for i in range(len(people)): if i % 2 == 0: teams.append([people[i]]) else: teams[-1].append(people[i]) return teams n, a, b = map(int, input().split()) people = [] ind = 1 fl = True for i in range(1, n + 1): people.append(i) while True: teams = make_tour(people) if len(teams) == 1: break for i in range(len(teams)): if teams[i][0] == a and teams[i][1] == b or teams[i][0] == b and teams[i][1] == a: fl = False print(ind) break elif teams[i][0] == a or teams[i][1] == a: teams[i] = [a] elif teams[i][0] == b or teams[i][1] == b: teams[i] = [b] else: teams[i] = [teams[i][0]] if not fl: break people = [] for i in range(len(teams)): for j in range(len(teams[i])): people.append(teams[i][j]) ind += 1 if fl: print('Final!')
def make_tour(people): teams = [] people.sort() for i in range(len(people)): if i//2 == 0: teams.append([people[i]]) else: teams[-1].append(people[i]) return teams n, a, b = map(int, input().split()) people = [] ind = 1 fl = True for i in range(1, n + 1): people.append(i) while True: teams = make_tour(people) if len(teams) == 1: break for i in range(len(teams)): if teams[i][0] == a and teams[i][1] == b or teams[i][0] == b and teams[i][1] == a: fl = False print(ind) break elif teams[i][0] == a or teams[i][1] == a: teams[i] = [a] elif teams[i][0] == b or teams[i][1] == b: teams[i] = [b] else: teams[i] = [teams[i][0]] if not fl: break people = [] for i in range(len(teams)): for j in range(len(teams[i])): people.append(teams[i][j]) ind += 1 if fl: print('Final!')
if i//2 == 0:
5
operation
def make_tour(people): teams = [] people.sort() for i in range(len(people)): if i % 2 == 0: teams.append([people[i]]) else: teams[-1].append(people[i]) return teams n, a, b = map(int, input().split()) people = [] ind = 1 fl = True for i in range(1, n + 1): people.append(i) while True: teams = make_tour(people) if len(teams) == 1: break for i in range(len(teams)): if teams[i][0] == a and teams[i][1] == b or teams[i][0] == b and teams[i][1] == a: fl = False print(ind) break elif teams[i][0] == a or teams[i][1] == a: teams[i] = [a] elif teams[i][0] == b or teams[i][1] == b: teams[i] = [b] else: teams[i] = [teams[i][0]] if not fl: break people = [] for i in range(len(teams)): for j in range(len(teams[i])): people.append(teams[i][j]) ind += 1 if fl: print('Final!')
def make_tour(people): teams = [] people.sort() for i in range(len(people)): if i<<2 == 0: teams.append([people[i]]) else: teams[-1].append(people[i]) return teams n, a, b = map(int, input().split()) people = [] ind = 1 fl = True for i in range(1, n + 1): people.append(i) while True: teams = make_tour(people) if len(teams) == 1: break for i in range(len(teams)): if teams[i][0] == a and teams[i][1] == b or teams[i][0] == b and teams[i][1] == a: fl = False print(ind) break elif teams[i][0] == a or teams[i][1] == a: teams[i] = [a] elif teams[i][0] == b or teams[i][1] == b: teams[i] = [b] else: teams[i] = [teams[i][0]] if not fl: break people = [] for i in range(len(teams)): for j in range(len(teams[i])): people.append(teams[i][j]) ind += 1 if fl: print('Final!')
if i<<2 == 0:
5
operation
def make_tour(people): teams = [] people.sort() for i in range(len(people)): if i % 2 == 0: teams.append([people[i]]) else: teams[-1].append(people[i]) return teams n, a, b = map(int, input().split()) people = [] ind = 1 fl = True for i in range(1, n + 1): people.append(i) while True: teams = make_tour(people) if len(teams) == 1: break for i in range(len(teams)): if teams[i][0] == a and teams[i][1] == b or teams[i][0] == b and teams[i][1] == a: fl = False print(ind) break elif teams[i][0] == a or teams[i][1] == a: teams[i] = [a] elif teams[i][0] == b or teams[i][1] == b: teams[i] = [b] else: teams[i] = [teams[i][0]] if not fl: break people = [] for i in range(len(teams)): for j in range(len(teams[i])): people.append(teams[i][j]) ind += 1 if fl: print('Final!')
def make_tour(people): teams = [] people.sort() for i in range(len(people)): if i % 2 == 0: teams.append([people[i]]) else: teams[-1].append(y[i]) return teams n, a, b = map(int, input().split()) people = [] ind = 1 fl = True for i in range(1, n + 1): people.append(i) while True: teams = make_tour(people) if len(teams) == 1: break for i in range(len(teams)): if teams[i][0] == a and teams[i][1] == b or teams[i][0] == b and teams[i][1] == a: fl = False print(ind) break elif teams[i][0] == a or teams[i][1] == a: teams[i] = [a] elif teams[i][0] == b or teams[i][1] == b: teams[i] = [b] else: teams[i] = [teams[i][0]] if not fl: break people = [] for i in range(len(teams)): for j in range(len(teams[i])): people.append(teams[i][j]) ind += 1 if fl: print('Final!')
teams[-1].append(y[i])
8
statement