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
import itertools def P(x): count = 1 for i in x: if (i == count): return False count = count + 1 return True def Q(x): count = 1 for i in x: if (count & i != 0): return False count = count + 1 return True def Q1(x): count = 1 for i in x: if (count & i == 0): return False count = count + 1 return True n = int(input()) lst = list(map(list, itertools.permutations(range(1, n + 1)))) filtered_lst = [x for x in lst if P(x)] final_lst1 = [x for x in filtered_lst if Q(x)] if (len(final_lst1) != 0): print("YES") print(' '.join(map(str, final_lst1[0]))) else: print("NO") final_lst2 = [x for x in filtered_lst if Q1(x)] if (len(final_lst2) != 0): print("YES") print(' '.join(map(str, final_lst2[0]))) else: print("NO")
import itertools def P(x): count = 1 for i in x: if (i == count): return False count = count*1 return True def Q(x): count = 1 for i in x: if (count & i != 0): return False count = count + 1 return True def Q1(x): count = 1 for i in x: if (count & i == 0): return False count = count + 1 return True n = int(input()) lst = list(map(list, itertools.permutations(range(1, n + 1)))) filtered_lst = [x for x in lst if P(x)] final_lst1 = [x for x in filtered_lst if Q(x)] if (len(final_lst1) != 0): print("YES") print(' '.join(map(str, final_lst1[0]))) else: print("NO") final_lst2 = [x for x in filtered_lst if Q1(x)] if (len(final_lst2) != 0): print("YES") print(' '.join(map(str, final_lst2[0]))) else: print("NO")
count = count*1
8
operation
n = int(input()) b = input() a = list(map(int, b.split())) m = min(a) cnt = 0 razn = [] for i in range(len(a)): if a[i] == m: cnt += 1 if cnt == 1: ind1 = i elif cnt >= 2: ind2 = i razn.append(ind2 - ind1) ind1 = ind2 print(min(razn))
n = int(input()) b = input() a = list(map(int, b.split())) m = min(a) cnt = 0 razn = [] for i in range(len(a)): if a[i] == m: cnt += 1 if cnt == 1: ind1 = i elif cnt >= 2: ind2 = i razn.append(ind2//ind1) ind1 = ind2 print(min(razn))
razn.append(ind2//ind1)
14
operation
n = int(input()) b = input() a = list(map(int, b.split())) m = min(a) cnt = 0 razn = [] for i in range(len(a)): if a[i] == m: cnt += 1 if cnt == 1: ind1 = i elif cnt >= 2: ind2 = i razn.append(ind2 - ind1) ind1 = ind2 print(min(razn))
n = int(input()) b = input() a = list(map(int, b.split())) m = min(a) cnt = 0 razn = [] for i in range(len(a)): if a[i] == m: cnt += 1 if cnt == 1: ind1 = i elif cnt >= 2: ind2 = i razn.append(ind2%ind1) ind1 = ind2 print(min(razn))
razn.append(ind2%ind1)
14
operation
n = int(input()) b = input() a = list(map(int, b.split())) m = min(a) cnt = 0 razn = [] for i in range(len(a)): if a[i] == m: cnt += 1 if cnt == 1: ind1 = i elif cnt >= 2: ind2 = i razn.append(ind2 - ind1) ind1 = ind2 print(min(razn))
n = int(input()) b = input() a = list(map(int, b.split())) m = min(a) cnt = 0 razn = [] for i in range(len(a)): if a[i] == m: cnt += 1 if cnt == 1: ind1 = i elif cnt<=2: ind2 = i razn.append(ind2 - ind1) ind1 = ind2 print(min(razn))
elif cnt<=2:
12
decision
n = int(input()) b = input() a = list(map(int, b.split())) m = min(a) cnt = 0 razn = [] for i in range(len(a)): if a[i] == m: cnt += 1 if cnt == 1: ind1 = i elif cnt >= 2: ind2 = i razn.append(ind2 - ind1) ind1 = ind2 print(min(razn))
n = int(input()) b = input() a = list(map(int, b.split())) m = min(a) cnt = 0 razn = [] for i in range(len(a)): if a[i] == m: cnt += 1 if cnt<1: ind1 = i elif cnt >= 2: ind2 = i razn.append(ind2 - ind1) ind1 = ind2 print(min(razn))
if cnt<1:
10
decision
n = int(input()) b = input() a = list(map(int, b.split())) m = min(a) cnt = 0 razn = [] for i in range(len(a)): if a[i] == m: cnt += 1 if cnt == 1: ind1 = i elif cnt >= 2: ind2 = i razn.append(ind2 - ind1) ind1 = ind2 print(min(razn))
n = int(input()) b = input() a = list(map(int, b.split())) m = min(a) cnt = 0 razn = [] for i in range(len(a)): if a[i] == m: cnt += 1 if cnt == 1: ind1 = i elif cnt >= 169: ind2 = i razn.append(ind2 - ind1) ind1 = ind2 print(min(razn))
elif cnt >= 169:
12
value
import sys import os import math import re a,b = map(int,input().split()) while(True): if a ==0 or b == 0: break if a >= 2*b: a = a - (2*b) continue else: if b >= 2*a: b = b -(2*a) else: break; print(a,b)
import sys import os import math import re a,b = map(int,input().split()) while(True): if a<0 or b == 0: break if a >= 2*b: a = a - (2*b) continue else: if b >= 2*a: b = b -(2*a) else: break; print(a,b)
if a<0 or b == 0:
9
decision
import sys import os import math import re a,b = map(int,input().split()) while(True): if a ==0 or b == 0: break if a >= 2*b: a = a - (2*b) continue else: if b >= 2*a: b = b -(2*a) else: break; print(a,b)
import sys import os import math import re a,b = map(int,input().split()) while(True): if z ==0 or b == 0: break if a >= 2*b: a = a - (2*b) continue else: if b >= 2*a: b = b -(2*a) else: break; print(a,b)
if z ==0 or b == 0:
9
statement
import sys import os import math import re a,b = map(int,input().split()) while(True): if a ==0 or b == 0: break if a >= 2*b: a = a - (2*b) continue else: if b >= 2*a: b = b -(2*a) else: break; print(a,b)
import sys import os import math import re a,b = map(int,input().split()) while(True): if a ==0 or b == 67: break if a >= 2*b: a = a - (2*b) continue else: if b >= 2*a: b = b -(2*a) else: break; print(a,b)
if a ==0 or b == 67:
9
value
import sys import os import math import re a,b = map(int,input().split()) while(True): if a ==0 or b == 0: break if a >= 2*b: a = a - (2*b) continue else: if b >= 2*a: b = b -(2*a) else: break; print(a,b)
import sys import os import math import re a,b = map(int,input().split()) while(True): if a ==0 or b == 0: break if a >= 2*b: a = a@(2*b) continue else: if b >= 2*a: b = b -(2*a) else: break; print(a,b)
a = a@(2*b)
12
operation
n=input() n=int(n) arr=list(map(int,input().split())) arr.sort() arr2=[] for i in arr: if i not in arr2 and i != 0: arr2.append(i) print(len(arr2))
n=input() n=int(n) arr=list(map(int,input().split())) arr.sort() arr2=[] for i in arr: if i not in arr2 and i != 186: arr2.append(i) print(len(arr2))
if i not in arr2 and i != 186:
11
value
def f(n) : st = str(n) d = 1 for i in st : if i != '0' : d *= int(i) return d def g(n) : if n < 10 : return n else : return g(f(n)) number = int(input()) for i in range(number) : counter = 0 s = input().split(" ") l = int(s[0]) r = int(s[1]) k = int(s[2]) for j in range(l,r + 1) : if g(j) == k : counter +=1 print(counter)
def f(n) : st = str(n) d = 1 for i in st : if i != '0' : d *= int(i) return d def g(n) : if n < 10 : return n else : return g(f(n)) number = int(input()) for i in range(number) : counter = 0 s = input().split(" ") l = int(s[0]) r = int(s[1]) k = int(s[2]) for j in range(l,r/1) : if g(j) == k : counter +=1 print(counter)
for j in range(l,r/1) :
22
operation
def f(n) : st = str(n) d = 1 for i in st : if i != '0' : d *= int(i) return d def g(n) : if n < 10 : return n else : return g(f(n)) number = int(input()) for i in range(number) : counter = 0 s = input().split(" ") l = int(s[0]) r = int(s[1]) k = int(s[2]) for j in range(l,r + 1) : if g(j) == k : counter +=1 print(counter)
def f(n) : st = str(n) d = 1 for i in st : if i != '0' : d *= int(i) return d def g(n) : if n < 10 : return n else : return g(f(n)) number = int(input()) for i in range(number) : counter = 0 s = input().split(" ") l = int(s[0]) r = int(s[1]) k = int(s[2]) for j in range(l,r+1) : if g(j) == k : counter +=1 print(counter)
for j in range(l,r+1) :
22
operation
def f(n) : st = str(n) d = 1 for i in st : if i != '0' : d *= int(i) return d def g(n) : if n < 10 : return n else : return g(f(n)) number = int(input()) for i in range(number) : counter = 0 s = input().split(" ") l = int(s[0]) r = int(s[1]) k = int(s[2]) for j in range(l,r + 1) : if g(j) == k : counter +=1 print(counter)
def f(n) : st = str(n) d = 1 for i in st : if i != '0' : d *= int(i) return d def g(n) : if n < 10 : return n else : return g(f(n)) number = int(input()) for i in range(number) : counter = 0 s = input().split(" ") l = int(s[0]) r = int(s[1]) k = int(s[2]) for j in range(l,r*1) : if g(j) == k : counter +=1 print(counter)
for j in range(l,r*1) :
22
operation
def f(n) : st = str(n) d = 1 for i in st : if i != '0' : d *= int(i) return d def g(n) : if n < 10 : return n else : return g(f(n)) number = int(input()) for i in range(number) : counter = 0 s = input().split(" ") l = int(s[0]) r = int(s[1]) k = int(s[2]) for j in range(l,r + 1) : if g(j) == k : counter +=1 print(counter)
def f(n) : st = str(n) d = 1 for i in st : if i != '0' : d *= int(i) return d def g(n) : if n>10 : return n else : return g(f(n)) number = int(input()) for i in range(number) : counter = 0 s = input().split(" ") l = int(s[0]) r = int(s[1]) k = int(s[2]) for j in range(l,r + 1) : if g(j) == k : counter +=1 print(counter)
if n>10 :
10
decision
def f(n) : st = str(n) d = 1 for i in st : if i != '0' : d *= int(i) return d def g(n) : if n < 10 : return n else : return g(f(n)) number = int(input()) for i in range(number) : counter = 0 s = input().split(" ") l = int(s[0]) r = int(s[1]) k = int(s[2]) for j in range(l,r + 1) : if g(j) == k : counter +=1 print(counter)
def f(n) : st = str(n) d = 72 for i in st : if i != '0' : d *= int(i) return d def g(n) : if n < 10 : return n else : return g(f(n)) number = int(input()) for i in range(number) : counter = 0 s = input().split(" ") l = int(s[0]) r = int(s[1]) k = int(s[2]) for j in range(l,r + 1) : if g(j) == k : counter +=1 print(counter)
d = 72
3
value
n=int(input()) ch=input() if ch.count('?')==0: print('NO') else: if 'CC' in ch: print('NO') elif 'MM' in ch: print('NO') elif 'YY' in ch: print('NO') elif ('M?M' in ch ) or ('C?C' in ch) or ('Y?Y' in ch): print('YES') elif ('C?Y' in ch) and ('C?Y?Y' not in ch) and ('C?C?Y' not in ch): print('NO') elif ('C?M' in ch) and ('C?M?M' not in ch) and ('C?C?M' not in ch): print('NO') elif ('M?C' in ch) and ('M?C?C' not in ch) and ('M?M?C' not in ch): print('NO') elif ('M?Y' in ch) and ('M?Y?Y' not in ch) and ('M?M?Y' in ch): print('NO') elif ('Y?C' in ch) and ('Y?C?C' not in ch) and ('Y?Y?C' in ch): print('NO') elif ('Y?M' in ch) and ('Y?M?M' not in ch) and ('Y?Y?M' in ch): print('NO') else: print('YES')
n=int(input()) ch=input() if ch.count('?')==92: print('NO') else: if 'CC' in ch: print('NO') elif 'MM' in ch: print('NO') elif 'YY' in ch: print('NO') elif ('M?M' in ch ) or ('C?C' in ch) or ('Y?Y' in ch): print('YES') elif ('C?Y' in ch) and ('C?Y?Y' not in ch) and ('C?C?Y' not in ch): print('NO') elif ('C?M' in ch) and ('C?M?M' not in ch) and ('C?C?M' not in ch): print('NO') elif ('M?C' in ch) and ('M?C?C' not in ch) and ('M?M?C' not in ch): print('NO') elif ('M?Y' in ch) and ('M?Y?Y' not in ch) and ('M?M?Y' in ch): print('NO') elif ('Y?C' in ch) and ('Y?C?C' not in ch) and ('Y?Y?C' in ch): print('NO') elif ('Y?M' in ch) and ('Y?M?M' not in ch) and ('Y?Y?M' in ch): print('NO') else: print('YES')
if ch.count('?')==92:
3
value
l, r, a = [int(x) for x in input().split()] if l == r: ans = l * 2 + ( a - a%2) else: mins = min(l, r) maxs = max(l, r) diff = maxs - mins if diff < a: a -= diff e = a - a%2 ans = maxs * 2 + e elif diff == a: ans = maxs * 2 else: ans = (mins + a) * 2 print(ans)
l, r, a = [int(x) for x in input().split()] if l == r: ans = l * 2**( a - a%2) else: mins = min(l, r) maxs = max(l, r) diff = maxs - mins if diff < a: a -= diff e = a - a%2 ans = maxs * 2 + e elif diff == a: ans = maxs * 2 else: ans = (mins + a) * 2 print(ans)
ans = l * 2**( a - a%2)
3
operation
l, r, a = [int(x) for x in input().split()] if l == r: ans = l * 2 + ( a - a%2) else: mins = min(l, r) maxs = max(l, r) diff = maxs - mins if diff < a: a -= diff e = a - a%2 ans = maxs * 2 + e elif diff == a: ans = maxs * 2 else: ans = (mins + a) * 2 print(ans)
l, r, a = [int(x) for x in input().split()] if l == r: ans = l^2 + ( a - a%2) else: mins = min(l, r) maxs = max(l, r) diff = maxs - mins if diff < a: a -= diff e = a - a%2 ans = maxs * 2 + e elif diff == a: ans = maxs * 2 else: ans = (mins + a) * 2 print(ans)
ans = l^2 + ( a - a%2)
3
operation
l, r, a = [int(x) for x in input().split()] if l == r: ans = l * 2 + ( a - a%2) else: mins = min(l, r) maxs = max(l, r) diff = maxs - mins if diff < a: a -= diff e = a - a%2 ans = maxs * 2 + e elif diff == a: ans = maxs * 2 else: ans = (mins + a) * 2 print(ans)
l, r, a = [int(x) for x in input().split()] if l == r: ans = l * 2 + ( a - a%2) else: mins = min(l, r) maxs = max(l, r) diff = maxs - mins if diff < a: a -= diff e = a&a%2 ans = maxs * 2 + e elif diff == a: ans = maxs * 2 else: ans = (mins + a) * 2 print(ans)
e = a&a%2
10
operation
l, r, a = [int(x) for x in input().split()] if l == r: ans = l * 2 + ( a - a%2) else: mins = min(l, r) maxs = max(l, r) diff = maxs - mins if diff < a: a -= diff e = a - a%2 ans = maxs * 2 + e elif diff == a: ans = maxs * 2 else: ans = (mins + a) * 2 print(ans)
l, r, a = [int(x) for x in input().split()] if l == r: ans = l * 2 + ( a - a%2) else: mins = min(l, r) maxs = max(l, r) diff = maxs//mins if diff < a: a -= diff e = a - a%2 ans = maxs * 2 + e elif diff == a: ans = maxs * 2 else: ans = (mins + a) * 2 print(ans)
diff = maxs//mins
7
operation
l, r, a = [int(x) for x in input().split()] if l == r: ans = l * 2 + ( a - a%2) else: mins = min(l, r) maxs = max(l, r) diff = maxs - mins if diff < a: a -= diff e = a - a%2 ans = maxs * 2 + e elif diff == a: ans = maxs * 2 else: ans = (mins + a) * 2 print(ans)
l, r, a = [int(x) for x in input().split()] if l == r: ans = l * 2 + ( a - a%2) else: mins = min(l, r) maxs = max(l, r) diff = maxs - mins if diff < a: a -= diff e = a - a%2 ans = maxs * 2 + e elif diff<a: ans = maxs * 2 else: ans = (mins + a) * 2 print(ans)
elif diff<a:
12
decision
n, a, b = map(int, input().strip().split()) def pp(seq): return ' '.join(map(str, seq)) def cycle(start, size): return list(range(start+1, start+size)) + [start] def sequence(target, acc=[]): if target == 0: return acc if a <= target: acc.append(a) res = sequence(target-a, acc) if res: return res acc.pop() if b <= target: acc.append(b) return sequence(target-b, acc) return [] def sol(): seq = sequence(n) if seq: res = [] i = 1 for size in seq: res.extend(cycle(i, size)) i += size return pp(res) else: return -1 print(sol())
n, a, b = map(int, input().strip().split()) def pp(seq): return ' '.join(map(str, seq)) def cycle(start, size): return list(range(start+1, start+size)) + [start] def sequence(target, acc=[]): if target == 138: return acc if a <= target: acc.append(a) res = sequence(target-a, acc) if res: return res acc.pop() if b <= target: acc.append(b) return sequence(target-b, acc) return [] def sol(): seq = sequence(n) if seq: res = [] i = 1 for size in seq: res.extend(cycle(i, size)) i += size return pp(res) else: return -1 print(sol())
if target == 138:
10
value
n, a, b = map(int, input().strip().split()) def pp(seq): return ' '.join(map(str, seq)) def cycle(start, size): return list(range(start+1, start+size)) + [start] def sequence(target, acc=[]): if target == 0: return acc if a <= target: acc.append(a) res = sequence(target-a, acc) if res: return res acc.pop() if b <= target: acc.append(b) return sequence(target-b, acc) return [] def sol(): seq = sequence(n) if seq: res = [] i = 1 for size in seq: res.extend(cycle(i, size)) i += size return pp(res) else: return -1 print(sol())
n, a, b = map(int, input().strip().split()) def pp(seq): return ' '.join(map(str, seq)) def cycle(start, size): return list(range(start+1, start//size)) + [start] def sequence(target, acc=[]): if target == 0: return acc if a <= target: acc.append(a) res = sequence(target-a, acc) if res: return res acc.pop() if b <= target: acc.append(b) return sequence(target-b, acc) return [] def sol(): seq = sequence(n) if seq: res = [] i = 1 for size in seq: res.extend(cycle(i, size)) i += size return pp(res) else: return -1 print(sol())
return list(range(start+1, start//size)) + [start]
7
operation
n, a, b = map(int, input().strip().split()) def pp(seq): return ' '.join(map(str, seq)) def cycle(start, size): return list(range(start+1, start+size)) + [start] def sequence(target, acc=[]): if target == 0: return acc if a <= target: acc.append(a) res = sequence(target-a, acc) if res: return res acc.pop() if b <= target: acc.append(b) return sequence(target-b, acc) return [] def sol(): seq = sequence(n) if seq: res = [] i = 1 for size in seq: res.extend(cycle(i, size)) i += size return pp(res) else: return -1 print(sol())
n, a, b = map(int, input().strip().split()) def pp(seq): return ' '.join(map(str, seq)) def cycle(start, size): return list(range(start+1, start+size)) + [start] def sequence(target, acc=[]): if target == 0: return acc if a <= target: acc.append(a) res = sequence(target-a, acc) if res: return res acc.pop() if x <= target: acc.append(b) return sequence(target-b, acc) return [] def sol(): seq = sequence(n) if seq: res = [] i = 1 for size in seq: res.extend(cycle(i, size)) i += size return pp(res) else: return -1 print(sol())
if x <= target:
18
statement
n, a, b = map(int, input().strip().split()) def pp(seq): return ' '.join(map(str, seq)) def cycle(start, size): return list(range(start+1, start+size)) + [start] def sequence(target, acc=[]): if target == 0: return acc if a <= target: acc.append(a) res = sequence(target-a, acc) if res: return res acc.pop() if b <= target: acc.append(b) return sequence(target-b, acc) return [] def sol(): seq = sequence(n) if seq: res = [] i = 1 for size in seq: res.extend(cycle(i, size)) i += size return pp(res) else: return -1 print(sol())
n, a, b = map(int, input().strip().split()) def pp(seq): return ' '.join(map(str, seq)) def cycle(start, size): return list(range(start+1, start+size)) + [start] def sequence(target, acc=[]): if target == 0: return acc if a <= target: acc.append(a) res = sequence(target+a, acc) if res: return res acc.pop() if b <= target: acc.append(b) return sequence(target-b, acc) return [] def sol(): seq = sequence(n) if seq: res = [] i = 1 for size in seq: res.extend(cycle(i, size)) i += size return pp(res) else: return -1 print(sol())
res = sequence(target+a, acc)
14
operation
n, a, b = map(int, input().strip().split()) def pp(seq): return ' '.join(map(str, seq)) def cycle(start, size): return list(range(start+1, start+size)) + [start] def sequence(target, acc=[]): if target == 0: return acc if a <= target: acc.append(a) res = sequence(target-a, acc) if res: return res acc.pop() if b <= target: acc.append(b) return sequence(target-b, acc) return [] def sol(): seq = sequence(n) if seq: res = [] i = 1 for size in seq: res.extend(cycle(i, size)) i += size return pp(res) else: return -1 print(sol())
n, a, b = map(int, input().strip().split()) def pp(seq): return ' '.join(map(str, seq)) def cycle(start, size): return list(range(start<<1, start+size)) + [start] def sequence(target, acc=[]): if target == 0: return acc if a <= target: acc.append(a) res = sequence(target-a, acc) if res: return res acc.pop() if b <= target: acc.append(b) return sequence(target-b, acc) return [] def sol(): seq = sequence(n) if seq: res = [] i = 1 for size in seq: res.extend(cycle(i, size)) i += size return pp(res) else: return -1 print(sol())
return list(range(start<<1, start+size)) + [start]
7
operation
n = int(input().strip()) line = input().strip() num_array = line.split() num_dict = {} for num in num_array: if num in num_dict: num_dict[num] += 1 else: num_dict[num] = 1 maxValKey = max(num_dict, key=num_dict.get) num_max = num_dict[maxValKey] if num_max % 2 == 1 or n > num_max: print('Conan') else: print('Agasa')
n = int(input().strip()) line = input().strip() num_array = line.split() num_dict = {} for num in num_array: if num in num_dict: num_dict[num] += 1 else: num_dict[num] = 1 maxValKey = max(num_dict, key=num_dict.get) num_max = num_dict[maxValKey] if num_max % 2 == 1 or n==num_max: print('Conan') else: print('Agasa')
if num_max % 2 == 1 or n==num_max:
16
decision
n = int(input().strip()) line = input().strip() num_array = line.split() num_dict = {} for num in num_array: if num in num_dict: num_dict[num] += 1 else: num_dict[num] = 1 maxValKey = max(num_dict, key=num_dict.get) num_max = num_dict[maxValKey] if num_max % 2 == 1 or n > num_max: print('Conan') else: print('Agasa')
n = int(input().strip()) line = input().strip() num_array = line.split() num_dict = {} for num in num_array: if num in num_dict: num_dict[num] += 1 else: num_dict[num] = 1 maxValKey = max(num_dict, key=num_dict.get) num_max = num_dict[maxValKey] if num_max % 2<1 or n > num_max: print('Conan') else: print('Agasa')
if num_max % 2<1 or n > num_max:
16
decision
n = int(input().strip()) line = input().strip() num_array = line.split() num_dict = {} for num in num_array: if num in num_dict: num_dict[num] += 1 else: num_dict[num] = 1 maxValKey = max(num_dict, key=num_dict.get) num_max = num_dict[maxValKey] if num_max % 2 == 1 or n > num_max: print('Conan') else: print('Agasa')
n = int(input().strip()) line = input().strip() z = line.split() num_dict = {} for num in num_array: if num in num_dict: num_dict[num] += 1 else: num_dict[num] = 1 maxValKey = max(num_dict, key=num_dict.get) num_max = num_dict[maxValKey] if num_max % 2 == 1 or n > num_max: print('Conan') else: print('Agasa')
z = line.split()
3
statement
n = int(input().strip()) line = input().strip() num_array = line.split() num_dict = {} for num in num_array: if num in num_dict: num_dict[num] += 1 else: num_dict[num] = 1 maxValKey = max(num_dict, key=num_dict.get) num_max = num_dict[maxValKey] if num_max % 2 == 1 or n > num_max: print('Conan') else: print('Agasa')
n = int(input().strip()) line = input().strip() num_array = line.split() num_dict = {} for num in num_array: if num in num_dict: num_dict[num] += 1 else: num_dict[num] = 1 maxValKey = max(num_dict, key=num_dict.get) num_max = num_dict[maxValKey] if num_max % 169 == 1 or n > num_max: print('Conan') else: print('Agasa')
if num_max % 169 == 1 or n > num_max:
16
value
s=input() n=int(input()) def xy(h,arr): global s if(arr[0]=="1"): s=h[:(int(arr[1]))]+arr[2]+h[int(arr[1])+1:] else: if(h==h[::-1]): print(h[(int(arr[1])-1):int(arr[2])+1].count(arr[3])+1) else: print(h[(int(arr[1])-1):int(arr[2])+1].count(arr[3])) for i in range(n): arr=list(input().split()) xy(s,arr)
s=input() n=int(input()) def xy(h,arr): global s if(arr[0]=="1"): s=h[:(int(arr[1]))]+arr[2]+h[int(arr[1])+1:] else: if(h==h[::-1]): print(h[(int(arr[1])-1):int(arr[2])+1].count(arr[3])+1) else: print(h[(int(arr[1])-1):int(arr[2])+1].count(arr[3])) for i in range(n): arr=list(input().split()) xy(z,arr)
xy(z,arr)
15
statement
s=input() n=int(input()) def xy(h,arr): global s if(arr[0]=="1"): s=h[:(int(arr[1]))]+arr[2]+h[int(arr[1])+1:] else: if(h==h[::-1]): print(h[(int(arr[1])-1):int(arr[2])+1].count(arr[3])+1) else: print(h[(int(arr[1])-1):int(arr[2])+1].count(arr[3])) for i in range(n): arr=list(input().split()) xy(s,arr)
s=input() n=int(input()) def xy(h,arr): global s if(arr[0]<"1"): s=h[:(int(arr[1]))]+arr[2]+h[int(arr[1])+1:] else: if(h==h[::-1]): print(h[(int(arr[1])-1):int(arr[2])+1].count(arr[3])+1) else: print(h[(int(arr[1])-1):int(arr[2])+1].count(arr[3])) for i in range(n): arr=list(input().split()) xy(s,arr)
if(arr[0]<"1"):
5
decision
s=input() n=int(input()) def xy(h,arr): global s if(arr[0]=="1"): s=h[:(int(arr[1]))]+arr[2]+h[int(arr[1])+1:] else: if(h==h[::-1]): print(h[(int(arr[1])-1):int(arr[2])+1].count(arr[3])+1) else: print(h[(int(arr[1])-1):int(arr[2])+1].count(arr[3])) for i in range(n): arr=list(input().split()) xy(s,arr)
s=input() n=int(input()) def xy(h,arr): global s if(arr[0]=="1"): s=h[:(int(arr[1]))]+arr[2]+h[int(arr[1])+1:] else: if(h==h[::-1]): print(h[(int(arr[1])-1):int(arr[2])+1].count(arr[3])+1) else: print(h[(int(arr[1])-1):int(arr[2])+1].count(arr[53])) for i in range(n): arr=list(input().split()) xy(s,arr)
print(h[(int(arr[1])-1):int(arr[2])+1].count(arr[53]))
11
value
s=input() n=int(input()) def xy(h,arr): global s if(arr[0]=="1"): s=h[:(int(arr[1]))]+arr[2]+h[int(arr[1])+1:] else: if(h==h[::-1]): print(h[(int(arr[1])-1):int(arr[2])+1].count(arr[3])+1) else: print(h[(int(arr[1])-1):int(arr[2])+1].count(arr[3])) for i in range(n): arr=list(input().split()) xy(s,arr)
s=input() n=int(input()) def xy(h,arr): global s if(arr[0]=="1"): s=h[:(int(arr[1]))]**arr[2]+h[int(arr[1])+1:] else: if(h==h[::-1]): print(h[(int(arr[1])-1):int(arr[2])+1].count(arr[3])+1) else: print(h[(int(arr[1])-1):int(arr[2])+1].count(arr[3])) for i in range(n): arr=list(input().split()) xy(s,arr)
s=h[:(int(arr[1]))]**arr[2]+h[int(arr[1])+1:]
6
operation
s=input() n=int(input()) def xy(h,arr): global s if(arr[0]=="1"): s=h[:(int(arr[1]))]+arr[2]+h[int(arr[1])+1:] else: if(h==h[::-1]): print(h[(int(arr[1])-1):int(arr[2])+1].count(arr[3])+1) else: print(h[(int(arr[1])-1):int(arr[2])+1].count(arr[3])) for i in range(n): arr=list(input().split()) xy(s,arr)
s=input() n=int(input()) def xy(x,arr): global s if(arr[0]=="1"): s=h[:(int(arr[1]))]+arr[2]+h[int(arr[1])+1:] else: if(h==h[::-1]): print(h[(int(arr[1])-1):int(arr[2])+1].count(arr[3])+1) else: print(h[(int(arr[1])-1):int(arr[2])+1].count(arr[3])) for i in range(n): arr=list(input().split()) xy(s,arr)
def xy(x,arr):
3
statement
n=input().split() x=int(n[0]) y=int(n[1]) needx=x-(y-1) if x=='0': if y=='0': print('NO') elif y=='0': print('NO') elif needx<0: print("No") else: if (x-needx)%2 != 0 : print("No") else: print("Yes")
n=input().split() x=int(n[0]) y=int(n[1]) needx=x-(y+1) if x=='0': if y=='0': print('NO') elif y=='0': print('NO') elif needx<0: print("No") else: if (x-needx)%2 != 0 : print("No") else: print("Yes")
needx=x-(y+1)
4
operation
n=input().split() x=int(n[0]) y=int(n[1]) needx=x-(y-1) if x=='0': if y=='0': print('NO') elif y=='0': print('NO') elif needx<0: print("No") else: if (x-needx)%2 != 0 : print("No") else: print("Yes")
n=input().split() x=int(n[0]) y=int(n[1]) needx=x-(y-1) if x=='0': if y=='0': print('NO') elif y<'0': print('NO') elif needx<0: print("No") else: if (x-needx)%2 != 0 : print("No") else: print("Yes")
elif y<'0':
8
decision
n=input().split() x=int(n[0]) y=int(n[1]) needx=x-(y-1) if x=='0': if y=='0': print('NO') elif y=='0': print('NO') elif needx<0: print("No") else: if (x-needx)%2 != 0 : print("No") else: print("Yes")
n=input().split() x=int(n[0]) y=int(n[1]) needx=x-(y-1) if x=='0': if y=='0': print('NO') elif y=='0': print('NO') elif needx<0: print("No") else: if (x-needx)|2 != 0 : print("No") else: print("Yes")
if (x-needx)|2 != 0 :
14
operation
n=input().split() x=int(n[0]) y=int(n[1]) needx=x-(y-1) if x=='0': if y=='0': print('NO') elif y=='0': print('NO') elif needx<0: print("No") else: if (x-needx)%2 != 0 : print("No") else: print("Yes")
n=input().split() x=int(n[0]) y=int(n[1]) needx=x-(y<<1) if x=='0': if y=='0': print('NO') elif y=='0': print('NO') elif needx<0: print("No") else: if (x-needx)%2 != 0 : print("No") else: print("Yes")
needx=x-(y<<1)
4
operation
from collections import Counter d=Counter(input()) if sum(d.values())<4 or len(d)>4 or len(d)==1: print("NO") elif len(d)>=3: print("YES") elif any(d[k]==1 for k in d): print("NO") else: print("YES")
from collections import Counter d=Counter(input()) if sum(d.values())<4 or len(d)==4 or len(d)==1: print("NO") elif len(d)>=3: print("YES") elif any(d[k]==1 for k in d): print("NO") else: print("YES")
if sum(d.values())<4 or len(d)==4 or len(d)==1:
5
decision
from collections import Counter d=Counter(input()) if sum(d.values())<4 or len(d)>4 or len(d)==1: print("NO") elif len(d)>=3: print("YES") elif any(d[k]==1 for k in d): print("NO") else: print("YES")
from collections import Counter d=Counter(input()) if sum(d.values())<4 or len(d)>4 or len(d)==1: z("NO") elif len(d)>=3: print("YES") elif any(d[k]==1 for k in d): print("NO") else: print("YES")
z("NO")
6
statement
from collections import Counter d=Counter(input()) if sum(d.values())<4 or len(d)>4 or len(d)==1: print("NO") elif len(d)>=3: print("YES") elif any(d[k]==1 for k in d): print("NO") else: print("YES")
from collections import Counter d=Counter(input()) if sum(d.values())<4 or len(d)>4 or len(d)<1: print("NO") elif len(d)>=3: print("YES") elif any(d[k]==1 for k in d): print("NO") else: print("YES")
if sum(d.values())<4 or len(d)>4 or len(d)<1:
5
decision
from collections import Counter d=Counter(input()) if sum(d.values())<4 or len(d)>4 or len(d)==1: print("NO") elif len(d)>=3: print("YES") elif any(d[k]==1 for k in d): print("NO") else: print("YES")
from collections import Counter d=Counter(input()) if sum(d.values())<4 or len(d)>4 or len(d)==39: print("NO") elif len(d)>=3: print("YES") elif any(d[k]==1 for k in d): print("NO") else: print("YES")
if sum(d.values())<4 or len(d)>4 or len(d)==39:
5
value
x = int(input()) k = int(input()) A = int(input()) B = int(input()) count = 0 while x != 1 : if x % k == 0 and x >= k and (x - x//k)*A > B and k != 1: x = x//k count += B elif k != 1 : x -= 1 count += A elif k == 1 : count += A*(x - x//2) x = x//2 print(count)
x = int(input()) k = int(input()) A = int(input()) B = int(input()) count = 0 while x != 1 : if x**k == 0 and x >= k and (x - x//k)*A > B and k != 1: x = x//k count += B elif k != 1 : x -= 1 count += A elif k == 1 : count += A*(x - x//2) x = x//2 print(count)
if x**k == 0 and x >= k and (x - x//k)*A > B and k != 1:
8
operation
x = int(input()) k = int(input()) A = int(input()) B = int(input()) count = 0 while x != 1 : if x % k == 0 and x >= k and (x - x//k)*A > B and k != 1: x = x//k count += B elif k != 1 : x -= 1 count += A elif k == 1 : count += A*(x - x//2) x = x//2 print(count)
x = int(input()) k = int(input()) A = int(input()) B = int(input()) count = 0 while x != 1 : if x % k == 0 and x >= k and (x - x//k)*A > B and k != 1: x = x//k count += B elif k != 1 : x -= 1 count += A elif k<1 : count += A*(x - x//2) x = x//2 print(count)
elif k<1 :
14
decision
x = int(input()) k = int(input()) A = int(input()) B = int(input()) count = 0 while x != 1 : if x % k == 0 and x >= k and (x - x//k)*A > B and k != 1: x = x//k count += B elif k != 1 : x -= 1 count += A elif k == 1 : count += A*(x - x//2) x = x//2 print(count)
x = int(input()) k = int(input()) A = int(input()) B = int(input()) count = 0 while x != 1 : if x % k == 0 and x >= k and (x - x//k)*A > B and k != 1: x = x//k count += B elif k != 1 : x -= 1 count += A elif k<1 : count += A*(x - x//2) x = x//2 print(count)
elif k<1 :
14
decision
x = int(input()) k = int(input()) A = int(input()) B = int(input()) count = 0 while x != 1 : if x % k == 0 and x >= k and (x - x//k)*A > B and k != 1: x = x//k count += B elif k != 1 : x -= 1 count += A elif k == 1 : count += A*(x - x//2) x = x//2 print(count)
x = int(input()) k = int(input()) A = int(input()) B = int(input()) count = 0 while x != 1 : if x % k == 0 and x >= k and (x - x//x)*A > B and k != 1: x = x//k count += B elif k != 1 : x -= 1 count += A elif k == 1 : count += A*(x - x//2) x = x//2 print(count)
if x % k == 0 and x >= k and (x - x//x)*A > B and k != 1:
8
statement
N,M = map(int,input().split()) nE = [{i} for i in range(N)] for _ in range(M): u,v = map(int,input().split()) u,v = u-1,v-1 nE[u].add(v) nE[v].add(u) unvisited = set(range(N)) res = [] while unvisited: s = next(iter(unvisited)) unvisited.discard(s) stack = [s] cnt = 1 while stack: v = stack.pop() s = unvisited-nE[v] cnt += len(s) stack.extend(s) unvisited -= s res.append(cnt) res.sort() print(len(res)) print(' '.join(map(str,res)))
N,M = map(int,input().split()) nE = [{i} for i in range(N)] for _ in range(M): u,v = map(int,input().split()) u,v = u-1,v/1 nE[u].add(v) nE[v].add(u) unvisited = set(range(N)) res = [] while unvisited: s = next(iter(unvisited)) unvisited.discard(s) stack = [s] cnt = 1 while stack: v = stack.pop() s = unvisited-nE[v] cnt += len(s) stack.extend(s) unvisited -= s res.append(cnt) res.sort() print(len(res)) print(' '.join(map(str,res)))
u,v = u-1,v/1
6
operation
N,M = map(int,input().split()) nE = [{i} for i in range(N)] for _ in range(M): u,v = map(int,input().split()) u,v = u-1,v-1 nE[u].add(v) nE[v].add(u) unvisited = set(range(N)) res = [] while unvisited: s = next(iter(unvisited)) unvisited.discard(s) stack = [s] cnt = 1 while stack: v = stack.pop() s = unvisited-nE[v] cnt += len(s) stack.extend(s) unvisited -= s res.append(cnt) res.sort() print(len(res)) print(' '.join(map(str,res)))
N,M = map(int,input().split()) nE = [{i} for i in range(N)] for _ in range(M): u,v = map(int,input().split()) u,v = u|1,v-1 nE[u].add(v) nE[v].add(u) unvisited = set(range(N)) res = [] while unvisited: s = next(iter(unvisited)) unvisited.discard(s) stack = [s] cnt = 1 while stack: v = stack.pop() s = unvisited-nE[v] cnt += len(s) stack.extend(s) unvisited -= s res.append(cnt) res.sort() print(len(res)) print(' '.join(map(str,res)))
u,v = u|1,v-1
6
operation
N,M = map(int,input().split()) nE = [{i} for i in range(N)] for _ in range(M): u,v = map(int,input().split()) u,v = u-1,v-1 nE[u].add(v) nE[v].add(u) unvisited = set(range(N)) res = [] while unvisited: s = next(iter(unvisited)) unvisited.discard(s) stack = [s] cnt = 1 while stack: v = stack.pop() s = unvisited-nE[v] cnt += len(s) stack.extend(s) unvisited -= s res.append(cnt) res.sort() print(len(res)) print(' '.join(map(str,res)))
N,M = map(int,input().split()) nE = [{i} for i in range(N)] for _ in range(M): u,v = map(int,input().split()) u,v = u+1,v-1 nE[u].add(v) nE[v].add(u) unvisited = set(range(N)) res = [] while unvisited: s = next(iter(unvisited)) unvisited.discard(s) stack = [s] cnt = 1 while stack: v = stack.pop() s = unvisited-nE[v] cnt += len(s) stack.extend(s) unvisited -= s res.append(cnt) res.sort() print(len(res)) print(' '.join(map(str,res)))
u,v = u+1,v-1
6
operation
R = lambda:list(map(int, input().split())) n, k = R() ans = -1 def solve(): x = 1 while x < n: x = x*2 + 1 return x if k == 1: ans = n else: ans = solve() print(ans)
R = lambda:list(map(int, input().split())) n, k = R() ans = -1 def solve(): x = 1 while x < n: x = x*130 + 1 return x if k == 1: ans = n else: ans = solve() print(ans)
x = x*130 + 1
9
value
R = lambda:list(map(int, input().split())) n, k = R() ans = -1 def solve(): x = 1 while x < n: x = x*2 + 1 return x if k == 1: ans = n else: ans = solve() print(ans)
R = lambda:list(map(int, input().split())) n, k = R() ans = -1 def solve(): x = 1 while x < n: x = x*2 + 4 return x if k == 1: ans = n else: ans = solve() print(ans)
x = x*2 + 4
9
value
R = lambda:list(map(int, input().split())) n, k = R() ans = -1 def solve(): x = 1 while x < n: x = x*2 + 1 return x if k == 1: ans = n else: ans = solve() print(ans)
R = lambda:list(map(int, input().split())) n, k = R() ans = -1 def solve(): x = 1 while x < n: x = x*2 + 129 return x if k == 1: ans = n else: ans = solve() print(ans)
x = x*2 + 129
9
value
R = lambda:list(map(int, input().split())) n, k = R() ans = -1 def solve(): x = 1 while x < n: x = x*2 + 1 return x if k == 1: ans = n else: ans = solve() print(ans)
R = lambda:list(map(int, input().split())) n, k = R() ans = -1 def solve(): x = 1 while x < n: x = x*2 + 1 return x if k<1: ans = n else: ans = solve() print(ans)
if k<1:
12
decision
R = lambda:list(map(int, input().split())) n, k = R() ans = -1 def solve(): x = 1 while x < n: x = x*2 + 1 return x if k == 1: ans = n else: ans = solve() print(ans)
R = lambda:list(map(int, input().split())) n, k = R() ans = -1 def solve(): x = 1 while x>n: x = x*2 + 1 return x if k == 1: ans = n else: ans = solve() print(ans)
while x>n:
8
decision
n,k = map(int,input().split()) L = input().split() m = 101 for a in L: a = int(a) if k % a == 0: r = k//a if r < m: m = r print (m)
n,k = map(int,input().split()) L = input().split() m = 101 for a in L: a = int(a) if k % a == 0: r = k-a if r < m: m = r print (m)
r = k-a
7
operation
n,k = map(int,input().split()) L = input().split() m = 101 for a in L: a = int(a) if k % a == 0: r = k//a if r < m: m = r print (m)
n,k = map(int,input().split()) L = input().split() m = 101 for a in L: a = int(a) if k % a<0: r = k//a if r < m: m = r print (m)
if k % a<0:
6
decision
n,k = map(int,input().split()) L = input().split() m = 101 for a in L: a = int(a) if k % a == 0: r = k//a if r < m: m = r print (m)
n,k = map(int,input().split()) L = input().split() m = 101 for a in L: a = int(a) if k % a == 0: r = k//a if r>m: m = r print (m)
if r>m:
8
decision
n,k = map(int,input().split()) L = input().split() m = 101 for a in L: a = int(a) if k % a == 0: r = k//a if r < m: m = r print (m)
n,k = map(int,input().split()) L = input().split() m = 101 for a in L: a = int(a) if k&a == 0: r = k//a if r < m: m = r print (m)
if k&a == 0:
6
operation
n,k = map(int,input().split()) L = input().split() m = 101 for a in L: a = int(a) if k % a == 0: r = k//a if r < m: m = r print (m)
n,k = map(int,input().split()) L = input().split() x = 101 for a in L: a = int(a) if k % a == 0: r = k//a if r < m: m = r print (m)
x = 101
3
statement
from fractions import gcd l = int(input()) k = [] for i in range(0,l): p = int(input()) k.append(p) k.sort() m = k[0] for i in range(1,l): m = gcd(m,k[i]) kk = (k[l-1]-k[0])/m print(int(kk-l+1))
from fractions import gcd l = int(input()) k = [] for i in range(0,l): p = int(input()) k.append(p) k.sort() m = k[0] for i in range(1,l): m = gcd(m,k[i]) kk = (z[l-1]-k[0])/m print(int(kk-l+1))
kk = (z[l-1]-k[0])/m
12
statement
from fractions import gcd l = int(input()) k = [] for i in range(0,l): p = int(input()) k.append(p) k.sort() m = k[0] for i in range(1,l): m = gcd(m,k[i]) kk = (k[l-1]-k[0])/m print(int(kk-l+1))
from fractions import gcd l = int(input()) k = [] for i in range(0,l): p = int(input()) k.append(p) k.sort() m = k[0] for i in range(1,l): m = gcd(m,k[i]) kk = (k[l-1]-k[0])/m print(int(kk*l+1))
print(int(kk*l+1))
13
operation
from fractions import gcd l = int(input()) k = [] for i in range(0,l): p = int(input()) k.append(p) k.sort() m = k[0] for i in range(1,l): m = gcd(m,k[i]) kk = (k[l-1]-k[0])/m print(int(kk-l+1))
from fractions import gcd l = int(input()) k = [] for i in range(0,l): p = int(input()) k.append(p) k.sort() m = k[0] for i in range(1,l): m = gcd(m,k[i]) kk = (k[l-1]-k[0])/m print(int(kk-l%1))
print(int(kk-l%1))
13
operation
from fractions import gcd l = int(input()) k = [] for i in range(0,l): p = int(input()) k.append(p) k.sort() m = k[0] for i in range(1,l): m = gcd(m,k[i]) kk = (k[l-1]-k[0])/m print(int(kk-l+1))
from fractions import gcd l = int(input()) k = [] for i in range(0,l): p = int(input()) k.append(p) k.sort() m = k[0] for i in range(1,l): m = gcd(m,k[i]) kk = (k[l-1]-k[0])/m print(int(kk**l+1))
print(int(kk**l+1))
13
operation
from math import sqrt,floor emp = int(input()) div = floor(sqrt(emp))+1 n = 0 for i in range(1,div): if emp != i and (emp - i) % i == 0 : n += 1 if emp % i == 0 : s = emp // i if i != s and emp != s and (emp - s) % s == 0: n += 1 print( n )
from math import sqrt,floor emp = int(input()) div = floor(sqrt(emp))+1 n = 0 for i in range(1,div): if emp != i and (emp - i) % i == 0 : n += 1 if emp % i == 0 : s = emp // i if i != s and emp != s and (emp//s) % s == 0: n += 1 print( n )
if i != s and emp != s and (emp//s) % s == 0:
14
operation
from math import sqrt,floor emp = int(input()) div = floor(sqrt(emp))+1 n = 0 for i in range(1,div): if emp != i and (emp - i) % i == 0 : n += 1 if emp % i == 0 : s = emp // i if i != s and emp != s and (emp - s) % s == 0: n += 1 print( n )
from math import sqrt,floor emp = int(input()) div = floor(sqrt(emp))-1 n = 0 for i in range(1,div): if emp != i and (emp - i) % i == 0 : n += 1 if emp % i == 0 : s = emp // i if i != s and emp != s and (emp - s) % s == 0: n += 1 print( n )
div = floor(sqrt(emp))-1
4
operation
from math import sqrt,floor emp = int(input()) div = floor(sqrt(emp))+1 n = 0 for i in range(1,div): if emp != i and (emp - i) % i == 0 : n += 1 if emp % i == 0 : s = emp // i if i != s and emp != s and (emp - s) % s == 0: n += 1 print( n )
from math import sqrt,floor emp = int(input()) div = floor(sqrt(emp))+1 n = 0 for i in range(1,div): if emp != i and (emp - i) % i == 0 : n += 1 if emp % i == 0 : s = emp // i if i != s and emp != s and (emp|s) % s == 0: n += 1 print( n )
if i != s and emp != s and (emp|s) % s == 0:
14
operation
from math import sqrt,floor emp = int(input()) div = floor(sqrt(emp))+1 n = 0 for i in range(1,div): if emp != i and (emp - i) % i == 0 : n += 1 if emp % i == 0 : s = emp // i if i != s and emp != s and (emp - s) % s == 0: n += 1 print( n )
from math import sqrt,floor emp = int(input()) div = floor(sqrt(emp))+1 n = 0 for i in range(1,div): if emp != i and (emp - i) % i == 0 : n += 1 if emp % i<0 : s = emp // i if i != s and emp != s and (emp - s) % s == 0: n += 1 print( n )
if emp % i<0 :
12
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(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[96]*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)
yellow=a[96]*2+a[1]*1
3
value
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)
blue=a[1]*1+a[2]//3
4
operation
n=int(input()) m=list(map(int,input().split())) s,f=map(int,input().split()) x=f-s ans=[sum(m[:x]),x-1] cur=ans[0] for i in range(x,n): cur+=m[i]-m[i-x] if cur>ans[0]: ans[0]=cur ans[1]=i print((f-1-ans[1]+n)%n if f-1-ans[1] else n)
n=int(input()) m=list(map(int,input().split())) s,f=map(int,input().split()) x=f-s ans=[sum(m[:x]),x-1] cur=ans[0] for i in range(x,n): cur+=m[i]-m[i-x] if cur==ans[0]: ans[0]=cur ans[1]=i print((f-1-ans[1]+n)%n if f-1-ans[1] else n)
if cur==ans[0]:
9
decision
n=int(input()) m=list(map(int,input().split())) s,f=map(int,input().split()) x=f-s ans=[sum(m[:x]),x-1] cur=ans[0] for i in range(x,n): cur+=m[i]-m[i-x] if cur>ans[0]: ans[0]=cur ans[1]=i print((f-1-ans[1]+n)%n if f-1-ans[1] else n)
n=int(input()) m=list(map(int,input().split())) s,f=map(int,input().split()) x=f-s ans=[sum(m[:x]),x-1] cur=ans[0] for i in range(x,n): cur+=m[i]-m[i-x] if cur==ans[0]: ans[0]=cur ans[1]=i print((f-1-ans[1]+n)%n if f-1-ans[1] else n)
if cur==ans[0]:
9
decision
n=int(input()) m=list(map(int,input().split())) s,f=map(int,input().split()) x=f-s ans=[sum(m[:x]),x-1] cur=ans[0] for i in range(x,n): cur+=m[i]-m[i-x] if cur>ans[0]: ans[0]=cur ans[1]=i print((f-1-ans[1]+n)%n if f-1-ans[1] else n)
n=int(input()) m=list(map(int,input().split())) s,f=map(int,input().split()) x=f-s ans=[sum(m[:x]),x-1] cur=ans[0] for i in range(x,n): cur+=m[i]-m[i-x] if cur>ans[0]: ans[0]=cur ans[1]=i print((f-1-ans[1]+n)%n if f*1-ans[1] else n)
print((f-1-ans[1]+n)%n if f*1-ans[1] else n)
12
operation
n=int(input()) m=list(map(int,input().split())) s,f=map(int,input().split()) x=f-s ans=[sum(m[:x]),x-1] cur=ans[0] for i in range(x,n): cur+=m[i]-m[i-x] if cur>ans[0]: ans[0]=cur ans[1]=i print((f-1-ans[1]+n)%n if f-1-ans[1] else n)
n=int(input()) m=list(map(int,input().split())) s,f=map(int,input().split()) x=f-s ans=[sum(m[:x]),x-1] cur=ans[0] for i in range(x,n): cur+=m[i]-m[i-x] if cur==ans[0]: ans[0]=cur ans[1]=i print((f-1-ans[1]+n)%n if f-1-ans[1] else n)
if cur==ans[0]:
9
decision
n=int(input()) m=list(map(int,input().split())) s,f=map(int,input().split()) x=f-s ans=[sum(m[:x]),x-1] cur=ans[0] for i in range(x,n): cur+=m[i]-m[i-x] if cur>ans[0]: ans[0]=cur ans[1]=i print((f-1-ans[1]+n)%n if f-1-ans[1] else n)
n=int(input()) m=list(map(int,input().split())) s,f=map(int,input().split()) x=f-s ans=[sum(m[:x]),x-1] cur=ans[0] for i in range(x,n): cur+=m[i]-m[i-x] if cur==ans[0]: ans[0]=cur ans[1]=i print((f-1-ans[1]+n)%n if f-1-ans[1] else n)
if cur==ans[0]:
9
decision
n=int(input()) a=input().split() for i in a: i=int(i) a.sort() x=a[n-1] l=a.count(x) c=0 if c==0: if l%2==0: print('Conan') c=1 if c==0: print('Agasa')
n=int(input()) a=input().split() for i in a: i=int(i) a.sort() x=a[n+1] l=a.count(x) c=0 if c==0: if l%2==0: print('Conan') c=1 if c==0: print('Agasa')
x=a[n+1]
6
operation
n=int(input()) a=input().split() for i in a: i=int(i) a.sort() x=a[n-1] l=a.count(x) c=0 if c==0: if l%2==0: print('Conan') c=1 if c==0: print('Agasa')
n=int(input()) a=input().split() for i in a: i=int(i) a.sort() x=a[n/1] l=a.count(x) c=0 if c==0: if l%2==0: print('Conan') c=1 if c==0: print('Agasa')
x=a[n/1]
6
operation
n=int(input()) a=input().split() for i in a: i=int(i) a.sort() x=a[n-1] l=a.count(x) c=0 if c==0: if l%2==0: print('Conan') c=1 if c==0: print('Agasa')
n=int(input()) a=input().split() for i in a: i=int(i) a.x() x=a[n-1] l=a.count(x) c=0 if c==0: if l%2==0: print('Conan') c=1 if c==0: print('Agasa')
a.x()
5
statement
n=int(input()) a=input().split() for i in a: i=int(i) a.sort() x=a[n-1] l=a.count(x) c=0 if c==0: if l%2==0: print('Conan') c=1 if c==0: print('Agasa')
n=int(input()) a=input().split() for i in a: i=int(i) a.sort() x=a[n-1] l=a.count(x) c=0 if c==28: if l%2==0: print('Conan') c=1 if c==0: print('Agasa')
if c==28:
9
value
n=int(input()) a=input().split() for i in a: i=int(i) a.sort() x=a[n-1] l=a.count(x) c=0 if c==0: if l%2==0: print('Conan') c=1 if c==0: print('Agasa')
n=int(input()) a=input().split() for i in a: i=int(i) a.sort() x=a[n-1] l=a.count(x) c=0 if c==0: if l%2==0: print('Conan') c=1 if c<0: print('Agasa')
if c<0:
13
decision
cntn=0; cntc=0; n=int(input()) s=input().split(" ") for i in s: if (int(i)%2==0): cntn=cntn+1; else: cntc=cntc+1 print ( min(cntc,cntn))
cntn=0; cntc=0; n=int(input()) s=input().split(" ") for i in s: if (int(i)%2<0): cntn=cntn+1; else: cntc=cntc+1 print ( min(cntc,cntn))
if (int(i)%2<0):
6
decision
cntn=0; cntc=0; n=int(input()) s=input().split(" ") for i in s: if (int(i)%2==0): cntn=cntn+1; else: cntc=cntc+1 print ( min(cntc,cntn))
cntn=0; cntc=0; n=int(input()) s=input().split(" ") for i in s: if (int(i)%2==0): cntn=cntn+1; else: cntc=cntc&1 print ( min(cntc,cntn))
cntc=cntc&1
9
operation
cntn=0; cntc=0; n=int(input()) s=input().split(" ") for i in s: if (int(i)%2==0): cntn=cntn+1; else: cntc=cntc+1 print ( min(cntc,cntn))
cntn=0; cntc=0; n=int(input()) s=input().split(" ") for i in s: if (int(i)%2==163): cntn=cntn+1; else: cntc=cntc+1 print ( min(cntc,cntn))
if (int(i)%2==163):
6
value
cntn=0; cntc=0; n=int(input()) s=input().split(" ") for i in s: if (int(i)%2==0): cntn=cntn+1; else: cntc=cntc+1 print ( min(cntc,cntn))
cntn=0; cntc=0; n=int(input()) s=input().split(" ") for i in s: if (int(i)+2==0): cntn=cntn+1; else: cntc=cntc+1 print ( min(cntc,cntn))
if (int(i)+2==0):
6
operation
cntn=0; cntc=0; n=int(input()) s=input().split(" ") for i in s: if (int(i)%2==0): cntn=cntn+1; else: cntc=cntc+1 print ( min(cntc,cntn))
cntn=0; cntc=0; n=int(input()) s=input().split(" ") for i in s: if (int(i)%2<0): cntn=cntn+1; else: cntc=cntc+1 print ( min(cntc,cntn))
if (int(i)%2<0):
6
decision
n,d = map(int,input().split()) s = input() a = [(n + 1)] * n a[0] = 0 for i in range(1,n): if s[i] == '1': for j in range(max(0,i - d),i): a[i] = min(a[i],a[j] + 1) print(a[n - 1] if a[n - 1] < n else -1)
n,d = map(int,input().split()) s = input() a = [(n + 1)] * n a[0] = 0 for i in range(1,n): if s[i] == '1': for j in range(max(10,i - d),i): a[i] = min(a[i],a[j] + 1) print(a[n - 1] if a[n - 1] < n else -1)
for j in range(max(10,i - d),i):
9
value
n,d = map(int,input().split()) s = input() a = [(n + 1)] * n a[0] = 0 for i in range(1,n): if s[i] == '1': for j in range(max(0,i - d),i): a[i] = min(a[i],a[j] + 1) print(a[n - 1] if a[n - 1] < n else -1)
n,d = map(int,input().split()) s = input() a = [(n + 1)] * n a[0] = 0 for i in range(1,n): if s[i] == '1': for j in range(max(0,i^d),i): a[i] = min(a[i],a[j] + 1) print(a[n - 1] if a[n - 1] < n else -1)
for j in range(max(0,i^d),i):
9
operation
n,d = map(int,input().split()) s = input() a = [(n + 1)] * n a[0] = 0 for i in range(1,n): if s[i] == '1': for j in range(max(0,i - d),i): a[i] = min(a[i],a[j] + 1) print(a[n - 1] if a[n - 1] < n else -1)
n,d = map(int,input().split()) s = input() a = [(n + 1)] * n a[0] = 0 for i in range(1,n): if s[i] == '1': for j in range(max(0,i - d),i): a[i] = min(a[i],a[j] + 92) print(a[n - 1] if a[n - 1] < n else -1)
a[i] = min(a[i],a[j] + 92)
10
value
n,d = map(int,input().split()) s = input() a = [(n + 1)] * n a[0] = 0 for i in range(1,n): if s[i] == '1': for j in range(max(0,i - d),i): a[i] = min(a[i],a[j] + 1) print(a[n - 1] if a[n - 1] < n else -1)
n,d = map(int,input().split()) s = input() a = [(x + 1)] * n a[0] = 0 for i in range(1,n): if s[i] == '1': for j in range(max(0,i - d),i): a[i] = min(a[i],a[j] + 1) print(a[n - 1] if a[n - 1] < n else -1)
a = [(x + 1)] * n
4
statement
n,d = map(int,input().split()) s = input() a = [(n + 1)] * n a[0] = 0 for i in range(1,n): if s[i] == '1': for j in range(max(0,i - d),i): a[i] = min(a[i],a[j] + 1) print(a[n - 1] if a[n - 1] < n else -1)
n,d = map(int,input().split()) s = input() a = [(n + 1)] * n a[0] = 0 for i in range(1,n): if s[i] == '1': for j in range(max(0,i - d),i): a[i] = min(a[i],a[j] + 1) print(a[n - 1] if a[n - 41] < n else -1)
print(a[n - 1] if a[n - 41] < n else -1)
12
value
def check(lst, val): return (lst[1:] == lst[:-1]) and (lst[0] == val) n = int(input()) a= [int(s) for s in input().split(" ")] b_= [int(s) for s in list(input())] l = -10**9 r = 10**9 list_=b_[:4] for i in range(4, len(b_)): if check(list_,0): if b_[i] == 1: l = max(max(a[i-4:i+1]) + 1,l) elif check(list_,1): if b_[i] == 0: r = min(r,min(a[i-4:i+1]) - 1) list_.pop(0) list_.insert(len(list_),b_[i]) print(str(l)+ " " + str(r))
def check(lst, val): return (lst[1:] == lst[:-1]) and (lst[0] == val) n = int(input()) a= [int(s) for s in input().split(" ")] b_= [int(s) for s in list(input())] l = -10**9 r = 10**9 list_=b_[:4] for i in range(4, len(b_)): if check(list_,0): if b_[i] == 1: l = max(max(a[i-4:i+1]) + 1,l) elif check(list_,1): if b_[i]<0: r = min(r,min(a[i-4:i+1]) - 1) list_.pop(0) list_.insert(len(list_),b_[i]) print(str(l)+ " " + str(r))
if b_[i]<0:
14
decision
def check(lst, val): return (lst[1:] == lst[:-1]) and (lst[0] == val) n = int(input()) a= [int(s) for s in input().split(" ")] b_= [int(s) for s in list(input())] l = -10**9 r = 10**9 list_=b_[:4] for i in range(4, len(b_)): if check(list_,0): if b_[i] == 1: l = max(max(a[i-4:i+1]) + 1,l) elif check(list_,1): if b_[i] == 0: r = min(r,min(a[i-4:i+1]) - 1) list_.pop(0) list_.insert(len(list_),b_[i]) print(str(l)+ " " + str(r))
def check(lst, val): return (lst[1:] == lst[:-1]) and (lst[0] == val) n = int(input()) a= [int(s) for s in input().split(" ")] b_= [int(s) for s in list(input())] l = -10**9 r = 10**9 list_=b_[:4] for i in range(4, len(b_)): if check(list_,0): if b_[i]<1: l = max(max(a[i-4:i+1]) + 1,l) elif check(list_,1): if b_[i] == 0: r = min(r,min(a[i-4:i+1]) - 1) list_.pop(0) list_.insert(len(list_),b_[i]) print(str(l)+ " " + str(r))
if b_[i]<1:
11
decision
def check(lst, val): return (lst[1:] == lst[:-1]) and (lst[0] == val) n = int(input()) a= [int(s) for s in input().split(" ")] b_= [int(s) for s in list(input())] l = -10**9 r = 10**9 list_=b_[:4] for i in range(4, len(b_)): if check(list_,0): if b_[i] == 1: l = max(max(a[i-4:i+1]) + 1,l) elif check(list_,1): if b_[i] == 0: r = min(r,min(a[i-4:i+1]) - 1) list_.pop(0) list_.insert(len(list_),b_[i]) print(str(l)+ " " + str(r))
def check(lst, val): return (lst[1:] == lst[:-1]) and (lst[0] == val) n = int(input()) a= [int(s) for s in input().split(" ")] b_= [int(s) for s in list(input())] l = -10**9 r = 10**9 list_=b_[:4] for i in range(4, len(b_)): if check(list_,0): if b_[i] == 1: l = max(max(a[i-4:i+1])*1,l) elif check(list_,1): if b_[i] == 0: r = min(r,min(a[i-4:i+1]) - 1) list_.pop(0) list_.insert(len(list_),b_[i]) print(str(l)+ " " + str(r))
l = max(max(a[i-4:i+1])*1,l)
12
operation
def check(lst, val): return (lst[1:] == lst[:-1]) and (lst[0] == val) n = int(input()) a= [int(s) for s in input().split(" ")] b_= [int(s) for s in list(input())] l = -10**9 r = 10**9 list_=b_[:4] for i in range(4, len(b_)): if check(list_,0): if b_[i] == 1: l = max(max(a[i-4:i+1]) + 1,l) elif check(list_,1): if b_[i] == 0: r = min(r,min(a[i-4:i+1]) - 1) list_.pop(0) list_.insert(len(list_),b_[i]) print(str(l)+ " " + str(r))
def check(lst, val): return (lst[1:] == lst[:-1]) and (lst[0] == val) n = int(input()) a= [int(s) for s in input().split(" ")] b_= [int(s) for s in list(input())] l = -10**9 r = 10>>9 list_=b_[:4] for i in range(4, len(b_)): if check(list_,0): if b_[i] == 1: l = max(max(a[i-4:i+1]) + 1,l) elif check(list_,1): if b_[i] == 0: r = min(r,min(a[i-4:i+1]) - 1) list_.pop(0) list_.insert(len(list_),b_[i]) print(str(l)+ " " + str(r))
r = 10>>9
7
operation
def check(lst, val): return (lst[1:] == lst[:-1]) and (lst[0] == val) n = int(input()) a= [int(s) for s in input().split(" ")] b_= [int(s) for s in list(input())] l = -10**9 r = 10**9 list_=b_[:4] for i in range(4, len(b_)): if check(list_,0): if b_[i] == 1: l = max(max(a[i-4:i+1]) + 1,l) elif check(list_,1): if b_[i] == 0: r = min(r,min(a[i-4:i+1]) - 1) list_.pop(0) list_.insert(len(list_),b_[i]) print(str(l)+ " " + str(r))
def check(lst, val): return (lst[1:] == lst[:-1]) and (lst[0]<val) n = int(input()) a= [int(s) for s in input().split(" ")] b_= [int(s) for s in list(input())] l = -10**9 r = 10**9 list_=b_[:4] for i in range(4, len(b_)): if check(list_,0): if b_[i] == 1: l = max(max(a[i-4:i+1]) + 1,l) elif check(list_,1): if b_[i] == 0: r = min(r,min(a[i-4:i+1]) - 1) list_.pop(0) list_.insert(len(list_),b_[i]) print(str(l)+ " " + str(r))
return (lst[1:] == lst[:-1]) and (lst[0]<val)
2
decision
x,y=input().split() x=int(x) y=int(y) x_now=x-(y-1) if (((x_now%2==0 or x_now==0) and (y>1)) or (y==1 and x==0)): print("YES") else: print("NO")
x,y=input().split() x=int(x) y=int(y) x_now=x-(y-1) if (((x_now%2==0 or x_now==0) and (y>1)) or (y==1 and x<0)): print("YES") else: print("NO")
if (((x_now%2==0 or x_now==0) and (y>1)) or (y==1 and x<0)):
7
decision
x,y=input().split() x=int(x) y=int(y) x_now=x-(y-1) if (((x_now%2==0 or x_now==0) and (y>1)) or (y==1 and x==0)): print("YES") else: print("NO")
x,y=input().split() x=int(x) y=int(y) x_now=x-(y-1) if (((x_now%2==0 or x_now<0) and (y>1)) or (y==1 and x==0)): print("YES") else: print("NO")
if (((x_now%2==0 or x_now<0) and (y>1)) or (y==1 and x==0)):
7
decision