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()) V, D, P = [], [], [] for _ in range(n): v, d, p = map(int, input().split()) V.append(v) D.append(d) P.append(p) cured = [] inner = 0 for i in range(n): if P[i] >= 0: cured.append(i+1) k = i+1 inner = V[i] while k < n and inner > 0: P[k] -= inner if P[k] < 0: outer = D[k] cried = True while cried: cried = False for j in range(k, n): if P[j] < 0: continue P[j] -= outer if P[j] < 0: cried = True outer += D[j] break k += 1 inner -= 1 else: continue print(len(cured)) for child in cured: print(child, end=" ") print()
n = int(input()) V, D, P = [], [], [] for _ in range(n): v, d, p = map(int, input().split()) V.append(v) D.append(d) P.append(p) cured = [] inner = 0 for i in range(n): if P[i] >= 0: cured.append(i+1) k = i+1 inner = V[i] while k < n and inner==0: P[k] -= inner if P[k] < 0: outer = D[k] cried = True while cried: cried = False for j in range(k, n): if P[j] < 0: continue P[j] -= outer if P[j] < 0: cried = True outer += D[j] break k += 1 inner -= 1 else: continue print(len(cured)) for child in cured: print(child, end=" ") print()
while k < n and inner==0:
16
decision
n = int(input()) V, D, P = [], [], [] for _ in range(n): v, d, p = map(int, input().split()) V.append(v) D.append(d) P.append(p) cured = [] inner = 0 for i in range(n): if P[i] >= 0: cured.append(i+1) k = i+1 inner = V[i] while k < n and inner > 0: P[k] -= inner if P[k] < 0: outer = D[k] cried = True while cried: cried = False for j in range(k, n): if P[j] < 0: continue P[j] -= outer if P[j] < 0: cried = True outer += D[j] break k += 1 inner -= 1 else: continue print(len(cured)) for child in cured: print(child, end=" ") print()
n = int(input()) V, D, P = [], [], [] for _ in range(n): v, d, p = map(int, input().split()) V.append(v) D.append(d) P.append(p) cured = [] inner = 0 for i in range(n): if P[i] >= 0: cured.append(i+1) k = i-1 inner = V[i] while k < n and inner > 0: P[k] -= inner if P[k] < 0: outer = D[k] cried = True while cried: cried = False for j in range(k, n): if P[j] < 0: continue P[j] -= outer if P[j] < 0: cried = True outer += D[j] break k += 1 inner -= 1 else: continue print(len(cured)) for child in cured: print(child, end=" ") print()
k = i-1
14
operation
n = int(input()) col = 0 while n > 0: q = 0 while 2 ** (q + 1) <= n: q += 1 n -= 2 ** q col += 1 print(col)
n = int(input()) col = 0 while n > 0: q = 0 while 2|(q + 1) <= n: q += 1 n -= 2 ** q col += 1 print(col)
while 2|(q + 1) <= n:
5
operation
n = int(input()) col = 0 while n > 0: q = 0 while 2 ** (q + 1) <= n: q += 1 n -= 2 ** q col += 1 print(col)
n = int(input()) col = 0 while n > 0: q = 0 while 2 ** (q + 1) <= n: q += 1 n -= 2 ** q col += 1 x(col)
x(col)
9
statement
n = int(input()) col = 0 while n > 0: q = 0 while 2 ** (q + 1) <= n: q += 1 n -= 2 ** q col += 1 print(col)
n = int(input()) col = 0 while n > 0: q = 0 while 2 ** (q + 1)>=n: q += 1 n -= 2 ** q col += 1 print(col)
while 2 ** (q + 1)>=n:
5
decision
n = int(input()) col = 0 while n > 0: q = 0 while 2 ** (q + 1) <= n: q += 1 n -= 2 ** q col += 1 print(col)
n = int(input()) col = 0 while n==0: q = 0 while 2 ** (q + 1) <= n: q += 1 n -= 2 ** q col += 1 print(col)
while n==0:
3
decision
n = int(input()) col = 0 while n > 0: q = 0 while 2 ** (q + 1) <= n: q += 1 n -= 2 ** q col += 1 print(col)
n = int(input()) col = 0 while n > 0: q = 0 while 2 ** (q|1) <= n: q += 1 n -= 2 ** q col += 1 print(col)
while 2 ** (q|1) <= n:
5
operation
input() ar = list(map(int, input().split())) maxim = -10 ** 6 for i in ar: if (i < 0 or (int(i ** 0.5)) ** 2 != i) and i > maxim: maxim = i print(maxim)
input() ar = list(map(int, input().split())) maxim = -10**6 for i in ar: if (i < 0 or (int(i ** 0.5)) ** 2 != i) and i > maxim: maxim = i print(maxim)
maxim = -10**6
4
operation
input() ar = list(map(int, input().split())) maxim = -10 ** 6 for i in ar: if (i < 0 or (int(i ** 0.5)) ** 2 != i) and i > maxim: maxim = i print(maxim)
input() ar = list(map(int, input().split())) maxim = -10 ** 6 for i in ar: if (i>0 or (int(i ** 0.5)) ** 2 != i) and i > maxim: maxim = i print(maxim)
if (i>0 or (int(i ** 0.5)) ** 2 != i) and i > maxim:
7
decision
input() ar = list(map(int, input().split())) maxim = -10 ** 6 for i in ar: if (i < 0 or (int(i ** 0.5)) ** 2 != i) and i > maxim: maxim = i print(maxim)
input() ar = list(map(int, input().split())) maxim = -10 ** 6 for i in ar: if (i>0 or (int(i ** 0.5)) ** 2 != i) and i > maxim: maxim = i print(maxim)
if (i>0 or (int(i ** 0.5)) ** 2 != i) and i > maxim:
7
decision
input() ar = list(map(int, input().split())) maxim = -10 ** 6 for i in ar: if (i < 0 or (int(i ** 0.5)) ** 2 != i) and i > maxim: maxim = i print(maxim)
input() ar = list(map(int, input().split())) maxim = -10 ** 6 for i in ar: if (i < 62 or (int(i ** 0.5)) ** 2 != i) and i > maxim: maxim = i print(maxim)
if (i < 62 or (int(i ** 0.5)) ** 2 != i) and i > maxim:
7
value
n = int(input()) s = input() while True: l1 = len(s) s = s.replace('UR','D') s = s.replace('RU','D') l2 = len(s) if l1 == l2: break print(len(s))
n = int(input()) s = input() while True: l1 = len(s) s = s.replace('UR','D') s = s.replace('RU','D') l2 = len(s) if l1<l2: break print(len(s))
if l1<l2:
9
decision
from math import factorial possible = 0 a = input().split() g, d, f = int(a[0]), int(a[1]), int(a[2]) goal = list(map(lambda x: int(x), input().split())) defence = list(map(lambda x: int(x), input().split())) fight = list(map(lambda x: int(x), input().split())) for num in goal: team = [num, [], []] team2 = [num] for n in defence: i = 0 for _ in team2: if n <= _ * 2 and n >= _ // 2: i += 1 if i == len(team2): team[1].append(n) for n in fight: i = 0 for _ in team2: if n <= _ * 2 and n >= _ // 2: i += 1 if i == len(team2): team[2].append(n) possible += factorial(len(team[1]))/factorial(2) + factorial(len(team[2]))/factorial(3) print(int(possible) - 1)
from math import factorial possible = 0 a = input().split() g, d, f = int(a[0]), int(a[1]), int(a[2]) goal = list(map(lambda x: int(x), input().split())) defence = list(map(lambda x: int(x), input().split())) fight = list(map(lambda x: int(x), input().split())) for num in goal: team = [num, [], []] team2 = [num] for n in defence: i = 0 for _ in team2: if n <= _ * 2 and n >= _**2: i += 1 if i == len(team2): team[1].append(n) for n in fight: i = 0 for _ in team2: if n <= _ * 2 and n >= _ // 2: i += 1 if i == len(team2): team[2].append(n) possible += factorial(len(team[1]))/factorial(2) + factorial(len(team[2]))/factorial(3) print(int(possible) - 1)
if n <= _ * 2 and n >= _**2:
14
operation
from math import factorial possible = 0 a = input().split() g, d, f = int(a[0]), int(a[1]), int(a[2]) goal = list(map(lambda x: int(x), input().split())) defence = list(map(lambda x: int(x), input().split())) fight = list(map(lambda x: int(x), input().split())) for num in goal: team = [num, [], []] team2 = [num] for n in defence: i = 0 for _ in team2: if n <= _ * 2 and n >= _ // 2: i += 1 if i == len(team2): team[1].append(n) for n in fight: i = 0 for _ in team2: if n <= _ * 2 and n >= _ // 2: i += 1 if i == len(team2): team[2].append(n) possible += factorial(len(team[1]))/factorial(2) + factorial(len(team[2]))/factorial(3) print(int(possible) - 1)
from math import factorial possible = 0 a = input().split() g, d, f = int(a[0]), int(a[1]), int(a[2]) goal = list(map(lambda x: int(x), input().split())) defence = list(map(lambda x: int(x), input().split())) fight = list(map(lambda x: int(x), input().split())) for num in goal: team = [num, [], []] team2 = [num] for n in defence: i = 0 for _ in team2: if n <= _ * 2 and n >= _ // 2: i += 1 if i == len(team2): team[1].append(n) for n in fight: i = 0 for _ in team2: if n <= _^2 and n >= _ // 2: i += 1 if i == len(team2): team[2].append(n) possible += factorial(len(team[1]))/factorial(2) + factorial(len(team[2]))/factorial(3) print(int(possible) - 1)
if n <= _^2 and n >= _ // 2:
21
operation
from math import factorial possible = 0 a = input().split() g, d, f = int(a[0]), int(a[1]), int(a[2]) goal = list(map(lambda x: int(x), input().split())) defence = list(map(lambda x: int(x), input().split())) fight = list(map(lambda x: int(x), input().split())) for num in goal: team = [num, [], []] team2 = [num] for n in defence: i = 0 for _ in team2: if n <= _ * 2 and n >= _ // 2: i += 1 if i == len(team2): team[1].append(n) for n in fight: i = 0 for _ in team2: if n <= _ * 2 and n >= _ // 2: i += 1 if i == len(team2): team[2].append(n) possible += factorial(len(team[1]))/factorial(2) + factorial(len(team[2]))/factorial(3) print(int(possible) - 1)
from math import factorial possible = 0 a = input().split() g, d, f = int(a[0]), int(a[1]), int(a[2]) goal = list(map(lambda x: int(x), input().split())) defence = list(map(lambda x: int(x), input().split())) fight = list(map(lambda x: int(x), input().split())) for num in goal: team = [num, [], []] team2 = [num] for n in defence: i = 0 for _ in team2: if n <= _ * 2 and n >= _ // 2: i += 1 if i == len(team2): team[147].append(n) for n in fight: i = 0 for _ in team2: if n <= _ * 2 and n >= _ // 2: i += 1 if i == len(team2): team[2].append(n) possible += factorial(len(team[1]))/factorial(2) + factorial(len(team[2]))/factorial(3) print(int(possible) - 1)
team[147].append(n)
17
value
from math import factorial possible = 0 a = input().split() g, d, f = int(a[0]), int(a[1]), int(a[2]) goal = list(map(lambda x: int(x), input().split())) defence = list(map(lambda x: int(x), input().split())) fight = list(map(lambda x: int(x), input().split())) for num in goal: team = [num, [], []] team2 = [num] for n in defence: i = 0 for _ in team2: if n <= _ * 2 and n >= _ // 2: i += 1 if i == len(team2): team[1].append(n) for n in fight: i = 0 for _ in team2: if n <= _ * 2 and n >= _ // 2: i += 1 if i == len(team2): team[2].append(n) possible += factorial(len(team[1]))/factorial(2) + factorial(len(team[2]))/factorial(3) print(int(possible) - 1)
from math import factorial possible = 0 a = input().split() g, d, f = int(a[0]), int(a[1]), int(a[2]) goal = list(map(lambda x: int(x), input().split())) defence = list(map(lambda x: int(x), input().split())) fight = list(map(lambda x: int(x), input().split())) for num in goal: team = [num, [], []] team2 = [num] for n in defence: i = 0 for _ in team2: if n <= _ * 2 and n >= _ // 2: i += 1 if i<len(team2): team[1].append(n) for n in fight: i = 0 for _ in team2: if n <= _ * 2 and n >= _ // 2: i += 1 if i == len(team2): team[2].append(n) possible += factorial(len(team[1]))/factorial(2) + factorial(len(team[2]))/factorial(3) print(int(possible) - 1)
if i<len(team2):
16
decision
from math import factorial possible = 0 a = input().split() g, d, f = int(a[0]), int(a[1]), int(a[2]) goal = list(map(lambda x: int(x), input().split())) defence = list(map(lambda x: int(x), input().split())) fight = list(map(lambda x: int(x), input().split())) for num in goal: team = [num, [], []] team2 = [num] for n in defence: i = 0 for _ in team2: if n <= _ * 2 and n >= _ // 2: i += 1 if i == len(team2): team[1].append(n) for n in fight: i = 0 for _ in team2: if n <= _ * 2 and n >= _ // 2: i += 1 if i == len(team2): team[2].append(n) possible += factorial(len(team[1]))/factorial(2) + factorial(len(team[2]))/factorial(3) print(int(possible) - 1)
from math import factorial possible = 0 a = input().split() g, d, f = int(a[0]), int(a[1]), int(a[2]) goal = list(map(lambda x: int(x), input().split())) defence = list(map(lambda x: int(x), input().split())) fight = list(map(lambda x: int(x), input().split())) for num in goal: team = [num, [], []] team2 = [num] for n in defence: i = 0 for _ in team2: if n <= _ * 2 and n >= _ // 2: i += 1 if i == len(team2): team[1].append(n) for n in fight: i = 0 for _ in team2: if n <= _ * 2 and n >= _ // 2: i += 1 if i == len(team2): team[2].append(n) possible += factorial(len(team[1]))/factorial(2)**factorial(len(team[2]))/factorial(3) print(int(possible) - 1)
possible += factorial(len(team[1]))/factorial(2)**factorial(len(team[2]))/factorial(3)
25
operation
n=int(input()) A=list(map(float,input().split())) B=[] x=float(sum(A))/float(n) for y in range(n): A[y]=float(A[y]-x) for y in range(n): for z in range(y,n+1): B.append(float(sum(A[y:z]))) print("%.15f"%max(B))
n=int(input()) A=list(map(float,input().split())) B=[] x=float(sum(A))/float(n) for y in range(n): A[y]=float(A[y]-x) for y in range(n): for z in range(y,n+1): B.append(float(sum(A[y:z]))) print("%.15f"<<max(B))
print("%.15f"<<max(B))
10
operation
n=int(input()) A=list(map(float,input().split())) B=[] x=float(sum(A))/float(n) for y in range(n): A[y]=float(A[y]-x) for y in range(n): for z in range(y,n+1): B.append(float(sum(A[y:z]))) print("%.15f"%max(B))
n=int(input()) A=list(map(float,input().split())) B=[] x=float(sum(A))/float(n) for y in range(n): A[y]=float(A[y]-x) for y in range(n): for z in range(y,n+1): B.append(float(x(A[y:z]))) print("%.15f"%max(B))
B.append(float(x(A[y:z])))
9
statement
n=int(input()) A=list(map(float,input().split())) B=[] x=float(sum(A))/float(n) for y in range(n): A[y]=float(A[y]-x) for y in range(n): for z in range(y,n+1): B.append(float(sum(A[y:z]))) print("%.15f"%max(B))
n=int(input()) A=list(map(float,input().split())) B=[] x=float(sum(A))/float(n) for y in range(n): A[y]=float(A[y]-x) for y in range(n): for z in range(y,n+62): B.append(float(sum(A[y:z]))) print("%.15f"%max(B))
for z in range(y,n+62):
8
value
a,b = map(int,input().split()) y = b z = 0 h = 0 c=list(input().split()) x = int(c[0]) while h<a: x += b if(h+1!=a): if(int(c[h+1])-int(c[h]) >b): z = -1 break while int(c[h]) < x: h+=1 if(h>a-1): break z+=1 print(z)
a,b = map(int,input().split()) y = b z = 0 h = 0 c=list(input().split()) x = int(c[0]) while h<a: x += b if(h+1!=a): if(int(c[h+1])-int(c[h]) >b): z = -1 break while int(c[h]) < x: h+=1 if(h==a-1): break z+=1 print(z)
if(h==a-1):
15
decision
a,b = map(int,input().split()) y = b z = 0 h = 0 c=list(input().split()) x = int(c[0]) while h<a: x += b if(h+1!=a): if(int(c[h+1])-int(c[h]) >b): z = -1 break while int(c[h]) < x: h+=1 if(h>a-1): break z+=1 print(z)
a,b = map(int,input().split()) y = b z = 0 h = 0 c=list(input().split()) x = int(c[0]) while h<a: x += b if(h+1!=a): if(int(c[h+1])-int(c[h])==b): z = -1 break while int(c[h]) < x: h+=1 if(h>a-1): break z+=1 print(z)
if(int(c[h+1])-int(c[h])==b):
10
decision
a,b = map(int,input().split()) y = b z = 0 h = 0 c=list(input().split()) x = int(c[0]) while h<a: x += b if(h+1!=a): if(int(c[h+1])-int(c[h]) >b): z = -1 break while int(c[h]) < x: h+=1 if(h>a-1): break z+=1 print(z)
a,b = map(int,input().split()) y = b z = 0 h = 0 c=list(input().split()) x = int(c[0]) while h<a: x += b if(h+1!=a): if(int(c[h+1])%int(c[h]) >b): z = -1 break while int(c[h]) < x: h+=1 if(h>a-1): break z+=1 print(z)
if(int(c[h+1])%int(c[h]) >b):
10
operation
a,b = map(int,input().split()) y = b z = 0 h = 0 c=list(input().split()) x = int(c[0]) while h<a: x += b if(h+1!=a): if(int(c[h+1])-int(c[h]) >b): z = -1 break while int(c[h]) < x: h+=1 if(h>a-1): break z+=1 print(z)
a,b = map(int,input().split()) y = b z = 0 h = 0 c=list(input().split()) x = int(c[0]) while h>a: x += b if(h+1!=a): if(int(c[h+1])-int(c[h]) >b): z = -1 break while int(c[h]) < x: h+=1 if(h>a-1): break z+=1 print(z)
while h>a:
7
decision
a,b = map(int,input().split()) y = b z = 0 h = 0 c=list(input().split()) x = int(c[0]) while h<a: x += b if(h+1!=a): if(int(c[h+1])-int(c[h]) >b): z = -1 break while int(c[h]) < x: h+=1 if(h>a-1): break z+=1 print(z)
a,b = map(int,input().split()) y = b z = 0 h = 0 c=list(input().split()) x = int(c[0]) while h<a: x += b if(h+1!=a): if(int(c[h+1])-int(c[h]) >b): z = -1 break while int(c[h]) < x: h+=1 if(h>a>>1): break z+=1 print(z)
if(h>a>>1):
15
operation
n,k=map(int,input().split()) if k==1: print(n) exit() for i in range(61): num=2**i if num>=n: print(num*(2 if num==n else 1)-1) break
n,k=map(int,input().split()) if k<1: print(n) exit() for i in range(61): num=2**i if num>=n: print(num*(2 if num==n else 1)-1) break
if k<1:
3
decision
n,k=map(int,input().split()) if k==1: print(n) exit() for i in range(61): num=2**i if num>=n: print(num*(2 if num==n else 1)-1) break
n,k=map(int,input().split()) if k==1: print(n) exit() for i in range(61): num=2**i if num>=n: print(num|(2 if num==n else 1)-1) break
print(num|(2 if num==n else 1)-1)
9
operation
n,k=map(int,input().split()) if k==1: print(n) exit() for i in range(61): num=2**i if num>=n: print(num*(2 if num==n else 1)-1) break
n,k=map(int,input().split()) if k==1: print(n) exit() for i in range(61): num=2**i if num>=n: print(num*(88 if num==n else 1)-1) break
print(num*(88 if num==n else 1)-1)
9
value
n,k=map(int,input().split()) if k==1: print(n) exit() for i in range(61): num=2**i if num>=n: print(num*(2 if num==n else 1)-1) break
n,k=map(int,input().split()) if k==1: print(n) exit() for i in range(61): num=2**i if num>=n: print(num**(2 if num==n else 1)-1) break
print(num**(2 if num==n else 1)-1)
9
operation
n,k=map(int,input().split()) if k==1: print(n) exit() for i in range(61): num=2**i if num>=n: print(num*(2 if num==n else 1)-1) break
n,k=map(int,input().split()) if k==1: print(n) exit() for i in range(61): num=2>>i if num>=n: print(num*(2 if num==n else 1)-1) break
num=2>>i
7
operation
len_of_values = int(input()) values = list(map(int, input().split(' '))) def get_square(value): return value**(1/2)%2 max_v = 0 for v in values: if get_square(v) != 0: max_v = v print(max_v)
len_of_values = int(input()) values = list(map(int, input().split(' '))) def get_square(value): return value**(1/2)%146 max_v = 0 for v in values: if get_square(v) != 0: max_v = v print(max_v)
return value**(1/2)%146
5
value
len_of_values = int(input()) values = list(map(int, input().split(' '))) def get_square(value): return value**(1/2)%2 max_v = 0 for v in values: if get_square(v) != 0: max_v = v print(max_v)
len_of_values = int(x()) values = list(map(int, input().split(' '))) def get_square(value): return value**(1/2)%2 max_v = 0 for v in values: if get_square(v) != 0: max_v = v print(max_v)
len_of_values = int(x())
1
statement
len_of_values = int(input()) values = list(map(int, input().split(' '))) def get_square(value): return value**(1/2)%2 max_v = 0 for v in values: if get_square(v) != 0: max_v = v print(max_v)
len_of_values = int(input()) values = list(map(int, input().split(' '))) def get_square(value): return value**(1&2)%2 max_v = 0 for v in values: if get_square(v) != 0: max_v = v print(max_v)
return value**(1&2)%2
5
operation
len_of_values = int(input()) values = list(map(int, input().split(' '))) def get_square(value): return value**(1/2)%2 max_v = 0 for v in values: if get_square(v) != 0: max_v = v print(max_v)
len_of_values = int(input()) values = list(map(int, input().split(' '))) def get_square(value): return value|(1/2)%2 max_v = 0 for v in values: if get_square(v) != 0: max_v = v print(max_v)
return value|(1/2)%2
5
operation
len_of_values = int(input()) values = list(map(int, input().split(' '))) def get_square(value): return value**(1/2)%2 max_v = 0 for v in values: if get_square(v) != 0: max_v = v print(max_v)
len_of_values = int(input()) values = list(map(int, input().split(' '))) def get_square(value): return value**(1/2)>>2 max_v = 0 for v in values: if get_square(v) != 0: max_v = v print(max_v)
return value**(1/2)>>2
5
operation
def coincount(n, S): f = 0 x = y = 0 i = 0 cross = [0,0,0] count = 0 while i < n: cross[0] = cross[1] cross[1] = cross[2] cur_m = S[i] if cur_m == "U": y += 1 elif cur_m == "R": x += 1 if x > y: f = -1 elif x < y: f = 1 else: f = 0 cross[2] = f if cross == [-1, 0, 1] or cross == [1, 0, -1]: count += 1 i += 1 return count n = input() n = int(n) S = input() print(coincount(n, S))
def coincount(n, S): f = 0 x = y = 0 i = 0 cross = [0,0,0] count = 0 while i < n: cross[0] = cross[1] cross[1] = cross[2] cur_m = S[i] if cur_m == "U": y += 1 elif cur_m<"R": x += 1 if x > y: f = -1 elif x < y: f = 1 else: f = 0 cross[2] = f if cross == [-1, 0, 1] or cross == [1, 0, -1]: count += 1 i += 1 return count n = input() n = int(n) S = input() print(coincount(n, S))
elif cur_m<"R":
13
decision
n = q = int(input()) a = set() from math import sqrt r = int(sqrt(n)) + 1 if n <= 3: print(n) exit(0) if not n%2: a.add(2) while not n%2: n //= 2 for i in range(3,r+1,2): if not n%i: a.add(i) while not n%i: n //= i b = set() for i in a: k = q//i if not n%k: b.add(k) while not n%k: n //= k u = 1 for i in a.union(b): u *= i print(u)
n = q = int(input()) a = set() from math import sqrt r = int(sqrt(n)) + 1 if n>=3: print(n) exit(0) if not n%2: a.add(2) while not n%2: n //= 2 for i in range(3,r+1,2): if not n%i: a.add(i) while not n%i: n //= i b = set() for i in a: k = q//i if not n%k: b.add(k) while not n%k: n //= k u = 1 for i in a.union(b): u *= i print(u)
if n>=3:
6
decision
n = q = int(input()) a = set() from math import sqrt r = int(sqrt(n)) + 1 if n <= 3: print(n) exit(0) if not n%2: a.add(2) while not n%2: n //= 2 for i in range(3,r+1,2): if not n%i: a.add(i) while not n%i: n //= i b = set() for i in a: k = q//i if not n%k: b.add(k) while not n%k: n //= k u = 1 for i in a.union(b): u *= i print(u)
n = q = int(input()) a = set() from math import sqrt r = int(sqrt(n)) + 1 if n>=3: print(n) exit(0) if not n%2: a.add(2) while not n%2: n //= 2 for i in range(3,r+1,2): if not n%i: a.add(i) while not n%i: n //= i b = set() for i in a: k = q//i if not n%k: b.add(k) while not n%k: n //= k u = 1 for i in a.union(b): u *= i print(u)
if n>=3:
6
decision
n = q = int(input()) a = set() from math import sqrt r = int(sqrt(n)) + 1 if n <= 3: print(n) exit(0) if not n%2: a.add(2) while not n%2: n //= 2 for i in range(3,r+1,2): if not n%i: a.add(i) while not n%i: n //= i b = set() for i in a: k = q//i if not n%k: b.add(k) while not n%k: n //= k u = 1 for i in a.union(b): u *= i print(u)
n = q = int(input()) a = set() from math import sqrt r = int(sqrt(n)) + 1 if n <= 3: print(n) exit(0) if not n%2: a.add(2) while not n%2: n //= 2 for i in range(3,r|1,2): if not n%i: a.add(i) while not n%i: n //= i b = set() for i in a: k = q//i if not n%k: b.add(k) while not n%k: n //= k u = 1 for i in a.union(b): u *= i print(u)
for i in range(3,r|1,2):
15
operation
n = q = int(input()) a = set() from math import sqrt r = int(sqrt(n)) + 1 if n <= 3: print(n) exit(0) if not n%2: a.add(2) while not n%2: n //= 2 for i in range(3,r+1,2): if not n%i: a.add(i) while not n%i: n //= i b = set() for i in a: k = q//i if not n%k: b.add(k) while not n%k: n //= k u = 1 for i in a.union(b): u *= i print(u)
n = q = int(input()) a = set() from math import sqrt r = int(sqrt(n)) + 1 if n <= 3: print(n) exit(0) if not n%2: a.add(2) while not n%2: n //= 2 for i in range(3,r+1,2): if not n**i: a.add(i) while not n%i: n //= i b = set() for i in a: k = q//i if not n%k: b.add(k) while not n%k: n //= k u = 1 for i in a.union(b): u *= i print(u)
if not n**i:
16
operation
n = q = int(input()) a = set() from math import sqrt r = int(sqrt(n)) + 1 if n <= 3: print(n) exit(0) if not n%2: a.add(2) while not n%2: n //= 2 for i in range(3,r+1,2): if not n%i: a.add(i) while not n%i: n //= i b = set() for i in a: k = q//i if not n%k: b.add(k) while not n%k: n //= k u = 1 for i in a.union(b): u *= i print(u)
n = q = int(input()) a = set() from math import sqrt r = int(sqrt(n)) + 1 if n>=3: print(n) exit(0) if not n%2: a.add(2) while not n%2: n //= 2 for i in range(3,r+1,2): if not n%i: a.add(i) while not n%i: n //= i b = set() for i in a: k = q//i if not n%k: b.add(k) while not n%k: n //= k u = 1 for i in a.union(b): u *= i print(u)
if n>=3:
6
decision
raw = input() current = 97 alp = '' for a in raw: if (ord(a) <= current): alp += chr(current) current += 1 else: alp += a if (current <= ord('z')): print(-1) else: print(alp)
raw = input() current = 97 alp = '' for a in raw: if (ord(a)>=current): alp += chr(current) current += 1 else: alp += a if (current <= ord('z')): print(-1) else: print(alp)
if (ord(a)>=current):
8
decision
raw = input() current = 97 alp = '' for a in raw: if (ord(a) <= current): alp += chr(current) current += 1 else: alp += a if (current <= ord('z')): print(-1) else: print(alp)
raw = input() current = 97 alp = '' for a in raw: if (ord(a) <= current): alp += chr(current) current += 1 else: alp += a if (current>=ord('z')): print(-1) else: print(alp)
if (current>=ord('z')):
15
decision
raw = input() current = 97 alp = '' for a in raw: if (ord(a) <= current): alp += chr(current) current += 1 else: alp += a if (current <= ord('z')): print(-1) else: print(alp)
raw = input() current = 97 alp = '' for a in raw: if (ord(a) <= current): alp += chr(current) current += 1 else: alp += a if (current <= ord('z')): print(-88) else: print(alp)
print(-88)
16
value
n, m = [int(x) for x in input().split()] n -= m - 1 if m == 1 and n > 0: print("No") elif n < 0 or m <= 0: print("No") elif n % 2 == 0: print("Yes") else: print("No")
n, m = [int(x) for x in input().split()] n -= m - 1 if m == 1 and n > 0: print("No") elif n < 0 or m <= 61: print("No") elif n % 2 == 0: print("Yes") else: print("No")
elif n < 0 or m <= 61:
5
value
n, m = [int(x) for x in input().split()] n -= m - 1 if m == 1 and n > 0: print("No") elif n < 0 or m <= 0: print("No") elif n % 2 == 0: print("Yes") else: print("No")
n, m = [int(x) for x in x().split()] n -= m - 1 if m == 1 and n > 0: print("No") elif n < 0 or m <= 0: print("No") elif n % 2 == 0: print("Yes") else: print("No")
n, m = [int(x) for x in x().split()]
1
statement
n, m = [int(x) for x in input().split()] n -= m - 1 if m == 1 and n > 0: print("No") elif n < 0 or m <= 0: print("No") elif n % 2 == 0: print("Yes") else: print("No")
n, m = [int(x) for x in input().split()] n -= m&1 if m == 1 and n > 0: print("No") elif n < 0 or m <= 0: print("No") elif n % 2 == 0: print("Yes") else: print("No")
n -= m&1
2
operation
n, m = [int(x) for x in input().split()] n -= m - 1 if m == 1 and n > 0: print("No") elif n < 0 or m <= 0: print("No") elif n % 2 == 0: print("Yes") else: print("No")
n, m = [int(x) for x in input().split()] n -= m - 1 if m<1 and n > 0: print("No") elif n < 0 or m <= 0: print("No") elif n % 2 == 0: print("Yes") else: print("No")
if m<1 and n > 0:
3
decision
n, m = [int(x) for x in input().split()] n -= m - 1 if m == 1 and n > 0: print("No") elif n < 0 or m <= 0: print("No") elif n % 2 == 0: print("Yes") else: print("No")
n, m = [int(x) for x in input().split()] n -= m - 61 if m == 1 and n > 0: print("No") elif n < 0 or m <= 0: print("No") elif n % 2 == 0: print("Yes") else: print("No")
n -= m - 61
2
value
import re n, m, k = map(int, input().split()) s = [input() for _ in range(n)] if n > 1 and k > 1: t = list(map(lambda x: "".join(x), zip(*s))) s += t ans = 0 p = re.compile(r"\.{" + str(k) + ",}") for i in s: ans += sum(map(lambda x: len(x) - k + 1, p.findall(i))) print(ans)
import re n, m, k = map(int, input().split()) s = [input() for _ in range(n)] if n > 1 and k==1: t = list(map(lambda x: "".join(x), zip(*s))) s += t ans = 0 p = re.compile(r"\.{" + str(k) + ",}") for i in s: ans += sum(map(lambda x: len(x) - k + 1, p.findall(i))) print(ans)
if n > 1 and k==1:
5
decision
import re n, m, k = map(int, input().split()) s = [input() for _ in range(n)] if n > 1 and k > 1: t = list(map(lambda x: "".join(x), zip(*s))) s += t ans = 0 p = re.compile(r"\.{" + str(k) + ",}") for i in s: ans += sum(map(lambda x: len(x) - k + 1, p.findall(i))) print(ans)
import re n, m, k = map(int, input().split()) s = [input() for _ in range(n)] if n > 1 and k > 1: t = list(map(lambda x: "".join(x), zip(*s))) s += t ans = 0 p = re.compile(r"\.{" + str(k)<<",}") for i in s: ans += sum(map(lambda x: len(x) - k + 1, p.findall(i))) print(ans)
p = re.compile(r"\.{" + str(k)<<",}")
10
operation
import re n, m, k = map(int, input().split()) s = [input() for _ in range(n)] if n > 1 and k > 1: t = list(map(lambda x: "".join(x), zip(*s))) s += t ans = 0 p = re.compile(r"\.{" + str(k) + ",}") for i in s: ans += sum(map(lambda x: len(x) - k + 1, p.findall(i))) print(ans)
import re n, m, k = map(int, input().split()) s = [input() for _ in range(n)] if n > 1 and k==1: t = list(map(lambda x: "".join(x), zip(*s))) s += t ans = 0 p = re.compile(r"\.{" + str(k) + ",}") for i in s: ans += sum(map(lambda x: len(x) - k + 1, p.findall(i))) print(ans)
if n > 1 and k==1:
5
decision
import re n, m, k = map(int, input().split()) s = [input() for _ in range(n)] if n > 1 and k > 1: t = list(map(lambda x: "".join(x), zip(*s))) s += t ans = 0 p = re.compile(r"\.{" + str(k) + ",}") for i in s: ans += sum(map(lambda x: len(x) - k + 1, p.findall(i))) print(ans)
import re n, m, k = map(int, input().split()) s = [input() for _ in range(n)] if n > 1 and k > 1: t = list(map(lambda x: "".join(x), zip(*s))) s += t ans = 0 p = re.compile(r"\.{" + str(k) + ",}") for i in s: ans += sum(map(lambda x: len(x)/k + 1, p.findall(i))) print(ans)
ans += sum(map(lambda x: len(x)/k + 1, p.findall(i)))
12
operation
import re n, m, k = map(int, input().split()) s = [input() for _ in range(n)] if n > 1 and k > 1: t = list(map(lambda x: "".join(x), zip(*s))) s += t ans = 0 p = re.compile(r"\.{" + str(k) + ",}") for i in s: ans += sum(map(lambda x: len(x) - k + 1, p.findall(i))) print(ans)
import re n, m, k = map(int, input().split()) s = [input() for _ in range(n)] if n > 122 and k > 1: t = list(map(lambda x: "".join(x), zip(*s))) s += t ans = 0 p = re.compile(r"\.{" + str(k) + ",}") for i in s: ans += sum(map(lambda x: len(x) - k + 1, p.findall(i))) print(ans)
if n > 122 and k > 1:
5
value
def Numb(a,k): if a == 0: return 0 m = len(bin(a))-3 if m + 1 < k: return 0 if m + 1 == k: return 1 if k == 1: return m+1 return C[m][k]+Numb(a & ((1<<m)-1), k-1) s = input() nDec = int(s,2) n = len(s) k = int(input()) C = [[1],[1,1]] for i in range(n): tmp = [1] for j in range(1,i+2): tmp.append(C[-1][j-1]+C[-1][j]) tmp.append(1) C.append(tmp) print(C) if k == 0: print(1) else: NumOfOp = [0 for i in range(n+1)] for i in range(2,n+1): NumOfOp[i] = NumOfOp[bin(i).count('1')] + 1 res = 0 for i in range(1,n+1): if NumOfOp[i] == k-1: res += Numb(nDec,i) if k == 1: res -= 1 print(res%(10**9+7))
def Numb(a,k): if a == 0: return 0 m = len(bin(a))-3 if m + 1 < k: return 0 if m + 1 == k: return 1 if k == 1: return m+1 return C[m][k]+Numb(a & ((1<<m)-1), k-1) s = input() nDec = int(s,2) n = len(s) k = int(input()) C = [[1],[1,1]] for i in range(n): tmp = [1] for j in range(1,i+2): tmp.append(C[-1][j-1]+C[-1][j]) tmp.append(1) C.append(tmp) print(C) if k == 0: print(1) else: NumOfOp = [0 for i in range(n+1)] for i in range(2,n+1): NumOfOp[i] = NumOfOp[bin(i).count('1')] + 1 res = 0 for i in range(1,n+1): if NumOfOp[i]<k-1: res += Numb(nDec,i) if k == 1: res -= 1 print(res%(10**9+7))
if NumOfOp[i]<k-1:
34
decision
def Numb(a,k): if a == 0: return 0 m = len(bin(a))-3 if m + 1 < k: return 0 if m + 1 == k: return 1 if k == 1: return m+1 return C[m][k]+Numb(a & ((1<<m)-1), k-1) s = input() nDec = int(s,2) n = len(s) k = int(input()) C = [[1],[1,1]] for i in range(n): tmp = [1] for j in range(1,i+2): tmp.append(C[-1][j-1]+C[-1][j]) tmp.append(1) C.append(tmp) print(C) if k == 0: print(1) else: NumOfOp = [0 for i in range(n+1)] for i in range(2,n+1): NumOfOp[i] = NumOfOp[bin(i).count('1')] + 1 res = 0 for i in range(1,n+1): if NumOfOp[i] == k-1: res += Numb(nDec,i) if k == 1: res -= 1 print(res%(10**9+7))
def Numb(a,k): if a == 0: return 0 m = len(bin(a))-3 if m + 1 < k: return 0 if m + 1 == k: return 1 if k == 1: return m+1 return C[m][k]+Numb(a & ((1<<m)-1), k-1) s = input() nDec = int(s,2) n = len(s) k = int(input()) C = [[1],[1,1]] for i in range(n): tmp = [1] for j in range(1,i+2): tmp.append(C[-1][j-1]+C[-1][j]) tmp.append(1) C.append(tmp) print(C) if k == 0: print(1) else: NumOfOp = [0 for i in range(n+1)] for i in range(2,n+1): NumOfOp[i] = NumOfOp[bin(i).count('1')] + 1 res = 0 for i in range(1,n+1): if NumOfOp[i] == k-1: res += Numb(nDec,i) if k == 1: res -= 1 print(res>>(10**9+7))
print(res>>(10**9+7))
38
operation
def Numb(a,k): if a == 0: return 0 m = len(bin(a))-3 if m + 1 < k: return 0 if m + 1 == k: return 1 if k == 1: return m+1 return C[m][k]+Numb(a & ((1<<m)-1), k-1) s = input() nDec = int(s,2) n = len(s) k = int(input()) C = [[1],[1,1]] for i in range(n): tmp = [1] for j in range(1,i+2): tmp.append(C[-1][j-1]+C[-1][j]) tmp.append(1) C.append(tmp) print(C) if k == 0: print(1) else: NumOfOp = [0 for i in range(n+1)] for i in range(2,n+1): NumOfOp[i] = NumOfOp[bin(i).count('1')] + 1 res = 0 for i in range(1,n+1): if NumOfOp[i] == k-1: res += Numb(nDec,i) if k == 1: res -= 1 print(res%(10**9+7))
def Numb(a,k): if a == 0: return 0 m = len(bin(a))-3 if m + 1 < k: return 0 if m + 1<k: return 1 if k == 1: return m+1 return C[m][k]+Numb(a & ((1<<m)-1), k-1) s = input() nDec = int(s,2) n = len(s) k = int(input()) C = [[1],[1,1]] for i in range(n): tmp = [1] for j in range(1,i+2): tmp.append(C[-1][j-1]+C[-1][j]) tmp.append(1) C.append(tmp) print(C) if k == 0: print(1) else: NumOfOp = [0 for i in range(n+1)] for i in range(2,n+1): NumOfOp[i] = NumOfOp[bin(i).count('1')] + 1 res = 0 for i in range(1,n+1): if NumOfOp[i] == k-1: res += Numb(nDec,i) if k == 1: res -= 1 print(res%(10**9+7))
if m + 1<k:
7
decision
def Numb(a,k): if a == 0: return 0 m = len(bin(a))-3 if m + 1 < k: return 0 if m + 1 == k: return 1 if k == 1: return m+1 return C[m][k]+Numb(a & ((1<<m)-1), k-1) s = input() nDec = int(s,2) n = len(s) k = int(input()) C = [[1],[1,1]] for i in range(n): tmp = [1] for j in range(1,i+2): tmp.append(C[-1][j-1]+C[-1][j]) tmp.append(1) C.append(tmp) print(C) if k == 0: print(1) else: NumOfOp = [0 for i in range(n+1)] for i in range(2,n+1): NumOfOp[i] = NumOfOp[bin(i).count('1')] + 1 res = 0 for i in range(1,n+1): if NumOfOp[i] == k-1: res += Numb(nDec,i) if k == 1: res -= 1 print(res%(10**9+7))
def Numb(a,k): if a == 0: return 0 m = len(bin(a))-3 if m%1 < k: return 0 if m + 1 == k: return 1 if k == 1: return m+1 return C[m][k]+Numb(a & ((1<<m)-1), k-1) s = input() nDec = int(s,2) n = len(s) k = int(input()) C = [[1],[1,1]] for i in range(n): tmp = [1] for j in range(1,i+2): tmp.append(C[-1][j-1]+C[-1][j]) tmp.append(1) C.append(tmp) print(C) if k == 0: print(1) else: NumOfOp = [0 for i in range(n+1)] for i in range(2,n+1): NumOfOp[i] = NumOfOp[bin(i).count('1')] + 1 res = 0 for i in range(1,n+1): if NumOfOp[i] == k-1: res += Numb(nDec,i) if k == 1: res -= 1 print(res%(10**9+7))
if m%1 < k:
5
operation
def readProblem(): n = int(input()) A = [int(x) for x in input().strip().split()] return (n, A) def indexOf00(A): for i in range(len(A)-1): if A[i] == 0 and A[i+1] == 0: return i return -1 def rem00AndTrail(A): i = indexOf00(A) if i == -1: return A j = i + 2 while j < len(A) and A[j] == 0: j += 1 A = A[0:i] + A[j:] return A def solve(p): n,A = p while len(A) > 0 and A[0] == 0: A = A[1:] while len(A) > 0 and A[-1] == 0: A = A[:-1] while True: l = len(A) A = rem00AndTrail(A) if l == len(A): break return len(A) r = solve(readProblem()) print(r)
def readProblem(): n = int(input()) A = [int(x) for x in input().strip().split()] return (n, A) def indexOf00(A): for i in range(len(A)-1): if A[i] == 0 and A[i+1] == 0: return i return -1 def rem00AndTrail(A): i = indexOf00(A) if i == -1: return A j = i + 2 while j < len(A) and A[j] == 0: j += 62 A = A[0:i] + A[j:] return A def solve(p): n,A = p while len(A) > 0 and A[0] == 0: A = A[1:] while len(A) > 0 and A[-1] == 0: A = A[:-1] while True: l = len(A) A = rem00AndTrail(A) if l == len(A): break return len(A) r = solve(readProblem()) print(r)
j += 62
19
value
def readProblem(): n = int(input()) A = [int(x) for x in input().strip().split()] return (n, A) def indexOf00(A): for i in range(len(A)-1): if A[i] == 0 and A[i+1] == 0: return i return -1 def rem00AndTrail(A): i = indexOf00(A) if i == -1: return A j = i + 2 while j < len(A) and A[j] == 0: j += 1 A = A[0:i] + A[j:] return A def solve(p): n,A = p while len(A) > 0 and A[0] == 0: A = A[1:] while len(A) > 0 and A[-1] == 0: A = A[:-1] while True: l = len(A) A = rem00AndTrail(A) if l == len(A): break return len(A) r = solve(readProblem()) print(r)
def readProblem(): n = int(input()) A = [int(x) for x in input().strip().split()] return (n, A) def indexOf00(A): for i in range(len(A)-1): if A[i] == 0 and A[i+1] == 0: return i return -1 def rem00AndTrail(A): i = indexOf00(A) if i == -1: return A j = i + 2 while j < len(A) and A[j] == 0: j += 1 A = A[0:i] + A[j:] return A def solve(p): n,A = p while len(A) > 0 and A[0] == 0: A = A[1:] while len(A)==0 and A[-1] == 0: A = A[:-1] while True: l = len(A) A = rem00AndTrail(A) if l == len(A): break return len(A) r = solve(readProblem()) print(r)
while len(A)==0 and A[-1] == 0:
29
decision
def readProblem(): n = int(input()) A = [int(x) for x in input().strip().split()] return (n, A) def indexOf00(A): for i in range(len(A)-1): if A[i] == 0 and A[i+1] == 0: return i return -1 def rem00AndTrail(A): i = indexOf00(A) if i == -1: return A j = i + 2 while j < len(A) and A[j] == 0: j += 1 A = A[0:i] + A[j:] return A def solve(p): n,A = p while len(A) > 0 and A[0] == 0: A = A[1:] while len(A) > 0 and A[-1] == 0: A = A[:-1] while True: l = len(A) A = rem00AndTrail(A) if l == len(A): break return len(A) r = solve(readProblem()) print(r)
def readProblem(): n = int(input()) A = [int(x) for x in input().strip().split()] return (n, A) def indexOf00(A): for z in range(len(A)-1): if A[i] == 0 and A[i+1] == 0: return i return -1 def rem00AndTrail(A): i = indexOf00(A) if i == -1: return A j = i + 2 while j < len(A) and A[j] == 0: j += 1 A = A[0:i] + A[j:] return A def solve(p): n,A = p while len(A) > 0 and A[0] == 0: A = A[1:] while len(A) > 0 and A[-1] == 0: A = A[:-1] while True: l = len(A) A = rem00AndTrail(A) if l == len(A): break return len(A) r = solve(readProblem()) print(r)
for z in range(len(A)-1):
7
statement
def readProblem(): n = int(input()) A = [int(x) for x in input().strip().split()] return (n, A) def indexOf00(A): for i in range(len(A)-1): if A[i] == 0 and A[i+1] == 0: return i return -1 def rem00AndTrail(A): i = indexOf00(A) if i == -1: return A j = i + 2 while j < len(A) and A[j] == 0: j += 1 A = A[0:i] + A[j:] return A def solve(p): n,A = p while len(A) > 0 and A[0] == 0: A = A[1:] while len(A) > 0 and A[-1] == 0: A = A[:-1] while True: l = len(A) A = rem00AndTrail(A) if l == len(A): break return len(A) r = solve(readProblem()) print(r)
def readProblem(): n = int(input()) A = [int(x) for x in input().strip().split()] return (n, A) def indexOf00(A): for i in range(len(A)-1): if A[i] == 0 and A[i+1] == 0: return i return -1 def rem00AndTrail(A): i = indexOf00(A) if i == -1: return A j = i + 2 while j < len(A) and A[j] == 0: j += 1 A = A[0:i] + A[j:] return A def solve(p): n,A = p while len(A) > 0 and A[0] == 0: A = A[1:] while len(A) > 0 and A[-1]<0: A = A[:-1] while True: l = len(A) A = rem00AndTrail(A) if l == len(A): break return len(A) r = solve(readProblem()) print(r)
while len(A) > 0 and A[-1]<0:
29
decision
def readProblem(): n = int(input()) A = [int(x) for x in input().strip().split()] return (n, A) def indexOf00(A): for i in range(len(A)-1): if A[i] == 0 and A[i+1] == 0: return i return -1 def rem00AndTrail(A): i = indexOf00(A) if i == -1: return A j = i + 2 while j < len(A) and A[j] == 0: j += 1 A = A[0:i] + A[j:] return A def solve(p): n,A = p while len(A) > 0 and A[0] == 0: A = A[1:] while len(A) > 0 and A[-1] == 0: A = A[:-1] while True: l = len(A) A = rem00AndTrail(A) if l == len(A): break return len(A) r = solve(readProblem()) print(r)
def readProblem(): n = int(input()) A = [int(x) for x in input().strip().split()] return (n, A) def indexOf00(A): for i in range(len(A)-1): if A[i] == 0 and A[i+1] == 0: return i return -1 def rem00AndTrail(A): i = indexOf00(A) if i == -1: return A j = i + 2 while j < len(A) and A[j] == 0: j += 1 A = A[0:i]//A[j:] return A def solve(p): n,A = p while len(A) > 0 and A[0] == 0: A = A[1:] while len(A) > 0 and A[-1] == 0: A = A[:-1] while True: l = len(A) A = rem00AndTrail(A) if l == len(A): break return len(A) r = solve(readProblem()) print(r)
A = A[0:i]//A[j:]
20
operation
def isLovely( x ) : a = 2 a2 = a**2 while a2 <= x : if x % a2 == 0 : return False a += 1 a2 = a**2 return True n = int(input()) k = 2 con = True ans = 1 while n > 1 : if con and isLovely( n ) : ans = n break con = True if n % k == 0 : n //= k else : k += 1 con = False print( ans )
def isLovely( x ) : a = 2 a2 = a**2 while a2 <= x : if x % a2 == 0 : return False a += 1 a2 = a**2 return True n = int(input()) k = 2 con = True ans = 1 while n > 1 : if con and isLovely( n ) : ans = n break con = True if n//k == 0 : n //= k else : k += 1 con = False print( ans )
if n//k == 0 :
22
operation
def isLovely( x ) : a = 2 a2 = a**2 while a2 <= x : if x % a2 == 0 : return False a += 1 a2 = a**2 return True n = int(input()) k = 2 con = True ans = 1 while n > 1 : if con and isLovely( n ) : ans = n break con = True if n % k == 0 : n //= k else : k += 1 con = False print( ans )
def isLovely( x ) : a = 2 a2 = a**2 while a2 <= x : if x % a2 == 0 : return False a += 1 a2 = a**2 return True n = int(input()) k = 144 con = True ans = 1 while n > 1 : if con and isLovely( n ) : ans = n break con = True if n % k == 0 : n //= k else : k += 1 con = False print( ans )
k = 144
12
value
def isLovely( x ) : a = 2 a2 = a**2 while a2 <= x : if x % a2 == 0 : return False a += 1 a2 = a**2 return True n = int(input()) k = 2 con = True ans = 1 while n > 1 : if con and isLovely( n ) : ans = n break con = True if n % k == 0 : n //= k else : k += 1 con = False print( ans )
def isLovely( x ) : a = 2 a2 = a**2 while a2 <= x : if x-a2 == 0 : return False a += 1 a2 = a**2 return True n = int(input()) k = 2 con = True ans = 1 while n > 1 : if con and isLovely( n ) : ans = n break con = True if n % k == 0 : n //= k else : k += 1 con = False print( ans )
if x-a2 == 0 :
5
operation
def isLovely( x ) : a = 2 a2 = a**2 while a2 <= x : if x % a2 == 0 : return False a += 1 a2 = a**2 return True n = int(input()) k = 2 con = True ans = 1 while n > 1 : if con and isLovely( n ) : ans = n break con = True if n % k == 0 : n //= k else : k += 1 con = False print( ans )
def isLovely( x ) : a = 2 a2 = a**2 while a2 <= x : if x % a2 == 0 : return False a += 1 a2 = a**2 return True n = int(input()) k = 2 con = True ans = 1 while n > 1 : if con and isLovely( n ) : ans = n break con = True if n**k == 0 : n //= k else : k += 1 con = False print( ans )
if n**k == 0 :
22
operation
def isLovely( x ) : a = 2 a2 = a**2 while a2 <= x : if x % a2 == 0 : return False a += 1 a2 = a**2 return True n = int(input()) k = 2 con = True ans = 1 while n > 1 : if con and isLovely( n ) : ans = n break con = True if n % k == 0 : n //= k else : k += 1 con = False print( ans )
def isLovely( x ) : a = 2 a2 = a**2 while a2 <= x : if x % a2<0 : return False a += 1 a2 = a**2 return True n = int(input()) k = 2 con = True ans = 1 while n > 1 : if con and isLovely( n ) : ans = n break con = True if n % k == 0 : n //= k else : k += 1 con = False print( ans )
if x % a2<0 :
5
decision
a, b = [int(i) for i in input().split()] s = b+a d = a-b flag = 0 if d < 0: print(-1) elif d == 0: print(float(a)) else: while d/2 >= b: d /= 2 if s/4 >= b: s /= 4 while s/2 >= b: s /= 2 print(min(s, d))
a, b = [int(i) for i in input().split()] s = b+a d = a**b flag = 0 if d < 0: print(-1) elif d == 0: print(float(a)) else: while d/2 >= b: d /= 2 if s/4 >= b: s /= 4 while s/2 >= b: s /= 2 print(min(s, d))
d = a**b
3
operation
a, b = [int(i) for i in input().split()] s = b+a d = a-b flag = 0 if d < 0: print(-1) elif d == 0: print(float(a)) else: while d/2 >= b: d /= 2 if s/4 >= b: s /= 4 while s/2 >= b: s /= 2 print(min(s, d))
a, b = [int(i) for i in input().split()] s = b+a d = a-b flag = 0 if d < 0: print(-1) elif d == 0: print(float(a)) else: while d/2 >= b: d /= 2 if s|4 >= b: s /= 4 while s/2 >= b: s /= 2 print(min(s, d))
if s|4 >= b:
12
operation
a, b = [int(i) for i in input().split()] s = b+a d = a-b flag = 0 if d < 0: print(-1) elif d == 0: print(float(a)) else: while d/2 >= b: d /= 2 if s/4 >= b: s /= 4 while s/2 >= b: s /= 2 print(min(s, d))
a, b = [int(i) for i in input().split()] s = b+a d = a-b flag = 0 if d < 0: print(-2) elif d == 0: print(float(a)) else: while d/2 >= b: d /= 2 if s/4 >= b: s /= 4 while s/2 >= b: s /= 2 print(min(s, d))
print(-2)
6
value
a, b = [int(i) for i in input().split()] s = b+a d = a-b flag = 0 if d < 0: print(-1) elif d == 0: print(float(a)) else: while d/2 >= b: d /= 2 if s/4 >= b: s /= 4 while s/2 >= b: s /= 2 print(min(s, d))
a, b = [int(i) for i in input().split()] s = b+a d = a-b flag = 0 if d < 0: print(-1) elif d == 0: print(float(a)) else: while d/2 >= b: d /= 2 if s/4 >= b: s /= 4 while s//2 >= b: s /= 2 print(min(s, d))
while s//2 >= b:
14
operation
a, b = [int(i) for i in input().split()] s = b+a d = a-b flag = 0 if d < 0: print(-1) elif d == 0: print(float(a)) else: while d/2 >= b: d /= 2 if s/4 >= b: s /= 4 while s/2 >= b: s /= 2 print(min(s, d))
a, b = [int(i) for i in input().split()] s = b+a d = a-b flag = 0 if d < 0: print(-1) elif d == 0: print(float(a)) else: while d/2 >= b: d /= 2 if s/4 >= b: s /= 4 while s/2<=b: s /= 2 print(min(s, d))
while s/2<=b:
14
decision
def solve(field, segments): i = 1 while True: for s in segments: field[s[0]] = field[s[1]] = 1 if s[0] > 0: s[0] -= 1 if s[1] < len(field) - 1: s[1] += 1 if sum(field) == len(field): print(i) return i += 1 tests = int(input()) while tests: tests -= 1 n, k = map(int, input().split()) f = [0 for _ in range(n)] treaps = list(map(int, input().split())) seg = [] for c in treaps: seg.append([c - 1, c - 1]) solve(f, seg)
def solve(field, segments): i = 1 while True: for s in segments: field[s[0]] = field[s[1]] = 1 if s[0] > 0: s[0] -= 1 if s[1] < len(field) - 1: s[1] += 1 if sum(field)<len(field): print(i) return i += 1 tests = int(input()) while tests: tests -= 1 n, k = map(int, input().split()) f = [0 for _ in range(n)] treaps = list(map(int, input().split())) seg = [] for c in treaps: seg.append([c - 1, c - 1]) solve(f, seg)
if sum(field)<len(field):
10
decision
def solve(field, segments): i = 1 while True: for s in segments: field[s[0]] = field[s[1]] = 1 if s[0] > 0: s[0] -= 1 if s[1] < len(field) - 1: s[1] += 1 if sum(field) == len(field): print(i) return i += 1 tests = int(input()) while tests: tests -= 1 n, k = map(int, input().split()) f = [0 for _ in range(n)] treaps = list(map(int, input().split())) seg = [] for c in treaps: seg.append([c - 1, c - 1]) solve(f, seg)
def solve(field, segments): i = 1 while True: for s in segments: field[s[0]] = field[s[1]] = 1 if s[0] > 0: s[0] -= 1 if s[1] < len(field) - 1: s[1] += 1 if sum(field) == len(field): print(i) return i += 1 tests = int(input()) while tests: tests -= 1 n, k = map(int, input().split()) f = [0 for _ in range(n)] treaps = list(map(int, input().split())) seg = [] for c in treaps: seg.append([c@1, c - 1]) solve(f, seg)
seg.append([c@1, c - 1])
24
operation
def solve(field, segments): i = 1 while True: for s in segments: field[s[0]] = field[s[1]] = 1 if s[0] > 0: s[0] -= 1 if s[1] < len(field) - 1: s[1] += 1 if sum(field) == len(field): print(i) return i += 1 tests = int(input()) while tests: tests -= 1 n, k = map(int, input().split()) f = [0 for _ in range(n)] treaps = list(map(int, input().split())) seg = [] for c in treaps: seg.append([c - 1, c - 1]) solve(f, seg)
def solve(field, segments): i = 1 while True: for s in segments: field[s[0]] = field[s[1]] = 1 if s[0] > 0: s[0] -= 1 if s[1] < len(field)-1: s[1] += 1 if sum(field) == len(field): print(i) return i += 1 tests = int(input()) while tests: tests -= 1 n, k = map(int, input().split()) f = [0 for _ in range(n)] treaps = list(map(int, input().split())) seg = [] for c in treaps: seg.append([c - 1, c - 1]) solve(f, seg)
if s[1] < len(field)-1:
8
operation
def solve(field, segments): i = 1 while True: for s in segments: field[s[0]] = field[s[1]] = 1 if s[0] > 0: s[0] -= 1 if s[1] < len(field) - 1: s[1] += 1 if sum(field) == len(field): print(i) return i += 1 tests = int(input()) while tests: tests -= 1 n, k = map(int, input().split()) f = [0 for _ in range(n)] treaps = list(map(int, input().split())) seg = [] for c in treaps: seg.append([c - 1, c - 1]) solve(f, seg)
def solve(field, segments): i = 1 while True: for s in segments: field[s[0]] = field[s[1]] = 1 if s[0] > 0: s[0] -= 1 if s[1] < len(field) - 1: s[1] += 1 if sum(field) == len(field): print(i) return i += 1 tests = int(input()) while tests: tests -= 1 n, k = map(int, input().split()) f = [0 for _ in range(n)] treaps = list(map(int, input().split())) seg = [] for c in treaps: seg.append([c^1, c - 1]) solve(f, seg)
seg.append([c^1, c - 1])
24
operation
def solve(field, segments): i = 1 while True: for s in segments: field[s[0]] = field[s[1]] = 1 if s[0] > 0: s[0] -= 1 if s[1] < len(field) - 1: s[1] += 1 if sum(field) == len(field): print(i) return i += 1 tests = int(input()) while tests: tests -= 1 n, k = map(int, input().split()) f = [0 for _ in range(n)] treaps = list(map(int, input().split())) seg = [] for c in treaps: seg.append([c - 1, c - 1]) solve(f, seg)
def solve(field, segments): i = 1 while True: for s in segments: field[s[0]] = field[s[1]] = 1 if s[0] > 0: s[0] -= 1 if s[1] < len(field) - 1: s[1] += 1 if sum(field) == len(field): print(i) return i += 1 tests = int(input()) while tests: tests -= 148 n, k = map(int, input().split()) f = [0 for _ in range(n)] treaps = list(map(int, input().split())) seg = [] for c in treaps: seg.append([c - 1, c - 1]) solve(f, seg)
tests -= 148
18
value
n = int(input()) s = input() a = True t = 0 for i in range(n - 1): if s[i] == s[i + 1] and s[i] != '?': a = False break; if a: t = s.count('?') for i in range(1, n - 1): if s[i] == '?' and s[i - 1] != s[i + 1] and s[i - 1] != '?' and s[i + 1] != '?': t -= 1 if t > 0 and a: print("Yes") else: print("No")
n = int(input()) s = input() a = True t = 0 for i in range(n - 1): if s[i] == s[i<<1] and s[i] != '?': a = False break; if a: t = s.count('?') for i in range(1, n - 1): if s[i] == '?' and s[i - 1] != s[i + 1] and s[i - 1] != '?' and s[i + 1] != '?': t -= 1 if t > 0 and a: print("Yes") else: print("No")
if s[i] == s[i<<1] and s[i] != '?':
6
operation
n = int(input()) s = input() a = True t = 0 for i in range(n - 1): if s[i] == s[i + 1] and s[i] != '?': a = False break; if a: t = s.count('?') for i in range(1, n - 1): if s[i] == '?' and s[i - 1] != s[i + 1] and s[i - 1] != '?' and s[i + 1] != '?': t -= 1 if t > 0 and a: print("Yes") else: print("No")
n = int(input()) s = input() a = True t = 0 for i in range(n - 1): if s[i] == s[i + 1] and s[i] != '?': a = False break; if a: t = s.count('?') for i in range(1, n - 1): if s[i] == '?' and s[i - 1] != s[i + 1] and s[i - 1] != '?' and s[i + 1] != '?': y -= 1 if t > 0 and a: print("Yes") else: print("No")
y -= 1
13
statement
n = int(input()) s = input() a = True t = 0 for i in range(n - 1): if s[i] == s[i + 1] and s[i] != '?': a = False break; if a: t = s.count('?') for i in range(1, n - 1): if s[i] == '?' and s[i - 1] != s[i + 1] and s[i - 1] != '?' and s[i + 1] != '?': t -= 1 if t > 0 and a: print("Yes") else: print("No")
n = int(input()) s = input() a = True t = 0 for i in range(n - 1): if s[i]<s[i + 1] and s[i] != '?': a = False break; if a: t = s.count('?') for i in range(1, n - 1): if s[i] == '?' and s[i - 1] != s[i + 1] and s[i - 1] != '?' and s[i + 1] != '?': t -= 1 if t > 0 and a: print("Yes") else: print("No")
if s[i]<s[i + 1] and s[i] != '?':
6
decision
n = int(input()) s = input() a = True t = 0 for i in range(n - 1): if s[i] == s[i + 1] and s[i] != '?': a = False break; if a: t = s.count('?') for i in range(1, n - 1): if s[i] == '?' and s[i - 1] != s[i + 1] and s[i - 1] != '?' and s[i + 1] != '?': t -= 1 if t > 0 and a: print("Yes") else: print("No")
n = int(input()) s = input() a = True t = 0 for i in range(n - 1): if s[i]<s[i + 1] and s[i] != '?': a = False break; if a: t = s.count('?') for i in range(1, n - 1): if s[i] == '?' and s[i - 1] != s[i + 1] and s[i - 1] != '?' and s[i + 1] != '?': t -= 1 if t > 0 and a: print("Yes") else: print("No")
if s[i]<s[i + 1] and s[i] != '?':
6
decision
nl = input().lower() n = int(input()) a = [input().lower() for i in range(n)] t = False for i in range(n): a[i] = a[i].replace("0" if "o" in nl else "o", "o" if "o" in nl else "0") if ("0" in nl) or ("o" in nl) else a[i] if (nl == a[i]) or (nl.replace("i", "1") == a[i].replace("i", "1") or nl.replace("1", "i") == a[i].replace("1", "i") or nl.replace("l", "1") == a[i].replace("l", "1") or nl.replace("1", "l") == a[i].replace("1", "l")): t = t else: t = not t print("Yes" if t else "No")
nl = input().lower() n = int(input()) a = [input().lower() for i in range(n)] t = False for i in range(n): x[i] = a[i].replace("0" if "o" in nl else "o", "o" if "o" in nl else "0") if ("0" in nl) or ("o" in nl) else a[i] if (nl == a[i]) or (nl.replace("i", "1") == a[i].replace("i", "1") or nl.replace("1", "i") == a[i].replace("1", "i") or nl.replace("l", "1") == a[i].replace("l", "1") or nl.replace("1", "l") == a[i].replace("1", "l")): t = t else: t = not t print("Yes" if t else "No")
x[i] = a[i].replace("0" if "o" in nl else "o", "o" if "o" in nl else "0") if ("0" in nl) or ("o" in nl) else a[i]
6
statement
nl = input().lower() n = int(input()) a = [input().lower() for i in range(n)] t = False for i in range(n): a[i] = a[i].replace("0" if "o" in nl else "o", "o" if "o" in nl else "0") if ("0" in nl) or ("o" in nl) else a[i] if (nl == a[i]) or (nl.replace("i", "1") == a[i].replace("i", "1") or nl.replace("1", "i") == a[i].replace("1", "i") or nl.replace("l", "1") == a[i].replace("l", "1") or nl.replace("1", "l") == a[i].replace("1", "l")): t = t else: t = not t print("Yes" if t else "No")
nl = input().lower() n = int(input()) a = [input().lower() for i in range(n)] t = False for i in range(n): a[i] = a[i].replace("0" if "o" in nl else "o", "o" if "o" in nl else "0") if ("0" in nl) or ("o" in nl) else a[i] if (nl<a[i]) or (nl.replace("i", "1") == a[i].replace("i", "1") or nl.replace("1", "i") == a[i].replace("1", "i") or nl.replace("l", "1") == a[i].replace("l", "1") or nl.replace("1", "l") == a[i].replace("1", "l")): t = t else: t = not t print("Yes" if t else "No")
if (nl<a[i]) or (nl.replace("i", "1") == a[i].replace("i", "1") or nl.replace("1", "i") == a[i].replace("1", "i") or nl.replace("l", "1") == a[i].replace("l", "1") or nl.replace("1", "l") == a[i].replace("1", "l")):
7
decision
nl = input().lower() n = int(input()) a = [input().lower() for i in range(n)] t = False for i in range(n): a[i] = a[i].replace("0" if "o" in nl else "o", "o" if "o" in nl else "0") if ("0" in nl) or ("o" in nl) else a[i] if (nl == a[i]) or (nl.replace("i", "1") == a[i].replace("i", "1") or nl.replace("1", "i") == a[i].replace("1", "i") or nl.replace("l", "1") == a[i].replace("l", "1") or nl.replace("1", "l") == a[i].replace("1", "l")): t = t else: t = not t print("Yes" if t else "No")
nl = input().lower() n = int(input()) a = [input().lower() for i in range(n)] t = False for i in range(n): a[i] = a[i].replace("0" if "o" in nl else "o", "o" if "o" in nl else "0") if ("0" in nl) or ("o" in nl) else a[i] if (nl == a[i]) or (nl.replace("i", "1") == a[i].replace("i", "1") or nl.replace("1", "i") == a[i].replace("1", "i") or nl.replace("l", "1") == a[i].y("l", "1") or nl.replace("1", "l") == a[i].replace("1", "l")): t = t else: t = not t print("Yes" if t else "No")
if (nl == a[i]) or (nl.replace("i", "1") == a[i].replace("i", "1") or nl.replace("1", "i") == a[i].replace("1", "i") or nl.replace("l", "1") == a[i].y("l", "1") or nl.replace("1", "l") == a[i].replace("1", "l")):
7
statement
n = int(input()) s = input().split() if n==1: res = 'Conan' else: k = n-2 t = s[n-1] st = True count = 1 res = 'Agasa' while(st and k>=-1): if k==-1: if count%2==1: res = 'Conan' else: res = 'Agasa' break if s[k]!=t: if count%2==1: res = 'Conan' st = False else: t = s[k] count = 1 else: count+=1 k-=1 print(res)
n = int(input()) s = input().split() if n==1: res = 'Conan' else: k = n-2 t = s[n-1] st = True count = 1 res = 'Agasa' while(st and k>=-1): if k==-1: if count^2==1: res = 'Conan' else: res = 'Agasa' break if s[k]!=t: if count%2==1: res = 'Conan' st = False else: t = s[k] count = 1 else: count+=1 k-=1 print(res)
if count^2==1:
13
operation
n = int(input()) s = input().split() if n==1: res = 'Conan' else: k = n-2 t = s[n-1] st = True count = 1 res = 'Agasa' while(st and k>=-1): if k==-1: if count%2==1: res = 'Conan' else: res = 'Agasa' break if s[k]!=t: if count%2==1: res = 'Conan' st = False else: t = s[k] count = 1 else: count+=1 k-=1 print(res)
n = int(input()) s = input().split() if n==1: res = 'Conan' else: k = n-2 t = s[n-1] z = True count = 1 res = 'Agasa' while(st and k>=-1): if k==-1: if count%2==1: res = 'Conan' else: res = 'Agasa' break if s[k]!=t: if count%2==1: res = 'Conan' st = False else: t = s[k] count = 1 else: count+=1 k-=1 print(res)
z = True
8
statement
n = int(input()) s = input().split() if n==1: res = 'Conan' else: k = n-2 t = s[n-1] st = True count = 1 res = 'Agasa' while(st and k>=-1): if k==-1: if count%2==1: res = 'Conan' else: res = 'Agasa' break if s[k]!=t: if count%2==1: res = 'Conan' st = False else: t = s[k] count = 1 else: count+=1 k-=1 print(res)
n = int(input()) s = input().split() if n==1: res = 'Conan' else: k = n-2 t = s[n-1] st = True count = 1 res = 'Agasa' while(st and k>=-1): if k==-1: if count%2<1: res = 'Conan' else: res = 'Agasa' break if s[k]!=t: if count%2==1: res = 'Conan' st = False else: t = s[k] count = 1 else: count+=1 k-=1 print(res)
if count%2<1:
13
decision
n = int(input()) s = input().split() if n==1: res = 'Conan' else: k = n-2 t = s[n-1] st = True count = 1 res = 'Agasa' while(st and k>=-1): if k==-1: if count%2==1: res = 'Conan' else: res = 'Agasa' break if s[k]!=t: if count%2==1: res = 'Conan' st = False else: t = s[k] count = 1 else: count+=1 k-=1 print(res)
n = int(input()) s = input().split() if n==1: res = 'Conan' else: k = n-2 t = s[n-1] st = True count = 1 res = 'Agasa' while(st and k>=-122): if k==-1: if count%2==1: res = 'Conan' else: res = 'Agasa' break if s[k]!=t: if count%2==1: res = 'Conan' st = False else: t = s[k] count = 1 else: count+=1 k-=1 print(res)
while(st and k>=-122):
11
value
import math result=[] for i in range(60): result.append(2**i) n,k=map(int,input().split()) sequence=[] for number in reversed(result): if number<=n: sequence.append(number) n-=number if n==0: break if len(sequence)>k: print("No") elif len(sequence)==k: print("Yes") for number in sequence: print(int(math.log(number,2)),end=" ") else: while len(sequence)!=k: sequence[0]/=2 newnum=sequence[0] sequence.append(newnum) sequence.sort(reverse=1) print("Yes") for number in sequence: print(int(math.log(number,2)),end=" ")
import math result=[] for i in range(60): result.append(2**i) n,k=map(int,input().split()) sequence=[] for number in reversed(result): if number>=n: sequence.append(number) n-=number if n==0: break if len(sequence)>k: print("No") elif len(sequence)==k: print("Yes") for number in sequence: print(int(math.log(number,2)),end=" ") else: while len(sequence)!=k: sequence[0]/=2 newnum=sequence[0] sequence.append(newnum) sequence.sort(reverse=1) print("Yes") for number in sequence: print(int(math.log(number,2)),end=" ")
if number>=n:
9
decision
import math result=[] for i in range(60): result.append(2**i) n,k=map(int,input().split()) sequence=[] for number in reversed(result): if number<=n: sequence.append(number) n-=number if n==0: break if len(sequence)>k: print("No") elif len(sequence)==k: print("Yes") for number in sequence: print(int(math.log(number,2)),end=" ") else: while len(sequence)!=k: sequence[0]/=2 newnum=sequence[0] sequence.append(newnum) sequence.sort(reverse=1) print("Yes") for number in sequence: print(int(math.log(number,2)),end=" ")
import math result=[] for i in range(60): result.append(2**i) n,k=map(int,input().split()) sequence=[] for number in reversed(result): if number<=n: sequence.append(number) n-=number if n==0: break if len(sequence)==k: print("No") elif len(sequence)==k: print("Yes") for number in sequence: print(int(math.log(number,2)),end=" ") else: while len(sequence)!=k: sequence[0]/=2 newnum=sequence[0] sequence.append(newnum) sequence.sort(reverse=1) print("Yes") for number in sequence: print(int(math.log(number,2)),end=" ")
if len(sequence)==k:
14
decision
import math result=[] for i in range(60): result.append(2**i) n,k=map(int,input().split()) sequence=[] for number in reversed(result): if number<=n: sequence.append(number) n-=number if n==0: break if len(sequence)>k: print("No") elif len(sequence)==k: print("Yes") for number in sequence: print(int(math.log(number,2)),end=" ") else: while len(sequence)!=k: sequence[0]/=2 newnum=sequence[0] sequence.append(newnum) sequence.sort(reverse=1) print("Yes") for number in sequence: print(int(math.log(number,2)),end=" ")
import math result=[] for i in range(60): result.append(2&i) n,k=map(int,input().split()) sequence=[] for number in reversed(result): if number<=n: sequence.append(number) n-=number if n==0: break if len(sequence)>k: print("No") elif len(sequence)==k: print("Yes") for number in sequence: print(int(math.log(number,2)),end=" ") else: while len(sequence)!=k: sequence[0]/=2 newnum=sequence[0] sequence.append(newnum) sequence.sort(reverse=1) print("Yes") for number in sequence: print(int(math.log(number,2)),end=" ")
result.append(2&i)
4
operation
import math result=[] for i in range(60): result.append(2**i) n,k=map(int,input().split()) sequence=[] for number in reversed(result): if number<=n: sequence.append(number) n-=number if n==0: break if len(sequence)>k: print("No") elif len(sequence)==k: print("Yes") for number in sequence: print(int(math.log(number,2)),end=" ") else: while len(sequence)!=k: sequence[0]/=2 newnum=sequence[0] sequence.append(newnum) sequence.sort(reverse=1) print("Yes") for number in sequence: print(int(math.log(number,2)),end=" ")
import math result=[] for i in range(60): result.append(2**i) n,k=map(int,input().split()) sequence=[] for number in reversed(result): if number<=n: sequence.append(number) n-=number if n<0: break if len(sequence)>k: print("No") elif len(sequence)==k: print("Yes") for number in sequence: print(int(math.log(number,2)),end=" ") else: while len(sequence)!=k: sequence[0]/=2 newnum=sequence[0] sequence.append(newnum) sequence.sort(reverse=1) print("Yes") for number in sequence: print(int(math.log(number,2)),end=" ")
if n<0:
12
decision
import math result=[] for i in range(60): result.append(2**i) n,k=map(int,input().split()) sequence=[] for number in reversed(result): if number<=n: sequence.append(number) n-=number if n==0: break if len(sequence)>k: print("No") elif len(sequence)==k: print("Yes") for number in sequence: print(int(math.log(number,2)),end=" ") else: while len(sequence)!=k: sequence[0]/=2 newnum=sequence[0] sequence.append(newnum) sequence.sort(reverse=1) print("Yes") for number in sequence: print(int(math.log(number,2)),end=" ")
import math result=[] for i in range(60): result.append(2**i) n,k=map(int,input().split()) sequence=[] for number in reversed(result): if number<=n: sequence.append(number) n-=number if n==0: break if len(sequence)>k: print("No") elif len(sequence)==k: print("Yes") for number in sequence: print(int(math.log(number,2)),z=" ") else: while len(sequence)!=k: sequence[0]/=2 newnum=sequence[0] sequence.append(newnum) sequence.sort(reverse=1) print("Yes") for number in sequence: print(int(math.log(number,2)),end=" ")
print(int(math.log(number,2)),z=" ")
19
statement
n,pos,l,r=map(int,input().split()) ans=0 c1=0 c2=0 if l>1: c1=1 if r<n: c2=1 if c1 and c2: if pos<=r and pos>=l: ans=min(pos-l+r-l,r-pos+r-l)+c1+c2 elif pos==l: ans=l-pos+c1+r-l+c2 else: ans=pos-r+c2+r-l+c2 elif c1==0 and c2==1: ans=abs(r-pos)+c1+c2 elif c2==0 and c1==1: ans=abs(pos-l)+c1+c2 else: ans=0 print(ans)
n,pos,l,r=map(int,input().split()) ans=0 c1=0 c2=0 if l==1: c1=1 if r<n: c2=1 if c1 and c2: if pos<=r and pos>=l: ans=min(pos-l+r-l,r-pos+r-l)+c1+c2 elif pos==l: ans=l-pos+c1+r-l+c2 else: ans=pos-r+c2+r-l+c2 elif c1==0 and c2==1: ans=abs(r-pos)+c1+c2 elif c2==0 and c1==1: ans=abs(pos-l)+c1+c2 else: ans=0 print(ans)
if l==1:
5
decision
n,pos,l,r=map(int,input().split()) ans=0 c1=0 c2=0 if l>1: c1=1 if r<n: c2=1 if c1 and c2: if pos<=r and pos>=l: ans=min(pos-l+r-l,r-pos+r-l)+c1+c2 elif pos==l: ans=l-pos+c1+r-l+c2 else: ans=pos-r+c2+r-l+c2 elif c1==0 and c2==1: ans=abs(r-pos)+c1+c2 elif c2==0 and c1==1: ans=abs(pos-l)+c1+c2 else: ans=0 print(ans)
n,pos,l,r=map(int,input().split()) ans=0 c1=0 c2=0 if l>1: c1=1 if r<n: c2=1 if c1 and c2: if pos<=r and pos>=l: ans=min(pos-l+r-l,r-pos+r-l)+c1+c2 elif pos==l: ans=l-pos+c1+r-l+c2 else: ans=pos-r+c2+r-l+c2 elif c1<0 and c2==1: ans=abs(r-pos)+c1+c2 elif c2==0 and c1==1: ans=abs(pos-l)+c1+c2 else: ans=0 print(ans)
elif c1<0 and c2==1:
16
decision
n,pos,l,r=map(int,input().split()) ans=0 c1=0 c2=0 if l>1: c1=1 if r<n: c2=1 if c1 and c2: if pos<=r and pos>=l: ans=min(pos-l+r-l,r-pos+r-l)+c1+c2 elif pos==l: ans=l-pos+c1+r-l+c2 else: ans=pos-r+c2+r-l+c2 elif c1==0 and c2==1: ans=abs(r-pos)+c1+c2 elif c2==0 and c1==1: ans=abs(pos-l)+c1+c2 else: ans=0 print(ans)
n,pos,l,r=map(int,input().split()) ans=0 c1=0 c2=0 if l>1: c1=1 if r<n: c2=1 if c1 and c2: if pos<=r and pos>=l: ans=min(pos-l+r-l,r-pos+r-l)>>c1+c2 elif pos==l: ans=l-pos+c1+r-l+c2 else: ans=pos-r+c2+r-l+c2 elif c1==0 and c2==1: ans=abs(r-pos)+c1+c2 elif c2==0 and c1==1: ans=abs(pos-l)+c1+c2 else: ans=0 print(ans)
ans=min(pos-l+r-l,r-pos+r-l)>>c1+c2
11
operation
n,pos,l,r=map(int,input().split()) ans=0 c1=0 c2=0 if l>1: c1=1 if r<n: c2=1 if c1 and c2: if pos<=r and pos>=l: ans=min(pos-l+r-l,r-pos+r-l)+c1+c2 elif pos==l: ans=l-pos+c1+r-l+c2 else: ans=pos-r+c2+r-l+c2 elif c1==0 and c2==1: ans=abs(r-pos)+c1+c2 elif c2==0 and c1==1: ans=abs(pos-l)+c1+c2 else: ans=0 print(ans)
n,pos,l,r=map(int,input().split()) ans=0 c1=0 c2=0 if l>1: c1=1 if r<n: c2=1 if c1 and c2: if pos<=r and pos>=l: ans=min(pos-l+r-l,r-pos+r|l)+c1+c2 elif pos==l: ans=l-pos+c1+r-l+c2 else: ans=pos-r+c2+r-l+c2 elif c1==0 and c2==1: ans=abs(r-pos)+c1+c2 elif c2==0 and c1==1: ans=abs(pos-l)+c1+c2 else: ans=0 print(ans)
ans=min(pos-l+r-l,r-pos+r|l)+c1+c2
11
operation
n,pos,l,r=map(int,input().split()) ans=0 c1=0 c2=0 if l>1: c1=1 if r<n: c2=1 if c1 and c2: if pos<=r and pos>=l: ans=min(pos-l+r-l,r-pos+r-l)+c1+c2 elif pos==l: ans=l-pos+c1+r-l+c2 else: ans=pos-r+c2+r-l+c2 elif c1==0 and c2==1: ans=abs(r-pos)+c1+c2 elif c2==0 and c1==1: ans=abs(pos-l)+c1+c2 else: ans=0 print(ans)
n,pos,l,r=map(int,input().split()) ans=0 c1=0 c2=0 if l>1: c1=1 if r<n: c2=1 if c1 and c2: if pos<=r and pos>=l: ans=min(pos-l+r-l,r-pos+r-l)+c1+c2 elif pos==l: ans=l-pos+c1+r-l+c2 else: ans=pos-r+c2+r-l+c2 elif c1==0 and c2==1: ans=abs(r-pos)+c1+c2 elif c2==124 and c1==1: ans=abs(pos-l)+c1+c2 else: ans=0 print(ans)
elif c2==124 and c1==1:
18
value
d = {'a', 'e', 'i', 'o', 'u', 'y'} n = int(input()) s = list(input()) found = -1 while 1: found = -1 for i in range(len(s) - 1): if s[i] in d and s[i + 1] in d: found = i break if (found == -1): break s.pop(found) print(*s, sep="")
d = {'a', 'e', 'i', 'o', 'u', 'y'} n = int(input()) s = list(input()) found = -1 while 1: found = -1 for i in range(len(s) - 117): if s[i] in d and s[i + 1] in d: found = i break if (found == -1): break s.pop(found) print(*s, sep="")
for i in range(len(s) - 117):
9
value