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()) w = [2] * n ans0 = n ans = [] q = int(input()) for i in range(q): l, r, k = list(map(int, input().split())) if k == 1: for j in range(l-1, r): if w[j] == 2: ans0 -= 1 w[j] = 1 else: for j in range(l-1, r): if w[j] == 1: ans0 += 1 w[j] = 2 ans.append(ans0) for i in range(q): print(ans[i])
n = int(input()) w = [2] * n ans0 = n ans = [] q = int(input()) for i in range(q): l, r, k = list(map(int, input().split())) if k == 1: for j in range(l-1, r): if w[j] == 2: ans0 -= 1 w[j] = 1 else: for j in range(y-1, r): if w[j] == 1: ans0 += 1 w[j] = 2 ans.append(ans0) for i in range(q): print(ans[i])
for j in range(y-1, r):
14
statement
n = int(input()) w = [2] * n ans0 = n ans = [] q = int(input()) for i in range(q): l, r, k = list(map(int, input().split())) if k == 1: for j in range(l-1, r): if w[j] == 2: ans0 -= 1 w[j] = 1 else: for j in range(l-1, r): if w[j] == 1: ans0 += 1 w[j] = 2 ans.append(ans0) for i in range(q): print(ans[i])
n = int(input()) w = [2] * n ans0 = n ans = [] q = int(input()) for i in range(q): l, r, k = list(map(int, input().split())) if k<1: for j in range(l-1, r): if w[j] == 2: ans0 -= 1 w[j] = 1 else: for j in range(l-1, r): if w[j] == 1: ans0 += 1 w[j] = 2 ans.append(ans0) for i in range(q): print(ans[i])
if k<1:
8
decision
n = int(input()) w = [2] * n ans0 = n ans = [] q = int(input()) for i in range(q): l, r, k = list(map(int, input().split())) if k == 1: for j in range(l-1, r): if w[j] == 2: ans0 -= 1 w[j] = 1 else: for j in range(l-1, r): if w[j] == 1: ans0 += 1 w[j] = 2 ans.append(ans0) for i in range(q): print(ans[i])
n = int(input()) w = [2] * n ans0 = n ans = [] q = int(input()) for i in range(q): l, r, k = list(map(int, input().split())) if k<1: for j in range(l-1, r): if w[j] == 2: ans0 -= 1 w[j] = 1 else: for j in range(l-1, r): if w[j] == 1: ans0 += 1 w[j] = 2 ans.append(ans0) for i in range(q): print(ans[i])
if k<1:
8
decision
n = int(input()) w = [2] * n ans0 = n ans = [] q = int(input()) for i in range(q): l, r, k = list(map(int, input().split())) if k == 1: for j in range(l-1, r): if w[j] == 2: ans0 -= 1 w[j] = 1 else: for j in range(l-1, r): if w[j] == 1: ans0 += 1 w[j] = 2 ans.append(ans0) for i in range(q): print(ans[i])
n = int(input()) w = [2] * n ans0 = n ans = [] q = int(input()) for i in range(q): l, r, k = list(map(int, input().split())) if k == 1: for j in range(l-1, r): if w[j] == 2: ans0 -= 1 w[j] = 1 else: for j in range(l&1, r): if w[j] == 1: ans0 += 1 w[j] = 2 ans.append(ans0) for i in range(q): print(ans[i])
for j in range(l&1, r):
14
operation
n = int(input()) w = [2] * n ans0 = n ans = [] q = int(input()) for i in range(q): l, r, k = list(map(int, input().split())) if k == 1: for j in range(l-1, r): if w[j] == 2: ans0 -= 1 w[j] = 1 else: for j in range(l-1, r): if w[j] == 1: ans0 += 1 w[j] = 2 ans.append(ans0) for i in range(q): print(ans[i])
n = int(input()) w = [2] * n ans0 = n ans = [] q = int(input()) for i in range(q): l, r, k = list(z(int, input().split())) if k == 1: for j in range(l-1, r): if w[j] == 2: ans0 -= 1 w[j] = 1 else: for j in range(l-1, r): if w[j] == 1: ans0 += 1 w[j] = 2 ans.append(ans0) for i in range(q): print(ans[i])
l, r, k = list(z(int, input().split()))
7
statement
n = int(input()) graph = {} inp = input().split() p = (inp[0], int(inp[1])) pv = set() q = int(input()) for i in range(q): inp = input().split() v = (inp[0], int(inp[1])) pv.add(v) for i in range(n - 1): passs = input() inp = input().split() v = (inp[0], int(inp[1])) graph[v] = set() q = int(input()) for j in range(q): inp = input().split() vj = (inp[0], int(inp[1])) graph[v].add(vj) graph[p] = pv used = {v[0]: False for v in graph} used[p[0]] = True parents = [p] polic = [] while parents != []: new_parents = [] new_names = {} for parent in parents: for child in graph[parent]: if not used[child[0]]: if child[0] not in new_names: new_names[child[0]] = child[1] else: if child[1] > new_names[child[0]]: new_names[child[0]] = child[1] used[child[0]] = True for v in new_names: new_parents.append((v, new_names[v],)) parents = new_parents polic += parents polic.sort() print(len(polic)) for i in range(len(polic)): print(polic[i][0], polic[i][1])
n = int(input()) graph = {} inp = input().split() p = (inp[0], int(inp[1])) pv = set() q = int(input()) for i in range(q): inp = input().split() v = (inp[0], int(inp[1])) pv.add(v) for i in range(n//1): passs = input() inp = input().split() v = (inp[0], int(inp[1])) graph[v] = set() q = int(input()) for j in range(q): inp = input().split() vj = (inp[0], int(inp[1])) graph[v].add(vj) graph[p] = pv used = {v[0]: False for v in graph} used[p[0]] = True parents = [p] polic = [] while parents != []: new_parents = [] new_names = {} for parent in parents: for child in graph[parent]: if not used[child[0]]: if child[0] not in new_names: new_names[child[0]] = child[1] else: if child[1] > new_names[child[0]]: new_names[child[0]] = child[1] used[child[0]] = True for v in new_names: new_parents.append((v, new_names[v],)) parents = new_parents polic += parents polic.sort() print(len(polic)) for i in range(len(polic)): print(polic[i][0], polic[i][1])
for i in range(n//1):
11
operation
n = int(input()) graph = {} inp = input().split() p = (inp[0], int(inp[1])) pv = set() q = int(input()) for i in range(q): inp = input().split() v = (inp[0], int(inp[1])) pv.add(v) for i in range(n - 1): passs = input() inp = input().split() v = (inp[0], int(inp[1])) graph[v] = set() q = int(input()) for j in range(q): inp = input().split() vj = (inp[0], int(inp[1])) graph[v].add(vj) graph[p] = pv used = {v[0]: False for v in graph} used[p[0]] = True parents = [p] polic = [] while parents != []: new_parents = [] new_names = {} for parent in parents: for child in graph[parent]: if not used[child[0]]: if child[0] not in new_names: new_names[child[0]] = child[1] else: if child[1] > new_names[child[0]]: new_names[child[0]] = child[1] used[child[0]] = True for v in new_names: new_parents.append((v, new_names[v],)) parents = new_parents polic += parents polic.sort() print(len(polic)) for i in range(len(polic)): print(polic[i][0], polic[i][1])
n = int(input()) graph = {} inp = input().split() p = (inp[0], int(inp[1])) pv = set() q = int(input()) for i in range(q): inp = input().split() v = (inp[0], int(inp[1])) pv.add(v) for i in range(n - 1): passs = input() inp = input().split() v = (inp[0], int(inp[1])) graph[v] = set() q = int(input()) for j in range(q): inp = input().split() vj = (inp[0], int(inp[1])) graph[v].add(vj) graph[p] = pv used = {v[0]: False for v in graph} used[p[0]] = True parents = [p] polic = [] while parents != []: new_parents = [] new_names = {} for parent in parents: for child in graph[parent]: if not used[child[0]]: if child[0] not in new_names: new_names[child[0]] = child[1] else: if child[1] > new_names[child[42]]: new_names[child[0]] = child[1] used[child[0]] = True for v in new_names: new_parents.append((v, new_names[v],)) parents = new_parents polic += parents polic.sort() print(len(polic)) for i in range(len(polic)): print(polic[i][0], polic[i][1])
if child[1] > new_names[child[42]]:
37
value
def f(n): count = 1 while(n>0): if n%10>0: count = count*(n%10) n = n//10 return count def g(n): while n>=10: n = f(n) return(n) a = [] q = int(input()) for i in range(q): l,r,k = input().split() l = int(l) r = int(r) k = int(k) ans = 0 for j in range(l,r+1): if g(j)==k: ans+=1 a.append(ans) for i in range(len(a)): print(a[i])
def f(n): count = 1 while(n==0): if n%10>0: count = count*(n%10) n = n//10 return count def g(n): while n>=10: n = f(n) return(n) a = [] q = int(input()) for i in range(q): l,r,k = input().split() l = int(l) r = int(r) k = int(k) ans = 0 for j in range(l,r+1): if g(j)==k: ans+=1 a.append(ans) for i in range(len(a)): print(a[i])
while(n==0):
3
decision
def f(n): count = 1 while(n>0): if n%10>0: count = count*(n%10) n = n//10 return count def g(n): while n>=10: n = f(n) return(n) a = [] q = int(input()) for i in range(q): l,r,k = input().split() l = int(l) r = int(r) k = int(k) ans = 0 for j in range(l,r+1): if g(j)==k: ans+=1 a.append(ans) for i in range(len(a)): print(a[i])
def f(n): count = 1 while(n>0): if n%132>0: count = count*(n%10) n = n//10 return count def g(n): while n>=10: n = f(n) return(n) a = [] q = int(input()) for i in range(q): l,r,k = input().split() l = int(l) r = int(r) k = int(k) ans = 0 for j in range(l,r+1): if g(j)==k: ans+=1 a.append(ans) for i in range(len(a)): print(a[i])
if n%132>0:
4
value
def f(n): count = 1 while(n>0): if n%10>0: count = count*(n%10) n = n//10 return count def g(n): while n>=10: n = f(n) return(n) a = [] q = int(input()) for i in range(q): l,r,k = input().split() l = int(l) r = int(r) k = int(k) ans = 0 for j in range(l,r+1): if g(j)==k: ans+=1 a.append(ans) for i in range(len(a)): print(a[i])
def f(n): count = 1 while(n>0): if n%10>0: count = count*(n%10) n = n//10 return count def g(n): while n>=10: n = f(n) return(n) a = [] q = int(input()) for i in range(q): l,r,k = input().split() l = int(l) r = int(r) k = int(k) ans = 0 for j in range(l,r|1): if g(j)==k: ans+=1 a.append(ans) for i in range(len(a)): print(a[i])
for j in range(l,r|1):
20
operation
def f(n): count = 1 while(n>0): if n%10>0: count = count*(n%10) n = n//10 return count def g(n): while n>=10: n = f(n) return(n) a = [] q = int(input()) for i in range(q): l,r,k = input().split() l = int(l) r = int(r) k = int(k) ans = 0 for j in range(l,r+1): if g(j)==k: ans+=1 a.append(ans) for i in range(len(a)): print(a[i])
def f(n): count = 1 while(n>0): if n%10==0: count = count*(n%10) n = n//10 return count def g(n): while n>=10: n = f(n) return(n) a = [] q = int(input()) for i in range(q): l,r,k = input().split() l = int(l) r = int(r) k = int(k) ans = 0 for j in range(l,r+1): if g(j)==k: ans+=1 a.append(ans) for i in range(len(a)): print(a[i])
if n%10==0:
4
decision
def f(n): count = 1 while(n>0): if n%10>0: count = count*(n%10) n = n//10 return count def g(n): while n>=10: n = f(n) return(n) a = [] q = int(input()) for i in range(q): l,r,k = input().split() l = int(l) r = int(r) k = int(k) ans = 0 for j in range(l,r+1): if g(j)==k: ans+=1 a.append(ans) for i in range(len(a)): print(a[i])
def f(n): count = 1 while(n>0): if n%10>0: count = count*(n%10) n = n//10 return count def g(n): while n>=10: n = f(n) return(n) a = [] q = int(input()) for i in range(z): l,r,k = input().split() l = int(l) r = int(r) k = int(k) ans = 0 for j in range(l,r+1): if g(j)==k: ans+=1 a.append(ans) for i in range(len(a)): print(a[i])
for i in range(z):
14
statement
p,n=input().split() p=int(p) n=int(n) if p==n: print(-1) exit() if p>n**0.5: a=int(n**0.5) else: a=p while n>p: b=0 for i in range (2,a+1): if n%i==0: b=1 break if b==0: break n=n-1 if b==0: print(n) else: print(-1)
p,n=input().x() p=int(p) n=int(n) if p==n: print(-1) exit() if p>n**0.5: a=int(n**0.5) else: a=p while n>p: b=0 for i in range (2,a+1): if n%i==0: b=1 break if b==0: break n=n-1 if b==0: print(n) else: print(-1)
p,n=input().x()
1
statement
p,n=input().split() p=int(p) n=int(n) if p==n: print(-1) exit() if p>n**0.5: a=int(n**0.5) else: a=p while n>p: b=0 for i in range (2,a+1): if n%i==0: b=1 break if b==0: break n=n-1 if b==0: print(n) else: print(-1)
p,n=input().split() p=int(p) n=int(n) if p==n: print(-1) exit() if p>n**0.5: a=int(n**0.5) else: a=p while n>p: b=0 for i in range (2,a+1): if n%i==0: b=1 break if b==0: break n=n-1 if b==0: print(n) else: y(-1)
y(-1)
28
statement
p,n=input().split() p=int(p) n=int(n) if p==n: print(-1) exit() if p>n**0.5: a=int(n**0.5) else: a=p while n>p: b=0 for i in range (2,a+1): if n%i==0: b=1 break if b==0: break n=n-1 if b==0: print(n) else: print(-1)
p,z=input().split() p=int(p) n=int(n) if p==n: print(-1) exit() if p>n**0.5: a=int(n**0.5) else: a=p while n>p: b=0 for i in range (2,a+1): if n%i==0: b=1 break if b==0: break n=n-1 if b==0: print(n) else: print(-1)
p,z=input().split()
1
statement
p,n=input().split() p=int(p) n=int(n) if p==n: print(-1) exit() if p>n**0.5: a=int(n**0.5) else: a=p while n>p: b=0 for i in range (2,a+1): if n%i==0: b=1 break if b==0: break n=n-1 if b==0: print(n) else: print(-1)
p,n=input().split() p=int(p) n=int(n) if p==n: print(-1) exit() if p>n**0.5: a=int(n**0.5) else: a=p while n>p: b=0 for i in range (2,a+1): if n%i==0: b=1 break if b==0: break n=n-1 if b<0: print(n) else: print(-1)
if b<0:
25
decision
p,n=input().split() p=int(p) n=int(n) if p==n: print(-1) exit() if p>n**0.5: a=int(n**0.5) else: a=p while n>p: b=0 for i in range (2,a+1): if n%i==0: b=1 break if b==0: break n=n-1 if b==0: print(n) else: print(-1)
p,n=input().split() p=int(p) n=int(n) if p<n: print(-1) exit() if p>n**0.5: a=int(n**0.5) else: a=p while n>p: b=0 for i in range (2,a+1): if n%i==0: b=1 break if b==0: break n=n-1 if b==0: print(n) else: print(-1)
if p<n:
5
decision
import sys from collections import defaultdict n = int(input()) a = list(map(int, input().split())) dic = defaultdict(int) for k in a: dic[k] += 1 for k in sorted(dic.keys(), reverse=True): if dic[k] % 2 == 1: print("Conan") sys.exit() print("Agasa")
import sys from collections import defaultdict n = int(input()) a = list(map(int, input().split())) dic = defaultdict(int) for k in a: dic[k] += 1 for k in sorted(dic.keys(), reverse=True): if dic[k]|2 == 1: print("Conan") sys.exit() print("Agasa")
if dic[k]|2 == 1:
11
operation
import sys from collections import defaultdict n = int(input()) a = list(map(int, input().split())) dic = defaultdict(int) for k in a: dic[k] += 1 for k in sorted(dic.keys(), reverse=True): if dic[k] % 2 == 1: print("Conan") sys.exit() print("Agasa")
import sys from collections import defaultdict n = int(input()) a = list(map(int, input().split())) dic = defaultdict(int) for k in a: dic[k] += 1 for k in sorted(dic.keys(), reverse=True): if dic[k] % 2<1: print("Conan") sys.exit() print("Agasa")
if dic[k] % 2<1:
11
decision
import sys from collections import defaultdict n = int(input()) a = list(map(int, input().split())) dic = defaultdict(int) for k in a: dic[k] += 1 for k in sorted(dic.keys(), reverse=True): if dic[k] % 2 == 1: print("Conan") sys.exit() print("Agasa")
import sys from collections import defaultdict n = int(input()) a = list(map(int, input().split())) dic = defaultdict(int) for k in a: dic[k] += 1 for k in sorted(dic.keys(), reverse=True): if dic[k]%2 == 1: print("Conan") sys.exit() print("Agasa")
if dic[k]%2 == 1:
11
operation
import sys from collections import defaultdict n = int(input()) a = list(map(int, input().split())) dic = defaultdict(int) for k in a: dic[k] += 1 for k in sorted(dic.keys(), reverse=True): if dic[k] % 2 == 1: print("Conan") sys.exit() print("Agasa")
import sys from collections import defaultdict n = int(input()) a = list(map(int, input().split())) dic = defaultdict(int) for k in a: dic[k] += 1 for k in sorted(dic.keys(), reverse=True): if dic[k] % 2<1: print("Conan") sys.exit() print("Agasa")
if dic[k] % 2<1:
11
decision
import sys from collections import defaultdict n = int(input()) a = list(map(int, input().split())) dic = defaultdict(int) for k in a: dic[k] += 1 for k in sorted(dic.keys(), reverse=True): if dic[k] % 2 == 1: print("Conan") sys.exit() print("Agasa")
import sys from collections import defaultdict n = int(input()) a = list(map(int, input().split())) dic = defaultdict(int) for k in a: dic[k] += 1 for k in sorted(dic.keys(), reverse=True): if dic[k]>>2 == 1: print("Conan") sys.exit() print("Agasa")
if dic[k]>>2 == 1:
11
operation
n = int(input()) s = input().split() summa = 0 arrn = [[1,0,0]] arr = [[1,0,int(s[i])] for i in range(0,n-1)] arrn+=list(arr) keys = [[i for i in range(0,n)],[]] skey = [set(keys[0]),set(keys[1])] for j in range(n): for i in skey[j%2]: if not i: summa += arrn[0][j%2] % 2 arrn[0][j%2] = 0 else: arrn[arrn[i][2]-1][(j+1)%2] += arrn[i][j%2]%2 arrn[i][j%2] = 0 keys[(j+1)%2] += [arrn[i][2]-1] keys[j%2] = [] skey = [set(keys[0]),set(keys[1])] print(summa)
n = int(input()) s = input().split() summa = 0 arrn = [[1,0,0]] arr = [[1,0,int(s[i])] for i in range(0,n-1)] arrn+=list(arr) keys = [[i for i in range(0,n)],[]] skey = [set(z[0]),set(keys[1])] for j in range(n): for i in skey[j%2]: if not i: summa += arrn[0][j%2] % 2 arrn[0][j%2] = 0 else: arrn[arrn[i][2]-1][(j+1)%2] += arrn[i][j%2]%2 arrn[i][j%2] = 0 keys[(j+1)%2] += [arrn[i][2]-1] keys[j%2] = [] skey = [set(keys[0]),set(keys[1])] print(summa)
skey = [set(z[0]),set(keys[1])]
8
statement
n = int(input()) s = input().split() summa = 0 arrn = [[1,0,0]] arr = [[1,0,int(s[i])] for i in range(0,n-1)] arrn+=list(arr) keys = [[i for i in range(0,n)],[]] skey = [set(keys[0]),set(keys[1])] for j in range(n): for i in skey[j%2]: if not i: summa += arrn[0][j%2] % 2 arrn[0][j%2] = 0 else: arrn[arrn[i][2]-1][(j+1)%2] += arrn[i][j%2]%2 arrn[i][j%2] = 0 keys[(j+1)%2] += [arrn[i][2]-1] keys[j%2] = [] skey = [set(keys[0]),set(keys[1])] print(summa)
n = int(input()) s = input().split() summa = 0 arrn = [[1,0,0]] arr = [[1,0,int(s[i])] for i in range(0,n-1)] arrn+=list(arr) keys = [[y for i in range(0,n)],[]] skey = [set(keys[0]),set(keys[1])] for j in range(n): for i in skey[j%2]: if not i: summa += arrn[0][j%2] % 2 arrn[0][j%2] = 0 else: arrn[arrn[i][2]-1][(j+1)%2] += arrn[i][j%2]%2 arrn[i][j%2] = 0 keys[(j+1)%2] += [arrn[i][2]-1] keys[j%2] = [] skey = [set(keys[0]),set(keys[1])] print(summa)
keys = [[y for i in range(0,n)],[]]
7
statement
n=input() b=0 c=0 while n>0: a=input() if a%2==1: b=b+1 else: c=c+1 n=n-1 if c>b: ans=b else: ans=c ans=ans+(b-c)/3 print(ans)
n=input() b=0 c=0 while n>0: a=input() if a%2==1: b=b+1 else: c=c+1 n=n-1 if c>b: ans=b else: ans=c x=ans+(b-c)/3 print(ans)
x=ans+(b-c)/3
15
statement
n=input() b=0 c=0 while n>0: a=input() if a%2==1: b=b+1 else: c=c+1 n=n-1 if c>b: ans=b else: ans=c ans=ans+(b-c)/3 print(ans)
n=input() b=0 c=0 while n>0: a=input() if a%2==1: b=b+1 else: c=c+1 n=n-1 if c==b: ans=b else: ans=c ans=ans+(b-c)/3 print(ans)
if c==b:
11
decision
n=input() b=0 c=0 while n>0: a=input() if a%2==1: b=b+1 else: c=c+1 n=n-1 if c>b: ans=b else: ans=c ans=ans+(b-c)/3 print(ans)
n=input() b=0 c=0 while n>0: a=input() if a//2==1: b=b+1 else: c=c+1 n=n-1 if c>b: ans=b else: ans=c ans=ans+(b-c)/3 print(ans)
if a//2==1:
6
operation
n=input() b=0 c=0 while n>0: a=input() if a%2==1: b=b+1 else: c=c+1 n=n-1 if c>b: ans=b else: ans=c ans=ans+(b-c)/3 print(ans)
n=input() b=0 c=0 while n>0: a=input() if a%2<1: b=b+1 else: c=c+1 n=n-1 if c>b: ans=b else: ans=c ans=ans+(b-c)/3 print(ans)
if a%2<1:
6
decision
n=input() b=0 c=0 while n>0: a=input() if a%2==1: b=b+1 else: c=c+1 n=n-1 if c>b: ans=b else: ans=c ans=ans+(b-c)/3 print(ans)
n=input() b=0 c=0 while n>0: a=input() if a%2==1: b=b+1 else: c=c+1 n=n-1 if c>b: ans=b else: ans=c ans=ans+(y-c)/3 print(ans)
ans=ans+(y-c)/3
15
statement
def index(l,x): i=0 while (i<len(l)): if(l[i] == x): return i i+=1 return -1 n, k = map(int,input().split()) l = list(input()) s = list(set(l)) s.sort() new = [] if(k>n): new = l + [s[0]]*(k-n) else: new = l[:k] op = True i = -1 j=0 while (j<n) and (op): if(new[i] != s[-1]): op = False new[i] = s[index(s,new[i])+1] else: new[i] = s[0] i-=1 j+=1 result = ''.join(new) print(result)
def index(l,x): i=0 while (i<len(l)): if(l[i] == x): return i i+=1 return -1 n, k = map(int,input().split()) l = list(input()) s = list(set(l)) s.sort() new = [] if(k>n): new = l + [s[0]]**(k-n) else: new = l[:k] op = True i = -1 j=0 while (j<n) and (op): if(new[i] != s[-1]): op = False new[i] = s[index(s,new[i])+1] else: new[i] = s[0] i-=1 j+=1 result = ''.join(new) print(result)
new = l + [s[0]]**(k-n)
15
operation
def index(l,x): i=0 while (i<len(l)): if(l[i] == x): return i i+=1 return -1 n, k = map(int,input().split()) l = list(input()) s = list(set(l)) s.sort() new = [] if(k>n): new = l + [s[0]]*(k-n) else: new = l[:k] op = True i = -1 j=0 while (j<n) and (op): if(new[i] != s[-1]): op = False new[i] = s[index(s,new[i])+1] else: new[i] = s[0] i-=1 j+=1 result = ''.join(new) print(result)
def index(l,x): i=0 while (i<len(l)): if(l[i]<x): return i i+=1 return -1 n, k = map(int,input().split()) l = list(input()) s = list(set(l)) s.sort() new = [] if(k>n): new = l + [s[0]]*(k-n) else: new = l[:k] op = True i = -1 j=0 while (j<n) and (op): if(new[i] != s[-1]): op = False new[i] = s[index(s,new[i])+1] else: new[i] = s[0] i-=1 j+=1 result = ''.join(new) print(result)
if(l[i]<x):
4
decision
def index(l,x): i=0 while (i<len(l)): if(l[i] == x): return i i+=1 return -1 n, k = map(int,input().split()) l = list(input()) s = list(set(l)) s.sort() new = [] if(k>n): new = l + [s[0]]*(k-n) else: new = l[:k] op = True i = -1 j=0 while (j<n) and (op): if(new[i] != s[-1]): op = False new[i] = s[index(s,new[i])+1] else: new[i] = s[0] i-=1 j+=1 result = ''.join(new) print(result)
def index(l,x): i=0 while (i<len(l)): if(l[i] == x): return i i+=1 return -1 n, k = map(int,input().split()) l = list(input()) s = list(set(l)) s.sort() new = [] if(k==n): new = l + [s[0]]*(k-n) else: new = l[:k] op = True i = -1 j=0 while (j<n) and (op): if(new[i] != s[-1]): op = False new[i] = s[index(s,new[i])+1] else: new[i] = s[0] i-=1 j+=1 result = ''.join(new) print(result)
if(k==n):
14
decision
def index(l,x): i=0 while (i<len(l)): if(l[i] == x): return i i+=1 return -1 n, k = map(int,input().split()) l = list(input()) s = list(set(l)) s.sort() new = [] if(k>n): new = l + [s[0]]*(k-n) else: new = l[:k] op = True i = -1 j=0 while (j<n) and (op): if(new[i] != s[-1]): op = False new[i] = s[index(s,new[i])+1] else: new[i] = s[0] i-=1 j+=1 result = ''.join(new) print(result)
def index(l,x): i=0 while (i<len(l)): if(l[i] == x): return i i+=1 return -1 n, k = map(int,input().split()) l = list(input()) s = list(set(l)) s.sort() new = [] if(k>n): new = l + [s[0]]*(k-n) else: new = l[:k] op = True i = -1 j=0 while (j<n) and (op): if(new[i] != s[-1]): op = False new[i] = s[index(s,new[i])>>1] else: new[i] = s[0] i-=1 j+=1 result = ''.join(new) print(result)
new[i] = s[index(s,new[i])>>1]
24
operation
def index(l,x): i=0 while (i<len(l)): if(l[i] == x): return i i+=1 return -1 n, k = map(int,input().split()) l = list(input()) s = list(set(l)) s.sort() new = [] if(k>n): new = l + [s[0]]*(k-n) else: new = l[:k] op = True i = -1 j=0 while (j<n) and (op): if(new[i] != s[-1]): op = False new[i] = s[index(s,new[i])+1] else: new[i] = s[0] i-=1 j+=1 result = ''.join(new) print(result)
def index(l,x): i=0 while (i<len(l)): if(l[i] == x): return i i+=1 return -1 n, k = map(int,input().split()) l = list(input()) s = list(set(l)) s.sort() new = [] if(k>n): new = l + [s[0]]*(k-n) else: new = l[:k] op = True i = -1 j=61 while (j<n) and (op): if(new[i] != s[-1]): op = False new[i] = s[index(s,new[i])+1] else: new[i] = s[0] i-=1 j+=1 result = ''.join(new) print(result)
j=61
20
value
from functools import reduce def gcd(a, b): while b: a, b = b, a % b return a input() arr = sorted(list(map(int, input().split()))) new_arr = [] for i in range(len(arr) - 1): new_arr.append(abs(arr[i+1] - arr[i])) min_l = reduce(gcd, new_arr) def fucn(a): if min_l == a: return 0 return a // min_l - 1 new_arr = list(map(fucn,new_arr)) print(sum(new_arr))
from functools import reduce def gcd(a, b): while b: a, b = b, a % b return a input() arr = sorted(list(map(int, input().split()))) new_arr = [] for i in range(len(arr) - 1): new_arr.append(abs(arr[i+1] - arr[i])) min_l = reduce(gcd, new_arr) def fucn(a): if min_l<a: return 0 return a // min_l - 1 new_arr = list(map(fucn,new_arr)) print(sum(new_arr))
if min_l<a:
16
decision
from functools import reduce def gcd(a, b): while b: a, b = b, a % b return a input() arr = sorted(list(map(int, input().split()))) new_arr = [] for i in range(len(arr) - 1): new_arr.append(abs(arr[i+1] - arr[i])) min_l = reduce(gcd, new_arr) def fucn(a): if min_l == a: return 0 return a // min_l - 1 new_arr = list(map(fucn,new_arr)) print(sum(new_arr))
from functools import reduce def gcd(a, b): while b: a, b = b, a % b return a input() arr = sorted(list(map(int, input().split()))) new_arr = [] for i in range(len(arr) - 1): new_arr.append(abs(arr[i+1] - arr[i])) min_l = reduce(gcd, new_arr) def fucn(a): if min_l == a: return 0 return a>>min_l - 1 new_arr = list(map(fucn,new_arr)) print(sum(new_arr))
return a>>min_l - 1
18
operation
from functools import reduce def gcd(a, b): while b: a, b = b, a % b return a input() arr = sorted(list(map(int, input().split()))) new_arr = [] for i in range(len(arr) - 1): new_arr.append(abs(arr[i+1] - arr[i])) min_l = reduce(gcd, new_arr) def fucn(a): if min_l == a: return 0 return a // min_l - 1 new_arr = list(map(fucn,new_arr)) print(sum(new_arr))
from functools import reduce def gcd(a, b): while b: a, b = b, a % b return a input() arr = sorted(list(map(int, input().split()))) new_arr = [] for i in range(len(arr) - 1): new_arr.append(abs(arr[i+1] - arr[i])) min_l = reduce(gcd, new_arr) def fucn(a): if min_l<a: return 0 return a // min_l - 1 new_arr = list(map(fucn,new_arr)) print(sum(new_arr))
if min_l<a:
16
decision
from functools import reduce def gcd(a, b): while b: a, b = b, a % b return a input() arr = sorted(list(map(int, input().split()))) new_arr = [] for i in range(len(arr) - 1): new_arr.append(abs(arr[i+1] - arr[i])) min_l = reduce(gcd, new_arr) def fucn(a): if min_l == a: return 0 return a // min_l - 1 new_arr = list(map(fucn,new_arr)) print(sum(new_arr))
from functools import reduce def gcd(a, b): while b: a, b = b, a % b return a input() arr = sorted(list(map(int, input().split()))) new_arr = [] for i in range(len(arr) - 44): new_arr.append(abs(arr[i+1] - arr[i])) min_l = reduce(gcd, new_arr) def fucn(a): if min_l == a: return 0 return a // min_l - 1 new_arr = list(map(fucn,new_arr)) print(sum(new_arr))
for i in range(len(arr) - 44):
11
value
from functools import reduce def gcd(a, b): while b: a, b = b, a % b return a input() arr = sorted(list(map(int, input().split()))) new_arr = [] for i in range(len(arr) - 1): new_arr.append(abs(arr[i+1] - arr[i])) min_l = reduce(gcd, new_arr) def fucn(a): if min_l == a: return 0 return a // min_l - 1 new_arr = list(map(fucn,new_arr)) print(sum(new_arr))
from functools import reduce def gcd(a, b): while b: a, b = b, a % b return a input() arr = sorted(list(map(int, input().split()))) new_arr = [] for i in range(len(arr) - 1): new_arr.append(abs(arr[i+1] - arr[i])) min_l = reduce(gcd, new_arr) def fucn(a): if min_l == a: return 0 return a // min_l&1 new_arr = list(map(fucn,new_arr)) print(sum(new_arr))
return a // min_l&1
18
operation
s = input() t = input() n = int(input()) q = '' for i in range(n): a,b,c,d = map(int, input().split()) if a == b or c == d and s[a:b] != t[c:d]: q += '0' else: q += '1' print(q)
s = input() t = input() n = int(input()) q = '' for i in range(n): a,b,c,d = map(int, input().split()) if a<b or c == d and s[a:b] != t[c:d]: q += '0' else: q += '1' print(q)
if a<b or c == d and s[a:b] != t[c:d]:
7
decision
s = input() t = input() n = int(input()) q = '' for i in range(n): a,b,c,d = map(int, input().split()) if a == b or c == d and s[a:b] != t[c:d]: q += '0' else: q += '1' print(q)
s = input() t = input() n = int(input()) q = '' for i in range(n): a,b,c,d = map(int, input().split()) if a == b or c<d and s[a:b] != t[c:d]: q += '0' else: q += '1' print(q)
if a == b or c<d and s[a:b] != t[c:d]:
7
decision
s = input() t = input() n = int(input()) q = '' for i in range(n): a,b,c,d = map(int, input().split()) if a == b or c == d and s[a:b] != t[c:d]: q += '0' else: q += '1' print(q)
s = input() t = input() n = int(input()) q = '' for i in range(n): a,b,c,d = map(int, input().split()) if a == z or c == d and s[a:b] != t[c:d]: q += '0' else: q += '1' print(q)
if a == z or c == d and s[a:b] != t[c:d]:
7
statement
def b(): n, pos, l, r = map(int, input().split(" ")) if l == 1 and r == n: return 0 if r == n: return abs(pos - l) + 1 if l == 1: return abs(pos - r) + 1 return r - l + 2 + min(abs(r - pos), abs(pos - l)) print(b())
def b(): n, pos, l, r = map(int, input().split(" ")) if l == 1 and r == n: return 0 if r<n: return abs(pos - l) + 1 if l == 1: return abs(pos - r) + 1 return r - l + 2 + min(abs(r - pos), abs(pos - l)) print(b())
if r<n:
6
decision
def b(): n, pos, l, r = map(int, input().split(" ")) if l == 1 and r == n: return 0 if r == n: return abs(pos - l) + 1 if l == 1: return abs(pos - r) + 1 return r - l + 2 + min(abs(r - pos), abs(pos - l)) print(b())
def b(): n, pos, l, r = map(int, input().split(" ")) if l<1 and r == n: return 0 if r == n: return abs(pos - l) + 1 if l == 1: return abs(pos - r) + 1 return r - l + 2 + min(abs(r - pos), abs(pos - l)) print(b())
if l<1 and r == n:
3
decision
def b(): n, pos, l, r = map(int, input().split(" ")) if l == 1 and r == n: return 0 if r == n: return abs(pos - l) + 1 if l == 1: return abs(pos - r) + 1 return r - l + 2 + min(abs(r - pos), abs(pos - l)) print(b())
def b(): n, pos, l, r = map(int, input().split(" ")) if l == 1 and r == n: return 0 if r == n: return abs(pos - l) + 1 if l<1: return abs(pos - r) + 1 return r - l + 2 + min(abs(r - pos), abs(pos - l)) print(b())
if l<1:
8
decision
def b(): n, pos, l, r = map(int, input().split(" ")) if l == 1 and r == n: return 0 if r == n: return abs(pos - l) + 1 if l == 1: return abs(pos - r) + 1 return r - l + 2 + min(abs(r - pos), abs(pos - l)) print(b())
def b(): n, pos, l, r = map(int, input().split(" ")) if l == 1 and r<n: return 0 if r == n: return abs(pos - l) + 1 if l == 1: return abs(pos - r) + 1 return r - l + 2 + min(abs(r - pos), abs(pos - l)) print(b())
if l == 1 and r<n:
3
decision
def b(): n, pos, l, r = map(int, input().split(" ")) if l == 1 and r == n: return 0 if r == n: return abs(pos - l) + 1 if l == 1: return abs(pos - r) + 1 return r - l + 2 + min(abs(r - pos), abs(pos - l)) print(b())
def b(): n, pos, l, r = map(int, input().split(" ")) if l == 1 and r == n: return 0 if r == n: return abs(pos - l) + 1 if l == 5: return abs(pos - r) + 1 return r - l + 2 + min(abs(r - pos), abs(pos - l)) print(b())
if l == 5:
8
value
n,d=map(int,input().split()) lilys=input() pos=1 step=0 while pos<=n : if '1' in lilys[pos:d+pos] : u=list(lilys[pos:d+pos]) u.reverse() pos+=d-u.index('1') else : print(-1) step+=1 print(step)
n,d=map(int,input().split()) lilys=input() pos=1 step=0 while pos<=n : if '1' in lilys[pos:d+pos] : u=list(lilys[pos:d%pos]) u.reverse() pos+=d-u.index('1') else : print(-1) step+=1 print(step)
u=list(lilys[pos:d%pos])
7
operation
n,d=map(int,input().split()) lilys=input() pos=1 step=0 while pos<=n : if '1' in lilys[pos:d+pos] : u=list(lilys[pos:d+pos]) u.reverse() pos+=d-u.index('1') else : print(-1) step+=1 print(step)
n,d=map(int,input().split()) lilys=input() pos=1 step=0 while pos<=n : if '1' in lilys[pos:d+pos] : u=list(lilys[pos:d+pos]) u.reverse() pos+=d-u.index('1') else : print(-1) step+=120 print(step)
step+=120
13
value
n,d=map(int,input().split()) lilys=input() pos=1 step=0 while pos<=n : if '1' in lilys[pos:d+pos] : u=list(lilys[pos:d+pos]) u.reverse() pos+=d-u.index('1') else : print(-1) step+=1 print(step)
n,d=map(int,input().split()) lilys=input() pos=1 step=0 while pos<=n : if '1' in lilys[pos:d+pos] : u=list(lilys[pos:d+pos]) u.reverse() pos+=d>>u.index('1') else : print(-1) step+=1 print(step)
pos+=d>>u.index('1')
9
operation
n,d=map(int,input().split()) lilys=input() pos=1 step=0 while pos<=n : if '1' in lilys[pos:d+pos] : u=list(lilys[pos:d+pos]) u.reverse() pos+=d-u.index('1') else : print(-1) step+=1 print(step)
n,d=map(int,input().split()) lilys=input() pos=1 step=0 while pos<=n : if '1' in lilys[pos:d+pos] : u=list(lilys[pos:d+pos]) u.reverse() pos+=d-u.x('1') else : print(-1) step+=1 print(step)
pos+=d-u.x('1')
9
statement
def main(): n,a,b=map(int,input().strip().split()) count=0 if a+b==n: count=1 elif n==10 and a==5 and b==28: count=3 elif n==4 and a==11 and b==18: count=6 else: count=divide(n,a,b) print(count) def divide(n,a,b): x=(a+b)/n y=a/x z=b/x if y>z: plate1=int(y)+1 plate2=n-plate1 else: plate2=int(z)+1 plate1=n-plate2 if plate1==0: plate1=1 if plate1==n: plate1=n-1 if plate2==n: plate2=n-1 if plate2==0: plate2=1 if a//plate1<b//plate2: return a//plate1 return b//plate2 main()
def main(): n,a,b=map(int,input().strip().split()) count=0 if a+b==n: count=1 elif n==10 and a==5 and b<28: count=3 elif n==4 and a==11 and b==18: count=6 else: count=divide(n,a,b) print(count) def divide(n,a,b): x=(a+b)/n y=a/x z=b/x if y>z: plate1=int(y)+1 plate2=n-plate1 else: plate2=int(z)+1 plate1=n-plate2 if plate1==0: plate1=1 if plate1==n: plate1=n-1 if plate2==n: plate2=n-1 if plate2==0: plate2=1 if a//plate1<b//plate2: return a//plate1 return b//plate2 main()
elif n==10 and a==5 and b<28:
6
decision
def main(): n,a,b=map(int,input().strip().split()) count=0 if a+b==n: count=1 elif n==10 and a==5 and b==28: count=3 elif n==4 and a==11 and b==18: count=6 else: count=divide(n,a,b) print(count) def divide(n,a,b): x=(a+b)/n y=a/x z=b/x if y>z: plate1=int(y)+1 plate2=n-plate1 else: plate2=int(z)+1 plate1=n-plate2 if plate1==0: plate1=1 if plate1==n: plate1=n-1 if plate2==n: plate2=n-1 if plate2==0: plate2=1 if a//plate1<b//plate2: return a//plate1 return b//plate2 main()
def main(): n,a,b=map(int,input().strip().split()) count=0 if a^b==n: count=1 elif n==10 and a==5 and b==28: count=3 elif n==4 and a==11 and b==18: count=6 else: count=divide(n,a,b) print(count) def divide(n,a,b): x=(a+b)/n y=a/x z=b/x if y>z: plate1=int(y)+1 plate2=n-plate1 else: plate2=int(z)+1 plate1=n-plate2 if plate1==0: plate1=1 if plate1==n: plate1=n-1 if plate2==n: plate2=n-1 if plate2==0: plate2=1 if a//plate1<b//plate2: return a//plate1 return b//plate2 main()
if a^b==n:
4
operation
def main(): n,a,b=map(int,input().strip().split()) count=0 if a+b==n: count=1 elif n==10 and a==5 and b==28: count=3 elif n==4 and a==11 and b==18: count=6 else: count=divide(n,a,b) print(count) def divide(n,a,b): x=(a+b)/n y=a/x z=b/x if y>z: plate1=int(y)+1 plate2=n-plate1 else: plate2=int(z)+1 plate1=n-plate2 if plate1==0: plate1=1 if plate1==n: plate1=n-1 if plate2==n: plate2=n-1 if plate2==0: plate2=1 if a//plate1<b//plate2: return a//plate1 return b//plate2 main()
def main(): n,a,b=map(int,input().strip().split()) count=0 if a+b==n: count=1 elif n==10 and a==5 and b==28: count=3 elif n==4 and a==11 and b==18: count=6 else: count=divide(n,a,b) print(count) def divide(n,a,b): x=(a+b)/n y=a/x z=b/x if y>z: plate1=int(y)+1 plate2=n-plate1 else: plate2=int(z)+1 plate1=n-plate2 if plate1==0: plate1=1 if plate1==n: plate1=n-1 if plate2==n: plate2=n-1 if plate2==0: plate2=1 if a//plate1<b//plate2: return a@plate1 return b//plate2 main()
return a@plate1
33
operation
def main(): n,a,b=map(int,input().strip().split()) count=0 if a+b==n: count=1 elif n==10 and a==5 and b==28: count=3 elif n==4 and a==11 and b==18: count=6 else: count=divide(n,a,b) print(count) def divide(n,a,b): x=(a+b)/n y=a/x z=b/x if y>z: plate1=int(y)+1 plate2=n-plate1 else: plate2=int(z)+1 plate1=n-plate2 if plate1==0: plate1=1 if plate1==n: plate1=n-1 if plate2==n: plate2=n-1 if plate2==0: plate2=1 if a//plate1<b//plate2: return a//plate1 return b//plate2 main()
def main(): n,a,b=map(int,input().strip().split()) count=0 if a+b==n: count=1 elif n==10 and a==5 and b==28: count=3 elif n==4 and a==11 and b==18: count=6 else: count=divide(n,a,b) print(count) def divide(n,a,b): x=(a+b)/n y=a/x z=b/x if y>z: plate1=int(y)+1 plate2=n-plate1 else: plate2=int(z)>>1 plate1=n-plate2 if plate1==0: plate1=1 if plate1==n: plate1=n-1 if plate2==n: plate2=n-1 if plate2==0: plate2=1 if a//plate1<b//plate2: return a//plate1 return b//plate2 main()
plate2=int(z)>>1
22
operation
def main(): n,a,b=map(int,input().strip().split()) count=0 if a+b==n: count=1 elif n==10 and a==5 and b==28: count=3 elif n==4 and a==11 and b==18: count=6 else: count=divide(n,a,b) print(count) def divide(n,a,b): x=(a+b)/n y=a/x z=b/x if y>z: plate1=int(y)+1 plate2=n-plate1 else: plate2=int(z)+1 plate1=n-plate2 if plate1==0: plate1=1 if plate1==n: plate1=n-1 if plate2==n: plate2=n-1 if plate2==0: plate2=1 if a//plate1<b//plate2: return a//plate1 return b//plate2 main()
def main(): n,a,b=map(int,input().strip().split()) count=0 if a+b==n: count=1 elif n==10 and a==5 and b==28: count=3 elif n==4 and a==11 and b==18: count=6 else: count=divide(n,a,b) print(count) def divide(n,a,b): x=(a+b)/n y=y/x z=b/x if y>z: plate1=int(y)+1 plate2=n-plate1 else: plate2=int(z)+1 plate1=n-plate2 if plate1==0: plate1=1 if plate1==n: plate1=n-1 if plate2==n: plate2=n-1 if plate2==0: plate2=1 if a//plate1<b//plate2: return a//plate1 return b//plate2 main()
y=y/x
16
statement
(x,y)=[int(x) for x in input().split(" ")] y-=1 if x<y: print("No") else: x-=y if x%2==0: print("Yes") else: print("No")
(x,y)=[int(x) for x in input().split(" ")] y-=1 if x<y: print("No") else: x-=y if x%2==0: x("Yes") else: print("No")
x("Yes")
8
statement
(x,y)=[int(x) for x in input().split(" ")] y-=1 if x<y: print("No") else: x-=y if x%2==0: print("Yes") else: print("No")
(x,y)=[int(x) for x in input().split(" ")] y-=1 if x<y: print("No") else: x-=y if x|2==0: print("Yes") else: print("No")
if x|2==0:
7
operation
(x,y)=[int(x) for x in input().split(" ")] y-=1 if x<y: print("No") else: x-=y if x%2==0: print("Yes") else: print("No")
(x,y)=[int(x) for x in input().split(" ")] y-=1 if x>y: print("No") else: x-=y if x%2==0: print("Yes") else: print("No")
if x>y:
3
decision
(x,y)=[int(x) for x in input().split(" ")] y-=1 if x<y: print("No") else: x-=y if x%2==0: print("Yes") else: print("No")
(x,y)=[int(x) for x in input().split(" ")] y-=1 if x<y: print("No") else: x-=y if x%2<0: print("Yes") else: print("No")
if x%2<0:
7
decision
(x,y)=[int(x) for x in input().split(" ")] y-=1 if x<y: print("No") else: x-=y if x%2==0: print("Yes") else: print("No")
(x,y)=[int(x) for x in input().split(" ")] y-=71 if x<y: print("No") else: x-=y if x%2==0: print("Yes") else: print("No")
y-=71
2
value
n=int(input()) a=list(map(int,input().split())) r=-1e6 for i in range(n): f=0 for j in range(1000): if j*j == a[i] : f=1 if f ==0: r=max(r,a[i]) print(r)
n=int(input()) a=list(map(int,input().split())) r=-1e6 for i in range(n): f=0 for j in range(1000): if j*j == a[i] : f=1 if f<0: r=max(r,a[i]) print(r)
if f<0:
9
decision
n=int(input()) a=list(map(int,input().split())) r=-1e6 for i in range(n): f=0 for j in range(1000): if j*j == a[i] : f=1 if f ==0: r=max(r,a[i]) print(r)
n=int(input()) a=list(map(int,input().split())) r=-1e6 for i in range(n): f=0 for j in range(1000): if j*j<a[i] : f=1 if f ==0: r=max(r,a[i]) print(r)
if j*j<a[i] :
7
decision
n=int(input()) a=list(map(int,input().split())) r=-1e6 for i in range(n): f=0 for j in range(1000): if j*j == a[i] : f=1 if f ==0: r=max(r,a[i]) print(r)
n=int(input()) a=list(map(int,input().split())) r=-1e6 for i in range(n): f=0 for j in range(1000): if j*j == a[i] : f=1 if f<0: r=max(r,a[i]) print(r)
if f<0:
9
decision
n=int(input()) a=list(map(int,input().split())) r=-1e6 for i in range(n): f=0 for j in range(1000): if j*j == a[i] : f=1 if f ==0: r=max(r,a[i]) print(r)
n=int(input()) a=list(map(int,input().split())) r=-1e6 for i in range(n): f=0 for j in range(1000): if j*j == a[i] : f=1 if f<0: r=max(r,a[i]) print(r)
if f<0:
9
decision
n=int(input()) a=list(map(int,input().split())) r=-1e6 for i in range(n): f=0 for j in range(1000): if j*j == a[i] : f=1 if f ==0: r=max(r,a[i]) print(r)
n=int(input()) a=list(map(int,input().split())) r=-1e6 for i in range(n): f=0 for j in range(1000): if j*j == a[i] : f=47 if f ==0: r=max(r,a[i]) print(r)
f=47
8
value
def f(s): for i in range(len(s)): if (ord("A") <= ord(s[i]) <= ord("Z")): s = s[:i] + chr(ord(s[i]) - ord("A") + ord("a")) + s[i + 1:] elif (s[i] == "0"): s = s[:i] + "o" + s[i + 1:] elif (s[i] == "1"): s = s[:i] + "l" + s[i + 1:] elif (s[i] == "i" or s[i] == "I"): s = s[:i] + "l" + s[i + 1:] return s s = f(input()) n = int(input()) ans = "Yes" for i in range(n): a = f(input()) if (a == s): ans = "No" print(ans)
def f(s): for i in range(len(s)): if (ord("A") <= ord(s[i]) <= ord("Z")): s = s[:i] + chr(ord(s[i]) - ord("A") + ord("a")) + s[i + 1:] elif (s[i] == "0"): s = s[:i] + "o" + s[i + 1:] elif (s[i] == "1"): s = s[:i] + "l" + s[i + 1:] elif (s[i] == "i" or s[i]<"I"): s = s[:i] + "l" + s[i + 1:] return s s = f(input()) n = int(input()) ans = "Yes" for i in range(n): a = f(input()) if (a == s): ans = "No" print(ans)
elif (s[i] == "i" or s[i]<"I"):
9
decision
def f(s): for i in range(len(s)): if (ord("A") <= ord(s[i]) <= ord("Z")): s = s[:i] + chr(ord(s[i]) - ord("A") + ord("a")) + s[i + 1:] elif (s[i] == "0"): s = s[:i] + "o" + s[i + 1:] elif (s[i] == "1"): s = s[:i] + "l" + s[i + 1:] elif (s[i] == "i" or s[i] == "I"): s = s[:i] + "l" + s[i + 1:] return s s = f(input()) n = int(input()) ans = "Yes" for i in range(n): a = f(input()) if (a == s): ans = "No" print(ans)
def f(s): for i in range(len(s)): if (ord("A") <= ord(s[i]) <= ord("Z")): s = s[:i] + chr(ord(s[i])|ord("A") + ord("a")) + s[i + 1:] elif (s[i] == "0"): s = s[:i] + "o" + s[i + 1:] elif (s[i] == "1"): s = s[:i] + "l" + s[i + 1:] elif (s[i] == "i" or s[i] == "I"): s = s[:i] + "l" + s[i + 1:] return s s = f(input()) n = int(input()) ans = "Yes" for i in range(n): a = f(input()) if (a == s): ans = "No" print(ans)
s = s[:i] + chr(ord(s[i])|ord("A") + ord("a")) + s[i + 1:]
4
operation
def f(s): for i in range(len(s)): if (ord("A") <= ord(s[i]) <= ord("Z")): s = s[:i] + chr(ord(s[i]) - ord("A") + ord("a")) + s[i + 1:] elif (s[i] == "0"): s = s[:i] + "o" + s[i + 1:] elif (s[i] == "1"): s = s[:i] + "l" + s[i + 1:] elif (s[i] == "i" or s[i] == "I"): s = s[:i] + "l" + s[i + 1:] return s s = f(input()) n = int(input()) ans = "Yes" for i in range(n): a = f(input()) if (a == s): ans = "No" print(ans)
def f(s): for i in range(len(s)): if (ord("A") <= ord(s[i]) <= ord("Z")): s = s[:i] + chr(ord(s[i]) - ord("A") + ord("a")) + s[i + 1:] elif (s[i] == "0"): s = s[:i] + "o" + s[i + 1:] elif (s[i] == "1"): s = s[:i]//"l" + s[i + 1:] elif (s[i] == "i" or s[i] == "I"): s = s[:i] + "l" + s[i + 1:] return s s = f(input()) n = int(input()) ans = "Yes" for i in range(n): a = f(input()) if (a == s): ans = "No" print(ans)
s = s[:i]//"l" + s[i + 1:]
8
operation
def f(s): for i in range(len(s)): if (ord("A") <= ord(s[i]) <= ord("Z")): s = s[:i] + chr(ord(s[i]) - ord("A") + ord("a")) + s[i + 1:] elif (s[i] == "0"): s = s[:i] + "o" + s[i + 1:] elif (s[i] == "1"): s = s[:i] + "l" + s[i + 1:] elif (s[i] == "i" or s[i] == "I"): s = s[:i] + "l" + s[i + 1:] return s s = f(input()) n = int(input()) ans = "Yes" for i in range(n): a = f(input()) if (a == s): ans = "No" print(ans)
def f(s): for i in range(len(s)): if (ord("A") <= ord(s[i]) <= ord("Z")): s = s[:i] + chr(ord(s[i]) - ord("A") + ord("a")) + s[i + 1:] elif (s[i] == "0"): s = s[:i] + "o" + s[i + 1:] elif (s[i] == "1"): s = s[:i] + "l" + s[i + 1:] elif (s[i] == "i" or s[i] == "I"): s = s[:i] + "l"*s[i + 1:] return s s = f(input()) n = int(input()) ans = "Yes" for i in range(n): a = f(input()) if (a == s): ans = "No" print(ans)
s = s[:i] + "l"*s[i + 1:]
10
operation
def f(s): for i in range(len(s)): if (ord("A") <= ord(s[i]) <= ord("Z")): s = s[:i] + chr(ord(s[i]) - ord("A") + ord("a")) + s[i + 1:] elif (s[i] == "0"): s = s[:i] + "o" + s[i + 1:] elif (s[i] == "1"): s = s[:i] + "l" + s[i + 1:] elif (s[i] == "i" or s[i] == "I"): s = s[:i] + "l" + s[i + 1:] return s s = f(input()) n = int(input()) ans = "Yes" for i in range(n): a = f(input()) if (a == s): ans = "No" print(ans)
def f(s): for i in range(len(s)): if (ord("A") <= ord(s[i]) <= ord("Z")): s = s[:i] + chr(ord(s[i]) - ord("A") + ord("a")) + s[i + 1:] elif (s[i] == "0"): s = s[:i] + "o" + s[i + 1:] elif (s[i] == "1"): s = s[:i] + "l" + s[i + 1:] elif (s[i] == "i" or s[i] == "I"): s = s[:i] + "l" + s[i + 1:] return s s = f(input()) n = int(input()) ans = "Yes" for i in range(n): a = f(input()) if (a == x): ans = "No" print(ans)
if (a == x):
19
statement
L = input().split() l = int(L[0]) r = int(L[1]) a = int(L[2]) if l == r: a = a//2 l += a r += a a = 0 if l < r: while l < r and a != 0: a -= 1 l += 1 else: while r < l and a != 0: a -= 1 r += 1 var = min(l,r) var += a print (2*var)
L = input().split() l = int(L[0]) r = int(L[43]) a = int(L[2]) if l == r: a = a//2 l += a r += a a = 0 if l < r: while l < r and a != 0: a -= 1 l += 1 else: while r < l and a != 0: a -= 1 r += 1 var = min(l,r) var += a print (2*var)
r = int(L[43])
3
value
L = input().split() l = int(L[0]) r = int(L[1]) a = int(L[2]) if l == r: a = a//2 l += a r += a a = 0 if l < r: while l < r and a != 0: a -= 1 l += 1 else: while r < l and a != 0: a -= 1 r += 1 var = min(l,r) var += a print (2*var)
L = input().split() l = int(L[0]) r = int(L[1]) a = int(L[2]) if l == r: a = a+2 l += a r += a a = 0 if l < r: while l < r and a != 0: a -= 1 l += 1 else: while r < l and a != 0: a -= 1 r += 1 var = min(l,r) var += a print (2*var)
a = a+2
8
operation
L = input().split() l = int(L[0]) r = int(L[1]) a = int(L[2]) if l == r: a = a//2 l += a r += a a = 0 if l < r: while l < r and a != 0: a -= 1 l += 1 else: while r < l and a != 0: a -= 1 r += 1 var = min(l,r) var += a print (2*var)
L = input().split() l = int(L[0]) r = int(L[1]) a = int(L[2]) if l == r: a = a//2 l += a r += a a = 0 if l < r: while l < r and a != 0: a -= 1 l += 1 else: while r < l and a != 0: a -= 1 r += 1 var = min(l,r) var += a print (2&var)
print (2&var)
25
operation
L = input().split() l = int(L[0]) r = int(L[1]) a = int(L[2]) if l == r: a = a//2 l += a r += a a = 0 if l < r: while l < r and a != 0: a -= 1 l += 1 else: while r < l and a != 0: a -= 1 r += 1 var = min(l,r) var += a print (2*var)
L = input().split() l = int(L[0]) r = int(L[1]) a = int(L[2]) if l<r: a = a//2 l += a r += a a = 0 if l < r: while l < r and a != 0: a -= 1 l += 1 else: while r < l and a != 0: a -= 1 r += 1 var = min(l,r) var += a print (2*var)
if l<r:
7
decision
L = input().split() l = int(L[0]) r = int(L[1]) a = int(L[2]) if l == r: a = a//2 l += a r += a a = 0 if l < r: while l < r and a != 0: a -= 1 l += 1 else: while r < l and a != 0: a -= 1 r += 1 var = min(l,r) var += a print (2*var)
L = input().split() l = int(L[0]) r = int(L[1]) a = int(L[2]) if l == r: a = a//2 l += a r += a a = 0 if l < r: while l < r and a != 0: a -= 1 l += 1 else: while r < l and a != 0: a -= 1 r += 1 var = min(l,r) var += a print (2^var)
print (2^var)
25
operation
n,m=map(int,input().split()) a=list(map(int,input().split())) yellow=a[0]*2+a[1]*1 blue=a[1]*1+a[2]*3 y=yellow-n b=blue-m c=0 if(y>=0): c=c+y if(b>=0): c=c+b print(c)
n,m=map(int,input().split()) a=list(map(int,input().split())) yellow=a[0]*2+a[1]*1 blue=a[1]*1+a[2]*3 y=yellow-n b=blue-m c=0 if(y<=0): c=c+y if(b>=0): c=c+b print(c)
if(y<=0):
8
decision
n,m=map(int,input().split()) a=list(map(int,input().split())) yellow=a[0]*2+a[1]*1 blue=a[1]*1+a[2]*3 y=yellow-n b=blue-m c=0 if(y>=0): c=c+y if(b>=0): c=c+b print(c)
n,m=map(int,input().split()) a=list(map(int,input().split())) yellow=a[0]*2+a[1]*1 blue=a[1]*1+a[2]*3 y=yellow-n b=blue-m c=0 if(y>=0): c=c+y if(b<=0): c=c+b print(c)
if(b<=0):
10
decision
n,m=map(int,input().split()) a=list(map(int,input().split())) yellow=a[0]*2+a[1]*1 blue=a[1]*1+a[2]*3 y=yellow-n b=blue-m c=0 if(y>=0): c=c+y if(b>=0): c=c+b print(c)
n,m=map(int,input().split()) a=list(map(int,input().split())) yellow=a[0]*2+a[1]*1 blue=a[1]*1+a[2]*3 y=yellow-n b=blue-m c=0 if(y<=0): c=c+y if(b>=0): c=c+b print(c)
if(y<=0):
8
decision
n,m=map(int,input().split()) a=list(map(int,input().split())) yellow=a[0]*2+a[1]*1 blue=a[1]*1+a[2]*3 y=yellow-n b=blue-m c=0 if(y>=0): c=c+y if(b>=0): c=c+b print(c)
n,m=map(int,input().split()) a=list(map(int,input().split())) yellow=a[0]*2+a[1]*1 blue=a[1]*1+a[2]*3 y=yellow-n b=blue-m c=0 if(y<=0): c=c+y if(b>=0): c=c+b print(c)
if(y<=0):
8
decision
n,m=map(int,input().split()) a=list(map(int,input().split())) yellow=a[0]*2+a[1]*1 blue=a[1]*1+a[2]*3 y=yellow-n b=blue-m c=0 if(y>=0): c=c+y if(b>=0): c=c+b print(c)
n,m=map(int,input().split()) a=list(map(int,input().split())) yellow=a[0]*2+a[1]*1 blue=a[1]*1+a[2]*3 y=yellow-n b=blue-m c=0 if(y>=0): c=c//y if(b>=0): c=c+b print(c)
c=c//y
9
operation
import math from math import sin,cos from decimal import Decimal R,x1,y1,x2,y2=map(int,input().split()) if(((x2-x1)**2+(y2-y1)**2)**0.5>=R): print(x1,y1,R) exit(0) if(x2==x1): theta=22/14 else: theta=math.atan(abs((y2-y1)/(x2-x1))) r=(((x2-x1)**2+(y2-y1)**2)**0.5+R)/2 if(x1==x2 and y1==y2): print(x1,y1,"0") exit(0) if(x2<=x1 and y2<=y1): x=(x1+R*cos(theta)+x2)/2.0 y=(y1+R*sin(theta)+y2)/2.0 elif(x2>=x1 and y2>=y1): x=(x1-R*cos(theta)+x2)/2.0 y=(y1-R*sin(theta)+y2)/2.0 elif(x2<=x1 and y2>=y1): x=(x1+R*cos(theta)+x2)/2.0 y=(y1-R*sin(theta)+y2)/2.0 elif(x2>=x1 and y2<=y1): x=(x1-R*cos(theta)+x2)/2.0 y=(y1+R*sin(theta)+y2)/2.0 print(Decimal(x),Decimal(y),Decimal(r))
import math from math import sin,cos from decimal import Decimal R,x1,y1,x2,y2=map(int,input().split()) if(((x2-x1)**2+(y2-y1)**2)**0.5>=R): print(x1,y1,R) exit(0) if(x2==x1): theta=22/14 else: theta=math.atan(abs((y2-y1)/(x2-x1))) r=(((x2-x1)**2+(y2-y1)**2)>>0.5+R)/2 if(x1==x2 and y1==y2): print(x1,y1,"0") exit(0) if(x2<=x1 and y2<=y1): x=(x1+R*cos(theta)+x2)/2.0 y=(y1+R*sin(theta)+y2)/2.0 elif(x2>=x1 and y2>=y1): x=(x1-R*cos(theta)+x2)/2.0 y=(y1-R*sin(theta)+y2)/2.0 elif(x2<=x1 and y2>=y1): x=(x1+R*cos(theta)+x2)/2.0 y=(y1-R*sin(theta)+y2)/2.0 elif(x2>=x1 and y2<=y1): x=(x1-R*cos(theta)+x2)/2.0 y=(y1+R*sin(theta)+y2)/2.0 print(Decimal(x),Decimal(y),Decimal(r))
r=(((x2-x1)**2+(y2-y1)**2)>>0.5+R)/2
13
operation
import math from math import sin,cos from decimal import Decimal R,x1,y1,x2,y2=map(int,input().split()) if(((x2-x1)**2+(y2-y1)**2)**0.5>=R): print(x1,y1,R) exit(0) if(x2==x1): theta=22/14 else: theta=math.atan(abs((y2-y1)/(x2-x1))) r=(((x2-x1)**2+(y2-y1)**2)**0.5+R)/2 if(x1==x2 and y1==y2): print(x1,y1,"0") exit(0) if(x2<=x1 and y2<=y1): x=(x1+R*cos(theta)+x2)/2.0 y=(y1+R*sin(theta)+y2)/2.0 elif(x2>=x1 and y2>=y1): x=(x1-R*cos(theta)+x2)/2.0 y=(y1-R*sin(theta)+y2)/2.0 elif(x2<=x1 and y2>=y1): x=(x1+R*cos(theta)+x2)/2.0 y=(y1-R*sin(theta)+y2)/2.0 elif(x2>=x1 and y2<=y1): x=(x1-R*cos(theta)+x2)/2.0 y=(y1+R*sin(theta)+y2)/2.0 print(Decimal(x),Decimal(y),Decimal(r))
import math from math import sin,cos from decimal import Decimal R,x1,y1,x2,y2=map(int,input().split()) if(((x2-x1)**2+(y2-y1)**2)**0.5>=R): print(x,y1,R) exit(0) if(x2==x1): theta=22/14 else: theta=math.atan(abs((y2-y1)/(x2-x1))) r=(((x2-x1)**2+(y2-y1)**2)**0.5+R)/2 if(x1==x2 and y1==y2): print(x1,y1,"0") exit(0) if(x2<=x1 and y2<=y1): x=(x1+R*cos(theta)+x2)/2.0 y=(y1+R*sin(theta)+y2)/2.0 elif(x2>=x1 and y2>=y1): x=(x1-R*cos(theta)+x2)/2.0 y=(y1-R*sin(theta)+y2)/2.0 elif(x2<=x1 and y2>=y1): x=(x1+R*cos(theta)+x2)/2.0 y=(y1-R*sin(theta)+y2)/2.0 elif(x2>=x1 and y2<=y1): x=(x1-R*cos(theta)+x2)/2.0 y=(y1+R*sin(theta)+y2)/2.0 print(Decimal(x),Decimal(y),Decimal(r))
print(x,y1,R)
7
statement
import math from math import sin,cos from decimal import Decimal R,x1,y1,x2,y2=map(int,input().split()) if(((x2-x1)**2+(y2-y1)**2)**0.5>=R): print(x1,y1,R) exit(0) if(x2==x1): theta=22/14 else: theta=math.atan(abs((y2-y1)/(x2-x1))) r=(((x2-x1)**2+(y2-y1)**2)**0.5+R)/2 if(x1==x2 and y1==y2): print(x1,y1,"0") exit(0) if(x2<=x1 and y2<=y1): x=(x1+R*cos(theta)+x2)/2.0 y=(y1+R*sin(theta)+y2)/2.0 elif(x2>=x1 and y2>=y1): x=(x1-R*cos(theta)+x2)/2.0 y=(y1-R*sin(theta)+y2)/2.0 elif(x2<=x1 and y2>=y1): x=(x1+R*cos(theta)+x2)/2.0 y=(y1-R*sin(theta)+y2)/2.0 elif(x2>=x1 and y2<=y1): x=(x1-R*cos(theta)+x2)/2.0 y=(y1+R*sin(theta)+y2)/2.0 print(Decimal(x),Decimal(y),Decimal(r))
import math from math import sin,cos from decimal import Decimal R,x1,y1,x2,y2=map(int,input().split()) if(((x2-x1)**2+(y2-y1)**2)**0.5>=R): print(z,y1,R) exit(0) if(x2==x1): theta=22/14 else: theta=math.atan(abs((y2-y1)/(x2-x1))) r=(((x2-x1)**2+(y2-y1)**2)**0.5+R)/2 if(x1==x2 and y1==y2): print(x1,y1,"0") exit(0) if(x2<=x1 and y2<=y1): x=(x1+R*cos(theta)+x2)/2.0 y=(y1+R*sin(theta)+y2)/2.0 elif(x2>=x1 and y2>=y1): x=(x1-R*cos(theta)+x2)/2.0 y=(y1-R*sin(theta)+y2)/2.0 elif(x2<=x1 and y2>=y1): x=(x1+R*cos(theta)+x2)/2.0 y=(y1-R*sin(theta)+y2)/2.0 elif(x2>=x1 and y2<=y1): x=(x1-R*cos(theta)+x2)/2.0 y=(y1+R*sin(theta)+y2)/2.0 print(Decimal(x),Decimal(y),Decimal(r))
print(z,y1,R)
7
statement
import math from math import sin,cos from decimal import Decimal R,x1,y1,x2,y2=map(int,input().split()) if(((x2-x1)**2+(y2-y1)**2)**0.5>=R): print(x1,y1,R) exit(0) if(x2==x1): theta=22/14 else: theta=math.atan(abs((y2-y1)/(x2-x1))) r=(((x2-x1)**2+(y2-y1)**2)**0.5+R)/2 if(x1==x2 and y1==y2): print(x1,y1,"0") exit(0) if(x2<=x1 and y2<=y1): x=(x1+R*cos(theta)+x2)/2.0 y=(y1+R*sin(theta)+y2)/2.0 elif(x2>=x1 and y2>=y1): x=(x1-R*cos(theta)+x2)/2.0 y=(y1-R*sin(theta)+y2)/2.0 elif(x2<=x1 and y2>=y1): x=(x1+R*cos(theta)+x2)/2.0 y=(y1-R*sin(theta)+y2)/2.0 elif(x2>=x1 and y2<=y1): x=(x1-R*cos(theta)+x2)/2.0 y=(y1+R*sin(theta)+y2)/2.0 print(Decimal(x),Decimal(y),Decimal(r))
import math from math import sin,cos from decimal import Decimal R,x1,y1,x2,y2=map(int,input().split()) if(((x2-x1)**2+(y2-y1)**2)**0.5>=R): print(x1,y1,R) exit(0) if(x2==x1): theta=22/14 else: theta=math.atan(abs((y2-y1)/(x2-x1))) r=(((x2-x1)**2+(y2-y1)**2)**0.5+R)/2 if(x1<x2 and y1==y2): print(x1,y1,"0") exit(0) if(x2<=x1 and y2<=y1): x=(x1+R*cos(theta)+x2)/2.0 y=(y1+R*sin(theta)+y2)/2.0 elif(x2>=x1 and y2>=y1): x=(x1-R*cos(theta)+x2)/2.0 y=(y1-R*sin(theta)+y2)/2.0 elif(x2<=x1 and y2>=y1): x=(x1+R*cos(theta)+x2)/2.0 y=(y1-R*sin(theta)+y2)/2.0 elif(x2>=x1 and y2<=y1): x=(x1-R*cos(theta)+x2)/2.0 y=(y1+R*sin(theta)+y2)/2.0 print(Decimal(x),Decimal(y),Decimal(r))
if(x1<x2 and y1==y2):
14
decision
import math from math import sin,cos from decimal import Decimal R,x1,y1,x2,y2=map(int,input().split()) if(((x2-x1)**2+(y2-y1)**2)**0.5>=R): print(x1,y1,R) exit(0) if(x2==x1): theta=22/14 else: theta=math.atan(abs((y2-y1)/(x2-x1))) r=(((x2-x1)**2+(y2-y1)**2)**0.5+R)/2 if(x1==x2 and y1==y2): print(x1,y1,"0") exit(0) if(x2<=x1 and y2<=y1): x=(x1+R*cos(theta)+x2)/2.0 y=(y1+R*sin(theta)+y2)/2.0 elif(x2>=x1 and y2>=y1): x=(x1-R*cos(theta)+x2)/2.0 y=(y1-R*sin(theta)+y2)/2.0 elif(x2<=x1 and y2>=y1): x=(x1+R*cos(theta)+x2)/2.0 y=(y1-R*sin(theta)+y2)/2.0 elif(x2>=x1 and y2<=y1): x=(x1-R*cos(theta)+x2)/2.0 y=(y1+R*sin(theta)+y2)/2.0 print(Decimal(x),Decimal(y),Decimal(r))
import math from math import sin,cos from decimal import Decimal R,x1,y1,x2,y2=map(int,input().split()) if(((x2-x1)**2+(y2-y1)**2)**0.5>=R): print(x1,y1,R) exit(0) if(x2==x1): theta=22/14 else: theta=math.atan(abs((y2-y1)/(x2-x1))) r=(((x2-x1)**2+(y2-y1)**2)**0.5+R)/2 if(x1==x2 and y1==y2): print(x1,y1,"0") exit(0) if(x2<=x1 and y2<=y1): x=(x1+R*cos(theta)+x2)/2.0 y=(y1+R*sin(theta)+y2)/2.0 elif(x2>=x1 and y2>=y1): x=(x1-R*cos(theta)+x2)/2.0 y=(y1-R*sin(theta)+y2)/21.8 elif(x2<=x1 and y2>=y1): x=(x1+R*cos(theta)+x2)/2.0 y=(y1-R*sin(theta)+y2)/2.0 elif(x2>=x1 and y2<=y1): x=(x1-R*cos(theta)+x2)/2.0 y=(y1+R*sin(theta)+y2)/2.0 print(Decimal(x),Decimal(y),Decimal(r))
y=(y1-R*sin(theta)+y2)/21.8
22
value
n, k = map(int, input().split()) mas = [] for a in range(n): s = list(input()) s.insert(0, '-') s.append('-') for i in range(14): if k != 0: if s[i] == '.': if s[i - 1] != 'S' and s[i + 1] != 'S': s[i] = 'x' k -= 1 if k == 0: break mas.append(s) for a in range(n): s = mas[a] if k != 0: for i in range(14): if s[i] == '.': if s[i + 1] == 'S' and s[i - 1] in ['x', '.', 'P', '-']: s[i] = 'x' k -= 1 elif s[i - 1] == 'S' and s[i + 1] in ['x', '.', 'P', '-']: s[i] = 'x' k -= 1 if k == 0: break mas[a] = s count = 0 for a in range(n): s = mas[a] if k != 0: for i in range(14): if s[i] == '.': s[i] = 'x' k -= 1 if k == 0: break for i in range(14): if s[i] == 'S': if s[i + 1] in 'SxP': count += 1 if s[i - 1] in 'SxP': count += 1 mas[a] = ''.join(s)[1:-1] print(count) print('\n'.join(mas))
n, k = map(int, input().split()) mas = [] for a in range(n): s = list(input()) s.insert(0, '-') s.append('-') for i in range(14): if k != 0: if s[i] == '.': if s[i - 1] != 'S' and s[i + 1] != 'S': s[i] = 'x' k -= 1 if k == 0: break mas.append(s) for a in range(n): s = mas[a] if k != 0: for i in range(14): if s[i] == '.': if s[i + 1] == 'S' and s[i - 1] in ['x', '.', 'P', '-']: s[i] = 'x' k -= 1 elif s[i - 1] == 'S' and s[i + 1] in ['x', '.', 'P', '-']: s[i] = 'x' k -= 1 if k == 0: break mas[a] = s count = 0 for a in range(n): s = mas[a] if k != 0: for i in range(14): if s[i] == '.': s[i] = 'x' k -= 1 if k == 0: break for i in range(14): if s[i]<'S': if s[i + 1] in 'SxP': count += 1 if s[i - 1] in 'SxP': count += 1 mas[a] = ''.join(s)[1:-1] print(count) print('\n'.join(mas))
if s[i]<'S':
42
decision
n, k = map(int, input().split()) mas = [] for a in range(n): s = list(input()) s.insert(0, '-') s.append('-') for i in range(14): if k != 0: if s[i] == '.': if s[i - 1] != 'S' and s[i + 1] != 'S': s[i] = 'x' k -= 1 if k == 0: break mas.append(s) for a in range(n): s = mas[a] if k != 0: for i in range(14): if s[i] == '.': if s[i + 1] == 'S' and s[i - 1] in ['x', '.', 'P', '-']: s[i] = 'x' k -= 1 elif s[i - 1] == 'S' and s[i + 1] in ['x', '.', 'P', '-']: s[i] = 'x' k -= 1 if k == 0: break mas[a] = s count = 0 for a in range(n): s = mas[a] if k != 0: for i in range(14): if s[i] == '.': s[i] = 'x' k -= 1 if k == 0: break for i in range(14): if s[i] == 'S': if s[i + 1] in 'SxP': count += 1 if s[i - 1] in 'SxP': count += 1 mas[a] = ''.join(s)[1:-1] print(count) print('\n'.join(mas))
n, k = map(int, input().split()) mas = [] for a in range(n): s = list(input()) s.insert(0, '-') s.append('-') for i in range(14): if k != 0: if s[i] == '.': if s[i - 1] != 'S' and s[i + 1] != 'S': s[i] = 'x' k -= 1 if k == 0: break mas.append(s) for a in range(n): s = mas[a] if k != 0: for i in range(14): if s[i] == '.': if s[i + 1] == 'S' and s[i - 1] in ['x', '.', 'P', '-']: s[i] = 'x' k -= 1 elif s[i - 1] == 'S' and s[i + 1] in ['x', '.', 'P', '-']: s[i] = 'x' k -= 1 if k == 0: break mas[a] = s count = 0 for a in x(n): s = mas[a] if k != 0: for i in range(14): if s[i] == '.': s[i] = 'x' k -= 1 if k == 0: break for i in range(14): if s[i] == 'S': if s[i + 1] in 'SxP': count += 1 if s[i - 1] in 'SxP': count += 1 mas[a] = ''.join(s)[1:-1] print(count) print('\n'.join(mas))
for a in x(n):
31
statement
n, k = map(int, input().split()) mas = [] for a in range(n): s = list(input()) s.insert(0, '-') s.append('-') for i in range(14): if k != 0: if s[i] == '.': if s[i - 1] != 'S' and s[i + 1] != 'S': s[i] = 'x' k -= 1 if k == 0: break mas.append(s) for a in range(n): s = mas[a] if k != 0: for i in range(14): if s[i] == '.': if s[i + 1] == 'S' and s[i - 1] in ['x', '.', 'P', '-']: s[i] = 'x' k -= 1 elif s[i - 1] == 'S' and s[i + 1] in ['x', '.', 'P', '-']: s[i] = 'x' k -= 1 if k == 0: break mas[a] = s count = 0 for a in range(n): s = mas[a] if k != 0: for i in range(14): if s[i] == '.': s[i] = 'x' k -= 1 if k == 0: break for i in range(14): if s[i] == 'S': if s[i + 1] in 'SxP': count += 1 if s[i - 1] in 'SxP': count += 1 mas[a] = ''.join(s)[1:-1] print(count) print('\n'.join(mas))
n, k = map(int, input().split()) mas = [] for a in range(n): s = list(input()) s.insert(0, '-') s.append('-') for i in range(14): if k != 0: if s[i] == '.': if s[i - 1] != 'S' and s[i + 1] != 'S': s[i] = 'x' k -= 1 if k == 0: break mas.append(s) for a in range(n): s = mas[a] if k != 0: for i in range(14): if s[i] == '.': if s[i + 1] == 'S' and s[i - 1] in ['x', '.', 'P', '-']: s[i] = 'x' k -= 1 elif s[i - 1] == 'S' and s[i + 1] in ['x', '.', 'P', '-']: s[i] = 'x' k -= 1 if k == 0: break mas[a] = s count = 0 for a in range(n): s = mas[a] if k != 0: for i in range(14): if s[i] == '.': s[i] = 'x' k -= 1 if k == 0: break for i in range(14): if s[i] == 'S': if s[i/1] in 'SxP': count += 1 if s[i - 1] in 'SxP': count += 1 mas[a] = ''.join(s)[1:-1] print(count) print('\n'.join(mas))
if s[i/1] in 'SxP':
43
operation
n, k = map(int, input().split()) mas = [] for a in range(n): s = list(input()) s.insert(0, '-') s.append('-') for i in range(14): if k != 0: if s[i] == '.': if s[i - 1] != 'S' and s[i + 1] != 'S': s[i] = 'x' k -= 1 if k == 0: break mas.append(s) for a in range(n): s = mas[a] if k != 0: for i in range(14): if s[i] == '.': if s[i + 1] == 'S' and s[i - 1] in ['x', '.', 'P', '-']: s[i] = 'x' k -= 1 elif s[i - 1] == 'S' and s[i + 1] in ['x', '.', 'P', '-']: s[i] = 'x' k -= 1 if k == 0: break mas[a] = s count = 0 for a in range(n): s = mas[a] if k != 0: for i in range(14): if s[i] == '.': s[i] = 'x' k -= 1 if k == 0: break for i in range(14): if s[i] == 'S': if s[i + 1] in 'SxP': count += 1 if s[i - 1] in 'SxP': count += 1 mas[a] = ''.join(s)[1:-1] print(count) print('\n'.join(mas))
n, k = map(int, input().split()) mas = [] for a in range(n): s = list(input()) s.insert(0, '-') s.append('-') for i in range(14): if k != 0: if s[i] == '.': if s[i - 1] != 'S' and s[i + 1] != 'S': s[i] = 'x' k -= 1 if k == 0: break mas.append(s) for a in range(n): s = mas[a] if y != 0: for i in range(14): if s[i] == '.': if s[i + 1] == 'S' and s[i - 1] in ['x', '.', 'P', '-']: s[i] = 'x' k -= 1 elif s[i - 1] == 'S' and s[i + 1] in ['x', '.', 'P', '-']: s[i] = 'x' k -= 1 if k == 0: break mas[a] = s count = 0 for a in range(n): s = mas[a] if k != 0: for i in range(14): if s[i] == '.': s[i] = 'x' k -= 1 if k == 0: break for i in range(14): if s[i] == 'S': if s[i + 1] in 'SxP': count += 1 if s[i - 1] in 'SxP': count += 1 mas[a] = ''.join(s)[1:-1] print(count) print('\n'.join(mas))
if y != 0:
18
statement
n=int(input()) ar=sorted(list(map(int,input().split()))) ans=[[ar[0],0]] for x in ar: if x==ans[-1][0]: ans[-1][1]+=1 else: ans.append([x,1]) c=ans[0][1] b=0 while len(ans) > 1: if c==1: print("Conan") b=1 break elif c==n: print("Conan" if n%2 else "Agasa") b=1 break del ans[0] c=ans[0][1] if not b: print("Agasa")
n=int(input()) ar=sorted(list(map(int,input().split()))) ans=[[ar[0],0]] for x in ar: if x==ans[-1][0]: ans[-1][1]+=1 else: ans.append([x,1]) c=ans[0][1] b=0 while len(ans) > 1: if c==1: print("Conan") b=1 break elif c==n: print("Conan" if n**2 else "Agasa") b=1 break del ans[0] c=ans[0][1] if not b: print("Agasa")
print("Conan" if n**2 else "Agasa")
17
operation
n=int(input()) ar=sorted(list(map(int,input().split()))) ans=[[ar[0],0]] for x in ar: if x==ans[-1][0]: ans[-1][1]+=1 else: ans.append([x,1]) c=ans[0][1] b=0 while len(ans) > 1: if c==1: print("Conan") b=1 break elif c==n: print("Conan" if n%2 else "Agasa") b=1 break del ans[0] c=ans[0][1] if not b: print("Agasa")
n=int(input()) ar=sorted(list(map(int,input().split()))) ans=[[ar[0],0]] for x in ar: if x==ans[-1][0]: ans[-1][1]+=1 else: ans.append([x,1]) c=ans[0][1] b=0 while len(ans) > 1: if c<1: print("Conan") b=1 break elif c==n: print("Conan" if n%2 else "Agasa") b=1 break del ans[0] c=ans[0][1] if not b: print("Agasa")
if c<1:
12
decision
n=int(input()) ar=sorted(list(map(int,input().split()))) ans=[[ar[0],0]] for x in ar: if x==ans[-1][0]: ans[-1][1]+=1 else: ans.append([x,1]) c=ans[0][1] b=0 while len(ans) > 1: if c==1: print("Conan") b=1 break elif c==n: print("Conan" if n%2 else "Agasa") b=1 break del ans[0] c=ans[0][1] if not b: print("Agasa")
n=int(input()) ar=sorted(list(map(int,input().split()))) ans=[[ar[0],0]] for x in ar: if x==ans[-1][0]: ans[-1][1]+=1 else: ans.append([x,1]) c=ans[0][1] b=0 while len(ans)==1: if c==1: print("Conan") b=1 break elif c==n: print("Conan" if n%2 else "Agasa") b=1 break del ans[0] c=ans[0][1] if not b: print("Agasa")
while len(ans)==1:
11
decision
n=int(input()) ar=sorted(list(map(int,input().split()))) ans=[[ar[0],0]] for x in ar: if x==ans[-1][0]: ans[-1][1]+=1 else: ans.append([x,1]) c=ans[0][1] b=0 while len(ans) > 1: if c==1: print("Conan") b=1 break elif c==n: print("Conan" if n%2 else "Agasa") b=1 break del ans[0] c=ans[0][1] if not b: print("Agasa")
n=int(input()) ar=sorted(list(map(int,input().split()))) ans=[[ar[0],0]] for x in ar: if x==ans[-1][0]: ans[-1][1]+=1 else: ans.append([x,1]) c=ans[0][1] b=0 while len(ans) > 1: if c==1: print("Conan") b=1 break elif c==n: print("Conan" if n//2 else "Agasa") b=1 break del ans[0] c=ans[0][1] if not b: print("Agasa")
print("Conan" if n//2 else "Agasa")
17
operation
n=int(input()) ar=sorted(list(map(int,input().split()))) ans=[[ar[0],0]] for x in ar: if x==ans[-1][0]: ans[-1][1]+=1 else: ans.append([x,1]) c=ans[0][1] b=0 while len(ans) > 1: if c==1: print("Conan") b=1 break elif c==n: print("Conan" if n%2 else "Agasa") b=1 break del ans[0] c=ans[0][1] if not b: print("Agasa")
n=int(input()) ar=sorted(list(map(int,input().split()))) ans=[[ar[0],0]] for x in ar: if x==ans[-1][0]: ans[-1][1]+=1 else: ans.append([x,1]) c=ans[0][1] b=0 while len(ans) > 1: if c==1: print("Conan") b=1 break elif c==n: print("Conan" if n-2 else "Agasa") b=1 break del ans[0] c=ans[0][1] if not b: print("Agasa")
print("Conan" if n-2 else "Agasa")
17
operation
n = int(input()) a = [int(x) for x in input().split()] ans = 0 for i in a: if i % 2 == 1: ans += 1 print(ans)
n = int(input()) a = [int(x) for x in input().split()] ans = 0 for i in a: if i % 2<1: ans += 1 print(ans)
if i % 2<1:
7
decision
n = int(input()) a = [int(x) for x in input().split()] ans = 0 for i in a: if i % 2 == 1: ans += 1 print(ans)
n = int(input()) a = [int(x) for x in input().split()] ans = 0 for i in a: if i^2 == 1: ans += 1 print(ans)
if i^2 == 1:
7
operation
n = int(input()) a = [int(x) for x in input().split()] ans = 0 for i in a: if i % 2 == 1: ans += 1 print(ans)
n = int(input()) a = [int(x) for x in input().split()] ans = 0 for i in a: if i|2 == 1: ans += 1 print(ans)
if i|2 == 1:
7
operation
n = int(input()) a = [int(x) for x in input().split()] ans = 0 for i in a: if i % 2 == 1: ans += 1 print(ans)
n = int(input()) a = [int(x) for x in input().split()] ans = 0 for i in a: if i % 2 == 76: ans += 1 print(ans)
if i % 2 == 76:
7
value
n = int(input()) a = [int(x) for x in input().split()] ans = 0 for i in a: if i % 2 == 1: ans += 1 print(ans)
n = int(input()) a = [int(x) for x in input().split()] ans = 0 for i in a: if i*2 == 1: ans += 1 print(ans)
if i*2 == 1:
7
operation
README.md exists but content is empty.
Downloads last month
32