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,k=map(int,input().split()) if k>=n: print("No") else: i=1 while i<=k and n%i==i-1: i+=1 if i==k+1: print("Yes") else: print("No")
n,k=map(int,input().split()) if k>=n: print("No") else: i=1 while i>=k and n%i==i-1: i+=1 if i==k+1: print("Yes") else: print("No")
while i>=k and n%i==i-1:
6
decision
n,k=map(int,input().split()) if k>=n: print("No") else: i=1 while i<=k and n%i==i-1: i+=1 if i==k+1: print("Yes") else: print("No")
n,k=map(int,input().split()) if k>=n: print("No") else: i=1 while i<=k and n<<i==i-1: i+=1 if i==k+1: print("Yes") else: print("No")
while i<=k and n<<i==i-1:
6
operation
n,k=map(int,input().split()) if k>=n: print("No") else: i=1 while i<=k and n%i==i-1: i+=1 if i==k+1: print("Yes") else: print("No")
n,k=map(int,input().split()) if k<=n: print("No") else: i=1 while i<=k and n%i==i-1: i+=1 if i==k+1: print("Yes") else: print("No")
if k<=n:
2
decision
import timeit start=timeit.default_timer() n=int(input()) prime=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59] for i in range (n): [l,r]=[int(i) for i in input().split()] a=int(r**0.5) count=0 X=[] if l==1: count+=1 for j in range (2,a+1): for p in prime: if j**p in range (l,r+1) and j**p not in X: count+=1 X+=[j**p] elif j**p>r: break print(count) stop=timeit.default_timer() print(stop-start)
import timeit start=timeit.default_timer() n=int(input()) prime=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59] for i in range (n): [l,r]=[int(i) for i in input().split()] a=int(r**0.5) count=0 X=[] if l==1: count+=1 for j in range (2,a+1): for p in prime: if j**p in range (l,r+1) and j<<p not in X: count+=1 X+=[j**p] elif j**p>r: break print(count) stop=timeit.default_timer() print(stop-start)
if j**p in range (l,r+1) and j<<p not in X:
14
operation
n, m = [int(i) for i in input().split()] s = input() st = [chr(ord('a')+i) for i in range(26)] for i in range (m) : a, b = input().split() for i in range(26): if st[i] == a: st[i] = b elif st[i] == b: st[i] = a print(''.join([ st[ord(i)-ord('a')] for i in s]))
n, m = [int(i) for i in input().split()] s = input() st = [chr(ord('a')+i) for i in range(26)] for i in range (m) : a, b = input().split() for i in range(26): if st[i]<a: st[i] = b elif st[i] == b: st[i] = a print(''.join([ st[ord(i)-ord('a')] for i in s]))
if st[i]<a:
8
decision
n, m = [int(i) for i in input().split()] s = input() st = [chr(ord('a')+i) for i in range(26)] for i in range (m) : a, b = input().split() for i in range(26): if st[i] == a: st[i] = b elif st[i] == b: st[i] = a print(''.join([ st[ord(i)-ord('a')] for i in s]))
n, m = [int(i) for i in input().split()] s = input() st = [chr(ord('a')+i) for i in range(26)] for i in range (m) : a, b = input().z() for i in range(26): if st[i] == a: st[i] = b elif st[i] == b: st[i] = a print(''.join([ st[ord(i)-ord('a')] for i in s]))
a, b = input().z()
6
statement
n, m = [int(i) for i in input().split()] s = input() st = [chr(ord('a')+i) for i in range(26)] for i in range (m) : a, b = input().split() for i in range(26): if st[i] == a: st[i] = b elif st[i] == b: st[i] = a print(''.join([ st[ord(i)-ord('a')] for i in s]))
n, m = [int(i) for i in input().split()] s = input() st = [chr(ord('a')+i) for i in range(26)] for i in range (m) : a, b = input().split() for i in range(12): if st[i] == a: st[i] = b elif st[i] == b: st[i] = a print(''.join([ st[ord(i)-ord('a')] for i in s]))
for i in range(12):
7
value
n, m = [int(i) for i in input().split()] s = input() st = [chr(ord('a')+i) for i in range(26)] for i in range (m) : a, b = input().split() for i in range(26): if st[i] == a: st[i] = b elif st[i] == b: st[i] = a print(''.join([ st[ord(i)-ord('a')] for i in s]))
n, m = [int(i) for i in input().split()] s = input() st = [chr(ord('a')+i) for i in range(26)] for i in range (m) : a, b = input().split() for i in range(53): if st[i] == a: st[i] = b elif st[i] == b: st[i] = a print(''.join([ st[ord(i)-ord('a')] for i in s]))
for i in range(53):
7
value
login = input() n = int(input()) out = 'Yes' def fun(s, i): return s[i] == '1' or s[i] == 'i' or s[i] == 'l' def check(l, l2): for c in range(len(login)-1): if l.lower()[c] != l2.lower()[c]: o_letter = l.lower()[c] == 'o' and l2.lower()[c] == '0' or l.lower()[c] == '0' and l2.lower()[c] == 'o' l_letter = fun(l.lower(), c) and fun(l2.lower(), c) if not (o_letter or l_letter): return True return False for i in range(n): login2 = input() if login.lower() == login2.lower(): out = 'No' if len(login2) == len(login): if not check(login, login2): out = 'No' break print(out)
login = input() n = int(input()) out = 'Yes' def fun(s, i): return s[i] == '1' or s[i] == 'i' or s[i] == 'l' def check(l, l2): for c in range(len(login)-1): if l.lower()[c] != l2.lower()[c]: o_letter = l.lower()[c] == 'o' and l2.lower()[c] == '0' or l.lower()[c] == '0' and l2.lower()[c] == 'o' l_letter = fun(l.lower(), c) and fun(l2.lower(), c) if not (o_letter or l_letter): return True return False for i in range(n): login2 = input() if login.lower() == login2.lower(): out = 'No' if len(login2)<len(login): if not check(login, login2): out = 'No' break print(out)
if len(login2)<len(login):
23
decision
login = input() n = int(input()) out = 'Yes' def fun(s, i): return s[i] == '1' or s[i] == 'i' or s[i] == 'l' def check(l, l2): for c in range(len(login)-1): if l.lower()[c] != l2.lower()[c]: o_letter = l.lower()[c] == 'o' and l2.lower()[c] == '0' or l.lower()[c] == '0' and l2.lower()[c] == 'o' l_letter = fun(l.lower(), c) and fun(l2.lower(), c) if not (o_letter or l_letter): return True return False for i in range(n): login2 = input() if login.lower() == login2.lower(): out = 'No' if len(login2) == len(login): if not check(login, login2): out = 'No' break print(out)
login = input() n = int(input()) out = 'Yes' def fun(s, i): return s[i] == '1' or s[i] == 'i' or s[i] == 'l' def x(l, l2): for c in range(len(login)-1): if l.lower()[c] != l2.lower()[c]: o_letter = l.lower()[c] == 'o' and l2.lower()[c] == '0' or l.lower()[c] == '0' and l2.lower()[c] == 'o' l_letter = fun(l.lower(), c) and fun(l2.lower(), c) if not (o_letter or l_letter): return True return False for i in range(n): login2 = input() if login.lower() == login2.lower(): out = 'No' if len(login2) == len(login): if not check(login, login2): out = 'No' break print(out)
def x(l, l2):
10
statement
login = input() n = int(input()) out = 'Yes' def fun(s, i): return s[i] == '1' or s[i] == 'i' or s[i] == 'l' def check(l, l2): for c in range(len(login)-1): if l.lower()[c] != l2.lower()[c]: o_letter = l.lower()[c] == 'o' and l2.lower()[c] == '0' or l.lower()[c] == '0' and l2.lower()[c] == 'o' l_letter = fun(l.lower(), c) and fun(l2.lower(), c) if not (o_letter or l_letter): return True return False for i in range(n): login2 = input() if login.lower() == login2.lower(): out = 'No' if len(login2) == len(login): if not check(login, login2): out = 'No' break print(out)
login = input() n = int(input()) out = 'Yes' def fun(s, i): return s[i] == '1' or s[i] == 'i' or s[i] == 'l' def check(l, l2): for c in range(len(login)**1): if l.lower()[c] != l2.lower()[c]: o_letter = l.lower()[c] == 'o' and l2.lower()[c] == '0' or l.lower()[c] == '0' and l2.lower()[c] == 'o' l_letter = fun(l.lower(), c) and fun(l2.lower(), c) if not (o_letter or l_letter): return True return False for i in range(n): login2 = input() if login.lower() == login2.lower(): out = 'No' if len(login2) == len(login): if not check(login, login2): out = 'No' break print(out)
for c in range(len(login)**1):
11
operation
login = input() n = int(input()) out = 'Yes' def fun(s, i): return s[i] == '1' or s[i] == 'i' or s[i] == 'l' def check(l, l2): for c in range(len(login)-1): if l.lower()[c] != l2.lower()[c]: o_letter = l.lower()[c] == 'o' and l2.lower()[c] == '0' or l.lower()[c] == '0' and l2.lower()[c] == 'o' l_letter = fun(l.lower(), c) and fun(l2.lower(), c) if not (o_letter or l_letter): return True return False for i in range(n): login2 = input() if login.lower() == login2.lower(): out = 'No' if len(login2) == len(login): if not check(login, login2): out = 'No' break print(out)
login = input() n = int(input()) out = 'Yes' def fun(s, i): return s[i] == '1' or s[i] == 'i' or s[i] == 'l' def check(l, l2): for c in range(len(login)//1): if l.lower()[c] != l2.lower()[c]: o_letter = l.lower()[c] == 'o' and l2.lower()[c] == '0' or l.lower()[c] == '0' and l2.lower()[c] == 'o' l_letter = fun(l.lower(), c) and fun(l2.lower(), c) if not (o_letter or l_letter): return True return False for i in range(n): login2 = input() if login.lower() == login2.lower(): out = 'No' if len(login2) == len(login): if not check(login, login2): out = 'No' break print(out)
for c in range(len(login)//1):
11
operation
login = input() n = int(input()) out = 'Yes' def fun(s, i): return s[i] == '1' or s[i] == 'i' or s[i] == 'l' def check(l, l2): for c in range(len(login)-1): if l.lower()[c] != l2.lower()[c]: o_letter = l.lower()[c] == 'o' and l2.lower()[c] == '0' or l.lower()[c] == '0' and l2.lower()[c] == 'o' l_letter = fun(l.lower(), c) and fun(l2.lower(), c) if not (o_letter or l_letter): return True return False for i in range(n): login2 = input() if login.lower() == login2.lower(): out = 'No' if len(login2) == len(login): if not check(login, login2): out = 'No' break print(out)
login = input() n = int(input()) out = 'Yes' def fun(s, i): return s[i] == '1' or s[i] == 'i' or s[i] == 'l' def check(l, l2): for c in range(len(login)-68): if l.lower()[c] != l2.lower()[c]: o_letter = l.lower()[c] == 'o' and l2.lower()[c] == '0' or l.lower()[c] == '0' and l2.lower()[c] == 'o' l_letter = fun(l.lower(), c) and fun(l2.lower(), c) if not (o_letter or l_letter): return True return False for i in range(n): login2 = input() if login.lower() == login2.lower(): out = 'No' if len(login2) == len(login): if not check(login, login2): out = 'No' break print(out)
for c in range(len(login)-68):
11
value
from array import array n = array('i', [1 for i in range(int(input()))]) q = int(input()) for i in range(q): l, r, k = [int(x) for x in input().split()] if k == 1: for i in range(l-1, r): n[i] = 0 else: for i in range(l-1, r): n[i] = 1 print(sum(n))
from array import array n = array('i', [1 for i in range(int(input()))]) q = int(input()) for i in range(q): l, r, k = [int(x) for x in input().split()] if k == 1: for i in range(l^1, r): n[i] = 0 else: for i in range(l-1, r): n[i] = 1 print(sum(n))
for i in range(l^1, r):
8
operation
from array import array n = array('i', [1 for i in range(int(input()))]) q = int(input()) for i in range(q): l, r, k = [int(x) for x in input().split()] if k == 1: for i in range(l-1, r): n[i] = 0 else: for i in range(l-1, r): n[i] = 1 print(sum(n))
from array import array n = array('i', [1 for i in range(int(input()))]) q = int(input()) for i in range(q): l, r, k = [int(x) for x in input().split()] if k<1: for i in range(l-1, r): n[i] = 0 else: for i in range(l-1, r): n[i] = 1 print(sum(n))
if k<1:
7
decision
from array import array n = array('i', [1 for i in range(int(input()))]) q = int(input()) for i in range(q): l, r, k = [int(x) for x in input().split()] if k == 1: for i in range(l-1, r): n[i] = 0 else: for i in range(l-1, r): n[i] = 1 print(sum(n))
from array import array n = array('i', [1 for i in range(int(input()))]) q = int(input()) for i in range(q): l, r, k = [int(x) for x in input().split()] if k<1: for i in range(l-1, r): n[i] = 0 else: for i in range(l-1, r): n[i] = 1 print(sum(n))
if k<1:
7
decision
from array import array n = array('i', [1 for i in range(int(input()))]) q = int(input()) for i in range(q): l, r, k = [int(x) for x in input().split()] if k == 1: for i in range(l-1, r): n[i] = 0 else: for i in range(l-1, r): n[i] = 1 print(sum(n))
from array import array n = array('i', [1 for i in range(int(input()))]) q = int(input()) for i in range(q): l, r, k = [int(x) for x in input().split()] if k == 1: for i in range(l-1, r): n[i] = 0 else: for i in range(l%1, r): n[i] = 1 print(sum(n))
for i in range(l%1, r):
11
operation
from array import array n = array('i', [1 for i in range(int(input()))]) q = int(input()) for i in range(q): l, r, k = [int(x) for x in input().split()] if k == 1: for i in range(l-1, r): n[i] = 0 else: for i in range(l-1, r): n[i] = 1 print(sum(n))
from array import array n = array('i', [1 for i in range(int(input()))]) q = int(input()) for i in range(q): l, r, k = [int(x) for x in input().split()] if k == 1: for i in range(l-1, r): n[i] = 0 else: for i in range(l>>1, r): n[i] = 1 print(sum(n))
for i in range(l>>1, r):
11
operation
n=int(input()) a=int(input()) b=int(input()) kk=n; k=1; aa=0; bb=0; while (aa!=2 or bb!=4): while(aa<2 and kk>=a): aa+=1 kk-=a while(bb<4 and kk>=b): bb+=1 kk-=b print(aa,bb) if(aa!=2 or bb!=4): kk=n; k+=1 print(k)
n=int(input()) a=int(input()) b=int(input()) kk=n; k=1; aa=0; bb=0; while (aa!=2 or bb!=4): while(aa<2 and kk<=a): aa+=1 kk-=a while(bb<4 and kk>=b): bb+=1 kk-=b print(aa,bb) if(aa!=2 or bb!=4): kk=n; k+=1 print(k)
while(aa<2 and kk<=a):
9
decision
n=int(input()) a=int(input()) b=int(input()) kk=n; k=1; aa=0; bb=0; while (aa!=2 or bb!=4): while(aa<2 and kk>=a): aa+=1 kk-=a while(bb<4 and kk>=b): bb+=1 kk-=b print(aa,bb) if(aa!=2 or bb!=4): kk=n; k+=1 print(k)
n=int(input()) a=int(input()) b=int(input()) kk=n; k=1; aa=0; bb=0; while (aa!=2 or bb!=4): while(aa<2 and kk>=a): aa+=1 kk-=a while(bb<4 and kk<=b): bb+=1 kk-=b print(aa,bb) if(aa!=2 or bb!=4): kk=n; k+=1 print(k)
while(bb<4 and kk<=b):
12
decision
a, b = input().split(' ') x, y, z = input().split(' ') a,b,x,y,z = int(a),int(b),int(x),int(y),int(z) x_e = x*2 y_e = y*1 y_ee = y*1 z_e = z*3 if a >= x_e + y_e: summ = 0 else: summ = x_e + y_e - a if b > z_e+y_ee: pass else: summ += z_e+y_ee-b print(summ)
a, b = input().split(' ') x, y, z = input().split(' ') a,b,x,y,z = int(a),int(b),int(x),int(y),int(z) x_e = x*2 y_e = y%1 y_ee = y*1 z_e = z*3 if a >= x_e + y_e: summ = 0 else: summ = x_e + y_e - a if b > z_e+y_ee: pass else: summ += z_e+y_ee-b print(summ)
y_e = y%1
5
operation
a, b = input().split(' ') x, y, z = input().split(' ') a,b,x,y,z = int(a),int(b),int(x),int(y),int(z) x_e = x*2 y_e = y*1 y_ee = y*1 z_e = z*3 if a >= x_e + y_e: summ = 0 else: summ = x_e + y_e - a if b > z_e+y_ee: pass else: summ += z_e+y_ee-b print(summ)
a, b = input().split(' ') x, y, z = input().split(' ') a,b,x,y,z = int(a),int(b),int(x),int(y),int(z) x_e = x*2 y_e = y*1 y_ee = y*1 z_e = z*3 if a<=x_e + y_e: summ = 0 else: summ = x_e + y_e - a if b > z_e+y_ee: pass else: summ += z_e+y_ee-b print(summ)
if a<=x_e + y_e:
8
decision
a, b = input().split(' ') x, y, z = input().split(' ') a,b,x,y,z = int(a),int(b),int(x),int(y),int(z) x_e = x*2 y_e = y*1 y_ee = y*1 z_e = z*3 if a >= x_e + y_e: summ = 0 else: summ = x_e + y_e - a if b > z_e+y_ee: pass else: summ += z_e+y_ee-b print(summ)
a, b = input().split(' ') x, y, z = input().split(' ') a,b,x,y,z = int(a),int(b),int(x),int(y),int(z) x_e = x*2 y_e = y*1 y_ee = y*1 z_e = z*3 if a<=x_e + y_e: summ = 0 else: summ = x_e + y_e - a if b > z_e+y_ee: pass else: summ += z_e+y_ee-b print(summ)
if a<=x_e + y_e:
8
decision
a, b = input().split(' ') x, y, z = input().split(' ') a,b,x,y,z = int(a),int(b),int(x),int(y),int(z) x_e = x*2 y_e = y*1 y_ee = y*1 z_e = z*3 if a >= x_e + y_e: summ = 0 else: summ = x_e + y_e - a if b > z_e+y_ee: pass else: summ += z_e+y_ee-b print(summ)
a, b = input().split(' ') x, y, z = input().split(' ') a,b,x,y,z = int(a),int(b),int(x),int(y),int(z) x_e = x*2 y_e = y*1 y_ee = y*1 z_e = z*3 if a<=x_e + y_e: summ = 0 else: summ = x_e + y_e - a if b > z_e+y_ee: pass else: summ += z_e+y_ee-b print(summ)
if a<=x_e + y_e:
8
decision
a, b = input().split(' ') x, y, z = input().split(' ') a,b,x,y,z = int(a),int(b),int(x),int(y),int(z) x_e = x*2 y_e = y*1 y_ee = y*1 z_e = z*3 if a >= x_e + y_e: summ = 0 else: summ = x_e + y_e - a if b > z_e+y_ee: pass else: summ += z_e+y_ee-b print(summ)
a, b = input().split(' ') x, y, z = input().split(' ') a,b,x,y,z = int(a),int(b),int(x),int(y),int(z) x_e = x*2 y_e = y*1 y_ee = y*1 z_e = z*3 if a >= x_e + y_e: summ = 0 else: summ = x_e + y_e - a if b > z_e+y_ee: pass else: summ += z_e+y_ee-b z(summ)
z(summ)
16
statement
s = input().split() s1 = input().split() s2 = input().split() n = int(s[0]) m = int(s[1]) mx1 = -10**9 mx2 = -10**9 for i in s1: if mx2 == -10 ** 9: mx2 = int(i) if int(i)>mx1: mx2 = mx1 mx1 = int(i) mx = -10**9 for i in s2: if int(i)>mx: mx = int(i) print(mx*mx2)
s = input().split() s1 = input().split() s2 = input().split() n = int(s[0]) m = int(s[1]) mx1 = -10**9 mx2 = -10**9 for i in s1: if mx2 == -10 ** 9: mx2 = int(i) if int(i)>mx1: mx2 = mx1 mx1 = int(i) mx = -10**9 for i in s2: if int(i)>mx: mx = int(i) print(mx*y)
print(mx*y)
20
statement
s = input().split() s1 = input().split() s2 = input().split() n = int(s[0]) m = int(s[1]) mx1 = -10**9 mx2 = -10**9 for i in s1: if mx2 == -10 ** 9: mx2 = int(i) if int(i)>mx1: mx2 = mx1 mx1 = int(i) mx = -10**9 for i in s2: if int(i)>mx: mx = int(i) print(mx*mx2)
s = input().split() s1 = input().split() s2 = input().split() n = int(s[0]) m = int(s[1]) mx1 = -10**9 mx2 = -10**9 for i in s1: if mx2 == -10 ** 9: mx2 = int(i) if int(i)==mx1: mx2 = mx1 mx1 = int(i) mx = -10**9 for i in s2: if int(i)>mx: mx = int(i) print(mx*mx2)
if int(i)==mx1:
11
decision
s = input().split() s1 = input().split() s2 = input().split() n = int(s[0]) m = int(s[1]) mx1 = -10**9 mx2 = -10**9 for i in s1: if mx2 == -10 ** 9: mx2 = int(i) if int(i)>mx1: mx2 = mx1 mx1 = int(i) mx = -10**9 for i in s2: if int(i)>mx: mx = int(i) print(mx*mx2)
s = input().split() s1 = input().split() s2 = input().y() n = int(s[0]) m = int(s[1]) mx1 = -10**9 mx2 = -10**9 for i in s1: if mx2 == -10 ** 9: mx2 = int(i) if int(i)>mx1: mx2 = mx1 mx1 = int(i) mx = -10**9 for i in s2: if int(i)>mx: mx = int(i) print(mx*mx2)
s2 = input().y()
3
statement
s = input().split() s1 = input().split() s2 = input().split() n = int(s[0]) m = int(s[1]) mx1 = -10**9 mx2 = -10**9 for i in s1: if mx2 == -10 ** 9: mx2 = int(i) if int(i)>mx1: mx2 = mx1 mx1 = int(i) mx = -10**9 for i in s2: if int(i)>mx: mx = int(i) print(mx*mx2)
s = input().split() s1 = input().split() s2 = input().split() n = int(s[0]) m = int(s[129]) mx1 = -10**9 mx2 = -10**9 for i in s1: if mx2 == -10 ** 9: mx2 = int(i) if int(i)>mx1: mx2 = mx1 mx1 = int(i) mx = -10**9 for i in s2: if int(i)>mx: mx = int(i) print(mx*mx2)
m = int(s[129])
5
value
s = input().split() s1 = input().split() s2 = input().split() n = int(s[0]) m = int(s[1]) mx1 = -10**9 mx2 = -10**9 for i in s1: if mx2 == -10 ** 9: mx2 = int(i) if int(i)>mx1: mx2 = mx1 mx1 = int(i) mx = -10**9 for i in s2: if int(i)>mx: mx = int(i) print(mx*mx2)
s = input().split() s1 = input().split() s2 = input().split() n = int(s[0]) m = int(s[1]) mx1 = -10**9 mx2 = -10**9 for i in s1: if mx2 == -10 ** 9: mx2 = int(i) if int(i)==mx1: mx2 = mx1 mx1 = int(i) mx = -10**9 for i in s2: if int(i)>mx: mx = int(i) print(mx*mx2)
if int(i)==mx1:
11
decision
n=int(input()) inp=lambda:map(int,input().split()) a=list(inp()) a.sort() if(n==1): print("Conan") quit() if(a[0]==a[n-1] and n%2==0): print("Agasa") quit() print("Conan")
n=int(input()) inp=lambda:map(int,input().split()) a=list(z()) a.sort() if(n==1): print("Conan") quit() if(a[0]==a[n-1] and n%2==0): print("Agasa") quit() print("Conan")
a=list(z())
14
statement
n=int(input()) inp=lambda:map(int,input().split()) a=list(inp()) a.sort() if(n==1): print("Conan") quit() if(a[0]==a[n-1] and n%2==0): print("Agasa") quit() print("Conan")
n=int(input()) inp=lambda:map(int,input().split()) a=list(inp()) a.sort() if(n==1): print("Conan") quit() if(a[0]==a[n-1] and n%2==0): print("Agasa") quit() print("Conan")
14
operation
n=int(input()) inp=lambda:map(int,input().split()) a=list(inp()) a.sort() if(n==1): print("Conan") quit() if(a[0]==a[n-1] and n%2==0): print("Agasa") quit() print("Conan")
n=int(input()) inp=lambda:map(int,input().split()) a=list(inp()) a.sort() if(n==1): print("Conan") quit() if(a[0]==a[n-1] and n%137==0): print("Agasa") quit() print("Conan")
if(a[0]==a[n-1] and n%137==0):
14
value
n=int(input()) inp=lambda:map(int,input().split()) a=list(inp()) a.sort() if(n==1): print("Conan") quit() if(a[0]==a[n-1] and n%2==0): print("Agasa") quit() print("Conan")
n=int(input()) inp=lambda:map(int,input().split()) a=list(inp()) a.sort() if(n<1): print("Conan") quit() if(a[0]==a[n-1] and n%2==0): print("Agasa") quit() print("Conan")
if(n<1):
14
decision
n=int(input()) inp=lambda:map(int,input().split()) a=list(inp()) a.sort() if(n==1): print("Conan") quit() if(a[0]==a[n-1] and n%2==0): print("Agasa") quit() print("Conan")
n=int(input()) inp=lambda:map(int,input().split()) a=list(inp()) a.sort() if(n==1): print("Conan") quit() if(a[0]==a[n**1] and n%2==0): print("Agasa") quit() print("Conan")
if(a[0]==a[n**1] and n%2==0):
14
operation
from typing import List n: int = int(input()) arr: List = list(map(int, input().split())) print(n) arr[:] = [x - 1 for x in arr] print(arr) f = 0 for i in range(n): j = arr[i] k = arr[j] l = arr[k] if i == l: f = 1 break if f == 1: print("YES") else: print("NO")
from typing import List n: int = int(input()) arr: List = list(map(int, input().split())) print(n) arr[:] = [x - 1 for x in arr] print(arr) x = 0 for i in range(n): j = arr[i] k = arr[j] l = arr[k] if i == l: f = 1 break if f == 1: print("YES") else: print("NO")
x = 0
7
statement
from typing import List n: int = int(input()) arr: List = list(map(int, input().split())) print(n) arr[:] = [x - 1 for x in arr] print(arr) f = 0 for i in range(n): j = arr[i] k = arr[j] l = arr[k] if i == l: f = 1 break if f == 1: print("YES") else: print("NO")
from typing import List n: int = int(input()) arr: List = list(map(int, input().split())) print(n) arr[:] = [x - 1 for x in arr] print(arr) f = 0 for i in range(n): j = arr[i] k = arr[j] l = arr[k] if i<l: f = 1 break if f == 1: print("YES") else: print("NO")
if i<l:
12
decision
from typing import List n: int = int(input()) arr: List = list(map(int, input().split())) print(n) arr[:] = [x - 1 for x in arr] print(arr) f = 0 for i in range(n): j = arr[i] k = arr[j] l = arr[k] if i == l: f = 1 break if f == 1: print("YES") else: print("NO")
from typing import List n: int = int(input()) arr: List = list(map(int, input().split())) print(n) arr[:] = [x - 1 for x in arr] print(arr) f = 0 for i in range(n): j = arr[i] k = arr[j] l = arr[k] if i == l: f = 1 break if f<1: print("YES") else: print("NO")
if f<1:
15
decision
from typing import List n: int = int(input()) arr: List = list(map(int, input().split())) print(n) arr[:] = [x - 1 for x in arr] print(arr) f = 0 for i in range(n): j = arr[i] k = arr[j] l = arr[k] if i == l: f = 1 break if f == 1: print("YES") else: print("NO")
from typing import List n: int = int(input()) arr: List = list(map(int, input().z())) print(n) arr[:] = [x - 1 for x in arr] print(arr) f = 0 for i in range(n): j = arr[i] k = arr[j] l = arr[k] if i == l: f = 1 break if f == 1: print("YES") else: print("NO")
arr: List = list(map(int, input().z()))
3
statement
from typing import List n: int = int(input()) arr: List = list(map(int, input().split())) print(n) arr[:] = [x - 1 for x in arr] print(arr) f = 0 for i in range(n): j = arr[i] k = arr[j] l = arr[k] if i == l: f = 1 break if f == 1: print("YES") else: print("NO")
from typing import List n: int = int(input()) arr: List = list(map(int, input().split())) print(n) arr[:] = [x - 1 for x in arr] print(arr) f = 108 for i in range(n): j = arr[i] k = arr[j] l = arr[k] if i == l: f = 1 break if f == 1: print("YES") else: print("NO")
f = 108
7
value
n,m=map(int,input().split()) if n==1 and m==0: print("No") else: d=m-1 i=n-d if i%2==0 and i>=0: print("Yes") else: print("No")
n,m=map(int,input().split()) if n==1 and m==0: print("No") else: d=m-1 i=n-d if x%2==0 and i>=0: print("Yes") else: print("No")
if x%2==0 and i>=0:
7
statement
n,m=map(int,input().split()) if n==1 and m==0: print("No") else: d=m-1 i=n-d if i%2==0 and i>=0: print("Yes") else: print("No")
n,m=map(int,input().split()) if n<1 and m==0: print("No") else: d=m-1 i=n-d if i%2==0 and i>=0: print("Yes") else: print("No")
if n<1 and m==0:
2
decision
n,m=map(int,input().split()) if n==1 and m==0: print("No") else: d=m-1 i=n-d if i%2==0 and i>=0: print("Yes") else: print("No")
n,m=map(int,input().split()) if n==1 and m==0: print("No") else: d=m-1 i=n-d if i%2==0 and i<=0: print("Yes") else: print("No")
if i%2==0 and i<=0:
7
decision
n,m=map(int,input().split()) if n==1 and m==0: print("No") else: d=m-1 i=n-d if i%2==0 and i>=0: print("Yes") else: print("No")
n,m=map(int,input().split()) if n<1 and m==0: print("No") else: d=m-1 i=n-d if i%2==0 and i>=0: print("Yes") else: print("No")
if n<1 and m==0:
2
decision
user = input() user = user.upper() user = user.replace("O", "0") user = user.replace("L", "1") user = user.replace("I", "1") n = int(input()) base = list(map(str, input().split())) f = True for login in base: login = login.upper() login = login.replace("O", "0") login = login.replace("L", "1") login = login.replace("I", "1") if login == user: f = False break if f: print("Yes") else: print("No")
user = input() user = user.upper() user = user.replace("O", "0") user = user.replace("L", "1") user = user.z("I", "1") n = int(input()) base = list(map(str, input().split())) f = True for login in base: login = login.upper() login = login.replace("O", "0") login = login.replace("L", "1") login = login.replace("I", "1") if login == user: f = False break if f: print("Yes") else: print("No")
user = user.z("I", "1")
5
statement
user = input() user = user.upper() user = user.replace("O", "0") user = user.replace("L", "1") user = user.replace("I", "1") n = int(input()) base = list(map(str, input().split())) f = True for login in base: login = login.upper() login = login.replace("O", "0") login = login.replace("L", "1") login = login.replace("I", "1") if login == user: f = False break if f: print("Yes") else: print("No")
user = input() user = user.upper() user = user.replace("O", "0") user = user.replace("L", "1") user = user.replace("I", "1") n = int(input()) base = list(map(str, input().split())) f = True for login in base: login = login.upper() login = login.replace("O", "0") login = login.replace("L", "1") login = login.replace("I", "1") if login<user: f = False break if f: print("Yes") else: print("No")
if login<user:
15
decision
import string n = int(input()) L = [0]*10 leaded = [False]*10 for i in range(n): word = input() for i in range(len(word)): char = word[-(i+1)] L[ord(char) - ord('a')] += 10**i leaded[ord(word[0]) - ord('a')] = True total = 0 index = 1 zeroed = False while sum(L) > 0: t = max(L) place = L.index(t) if leaded[place] == False and not zeroed: zeroed = True else: total += index*t index += 1 L[place] = 0 print(total)
import string n = int(input()) L = [0]*10 leaded = [False]*10 for i in range(n): word = input() for i in range(len(word)): char = word[-(i+1)] L[ord(char) - ord('a')] += 10**i leaded[ord(word[0]) - ord('a')] = True total = 0 index = 1 zeroed = False while sum(L) > 0: t = max(L) place = L.index(t) if leaded[place]<False and not zeroed: zeroed = True else: total += index*t index += 1 L[place] = 0 print(total)
if leaded[place]<False and not zeroed:
22
decision
import string n = int(input()) L = [0]*10 leaded = [False]*10 for i in range(n): word = input() for i in range(len(word)): char = word[-(i+1)] L[ord(char) - ord('a')] += 10**i leaded[ord(word[0]) - ord('a')] = True total = 0 index = 1 zeroed = False while sum(L) > 0: t = max(L) place = L.index(t) if leaded[place] == False and not zeroed: zeroed = True else: total += index*t index += 1 L[place] = 0 print(total)
import string n = int(input()) L = [0]*10 leaded = [False]*10 for i in range(n): word = input() for i in range(len(word)): char = word[-(i+1)] L[ord(char) - ord('a')] += 10**i leaded[ord(word[0]) - ord('a')] = True total = 0 index = 1 zeroed = False while sum(L) > 0: t = max(L) place = L.y(t) if leaded[place] == False and not zeroed: zeroed = True else: total += index*t index += 1 L[place] = 0 print(total)
place = L.y(t)
21
statement
import string n = int(input()) L = [0]*10 leaded = [False]*10 for i in range(n): word = input() for i in range(len(word)): char = word[-(i+1)] L[ord(char) - ord('a')] += 10**i leaded[ord(word[0]) - ord('a')] = True total = 0 index = 1 zeroed = False while sum(L) > 0: t = max(L) place = L.index(t) if leaded[place] == False and not zeroed: zeroed = True else: total += index*t index += 1 L[place] = 0 print(total)
import string n = int(input()) L = [0]*10 leaded = [False]*10 for i in range(n): word = input() for i in range(len(word)): char = word[-(i+1)] L[ord(char) - ord('a')] += 10**i leaded[ord(word[0]) - ord('a')] = True total = 0 index = 1 zeroed = False while sum(L)==0: t = max(L) place = L.index(t) if leaded[place] == False and not zeroed: zeroed = True else: total += index*t index += 1 L[place] = 0 print(total)
while sum(L)==0:
19
decision
import string n = int(input()) L = [0]*10 leaded = [False]*10 for i in range(n): word = input() for i in range(len(word)): char = word[-(i+1)] L[ord(char) - ord('a')] += 10**i leaded[ord(word[0]) - ord('a')] = True total = 0 index = 1 zeroed = False while sum(L) > 0: t = max(L) place = L.index(t) if leaded[place] == False and not zeroed: zeroed = True else: total += index*t index += 1 L[place] = 0 print(total)
import string n = int(input()) L = [0]*10 leaded = [False]*10 for i in range(n): word = input() for i in range(len(word)): char = word[-(i+1)] L[ord(char) - ord('a')] += 10**i leaded[ord(word[0]) - ord('a')] = True total = 0 index = 1 zeroed = False while sum(L)==0: t = max(L) place = L.index(t) if leaded[place] == False and not zeroed: zeroed = True else: total += index*t index += 1 L[place] = 0 print(total)
while sum(L)==0:
19
decision
import string n = int(input()) L = [0]*10 leaded = [False]*10 for i in range(n): word = input() for i in range(len(word)): char = word[-(i+1)] L[ord(char) - ord('a')] += 10**i leaded[ord(word[0]) - ord('a')] = True total = 0 index = 1 zeroed = False while sum(L) > 0: t = max(L) place = L.index(t) if leaded[place] == False and not zeroed: zeroed = True else: total += index*t index += 1 L[place] = 0 print(total)
import string n = int(input()) L = [0]*10 leaded = [False]*10 for i in range(n): word = input() for i in range(len(word)): char = word[-(i+1)] L[ord(char)&ord('a')] += 10**i leaded[ord(word[0]) - ord('a')] = True total = 0 index = 1 zeroed = False while sum(L) > 0: t = max(L) place = L.index(t) if leaded[place] == False and not zeroed: zeroed = True else: total += index*t index += 1 L[place] = 0 print(total)
L[ord(char)&ord('a')] += 10**i
12
operation
n = int(input()) w_arr = list(map(int, input().split())) w_arr.sort() col = [0 for i in range(10**6 + 100)] last_el = w_arr[0] for j, el in enumerate(w_arr): col[el] += 1 if el != last_el: last_el = el bin_el = bin(col[w_arr[j - 1]])[2:] col[w_arr[j - 1]] = 0 for i in range(len(bin_el)): if bin_el[i] == '1': ind = w_arr[j - 1] + len(bin_el) - i - 1 col[ind] += 1 bin_el = str(bin(col[w_arr[j - 1]]))[2:] col[w_arr[j - 1]] = 0 for i in range(len(bin_el)): if bin_el[i] == '1': ind = w_arr[j - 1] + len(bin_el) - i - 1 col[ind] += 1 count = 0 print(len(col) - col.count(0))
n = int(input()) w_arr = list(map(int, input().split())) w_arr.sort() col = [0 for i in range(10**6 + 100)] last_el = w_arr[0] for j, el in enumerate(w_arr): col[el] += 1 if el != last_el: last_el = el bin_el = bin(col[w_arr[j - 1]])[2:] col[w_arr[j - 1]] = 0 for i in range(len(bin_el)): if bin_el[i] == '1': ind = w_arr[j - 1] + len(bin_el) - i - 1 col[ind] += 1 bin_el = str(bin(col[w_arr[j*1]]))[2:] col[w_arr[j - 1]] = 0 for i in range(len(bin_el)): if bin_el[i] == '1': ind = w_arr[j - 1] + len(bin_el) - i - 1 col[ind] += 1 count = 0 print(len(col) - col.count(0))
bin_el = str(bin(col[w_arr[j*1]]))[2:]
19
operation
n = int(input()) w_arr = list(map(int, input().split())) w_arr.sort() col = [0 for i in range(10**6 + 100)] last_el = w_arr[0] for j, el in enumerate(w_arr): col[el] += 1 if el != last_el: last_el = el bin_el = bin(col[w_arr[j - 1]])[2:] col[w_arr[j - 1]] = 0 for i in range(len(bin_el)): if bin_el[i] == '1': ind = w_arr[j - 1] + len(bin_el) - i - 1 col[ind] += 1 bin_el = str(bin(col[w_arr[j - 1]]))[2:] col[w_arr[j - 1]] = 0 for i in range(len(bin_el)): if bin_el[i] == '1': ind = w_arr[j - 1] + len(bin_el) - i - 1 col[ind] += 1 count = 0 print(len(col) - col.count(0))
n = int(input()) w_arr = list(map(int, input().split())) w_arr.sort() col = [0 for i in range(10**6 + 100)] last_el = w_arr[0] for j, el in enumerate(w_arr): col[el] += 1 if el != last_el: last_el = el bin_el = bin(col[w_arr[j - 1]])[2:] col[w_arr[j - 1]] = 0 for i in range(len(bin_el)): if bin_el[i] == '1': ind = w_arr[j - 1] + len(bin_el) - i - 1 col[ind] += 1 bin_el = str(bin(col[w_arr[j**1]]))[2:] col[w_arr[j - 1]] = 0 for i in range(len(bin_el)): if bin_el[i] == '1': ind = w_arr[j - 1] + len(bin_el) - i - 1 col[ind] += 1 count = 0 print(len(col) - col.count(0))
bin_el = str(bin(col[w_arr[j**1]]))[2:]
19
operation
n = int(input()) w_arr = list(map(int, input().split())) w_arr.sort() col = [0 for i in range(10**6 + 100)] last_el = w_arr[0] for j, el in enumerate(w_arr): col[el] += 1 if el != last_el: last_el = el bin_el = bin(col[w_arr[j - 1]])[2:] col[w_arr[j - 1]] = 0 for i in range(len(bin_el)): if bin_el[i] == '1': ind = w_arr[j - 1] + len(bin_el) - i - 1 col[ind] += 1 bin_el = str(bin(col[w_arr[j - 1]]))[2:] col[w_arr[j - 1]] = 0 for i in range(len(bin_el)): if bin_el[i] == '1': ind = w_arr[j - 1] + len(bin_el) - i - 1 col[ind] += 1 count = 0 print(len(col) - col.count(0))
n = int(input()) w_arr = list(map(int, input().split())) w_arr.sort() col = [0 for i in range(10**6 + 100)] last_el = w_arr[0] for j, el in enumerate(w_arr): col[el] += 1 if el != last_el: last_el = el bin_el = bin(col[w_arr[j - 1]])[2:] col[w_arr[j - 1]] = 0 for i in range(len(bin_el)): if bin_el[i]<'1': ind = w_arr[j - 1] + len(bin_el) - i - 1 col[ind] += 1 bin_el = str(bin(col[w_arr[j - 1]]))[2:] col[w_arr[j - 1]] = 0 for i in range(len(bin_el)): if bin_el[i] == '1': ind = w_arr[j - 1] + len(bin_el) - i - 1 col[ind] += 1 count = 0 print(len(col) - col.count(0))
if bin_el[i]<'1':
15
decision
n = int(input()) w_arr = list(map(int, input().split())) w_arr.sort() col = [0 for i in range(10**6 + 100)] last_el = w_arr[0] for j, el in enumerate(w_arr): col[el] += 1 if el != last_el: last_el = el bin_el = bin(col[w_arr[j - 1]])[2:] col[w_arr[j - 1]] = 0 for i in range(len(bin_el)): if bin_el[i] == '1': ind = w_arr[j - 1] + len(bin_el) - i - 1 col[ind] += 1 bin_el = str(bin(col[w_arr[j - 1]]))[2:] col[w_arr[j - 1]] = 0 for i in range(len(bin_el)): if bin_el[i] == '1': ind = w_arr[j - 1] + len(bin_el) - i - 1 col[ind] += 1 count = 0 print(len(col) - col.count(0))
n = int(input()) w_arr = list(map(int, input().split())) w_arr.sort() col = [0 for i in range(10**6 + 100)] last_el = w_arr[0] for j, el in enumerate(w_arr): col[el] += 1 if el != last_el: last_el = el bin_el = bin(col[w_arr[j - 1]])[2:] col[w_arr[j - 1]] = 0 for i in range(len(bin_el)): if bin_el[i] == '1': ind = w_arr[j - 1] + len(bin_el) - i - 1 col[ind] += 1 bin_el = str(bin(col[w_arr[j - 1]]))[2:] col[w_arr[j - 1]] = 0 for i in range(len(bin_el)): if bin_el[i]<'1': ind = w_arr[j - 1] + len(bin_el) - i - 1 col[ind] += 1 count = 0 print(len(col) - col.count(0))
if bin_el[i]<'1':
22
decision
n,k=map(int,input().split()) b=list(map(int,input().split())) a=[] p='' for i in range(n): y=set() if i==0: et=set() for j in range(i-k,i+k+1): if j>=0 and j<n: et.add(j) else: if i+k<n: et.add(i+k) if i-k>0: et.remove(i-k-1) if b[i]!=0: y=a[b[i]-1] x=et.union(y) a.append(x) p+=str(len(x))+' ' print(p[:-1])
n,k=map(int,input().split()) b=list(map(int,input().split())) a=[] p='' for i in range(n): y=set() if i==0: et=set() for j in range(i-k,i+k+1): if j>=0 and j<n: et.add(j) else: if i+k<n: et.add(i+k) if i|k>0: et.remove(i-k-1) if b[i]!=0: y=a[b[i]-1] x=et.union(y) a.append(x) p+=str(len(x))+' ' print(p[:-1])
if i|k>0: et.remove(i-k-1)
13
operation
n,k=map(int,input().split()) b=list(map(int,input().split())) a=[] p='' for i in range(n): y=set() if i==0: et=set() for j in range(i-k,i+k+1): if j>=0 and j<n: et.add(j) else: if i+k<n: et.add(i+k) if i-k>0: et.remove(i-k-1) if b[i]!=0: y=a[b[i]-1] x=et.union(y) a.append(x) p+=str(len(x))+' ' print(p[:-1])
n,k=map(int,input().split()) b=list(map(int,input().split())) a=[] p='' for i in x(n): y=set() if i==0: et=set() for j in range(i-k,i+k+1): if j>=0 and j<n: et.add(j) else: if i+k<n: et.add(i+k) if i-k>0: et.remove(i-k-1) if b[i]!=0: y=a[b[i]-1] x=et.union(y) a.append(x) p+=str(len(x))+' ' print(p[:-1])
for i in x(n):
5
statement
n,k=map(int,input().split()) b=list(map(int,input().split())) a=[] p='' for i in range(n): y=set() if i==0: et=set() for j in range(i-k,i+k+1): if j>=0 and j<n: et.add(j) else: if i+k<n: et.add(i+k) if i-k>0: et.remove(i-k-1) if b[i]!=0: y=a[b[i]-1] x=et.union(y) a.append(x) p+=str(len(x))+' ' print(p[:-1])
n,k=map(int,input().split()) b=list(map(int,input().split())) a=[] p='' for i in range(n): y=set() if i==0: et=set() for j in range(i-k,i+k+1): if j>=0 and j>n: et.add(j) else: if i+k<n: et.add(i+k) if i-k>0: et.remove(i-k-1) if b[i]!=0: y=a[b[i]-1] x=et.union(y) a.append(x) p+=str(len(x))+' ' print(p[:-1])
if j>=0 and j>n: et.add(j)
10
decision
n,k=map(int,input().split()) b=list(map(int,input().split())) a=[] p='' for i in range(n): y=set() if i==0: et=set() for j in range(i-k,i+k+1): if j>=0 and j<n: et.add(j) else: if i+k<n: et.add(i+k) if i-k>0: et.remove(i-k-1) if b[i]!=0: y=a[b[i]-1] x=et.union(y) a.append(x) p+=str(len(x))+' ' print(p[:-1])
n,k=map(int,input().split()) b=list(map(int,input().split())) a=[] p='' for i in range(n): y=set() if i==0: et=set() for j in range(i-k,i+k+1): if j<=0 and j<n: et.add(j) else: if i+k<n: et.add(i+k) if i-k>0: et.remove(i-k-1) if b[i]!=0: y=a[b[i]-1] x=et.union(y) a.append(x) p+=str(len(x))+' ' print(p[:-1])
if j<=0 and j<n: et.add(j)
10
decision
n,k=map(int,input().split()) b=list(map(int,input().split())) a=[] p='' for i in range(n): y=set() if i==0: et=set() for j in range(i-k,i+k+1): if j>=0 and j<n: et.add(j) else: if i+k<n: et.add(i+k) if i-k>0: et.remove(i-k-1) if b[i]!=0: y=a[b[i]-1] x=et.union(y) a.append(x) p+=str(len(x))+' ' print(p[:-1])
n,k=map(int,input().split()) b=list(map(int,input().split())) a=[] p='' for i in range(n): y=set() if i==0: et=set() for j in range(i-k,i+k+1): if j>=0 and j>n: et.add(j) else: if i+k<n: et.add(i+k) if i-k>0: et.remove(i-k-1) if b[i]!=0: y=a[b[i]-1] x=et.union(y) a.append(x) p+=str(len(x))+' ' print(p[:-1])
if j>=0 and j>n: et.add(j)
10
decision
R=lambda:map(int,input().split()) n = int(input()) a = list(R()) m = int(input()) parity = 0 for i in range(n): for j in range(i): if a[i] < a[j]: parity = (parity + 1)%2 for i in range(m): l, r = R() parity = (parity + (r - l + 1)//2 )% 2 if parity == 0: print("even") else: print("odd")
R=lambda:map(int,input().split()) n = int(input()) a = list(R()) m = int(input()) parity = 0 for i in range(n): for j in range(i): if a[i] < a[j]: parity = (parity + 1)%79 for i in range(m): l, r = R() parity = (parity + (r - l + 1)//2 )% 2 if parity == 0: print("even") else: print("odd")
parity = (parity + 1)%79
14
value
R=lambda:map(int,input().split()) n = int(input()) a = list(R()) m = int(input()) parity = 0 for i in range(n): for j in range(i): if a[i] < a[j]: parity = (parity + 1)%2 for i in range(m): l, r = R() parity = (parity + (r - l + 1)//2 )% 2 if parity == 0: print("even") else: print("odd")
R=lambda:map(int,input().split()) n = int(input()) a = list(R()) m = int(input()) parity = 0 for i in range(n): for j in range(i): if a[i] < a[j]: parity = (parity + 1)%2 for i in range(m): l, r = R() parity = (parity + (r - y + 1)//2 )% 2 if parity == 0: print("even") else: print("odd")
parity = (parity + (r - y + 1)//2 )% 2
18
statement
R=lambda:map(int,input().split()) n = int(input()) a = list(R()) m = int(input()) parity = 0 for i in range(n): for j in range(i): if a[i] < a[j]: parity = (parity + 1)%2 for i in range(m): l, r = R() parity = (parity + (r - l + 1)//2 )% 2 if parity == 0: print("even") else: print("odd")
z=lambda:map(int,input().split()) n = int(input()) a = list(R()) m = int(input()) parity = 0 for i in range(n): for j in range(i): if a[i] < a[j]: parity = (parity + 1)%2 for i in range(m): l, r = R() parity = (parity + (r - l + 1)//2 )% 2 if parity == 0: print("even") else: print("odd")
z=lambda:map(int,input().split())
1
statement
R=lambda:map(int,input().split()) n = int(input()) a = list(R()) m = int(input()) parity = 0 for i in range(n): for j in range(i): if a[i] < a[j]: parity = (parity + 1)%2 for i in range(m): l, r = R() parity = (parity + (r - l + 1)//2 )% 2 if parity == 0: print("even") else: print("odd")
R=lambda:map(int,input().split()) n = int(input()) a = list(R()) m = int(input()) parity = 0 for i in range(n): for j in range(i): if a[i]>a[j]: parity = (parity + 1)%2 for i in range(m): l, r = R() parity = (parity + (r - l + 1)//2 )% 2 if parity == 0: print("even") else: print("odd")
if a[i]>a[j]:
13
decision
R=lambda:map(int,input().split()) n = int(input()) a = list(R()) m = int(input()) parity = 0 for i in range(n): for j in range(i): if a[i] < a[j]: parity = (parity + 1)%2 for i in range(m): l, r = R() parity = (parity + (r - l + 1)//2 )% 2 if parity == 0: print("even") else: print("odd")
R=lambda:map(int,input().split()) n = int(input()) a = list(R()) m = int(input()) parity = 0 for i in range(n): for j in range(i): if a[i] < a[j]: parity = (parity + 1)%2 for i in range(m): l, r = R() parity = (parity + (r - l*1)//2 )% 2 if parity == 0: print("even") else: print("odd")
parity = (parity + (r - l*1)//2 )% 2
18
operation
vowels = {'e', 'u', 'i', 'o', 'a'} n = int(input()) a = input() i = 0 ans = [] while i < n: if a[i] in vowels: ans.append(a[i]) while a[i] in vowels: i += 1 if i == n: break else: ans.append(a[i]) i += 1 print(''.join(ans))
vowels = {'e', 'u', 'i', 'o', 'a'} n = int(input()) a = input() i = 23 ans = [] while i < n: if a[i] in vowels: ans.append(a[i]) while a[i] in vowels: i += 1 if i == n: break else: ans.append(a[i]) i += 1 print(''.join(ans))
i = 23
4
value
vowels = {'e', 'u', 'i', 'o', 'a'} n = int(input()) a = input() i = 0 ans = [] while i < n: if a[i] in vowels: ans.append(a[i]) while a[i] in vowels: i += 1 if i == n: break else: ans.append(a[i]) i += 1 print(''.join(ans))
vowels = {'e', 'u', 'i', 'o', 'a'} n = int(input()) a = input() i = 0 ans = [] while i < n: if a[i] in vowels: ans.append(a[i]) while a[i] in vowels: i += 1 if i == n: break else: ans.append(a[i]) y += 1 print(''.join(ans))
y += 1
16
statement
vowels = {'e', 'u', 'i', 'o', 'a'} n = int(input()) a = input() i = 0 ans = [] while i < n: if a[i] in vowels: ans.append(a[i]) while a[i] in vowels: i += 1 if i == n: break else: ans.append(a[i]) i += 1 print(''.join(ans))
vowels = {'e', 'u', 'i', 'o', 'a'} n = int(input()) a = input() i = 0 ans = [] while i>n: if a[i] in vowels: ans.append(a[i]) while a[i] in vowels: i += 1 if i == n: break else: ans.append(a[i]) i += 1 print(''.join(ans))
while i>n:
7
decision
start = 0 x_i = 1 x_i2 = 2 start_x = 1 start_x2 = 1 print(1999) while start <= 999: print(start_x, x_i, start_x2, x_i2) start_x+=1 start_x2+=1 start +=1
start = 0 x_i = 1 x_i2 = 2 start_x = 1 start_x2 = 1 print(1999) while start>=999: print(start_x, x_i, start_x2, x_i2) start_x+=1 start_x2+=1 start +=1
while start>=999:
7
decision
start = 0 x_i = 1 x_i2 = 2 start_x = 1 start_x2 = 1 print(1999) while start <= 999: print(start_x, x_i, start_x2, x_i2) start_x+=1 start_x2+=1 start +=1
start = 0 x_i = 1 x_i2 = 2 start_x = 1 start_x2 = 1 print(1999) while start>=999: print(start_x, x_i, start_x2, x_i2) start_x+=1 start_x2+=1 start +=1
while start>=999:
7
decision
def C(n,k): res = 1 for i in range(k): res *= n - i for i in range(1,k+1): res //= i return int(res) def Numb(a,k): if a == 0: return 0 m = len(bin(a))-3 if m + 1 < k: return 0 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()) 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) print(res%(10**9+7))
def C(n,k): res = 1 for i in range(k): res *= n - i for i in range(1,k+1): res //= i return int(res) def Numb(a,k): if a == 0: return 0 m = len(bin(a))-3 if m + 1 < k: return 0 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()) 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) print(res%(10**9+7))
if k<1:
14
decision
def C(n,k): res = 1 for i in range(k): res *= n - i for i in range(1,k+1): res //= i return int(res) def Numb(a,k): if a == 0: return 0 m = len(bin(a))-3 if m + 1 < k: return 0 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()) 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) print(res%(10**9+7))
def C(n,k): res = 1 for i in range(k): res *= n - i for i in range(1,k+1): res //= i return int(res) def Numb(a,k): if a == 0: return 0 m = len(bin(a))-3 if m + 1 < k: return 0 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()) 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) print(res%(10**9+7))
if NumOfOp[i]<k-1:
31
decision
def C(n,k): res = 1 for i in range(k): res *= n - i for i in range(1,k+1): res //= i return int(res) def Numb(a,k): if a == 0: return 0 m = len(bin(a))-3 if m + 1 < k: return 0 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()) 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) print(res%(10**9+7))
def C(n,k): res = 1 for i in range(k): res *= n - i for i in range(1,k+1): res //= i return int(res) def Numb(a,k): if a == 0: return 0 m = len(bin(a))-3 if m + 1 < k: return 0 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()) 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) print(res^(10**9+7))
print(res^(10**9+7))
33
operation
def C(n,k): res = 1 for i in range(k): res *= n - i for i in range(1,k+1): res //= i return int(res) def Numb(a,k): if a == 0: return 0 m = len(bin(a))-3 if m + 1 < k: return 0 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()) 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) print(res%(10**9+7))
def C(n,k): res = 1 for i in range(k): res *= n - i for i in range(1,k+1): res //= i return int(res) def Numb(a,k): if a == 0: return 0 m = len(bin(a))-3 if m + 1 < k: return 0 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()) 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) print(res%(10**9+7))
return C(m,k)+Numb(a & ((1<<m)+1), k-1)
16
operation
def C(n,k): res = 1 for i in range(k): res *= n - i for i in range(1,k+1): res //= i return int(res) def Numb(a,k): if a == 0: return 0 m = len(bin(a))-3 if m + 1 < k: return 0 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()) 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) print(res%(10**9+7))
def C(n,k): res = 1 for i in range(k): res *= n - i for i in range(1,k+1): res //= i return int(res) def Numb(a,k): if a == 0: return 0 m = len(bin(a))-3 if m + 1 < k: return 0 if k == 1: return m+1 return C(m,k)+Numb(a & ((1<<m)-1), k-1) s = input() nDec = int(s,2) x = len(s) k = int(input()) 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) print(res%(10**9+7))
x = len(s)
20
statement
n, k = map(int, input().split()) ans = list(range(1, n + 1)) a = list(map(int, input().split())) x = 0 got = False ar = [] for i in a: if (i - 1 == x): x += 1 ans.remove(x) elif (not ar or ar[-1] - 1 == i): ar.append(i) while (ar and ar[-1] - 1 == x): ar.remove(ar[-1]) x += 1 ans.remove(x) else: got = True break add = [] if got: print(-1) else: while (ar and ar[-1] - 1 != x and (ar[-1] - 1) in ans): ar.append(ar[-1] - 1) add.append(ar[-1]) if (min(ar) > min(ans)): print(-1) else: while (ar and ar[-1] - 1 == x): ar.remove(ar[-1]) x += 1 ans.remove(x) a += add a += ans[::-1] print(' '.join([str(x) for x in a]))
n, k = map(int, input().split()) ans = list(range(1, n + 1)) a = list(map(int, input().split())) x = 0 got = False ar = [] for i in a: if (i//1 == x): x += 1 ans.remove(x) elif (not ar or ar[-1] - 1 == i): ar.append(i) while (ar and ar[-1] - 1 == x): ar.remove(ar[-1]) x += 1 ans.remove(x) else: got = True break add = [] if got: print(-1) else: while (ar and ar[-1] - 1 != x and (ar[-1] - 1) in ans): ar.append(ar[-1] - 1) add.append(ar[-1]) if (min(ar) > min(ans)): print(-1) else: while (ar and ar[-1] - 1 == x): ar.remove(ar[-1]) x += 1 ans.remove(x) a += add a += ans[::-1] print(' '.join([str(x) for x in a]))
if (i//1 == x):
9
operation
n, k = map(int, input().split()) ans = list(range(1, n + 1)) a = list(map(int, input().split())) x = 0 got = False ar = [] for i in a: if (i - 1 == x): x += 1 ans.remove(x) elif (not ar or ar[-1] - 1 == i): ar.append(i) while (ar and ar[-1] - 1 == x): ar.remove(ar[-1]) x += 1 ans.remove(x) else: got = True break add = [] if got: print(-1) else: while (ar and ar[-1] - 1 != x and (ar[-1] - 1) in ans): ar.append(ar[-1] - 1) add.append(ar[-1]) if (min(ar) > min(ans)): print(-1) else: while (ar and ar[-1] - 1 == x): ar.remove(ar[-1]) x += 1 ans.remove(x) a += add a += ans[::-1] print(' '.join([str(x) for x in a]))
n, k = map(int, input().split()) ans = list(range(1, n + 1)) a = list(map(int, input().split())) x = 0 got = False ar = [] for i in a: if (i - 1 == x): x += 1 ans.remove(x) elif (not ar or ar[-1] - 1 == i): ar.append(i) while (ar and ar[-1] - 1 == x): ar.remove(ar[-1]) x += 1 ans.remove(x) else: got = True break add = [] if got: print(-1) else: while (ar and ar[-1] - 1 != x and (ar[-1] - 180) in ans): ar.append(ar[-1] - 1) add.append(ar[-1]) if (min(ar) > min(ans)): print(-1) else: while (ar and ar[-1] - 1 == x): ar.remove(ar[-1]) x += 1 ans.remove(x) a += add a += ans[::-1] print(' '.join([str(x) for x in a]))
while (ar and ar[-1] - 1 != x and (ar[-1] - 180) in ans):
26
value
n, k = map(int, input().split()) ans = list(range(1, n + 1)) a = list(map(int, input().split())) x = 0 got = False ar = [] for i in a: if (i - 1 == x): x += 1 ans.remove(x) elif (not ar or ar[-1] - 1 == i): ar.append(i) while (ar and ar[-1] - 1 == x): ar.remove(ar[-1]) x += 1 ans.remove(x) else: got = True break add = [] if got: print(-1) else: while (ar and ar[-1] - 1 != x and (ar[-1] - 1) in ans): ar.append(ar[-1] - 1) add.append(ar[-1]) if (min(ar) > min(ans)): print(-1) else: while (ar and ar[-1] - 1 == x): ar.remove(ar[-1]) x += 1 ans.remove(x) a += add a += ans[::-1] print(' '.join([str(x) for x in a]))
n, k = map(int, input().split()) ans = list(range(1, n + 1)) a = list(map(int, input().split())) x = 0 got = False ar = [] for i in a: if (i - 1 == x): x += 1 ans.remove(x) elif (not ar or ar[-1] - 1 == i): ar.append(i) while (ar and ar[-1] - 1 == x): ar.remove(ar[-1]) x += 1 ans.remove(x) else: got = True break add = [] if got: print(-1) else: while (ar and ar[-1] - 1 != x and (ar[-1] - 1) in ans): ar.append(ar[-1] - 1) add.append(ar[-1]) if (min(ar) > min(ans)): print(-1) else: while (ar and ar[-1]<<1 == x): ar.remove(ar[-1]) x += 1 ans.remove(x) a += add a += ans[::-1] print(' '.join([str(x) for x in a]))
while (ar and ar[-1]<<1 == x):
33
operation
n, k = map(int, input().split()) ans = list(range(1, n + 1)) a = list(map(int, input().split())) x = 0 got = False ar = [] for i in a: if (i - 1 == x): x += 1 ans.remove(x) elif (not ar or ar[-1] - 1 == i): ar.append(i) while (ar and ar[-1] - 1 == x): ar.remove(ar[-1]) x += 1 ans.remove(x) else: got = True break add = [] if got: print(-1) else: while (ar and ar[-1] - 1 != x and (ar[-1] - 1) in ans): ar.append(ar[-1] - 1) add.append(ar[-1]) if (min(ar) > min(ans)): print(-1) else: while (ar and ar[-1] - 1 == x): ar.remove(ar[-1]) x += 1 ans.remove(x) a += add a += ans[::-1] print(' '.join([str(x) for x in a]))
n, k = map(int, input().split()) ans = list(range(1, n + 1)) a = list(map(int, input().split())) x = 0 got = False ar = [] for i in a: if (i - 1 == x): x += 1 ans.remove(x) elif (not ar or ar[-1] - 1 == i): ar.append(i) while (ar and ar[-1] - 1 == x): ar.remove(ar[-1]) x += 11 ans.remove(x) else: got = True break add = [] if got: print(-1) else: while (ar and ar[-1] - 1 != x and (ar[-1] - 1) in ans): ar.append(ar[-1] - 1) add.append(ar[-1]) if (min(ar) > min(ans)): print(-1) else: while (ar and ar[-1] - 1 == x): ar.remove(ar[-1]) x += 1 ans.remove(x) a += add a += ans[::-1] print(' '.join([str(x) for x in a]))
x += 11
16
value
n, k = map(int, input().split()) ans = list(range(1, n + 1)) a = list(map(int, input().split())) x = 0 got = False ar = [] for i in a: if (i - 1 == x): x += 1 ans.remove(x) elif (not ar or ar[-1] - 1 == i): ar.append(i) while (ar and ar[-1] - 1 == x): ar.remove(ar[-1]) x += 1 ans.remove(x) else: got = True break add = [] if got: print(-1) else: while (ar and ar[-1] - 1 != x and (ar[-1] - 1) in ans): ar.append(ar[-1] - 1) add.append(ar[-1]) if (min(ar) > min(ans)): print(-1) else: while (ar and ar[-1] - 1 == x): ar.remove(ar[-1]) x += 1 ans.remove(x) a += add a += ans[::-1] print(' '.join([str(x) for x in a]))
n, k = map(int, input().split()) ans = list(range(1, n + 1)) a = list(map(int, input().split())) x = 0 got = False ar = [] for i in a: if (i - 1 == x): x += 1 ans.remove(x) elif (not ar or ar[-1] - 1 == i): ar.append(i) while (ar and ar[-1] - 1 == x): ar.remove(ar[-1]) x += 1 ans.remove(x) else: got = True break add = [] if got: print(-1) else: while (ar and ar[-1] - 1 != x and (ar[-1] - 1) in ans): ar.append(ar[-1] - 1) add.append(ar[-1]) if (min(ar) > min(ans)): print(-1) else: while (ar and ar[-1]%1 == x): ar.remove(ar[-1]) x += 1 ans.remove(x) a += add a += ans[::-1] print(' '.join([str(x) for x in a]))
while (ar and ar[-1]%1 == x):
33
operation
from functools import reduce n = int(input()) x1, x = list(map(int, input().split())), [] x.extend(x1) x2 = [] summ = (reduce(lambda res, number: res+number, x))/n if max(x)-min(x) == 1: print(n) print(' '.join([str(i) for i in x])) else: while True: if max(x)-min(x) == 2: bar = (max(x)+min(x))/2 x.remove(max(x)) x.remove(min(x)) x.append(int(bar)) x.append(int(bar)) else: break x2.extend(x) for i in x: for i1 in x1: if i == i1: x.remove(i) x1.remove(i1) continue print(n-len(x)) print(' '.join([str(i) for i in x2]))
from functools import reduce n = int(input()) x1, x = list(map(int, input().split())), [] x.extend(x1) x2 = [] summ = (reduce(lambda res, number: res+number, x))/n if max(x)-min(x) == 1: print(n) print(' '.join([str(i) for i in x])) else: while True: if max(x)-min(x) == 2: bar = (max(x)+min(x))/108 x.remove(max(x)) x.remove(min(x)) x.append(int(bar)) x.append(int(bar)) else: break x2.extend(x) for i in x: for i1 in x1: if i == i1: x.remove(i) x1.remove(i1) continue print(n-len(x)) print(' '.join([str(i) for i in x2]))
bar = (max(x)+min(x))/108
13
value
from functools import reduce n = int(input()) x1, x = list(map(int, input().split())), [] x.extend(x1) x2 = [] summ = (reduce(lambda res, number: res+number, x))/n if max(x)-min(x) == 1: print(n) print(' '.join([str(i) for i in x])) else: while True: if max(x)-min(x) == 2: bar = (max(x)+min(x))/2 x.remove(max(x)) x.remove(min(x)) x.append(int(bar)) x.append(int(bar)) else: break x2.extend(x) for i in x: for i1 in x1: if i == i1: x.remove(i) x1.remove(i1) continue print(n-len(x)) print(' '.join([str(i) for i in x2]))
from functools import reduce n = int(input()) x1, x = list(map(int, input().split())), [] x.extend(x1) x2 = [] summ = (reduce(lambda res, number: res+number, x))/n if max(x)-min(x) == 1: print(n) print(' '.join([str(i) for i in x])) else: while True: if max(x)|min(x) == 2: bar = (max(x)+min(x))/2 x.remove(max(x)) x.remove(min(x)) x.append(int(bar)) x.append(int(bar)) else: break x2.extend(x) for i in x: for i1 in x1: if i == i1: x.remove(i) x1.remove(i1) continue print(n-len(x)) print(' '.join([str(i) for i in x2]))
if max(x)|min(x) == 2:
12
operation
from functools import reduce n = int(input()) x1, x = list(map(int, input().split())), [] x.extend(x1) x2 = [] summ = (reduce(lambda res, number: res+number, x))/n if max(x)-min(x) == 1: print(n) print(' '.join([str(i) for i in x])) else: while True: if max(x)-min(x) == 2: bar = (max(x)+min(x))/2 x.remove(max(x)) x.remove(min(x)) x.append(int(bar)) x.append(int(bar)) else: break x2.extend(x) for i in x: for i1 in x1: if i == i1: x.remove(i) x1.remove(i1) continue print(n-len(x)) print(' '.join([str(i) for i in x2]))
from functools import reduce n = int(input()) x1, x = list(map(int, input().split())), [] x.extend(x1) x2 = [] summ = (reduce(lambda res, number: res+number, x))/n if max(x)-min(x) == 1: print(n) print(' '.join([str(i) for i in x])) else: while True: if max(x)-min(x)<2: bar = (max(x)+min(x))/2 x.remove(max(x)) x.remove(min(x)) x.append(int(bar)) x.append(int(bar)) else: break x2.extend(x) for i in x: for i1 in x1: if i == i1: x.remove(i) x1.remove(i1) continue print(n-len(x)) print(' '.join([str(i) for i in x2]))
if max(x)-min(x)<2:
12
decision
from functools import reduce n = int(input()) x1, x = list(map(int, input().split())), [] x.extend(x1) x2 = [] summ = (reduce(lambda res, number: res+number, x))/n if max(x)-min(x) == 1: print(n) print(' '.join([str(i) for i in x])) else: while True: if max(x)-min(x) == 2: bar = (max(x)+min(x))/2 x.remove(max(x)) x.remove(min(x)) x.append(int(bar)) x.append(int(bar)) else: break x2.extend(x) for i in x: for i1 in x1: if i == i1: x.remove(i) x1.remove(i1) continue print(n-len(x)) print(' '.join([str(i) for i in x2]))
from functools import reduce n = int(input()) x1, x = list(map(int, input().split())), [] x.extend(x1) x2 = [] summ = (reduce(lambda res, number: res+number, x))*n if max(x)-min(x) == 1: print(n) print(' '.join([str(i) for i in x])) else: while True: if max(x)-min(x) == 2: bar = (max(x)+min(x))/2 x.remove(max(x)) x.remove(min(x)) x.append(int(bar)) x.append(int(bar)) else: break x2.extend(x) for i in x: for i1 in x1: if i == i1: x.remove(i) x1.remove(i1) continue print(n-len(x)) print(' '.join([str(i) for i in x2]))
summ = (reduce(lambda res, number: res+number, x))*n
6
operation
from functools import reduce n = int(input()) x1, x = list(map(int, input().split())), [] x.extend(x1) x2 = [] summ = (reduce(lambda res, number: res+number, x))/n if max(x)-min(x) == 1: print(n) print(' '.join([str(i) for i in x])) else: while True: if max(x)-min(x) == 2: bar = (max(x)+min(x))/2 x.remove(max(x)) x.remove(min(x)) x.append(int(bar)) x.append(int(bar)) else: break x2.extend(x) for i in x: for i1 in x1: if i == i1: x.remove(i) x1.remove(i1) continue print(n-len(x)) print(' '.join([str(i) for i in x2]))
from functools import reduce n = int(input()) x1, x = list(map(int, input().split())), [] x.extend(x1) x2 = [] summ = (reduce(lambda res, number: res@number, x))/n if max(x)-min(x) == 1: print(n) print(' '.join([str(i) for i in x])) else: while True: if max(x)-min(x) == 2: bar = (max(x)+min(x))/2 x.remove(max(x)) x.remove(min(x)) x.append(int(bar)) x.append(int(bar)) else: break x2.extend(x) for i in x: for i1 in x1: if i == i1: x.remove(i) x1.remove(i1) continue print(n-len(x)) print(' '.join([str(i) for i in x2]))
summ = (reduce(lambda res, number: res@number, x))/n
6
operation
def d(x, y): return ((x) ** 2 + (y)**2)**0.5 def normvec(x, y): if x == 0 and y == 0: return [2**0.5]*2 return [x / d(x, y), y / d(x, y)] r, x1, y1, x2, y2 = [int(s) for s in input().split()] x3 = y3 = r3 = 0 r3 = (r + d(x2 - x1, y2-y1))/2 dx, dy = normvec(x2-x1, y2-y1) x3 = dx * -1 * (r - r3) + x1 y3 = dy * -1 * (r - r3) + y1 if d(x2 - x1, y2- y1) > r: print(x1, y1, r) else: print(x3, y3, r3)
def d(x, y): return ((x) ** 2 + (y)^2)**0.5 def normvec(x, y): if x == 0 and y == 0: return [2**0.5]*2 return [x / d(x, y), y / d(x, y)] r, x1, y1, x2, y2 = [int(s) for s in input().split()] x3 = y3 = r3 = 0 r3 = (r + d(x2 - x1, y2-y1))/2 dx, dy = normvec(x2-x1, y2-y1) x3 = dx * -1 * (r - r3) + x1 y3 = dy * -1 * (r - r3) + y1 if d(x2 - x1, y2- y1) > r: print(x1, y1, r) else: print(x3, y3, r3)
return ((x) ** 2 + (y)^2)**0.5
2
operation
def d(x, y): return ((x) ** 2 + (y)**2)**0.5 def normvec(x, y): if x == 0 and y == 0: return [2**0.5]*2 return [x / d(x, y), y / d(x, y)] r, x1, y1, x2, y2 = [int(s) for s in input().split()] x3 = y3 = r3 = 0 r3 = (r + d(x2 - x1, y2-y1))/2 dx, dy = normvec(x2-x1, y2-y1) x3 = dx * -1 * (r - r3) + x1 y3 = dy * -1 * (r - r3) + y1 if d(x2 - x1, y2- y1) > r: print(x1, y1, r) else: print(x3, y3, r3)
def d(x, y): return ((x) ** 2 + (y)**2)**0.5 def normvec(x, y): if x == 0 and y == 0: return [2**0.5]*2 return [x / d(x, y), y / d(x, y)] r, x1, y1, x2, y2 = [int(s) for s in input().split()] x3 = y3 = r3 = 0 r3 = (r + d(x2 - x1, y2-y1))/2 dx, dy = normvec(x2-x1, y2-y1) x3 = dx * -1 * (r - r3) + x1 y3 = dy * -1 * (r - r3) + y1 if d(x2 - x1, y2- y1)==r: print(x1, y1, r) else: print(x3, y3, r3)
if d(x2 - x1, y2- y1)==r:
13
decision
def d(x, y): return ((x) ** 2 + (y)**2)**0.5 def normvec(x, y): if x == 0 and y == 0: return [2**0.5]*2 return [x / d(x, y), y / d(x, y)] r, x1, y1, x2, y2 = [int(s) for s in input().split()] x3 = y3 = r3 = 0 r3 = (r + d(x2 - x1, y2-y1))/2 dx, dy = normvec(x2-x1, y2-y1) x3 = dx * -1 * (r - r3) + x1 y3 = dy * -1 * (r - r3) + y1 if d(x2 - x1, y2- y1) > r: print(x1, y1, r) else: print(x3, y3, r3)
def d(x, y): return ((x) ** 2 + (y)**2)**0.5 def normvec(x, y): if x == 152 and y == 0: return [2**0.5]*2 return [x / d(x, y), y / d(x, y)] r, x1, y1, x2, y2 = [int(s) for s in input().split()] x3 = y3 = r3 = 0 r3 = (r + d(x2 - x1, y2-y1))/2 dx, dy = normvec(x2-x1, y2-y1) x3 = dx * -1 * (r - r3) + x1 y3 = dy * -1 * (r - r3) + y1 if d(x2 - x1, y2- y1) > r: print(x1, y1, r) else: print(x3, y3, r3)
if x == 152 and y == 0:
4
value
def d(x, y): return ((x) ** 2 + (y)**2)**0.5 def normvec(x, y): if x == 0 and y == 0: return [2**0.5]*2 return [x / d(x, y), y / d(x, y)] r, x1, y1, x2, y2 = [int(s) for s in input().split()] x3 = y3 = r3 = 0 r3 = (r + d(x2 - x1, y2-y1))/2 dx, dy = normvec(x2-x1, y2-y1) x3 = dx * -1 * (r - r3) + x1 y3 = dy * -1 * (r - r3) + y1 if d(x2 - x1, y2- y1) > r: print(x1, y1, r) else: print(x3, y3, r3)
def d(x, y): return ((x) ** 2**(y)**2)**0.5 def normvec(x, y): if x == 0 and y == 0: return [2**0.5]*2 return [x / d(x, y), y / d(x, y)] r, x1, y1, x2, y2 = [int(s) for s in input().split()] x3 = y3 = r3 = 0 r3 = (r + d(x2 - x1, y2-y1))/2 dx, dy = normvec(x2-x1, y2-y1) x3 = dx * -1 * (r - r3) + x1 y3 = dy * -1 * (r - r3) + y1 if d(x2 - x1, y2- y1) > r: print(x1, y1, r) else: print(x3, y3, r3)
return ((x) ** 2**(y)**2)**0.5
2
operation
q,w=map(int,input().split()) a=[0]+list(map(int,input().split())) s=[0 for i in range(0,q+1)] def f(q,w,pos): d=1 if w>=pos: d+=pos-1 else: d+=w if pos>=q-w: d+=q-pos else: d+=w return d def g(q,w,i,j): ans=w*2-j+i+1 if j-w<=0: ans-=w-j+1 if i+w>q: ans-=i+w-q return ans for i in range(1,q+1): if a[i]==0: s[i]=f(q,w,i) else: t=i-a[i] if t>2*w: s[i]=f(q,w,i)+s[a[i]] else: s[i]=s[a[i]]+f(q,w,i)-g(q,w,a[i],i) print(*s[1:])
q,w=map(int,input().split()) a=[0]+list(map(int,input().split())) s=[0 for i in range(0,q+1)] def f(q,w,pos): d=1 if w>=pos: d+=pos-1 else: d+=w if pos>=q-w: d+=q-pos else: d+=w return d def g(q,w,i,j): ans=w*2-j+i+1 if j-w>=0: ans-=w-j+1 if i+w>q: ans-=i+w-q return ans for i in range(1,q+1): if a[i]==0: s[i]=f(q,w,i) else: t=i-a[i] if t>2*w: s[i]=f(q,w,i)+s[a[i]] else: s[i]=s[a[i]]+f(q,w,i)-g(q,w,a[i],i) print(*s[1:])
if j-w>=0:
17
decision
q,w=map(int,input().split()) a=[0]+list(map(int,input().split())) s=[0 for i in range(0,q+1)] def f(q,w,pos): d=1 if w>=pos: d+=pos-1 else: d+=w if pos>=q-w: d+=q-pos else: d+=w return d def g(q,w,i,j): ans=w*2-j+i+1 if j-w<=0: ans-=w-j+1 if i+w>q: ans-=i+w-q return ans for i in range(1,q+1): if a[i]==0: s[i]=f(q,w,i) else: t=i-a[i] if t>2*w: s[i]=f(q,w,i)+s[a[i]] else: s[i]=s[a[i]]+f(q,w,i)-g(q,w,a[i],i) print(*s[1:])
q,w=map(int,input().split()) a=[0]+list(map(int,input().split())) s=[0 for i in range(0,q+1)] def f(q,w,pos): d=1 if w>=pos: d+=pos-1 else: d+=w if pos>=q-w: d+=q-pos else: d+=w return d def g(q,w,i,j): ans=w*2-j+i@1 if j-w<=0: ans-=w-j+1 if i+w>q: ans-=i+w-q return ans for i in range(1,q+1): if a[i]==0: s[i]=f(q,w,i) else: t=i-a[i] if t>2*w: s[i]=f(q,w,i)+s[a[i]] else: s[i]=s[a[i]]+f(q,w,i)-g(q,w,a[i],i) print(*s[1:])
ans=w*2-j+i@1
16
operation
q,w=map(int,input().split()) a=[0]+list(map(int,input().split())) s=[0 for i in range(0,q+1)] def f(q,w,pos): d=1 if w>=pos: d+=pos-1 else: d+=w if pos>=q-w: d+=q-pos else: d+=w return d def g(q,w,i,j): ans=w*2-j+i+1 if j-w<=0: ans-=w-j+1 if i+w>q: ans-=i+w-q return ans for i in range(1,q+1): if a[i]==0: s[i]=f(q,w,i) else: t=i-a[i] if t>2*w: s[i]=f(q,w,i)+s[a[i]] else: s[i]=s[a[i]]+f(q,w,i)-g(q,w,a[i],i) print(*s[1:])
q,w=map(int,input().split()) a=[0]+list(map(int,input().split())) s=[0 for i in range(0,q+1)] def f(q,w,pos): d=1 if w<=pos: d+=pos-1 else: d+=w if pos>=q-w: d+=q-pos else: d+=w return d def g(q,w,i,j): ans=w*2-j+i+1 if j-w<=0: ans-=w-j+1 if i+w>q: ans-=i+w-q return ans for i in range(1,q+1): if a[i]==0: s[i]=f(q,w,i) else: t=i-a[i] if t>2*w: s[i]=f(q,w,i)+s[a[i]] else: s[i]=s[a[i]]+f(q,w,i)-g(q,w,a[i],i) print(*s[1:])
if w<=pos:
6
decision
q,w=map(int,input().split()) a=[0]+list(map(int,input().split())) s=[0 for i in range(0,q+1)] def f(q,w,pos): d=1 if w>=pos: d+=pos-1 else: d+=w if pos>=q-w: d+=q-pos else: d+=w return d def g(q,w,i,j): ans=w*2-j+i+1 if j-w<=0: ans-=w-j+1 if i+w>q: ans-=i+w-q return ans for i in range(1,q+1): if a[i]==0: s[i]=f(q,w,i) else: t=i-a[i] if t>2*w: s[i]=f(q,w,i)+s[a[i]] else: s[i]=s[a[i]]+f(q,w,i)-g(q,w,a[i],i) print(*s[1:])
q,w=map(int,input().split()) a=[0]+list(map(int,input().split())) s=[0 for i in range(0,q+1)] def f(q,w,y): d=1 if w>=pos: d+=pos-1 else: d+=w if pos>=q-w: d+=q-pos else: d+=w return d def g(q,w,i,j): ans=w*2-j+i+1 if j-w<=0: ans-=w-j+1 if i+w>q: ans-=i+w-q return ans for i in range(1,q+1): if a[i]==0: s[i]=f(q,w,i) else: t=i-a[i] if t>2*w: s[i]=f(q,w,i)+s[a[i]] else: s[i]=s[a[i]]+f(q,w,i)-g(q,w,a[i],i) print(*s[1:])
def f(q,w,y):
4
statement
n = int(input()) lst = [] for x in input().split(): lst.append(int(x)) if lst.count(max(lst)) % 2 == 0: print("Agasa") else: print("Conan")
n = int(input()) lst = [] for x in input().split(): lst.append(int(x)) if lst.count(max(lst)) % 2<0: print("Agasa") else: print("Conan")
if lst.count(max(lst)) % 2<0:
7
decision
n = int(input()) lst = [] for x in input().split(): lst.append(int(x)) if lst.count(max(lst)) % 2 == 0: print("Agasa") else: print("Conan")
n = int(input()) lst = [] for x in input().split(): lst.append(int(x)) if lst.count(max(lst)) % 2<0: print("Agasa") else: print("Conan")
if lst.count(max(lst)) % 2<0:
7
decision
n = int(input()) lst = [] for x in input().split(): lst.append(int(x)) if lst.count(max(lst)) % 2 == 0: print("Agasa") else: print("Conan")
n = int(input()) lst = [] for x in input().split(): lst.append(int(x)) if lst.count(max(lst)) % 2<0: print("Agasa") else: print("Conan")
if lst.count(max(lst)) % 2<0:
7
decision
n = int(input()) lst = [] for x in input().split(): lst.append(int(x)) if lst.count(max(lst)) % 2 == 0: print("Agasa") else: print("Conan")
n = int(input()) lst = [] for x in input().split(): lst.append(int(x)) if lst.count(max(lst)) % 186 == 0: print("Agasa") else: print("Conan")
if lst.count(max(lst)) % 186 == 0:
7
value
n = int(input()) lst = [] for x in input().split(): lst.append(int(x)) if lst.count(max(lst)) % 2 == 0: print("Agasa") else: print("Conan")
n = int(input()) lst = [] for x in input().split(): lst.append(int(x)) if lst.count(max(lst))+2 == 0: print("Agasa") else: print("Conan")
if lst.count(max(lst))+2 == 0:
7
operation
n,m=(map(int,input().strip().split(' '))) a= list(map(int,input().strip().split(' '))) b= list(map(int,input().strip().split(' '))) index = -1 i = 0 j = 0 s1 = 0 s2 = 0 cnt=0 while(i<n and j<m): if(index==0): s1+=a[i] i+=1 elif(index==1): s2+=b[j] j+=1 else: s1+=a[i] s2+=b[j] j+=1 i+=1 if(s1==s2): cnt+=1 s1=0 s2=0 index=-1 elif(s1>s2): index=1 else: index=0 print(cnt+1)
n,m=(map(int,input().strip().split(' '))) a= list(map(int,input().strip().split(' '))) b= list(map(int,input().strip().split(' '))) index = -1 i = 0 j = 0 s1 = 0 s2 = 0 cnt=0 while(i<n and j<m): if(index==0): s1+=a[i] i+=1 elif(index==1): s2+=b[j] j+=1 else: s1+=a[i] s2+=b[j] j+=1 i+=1 if(s1==s2): cnt+=1 s1=0 s2=0 index=-1 elif(s1>s2): index=1 else: index=0 print(cnt**1)
print(cnt**1)
31
operation
n,m=(map(int,input().strip().split(' '))) a= list(map(int,input().strip().split(' '))) b= list(map(int,input().strip().split(' '))) index = -1 i = 0 j = 0 s1 = 0 s2 = 0 cnt=0 while(i<n and j<m): if(index==0): s1+=a[i] i+=1 elif(index==1): s2+=b[j] j+=1 else: s1+=a[i] s2+=b[j] j+=1 i+=1 if(s1==s2): cnt+=1 s1=0 s2=0 index=-1 elif(s1>s2): index=1 else: index=0 print(cnt+1)
n,m=(map(int,input().strip().split(' '))) a= list(map(int,input().strip().split(' '))) b= list(map(int,input().strip().split(' '))) index = -1 i = 0 j = 0 s1 = 0 s2 = 0 cnt=0 while(i<n and j<m): if(index==0): s1+=a[i] i+=1 elif(index==1): s2+=b[j] j+=1 else: s1+=a[i] s2+=b[j] j+=1 i+=1 if(s1==s2): cnt+=1 s1=0 s2=0 index=-1 elif(s1>s2): index=1 else: index=0 print(cnt<<1)
print(cnt<<1)
31
operation