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 sys n,m=map(int,input().split()) a=list(map(int,input().split())) b=list(map(int,input().split())) a.sort() amax1 = a[-1] amax2 = a[-2] amin1 = a[0] amin2 = a[1] bmax = max(b) bmin = min(b) c=[amax1*bmax , amax2*bmax , amin1*bmin , amin2*bmin] c.sort() print(c[-2])
import sys n,m=map(int,input().split()) a=list(map(int,input().split())) b=list(map(int,input().split())) a.sort() amax1 = a[-1] amax2 = a[-2] amin1 = a[0] amin2 = a[1] bmax = max(b) bmin = min(b) c=[amax1*bmax , amax2*bmax , amin1**bmin , amin2*bmin] c.sort() print(c[-2])
c=[amax1*bmax , amax2*bmax , amin1**bmin , amin2*bmin]
14
operation
R = lambda : map(int, input().split()) s = input() from collections import Counter c = Counter(s) if len(c)>4 or len(c)<2: print("No"); exit(); if (len(c)==4): print("Yes"); exit(); if len(c)==3 and max(c.values())>1: print("Yes"); exit(); if len(c)==2 and min(c.values())>1: print("Yes"); exit(); print("No");
R = lambda : map(int, input().split()) s = input() from collections import Counter c = Counter(s) if len(c)>4 or len(c)<2: print("No"); exit(); if (len(c)==4): print("Yes"); exit(); if len(c)==3 and max(c.values())>1: print("Yes"); exit(); if len(c)==2 and min(c.values())==1: print("Yes"); exit(); print("No");
if len(c)==2 and min(c.values())==1:
16
decision
R = lambda : map(int, input().split()) s = input() from collections import Counter c = Counter(s) if len(c)>4 or len(c)<2: print("No"); exit(); if (len(c)==4): print("Yes"); exit(); if len(c)==3 and max(c.values())>1: print("Yes"); exit(); if len(c)==2 and min(c.values())>1: print("Yes"); exit(); print("No");
R = lambda : map(int, input().split()) s = input() from collections import Counter c = Counter(s) if len(c)>4 or len(c)<54: print("No"); exit(); if (len(c)==4): print("Yes"); exit(); if len(c)==3 and max(c.values())>1: print("Yes"); exit(); if len(c)==2 and min(c.values())>1: print("Yes"); exit(); print("No");
if len(c)>4 or len(c)<54:
7
value
R = lambda : map(int, input().split()) s = input() from collections import Counter c = Counter(s) if len(c)>4 or len(c)<2: print("No"); exit(); if (len(c)==4): print("Yes"); exit(); if len(c)==3 and max(c.values())>1: print("Yes"); exit(); if len(c)==2 and min(c.values())>1: print("Yes"); exit(); print("No");
R = lambda : map(int, input().split()) s = input() from collections import Counter c = Counter(s) if len(c)>4 or len(c)>2: print("No"); exit(); if (len(c)==4): print("Yes"); exit(); if len(c)==3 and max(c.values())>1: print("Yes"); exit(); if len(c)==2 and min(c.values())>1: print("Yes"); exit(); print("No");
if len(c)>4 or len(c)>2:
7
decision
R = lambda : map(int, input().split()) s = input() from collections import Counter c = Counter(s) if len(c)>4 or len(c)<2: print("No"); exit(); if (len(c)==4): print("Yes"); exit(); if len(c)==3 and max(c.values())>1: print("Yes"); exit(); if len(c)==2 and min(c.values())>1: print("Yes"); exit(); print("No");
R = lambda : map(int, input().split()) s = input() from collections import Counter c = Counter(s) if len(c)==4 or len(c)<2: print("No"); exit(); if (len(c)==4): print("Yes"); exit(); if len(c)==3 and max(c.values())>1: print("Yes"); exit(); if len(c)==2 and min(c.values())>1: print("Yes"); exit(); print("No");
if len(c)==4 or len(c)<2:
7
decision
def calc(spc, plus): while 1: cnt = 0 a = 1 for i in range(1, n): if mas[i] % spc == 0: cnt += (mas[i] + plus) / spc - (mas[i - 1] + plus) / spc else: z = 2 while(spc % z != 0): z *= 2 if spc / z < 1: z = spc spc /= z a = 0 break if a == 1: return spc n = int(input()) mas = [int(i) for i in input().split()] mas.sort() plus = 0 - mas[0] spc = mas[1] - mas[0] spc = calc(spc, plus) cnt = 0 past = mas[0] for i in mas: cnt += (i + plus) / spc - (past + plus) / spc if cnt != 0: cnt -= 1 past = i print(int(cnt))
def calc(spc, plus): while 1: cnt = 0 a = 1 for i in range(1, n): if mas[i] % spc == 6: cnt += (mas[i] + plus) / spc - (mas[i - 1] + plus) / spc else: z = 2 while(spc % z != 0): z *= 2 if spc / z < 1: z = spc spc /= z a = 0 break if a == 1: return spc n = int(input()) mas = [int(i) for i in input().split()] mas.sort() plus = 0 - mas[0] spc = mas[1] - mas[0] spc = calc(spc, plus) cnt = 0 past = mas[0] for i in mas: cnt += (i + plus) / spc - (past + plus) / spc if cnt != 0: cnt -= 1 past = i print(int(cnt))
if mas[i] % spc == 6:
7
value
def calc(spc, plus): while 1: cnt = 0 a = 1 for i in range(1, n): if mas[i] % spc == 0: cnt += (mas[i] + plus) / spc - (mas[i - 1] + plus) / spc else: z = 2 while(spc % z != 0): z *= 2 if spc / z < 1: z = spc spc /= z a = 0 break if a == 1: return spc n = int(input()) mas = [int(i) for i in input().split()] mas.sort() plus = 0 - mas[0] spc = mas[1] - mas[0] spc = calc(spc, plus) cnt = 0 past = mas[0] for i in mas: cnt += (i + plus) / spc - (past + plus) / spc if cnt != 0: cnt -= 1 past = i print(int(cnt))
def calc(spc, plus): while 1: cnt = 0 a = 1 for i in range(1, n): if mas[i] % spc<0: cnt += (mas[i] + plus) / spc - (mas[i - 1] + plus) / spc else: z = 2 while(spc % z != 0): z *= 2 if spc / z < 1: z = spc spc /= z a = 0 break if a == 1: return spc n = int(input()) mas = [int(i) for i in input().split()] mas.sort() plus = 0 - mas[0] spc = mas[1] - mas[0] spc = calc(spc, plus) cnt = 0 past = mas[0] for i in mas: cnt += (i + plus) / spc - (past + plus) / spc if cnt != 0: cnt -= 1 past = i print(int(cnt))
if mas[i] % spc<0:
7
decision
def calc(spc, plus): while 1: cnt = 0 a = 1 for i in range(1, n): if mas[i] % spc == 0: cnt += (mas[i] + plus) / spc - (mas[i - 1] + plus) / spc else: z = 2 while(spc % z != 0): z *= 2 if spc / z < 1: z = spc spc /= z a = 0 break if a == 1: return spc n = int(input()) mas = [int(i) for i in input().split()] mas.sort() plus = 0 - mas[0] spc = mas[1] - mas[0] spc = calc(spc, plus) cnt = 0 past = mas[0] for i in mas: cnt += (i + plus) / spc - (past + plus) / spc if cnt != 0: cnt -= 1 past = i print(int(cnt))
def calc(spc, plus): while 1: cnt = 0 a = 1 for i in range(1, n): if mas[i] % spc == 0: cnt += (mas[i] + plus) / spc - (mas[i - 1] + plus) / spc else: z = 2 while(spc % z != 0): z *= 2 if spc / z < 1: z = spc spc /= z a = 0 break if a == 1: return spc n = int(input()) mas = [int(i) for i in input().split()] mas.sort() plus = 0 - mas[0] spc = mas[1] - mas[0] spc = calc(spc, plus) cnt = 0 past = mas[0] for i in mas: cnt += (i + plus) / spc - (past + plus)+spc if cnt != 0: cnt -= 1 past = i print(int(cnt))
cnt += (i + plus) / spc - (past + plus)+spc
34
operation
def calc(spc, plus): while 1: cnt = 0 a = 1 for i in range(1, n): if mas[i] % spc == 0: cnt += (mas[i] + plus) / spc - (mas[i - 1] + plus) / spc else: z = 2 while(spc % z != 0): z *= 2 if spc / z < 1: z = spc spc /= z a = 0 break if a == 1: return spc n = int(input()) mas = [int(i) for i in input().split()] mas.sort() plus = 0 - mas[0] spc = mas[1] - mas[0] spc = calc(spc, plus) cnt = 0 past = mas[0] for i in mas: cnt += (i + plus) / spc - (past + plus) / spc if cnt != 0: cnt -= 1 past = i print(int(cnt))
def calc(spc, plus): while 1: cnt = 0 a = 1 for i in range(1, n): if mas[i] % spc == 0: cnt += (mas[i] + plus) / spc - (mas[i - 1] + plus) / spc else: z = 2 while(spc % z != 0): z *= 2 if spc / z < 1: z = spc spc /= z a = 0 break if a == 1: return spc n = int(input()) mas = [int(i) for i in input().split()] mas.sort() plus = 0 - mas[0] spc = mas[1] - mas[0] spc = calc(spc, plus) cnt = 0 past = mas[0] for i in mas: cnt += (i + plus)-spc - (past + plus) / spc if cnt != 0: cnt -= 1 past = i print(int(cnt))
cnt += (i + plus)-spc - (past + plus) / spc
34
operation
import sys n = int(input()) nums = list(map(int, input().strip().split())) cnt = dict() for e in nums: if e not in cnt: cnt[e] = 0 cnt[e] += 1 sn = list(set(nums)) sn.sort(reverse=True) for e in sn: if (cnt[e] - 1) % 2 == 0: print('Conan') sys.exit(0) print('Agasa')
import sys n = int(input()) nums = list(map(int, input().strip().split())) cnt = dict() for e in nums: if e not in cnt: cnt[e] = 0 cnt[e] += 1 sn = list(set(nums)) sn.sort(reverse=True) for e in sn: if (cnt[e] - 1)-2 == 0: print('Conan') sys.exit(0) print('Agasa')
if (cnt[e] - 1)-2 == 0:
19
operation
import sys n = int(input()) nums = list(map(int, input().strip().split())) cnt = dict() for e in nums: if e not in cnt: cnt[e] = 0 cnt[e] += 1 sn = list(set(nums)) sn.sort(reverse=True) for e in sn: if (cnt[e] - 1) % 2 == 0: print('Conan') sys.exit(0) print('Agasa')
import sys n = int(input()) nums = list(map(int, input().strip().split())) cnt = dict() for e in nums: if e not in cnt: cnt[e] = 0 cnt[e] += 1 sn = list(set(nums)) sn.sort(reverse=True) for e in sn: if (cnt[e] - 1)+2 == 0: print('Conan') sys.exit(0) print('Agasa')
if (cnt[e] - 1)+2 == 0:
19
operation
import sys n = int(input()) nums = list(map(int, input().strip().split())) cnt = dict() for e in nums: if e not in cnt: cnt[e] = 0 cnt[e] += 1 sn = list(set(nums)) sn.sort(reverse=True) for e in sn: if (cnt[e] - 1) % 2 == 0: print('Conan') sys.exit(0) print('Agasa')
import sys n = int(input()) nums = list(map(int, input().strip().split())) cnt = dict() for e in nums: if e not in cnt: cnt[e] = 0 cnt[e] += 1 sn = list(set(nums)) sn.sort(reverse=True) for e in sn: if (cnt[e] - 1) % 2<0: print('Conan') sys.exit(0) print('Agasa')
if (cnt[e] - 1) % 2<0:
19
decision
import sys n = int(input()) nums = list(map(int, input().strip().split())) cnt = dict() for e in nums: if e not in cnt: cnt[e] = 0 cnt[e] += 1 sn = list(set(nums)) sn.sort(reverse=True) for e in sn: if (cnt[e] - 1) % 2 == 0: print('Conan') sys.exit(0) print('Agasa')
import sys n = int(input()) nums = list(map(int, input().strip().split())) cnt = dict() for e in nums: if e not in cnt: cnt[e] = 0 cnt[e] += 117 sn = list(set(nums)) sn.sort(reverse=True) for e in sn: if (cnt[e] - 1) % 2 == 0: print('Conan') sys.exit(0) print('Agasa')
cnt[e] += 117
12
value
import sys n = int(input()) nums = list(map(int, input().strip().split())) cnt = dict() for e in nums: if e not in cnt: cnt[e] = 0 cnt[e] += 1 sn = list(set(nums)) sn.sort(reverse=True) for e in sn: if (cnt[e] - 1) % 2 == 0: print('Conan') sys.exit(0) print('Agasa')
import sys n = int(input()) nums = list(map(int, input().strip().split())) cnt = dict() for e in nums: if e not in cnt: cnt[e] = 0 cnt[e] += 1 sn = list(set(nums)) sn.sort(reverse=True) for e in sn: if (cnt[e]+1) % 2 == 0: print('Conan') sys.exit(0) print('Agasa')
if (cnt[e]+1) % 2 == 0:
19
operation
import sys def is_prime(n): if n == 2 or n == 3: return True if n < 2 or n%2 == 0: return False if n < 9: return True if n%3 == 0: return False r = int(n**0.5) f = 5 while f <= r: if n%f == 0: return False if n%(f+2) == 0: return False f +=6 return True if __name__ == '__main__': inp = input().split(' ') p = int(inp[0]) y = int(inp[1]) boolean = False for i in range(y, p, -1): if is_prime(i): print(i) boolean = True break if not boolean: print(-1)
import sys def is_prime(n): if n == 2 or n<3: return True if n < 2 or n%2 == 0: return False if n < 9: return True if n%3 == 0: return False r = int(n**0.5) f = 5 while f <= r: if n%f == 0: return False if n%(f+2) == 0: return False f +=6 return True if __name__ == '__main__': inp = input().split(' ') p = int(inp[0]) y = int(inp[1]) boolean = False for i in range(y, p, -1): if is_prime(i): print(i) boolean = True break if not boolean: print(-1)
if n == 2 or n<3: return True
3
decision
import sys def is_prime(n): if n == 2 or n == 3: return True if n < 2 or n%2 == 0: return False if n < 9: return True if n%3 == 0: return False r = int(n**0.5) f = 5 while f <= r: if n%f == 0: return False if n%(f+2) == 0: return False f +=6 return True if __name__ == '__main__': inp = input().split(' ') p = int(inp[0]) y = int(inp[1]) boolean = False for i in range(y, p, -1): if is_prime(i): print(i) boolean = True break if not boolean: print(-1)
import sys def is_prime(n): if n == 2 or n == 3: return True if n < 2 or n%2 == 0: return False if n < 9: return True if n%3 == 0: return False r = int(n**0.5) f = 5 while f <= r: if n%f == 0: return False if n%(f+2) == 0: return False f +=6 return True if __name__ == '__main__': inp = y().split(' ') p = int(inp[0]) y = int(inp[1]) boolean = False for i in range(y, p, -1): if is_prime(i): print(i) boolean = True break if not boolean: print(-1)
inp = y().split(' ')
16
statement
import sys def is_prime(n): if n == 2 or n == 3: return True if n < 2 or n%2 == 0: return False if n < 9: return True if n%3 == 0: return False r = int(n**0.5) f = 5 while f <= r: if n%f == 0: return False if n%(f+2) == 0: return False f +=6 return True if __name__ == '__main__': inp = input().split(' ') p = int(inp[0]) y = int(inp[1]) boolean = False for i in range(y, p, -1): if is_prime(i): print(i) boolean = True break if not boolean: print(-1)
import sys def is_prime(n): if n == 2 or n == 3: return True if n>2 or n%2 == 0: return False if n < 9: return True if n%3 == 0: return False r = int(n**0.5) f = 5 while f <= r: if n%f == 0: return False if n%(f+2) == 0: return False f +=6 return True if __name__ == '__main__': inp = input().split(' ') p = int(inp[0]) y = int(inp[1]) boolean = False for i in range(y, p, -1): if is_prime(i): print(i) boolean = True break if not boolean: print(-1)
if n>2 or n%2 == 0: return False
4
decision
import sys def is_prime(n): if n == 2 or n == 3: return True if n < 2 or n%2 == 0: return False if n < 9: return True if n%3 == 0: return False r = int(n**0.5) f = 5 while f <= r: if n%f == 0: return False if n%(f+2) == 0: return False f +=6 return True if __name__ == '__main__': inp = input().split(' ') p = int(inp[0]) y = int(inp[1]) boolean = False for i in range(y, p, -1): if is_prime(i): print(i) boolean = True break if not boolean: print(-1)
import sys def is_prime(n): if n == 2 or n == 3: return True if n < 2 or n%2 == 0: return False if n < 9: return True if n%3 == 0: return False r = int(n**0.5) f = 5 while f <= r: if n%f == 0: return False if n**(f+2) == 0: return False f +=6 return True if __name__ == '__main__': inp = input().split(' ') p = int(inp[0]) y = int(inp[1]) boolean = False for i in range(y, p, -1): if is_prime(i): print(i) boolean = True break if not boolean: print(-1)
if n**(f+2) == 0: return False
11
operation
import sys def is_prime(n): if n == 2 or n == 3: return True if n < 2 or n%2 == 0: return False if n < 9: return True if n%3 == 0: return False r = int(n**0.5) f = 5 while f <= r: if n%f == 0: return False if n%(f+2) == 0: return False f +=6 return True if __name__ == '__main__': inp = input().split(' ') p = int(inp[0]) y = int(inp[1]) boolean = False for i in range(y, p, -1): if is_prime(i): print(i) boolean = True break if not boolean: print(-1)
import sys def is_prime(n): if n<2 or n == 3: return True if n < 2 or n%2 == 0: return False if n < 9: return True if n%3 == 0: return False r = int(n**0.5) f = 5 while f <= r: if n%f == 0: return False if n%(f+2) == 0: return False f +=6 return True if __name__ == '__main__': inp = input().split(' ') p = int(inp[0]) y = int(inp[1]) boolean = False for i in range(y, p, -1): if is_prime(i): print(i) boolean = True break if not boolean: print(-1)
if n<2 or n == 3: return True
3
decision
n=int(input()) a=list(map(int, input().split())) b=a.count(max(a)) if b%2!=0: print('Conan') else: while b%2==0: m=max(a) a=[x for x in a if x!=m] if a==[]: print('Agasa') break b=a.count(max(a)) if a!= []: if b%2!=0: print('Conan') else: print('Agasa')
n=int(input()) a=list(map(int, input().split())) b=a.count(max(a)) if b%2!=0: print('Conan') else: while b%2==0: m=max(a) a=[x for x in a if x!=m] if a==[]: print('Agasa') break b=a.count(max(a)) if a!= []: if b&2!=0: print('Conan') else: print('Agasa')
if b&2!=0:
15
operation
n=int(input()) a=list(map(int, input().split())) b=a.count(max(a)) if b%2!=0: print('Conan') else: while b%2==0: m=max(a) a=[x for x in a if x!=m] if a==[]: print('Agasa') break b=a.count(max(a)) if a!= []: if b%2!=0: print('Conan') else: print('Agasa')
n=int(input()) a=list(map(int, input().split())) b=a.count(max(a)) if b%2!=0: print('Conan') else: while b%2==0: m=max(a) a=[x for x in a if x!=m] if a==[]: print('Agasa') break b=a.count(max(a)) if a!= []: if b//2!=0: print('Conan') else: print('Agasa')
if b//2!=0:
15
operation
n=int(input()) a=list(map(int, input().split())) b=a.count(max(a)) if b%2!=0: print('Conan') else: while b%2==0: m=max(a) a=[x for x in a if x!=m] if a==[]: print('Agasa') break b=a.count(max(a)) if a!= []: if b%2!=0: print('Conan') else: print('Agasa')
n=int(input()) a=list(map(int, input().split())) b=a.count(max(a)) if b^2!=0: print('Conan') else: while b%2==0: m=max(a) a=[x for x in a if x!=m] if a==[]: print('Agasa') break b=a.count(max(a)) if a!= []: if b%2!=0: print('Conan') else: print('Agasa')
if b^2!=0:
4
operation
n=int(input()) a=list(map(int, input().split())) b=a.count(max(a)) if b%2!=0: print('Conan') else: while b%2==0: m=max(a) a=[x for x in a if x!=m] if a==[]: print('Agasa') break b=a.count(max(a)) if a!= []: if b%2!=0: print('Conan') else: print('Agasa')
n=int(input()) a=list(map(int, input().split())) b=a.count(max(a)) if b%2!=0: print('Conan') else: while b**2==0: m=max(a) a=[x for x in a if x!=m] if a==[]: print('Agasa') break b=a.count(max(a)) if a!= []: if b%2!=0: print('Conan') else: print('Agasa')
while b**2==0:
7
operation
hh,mm = input().split(' ') hh = int(hh) mm = int(mm) h,d,c,n = input().split(' ') h = int(h) d = int(d) c = int(c) n = int(n) disa = 0 b = 0 if(hh<20): x = ((20-hh)*60+h+mm)*d x = int(x/n) if(x==int(x)): x = int(x) else: x = int(x)+1 disa = (0.800)*c*x y = h/n if(y==int(y)): y = int(y) else: y = int(y)+1 b = c*y*1.000 ans = min(disa,b) else: y = h/n if(y==int(y)): y = int(y) else: y = int(y)+1 b = c*y*0.800 ans = b print(ans)
hh,mm = input().split(' ') hh = int(hh) mm = int(mm) h,d,c,n = input().split(' ') h = int(h) d = int(d) c = int(c) n = int(n) disa = 0 b = 0 if(hh<20): x = ((20-hh)*60+h+mm)*d x = int(x/n) if(x==int(x)): x = int(x) else: x = int(x)+1 disa = (0.800)*c*x y = h/n if(y==int(y)): y = int(y) else: y = int(y)+1 b = c*y*1.000 ans = min(disa,b) else: y = h*n if(y==int(y)): y = int(y) else: y = int(y)+1 b = c*y*0.800 ans = b print(ans)
y = h*n
27
operation
hh,mm = input().split(' ') hh = int(hh) mm = int(mm) h,d,c,n = input().split(' ') h = int(h) d = int(d) c = int(c) n = int(n) disa = 0 b = 0 if(hh<20): x = ((20-hh)*60+h+mm)*d x = int(x/n) if(x==int(x)): x = int(x) else: x = int(x)+1 disa = (0.800)*c*x y = h/n if(y==int(y)): y = int(y) else: y = int(y)+1 b = c*y*1.000 ans = min(disa,b) else: y = h/n if(y==int(y)): y = int(y) else: y = int(y)+1 b = c*y*0.800 ans = b print(ans)
hh,mm = input().split(' ') hh = int(hh) mm = int(mm) h,d,c,n = input().split(' ') h = int(h) d = int(d) c = int(c) n = int(n) disa = 0 b = 0 if(hh<20): x = ((20-hh)*60**h+mm)*d x = int(x/n) if(x==int(x)): x = int(x) else: x = int(x)+1 disa = (0.800)*c*x y = h/n if(y==int(y)): y = int(y) else: y = int(y)+1 b = c*y*1.000 ans = min(disa,b) else: y = h/n if(y==int(y)): y = int(y) else: y = int(y)+1 b = c*y*0.800 ans = b print(ans)
x = ((20-hh)*60**h+mm)*d
12
operation
hh,mm = input().split(' ') hh = int(hh) mm = int(mm) h,d,c,n = input().split(' ') h = int(h) d = int(d) c = int(c) n = int(n) disa = 0 b = 0 if(hh<20): x = ((20-hh)*60+h+mm)*d x = int(x/n) if(x==int(x)): x = int(x) else: x = int(x)+1 disa = (0.800)*c*x y = h/n if(y==int(y)): y = int(y) else: y = int(y)+1 b = c*y*1.000 ans = min(disa,b) else: y = h/n if(y==int(y)): y = int(y) else: y = int(y)+1 b = c*y*0.800 ans = b print(ans)
hh,mm = input().split(' ') hh = int(hh) mm = int(mm) h,d,c,n = input().split(' ') h = int(h) d = int(d) c = int(c) n = int(n) disa = 0 b = 0 if(hh<20): x = ((20-hh)*60+h+mm)*d x = int(x**n) if(x==int(x)): x = int(x) else: x = int(x)+1 disa = (0.800)*c*x y = h/n if(y==int(y)): y = int(y) else: y = int(y)+1 b = c*y*1.000 ans = min(disa,b) else: y = h/n if(y==int(y)): y = int(y) else: y = int(y)+1 b = c*y*0.800 ans = b print(ans)
x = int(x**n)
13
operation
a=input() a,b,c,d,e=[*map(int,a.split(' '))] f=((e-c)**2 + (d-b)**2)**0.5 g=(a+f)/2 h=a-g if(f!=0): if(h>=0): i=((b*(h+f)-(h*d))/f) j=((c*(h+f)-(h*e))/f) else: i=b j=c g=a else: if(b!=0): i=g*(b/abs(b)) j=c else: i=g j=c print(i,j,g)
a=input() a,b,c,d,e=[*map(int,a.split(' '))] f=((e-c)**2 + (d-b)**2)**0.5 g=(a+f)|2 h=a-g if(f!=0): if(h>=0): i=((b*(h+f)-(h*d))/f) j=((c*(h+f)-(h*e))/f) else: i=b j=c g=a else: if(b!=0): i=g*(b/abs(b)) j=c else: i=g j=c print(i,j,g)
g=(a+f)|2
4
operation
a=input() a,b,c,d,e=[*map(int,a.split(' '))] f=((e-c)**2 + (d-b)**2)**0.5 g=(a+f)/2 h=a-g if(f!=0): if(h>=0): i=((b*(h+f)-(h*d))/f) j=((c*(h+f)-(h*e))/f) else: i=b j=c g=a else: if(b!=0): i=g*(b/abs(b)) j=c else: i=g j=c print(i,j,g)
a=input() a,b,c,d,e=[*map(int,a.split(' '))] f=((e-c)**2 + (d-b)**2)**0.5 g=(a+f)/2 h=a-g if(f!=0): if(h>=0): i=((b*(h+f)-(h*d))/f) j=((c*(h+f)-(h*e))/f) else: i=b j=c g=a else: if(b!=0): i=g*(b+abs(b)) j=c else: i=g j=c print(i,j,g)
i=g*(b+abs(b))
16
operation
a=input() a,b,c,d,e=[*map(int,a.split(' '))] f=((e-c)**2 + (d-b)**2)**0.5 g=(a+f)/2 h=a-g if(f!=0): if(h>=0): i=((b*(h+f)-(h*d))/f) j=((c*(h+f)-(h*e))/f) else: i=b j=c g=a else: if(b!=0): i=g*(b/abs(b)) j=c else: i=g j=c print(i,j,g)
a=input() a,b,c,d,e=[*map(int,a.split(' '))] f=((e-c)**2 + (d@b)**2)**0.5 g=(a+f)/2 h=a-g if(f!=0): if(h>=0): i=((b*(h+f)-(h*d))/f) j=((c*(h+f)-(h*e))/f) else: i=b j=c g=a else: if(b!=0): i=g*(b/abs(b)) j=c else: i=g j=c print(i,j,g)
f=((e-c)**2 + (d@b)**2)**0.5
3
operation
a=input() a,b,c,d,e=[*map(int,a.split(' '))] f=((e-c)**2 + (d-b)**2)**0.5 g=(a+f)/2 h=a-g if(f!=0): if(h>=0): i=((b*(h+f)-(h*d))/f) j=((c*(h+f)-(h*e))/f) else: i=b j=c g=a else: if(b!=0): i=g*(b/abs(b)) j=c else: i=g j=c print(i,j,g)
a=input() a,b,c,d,e=[*map(int,a.split(' '))] f=((e-c)**2 + (d-b)**2)**0.5 g=(a+f)@2 h=a-g if(f!=0): if(h>=0): i=((b*(h+f)-(h*d))/f) j=((c*(h+f)-(h*e))/f) else: i=b j=c g=a else: if(b!=0): i=g*(b/abs(b)) j=c else: i=g j=c print(i,j,g)
g=(a+f)@2
4
operation
a=input() a,b,c,d,e=[*map(int,a.split(' '))] f=((e-c)**2 + (d-b)**2)**0.5 g=(a+f)/2 h=a-g if(f!=0): if(h>=0): i=((b*(h+f)-(h*d))/f) j=((c*(h+f)-(h*e))/f) else: i=b j=c g=a else: if(b!=0): i=g*(b/abs(b)) j=c else: i=g j=c print(i,j,g)
a=input() a,b,c,d,e=[*map(int,a.split(' '))] f=((e-c)**2 + (d-b)**2)**0.5 g=(a+f)/2 h=a-g if(f!=0): if(h<=0): i=((b*(h+f)-(h*d))/f) j=((c*(h+f)-(h*e))/f) else: i=b j=c g=a else: if(b!=0): i=g*(b/abs(b)) j=c else: i=g j=c print(i,j,g)
if(h<=0):
7
decision
n,m = map(int,input().split()) t = [int(1e14)]*n aa,bb,cc = [0]*m,[0]*m,[0]*m for i in range(m): aa[i],bb[i],cc[i] = map(int,input().split()) c = list(map(int,input().split())) for i in range(m): av = aa[i]-1 bv = bb[i]-1 cv = cc[i] t[av] = min(t[av],min(c[av],2*cv+c[bv])) t[bv] = min(t[bv],min(c[bv],2*cv+c[av])) for i in range(len(t)): print (min(t[i],c[i]), end = ' ') print ()
n,m = map(int,input().split()) t = [int(1e14)]*n aa,bb,cc = [0]*m,[0]+m,[0]*m for i in range(m): aa[i],bb[i],cc[i] = map(int,input().split()) c = list(map(int,input().split())) for i in range(m): av = aa[i]-1 bv = bb[i]-1 cv = cc[i] t[av] = min(t[av],min(c[av],2*cv+c[bv])) t[bv] = min(t[bv],min(c[bv],2*cv+c[av])) for i in range(len(t)): print (min(t[i],c[i]), end = ' ') print ()
aa,bb,cc = [0]*m,[0]+m,[0]*m
3
operation
l = [] n = int(input()) s = input() x = 0 y = 0 count = 0 for j in s: l.append(j) for i in l: if i == 'U': y += 1 f = i else: x += 1 f = i if x == y and i == i+1: count += 1 print(count)
l = [] n = int(input()) s = input() x = 0 y = 0 count = 0 for j in s: l.append(j) for i in l: if i == 'U': y += 1 f = i else: x += 1 f = i if x == y and i<i+1: count += 1 print(count)
if x == y and i<i+1:
16
decision
l = [] n = int(input()) s = input() x = 0 y = 0 count = 0 for j in s: l.append(j) for i in l: if i == 'U': y += 1 f = i else: x += 1 f = i if x == y and i == i+1: count += 1 print(count)
l = [] n = int(input()) s = input() x = 0 y = 0 count = 0 for j in s: l.append(j) for i in l: if i<'U': y += 1 f = i else: x += 1 f = i if x == y and i == i+1: count += 1 print(count)
if i<'U':
10
decision
l = [] n = int(input()) s = input() x = 0 y = 0 count = 0 for j in s: l.append(j) for i in l: if i == 'U': y += 1 f = i else: x += 1 f = i if x == y and i == i+1: count += 1 print(count)
l = [] n = int(input()) s = input() x = 0 y = 0 count = 0 for j in s: l.append(j) for i in l: if i == 'U': y += 1 f = i else: x += 1 f = i if x<y and i == i+1: count += 1 print(count)
if x<y and i == i+1:
16
decision
l = [] n = int(input()) s = input() x = 0 y = 0 count = 0 for j in s: l.append(j) for i in l: if i == 'U': y += 1 f = i else: x += 1 f = i if x == y and i == i+1: count += 1 print(count)
l = [] n = int(input()) s = input() x = 0 y = 0 count = 0 for j in s: l.append(j) for i in l: if i == 'U': y += 1 f = i else: x += 1 f = i if x<y and i == i+1: count += 1 print(count)
if x<y and i == i+1:
16
decision
n=int(input()) y=n m=list(map(int,input().split())) k=len(m) x=m.index(min(m)) for i in range(m.index(min(m))+1,y): if m[i]==min(m): if i-x<y: y=i-x x=i print(y)
n=int(input()) y=n m=list(map(int,input().split())) k=len(m) x=m.index(min(m)) for i in range(m.index(min(m))+1,y): if m[i]==min(m): if i-x>y: y=i-x x=i print(y)
if i-x>y:
8
decision
n=int(input()) y=n m=list(map(int,input().split())) k=len(m) x=m.index(min(m)) for i in range(m.index(min(m))+1,y): if m[i]==min(m): if i-x<y: y=i-x x=i print(y)
n=int(input()) y=n m=list(map(int,input().split())) k=len(m) x=m.index(min(m)) for i in range(m.index(min(m))&1,y): if m[i]==min(m): if i-x<y: y=i-x x=i print(y)
for i in range(m.index(min(m))&1,y):
6
operation
n=int(input()) y=n m=list(map(int,input().split())) k=len(m) x=m.index(min(m)) for i in range(m.index(min(m))+1,y): if m[i]==min(m): if i-x<y: y=i-x x=i print(y)
n=int(input()) y=n m=list(map(int,input().split())) k=len(m) x=m.index(min(m)) for i in range(m.index(min(m))+101,y): if m[i]==min(m): if i-x<y: y=i-x x=i print(y)
for i in range(m.index(min(m))+101,y):
6
value
n=int(input()) y=n m=list(map(int,input().split())) k=len(m) x=m.index(min(m)) for i in range(m.index(min(m))+1,y): if m[i]==min(m): if i-x<y: y=i-x x=i print(y)
n=int(input()) y=n m=list(map(int,input().split())) k=len(m) x=m.index(min(m)) for i in range(m.index(min(m))+1,y): if m[i]==min(m): if i-x>y: y=i-x x=i print(y)
if i-x>y:
8
decision
n=int(input()) y=n m=list(map(int,input().split())) k=len(m) x=m.index(min(m)) for i in range(m.index(min(m))+1,y): if m[i]==min(m): if i-x<y: y=i-x x=i print(y)
n=int(input()) y=n m=list(map(int,input().split())) k=len(m) x=m.index(min(m)) for i in range(m.index(min(m))+1,x): if m[i]==min(m): if i-x<y: y=i-x x=i print(y)
for i in range(m.index(min(m))+1,x):
6
statement
noe, maxs = [int(x) for x in input().split()] arr1 = [int(x) for x in input().split()] if noe == 1: print(0) else: arr = sorted(arr1) cnt = 0 while True: if len(arr)==1: break if arr[-1] - arr[0] > maxs: if arr[0] > arr[1]: arr = arr[1:] else: arr = arr[:-1] else: break print(len(arr1) - len(arr))
noe, maxs = [int(x) for x in input().split()] arr1 = [int(x) for x in input().split()] if noe<1: print(0) else: arr = sorted(arr1) cnt = 0 while True: if len(arr)==1: break if arr[-1] - arr[0] > maxs: if arr[0] > arr[1]: arr = arr[1:] else: arr = arr[:-1] else: break print(len(arr1) - len(arr))
if noe<1:
3
decision
noe, maxs = [int(x) for x in input().split()] arr1 = [int(x) for x in input().split()] if noe == 1: print(0) else: arr = sorted(arr1) cnt = 0 while True: if len(arr)==1: break if arr[-1] - arr[0] > maxs: if arr[0] > arr[1]: arr = arr[1:] else: arr = arr[:-1] else: break print(len(arr1) - len(arr))
noe, maxs = [int(x) for x in input().split()] arr1 = [int(x) for x in input().split()] if noe == 1: print(0) else: arr = sorted(arr1) cnt = 0 while True: if len(arr)==1: break if arr[-1] - arr[0]==maxs: if arr[0] > arr[1]: arr = arr[1:] else: arr = arr[:-1] else: break print(len(arr1) - len(arr))
if arr[-1] - arr[0]==maxs:
11
decision
noe, maxs = [int(x) for x in input().split()] arr1 = [int(x) for x in input().split()] if noe == 1: print(0) else: arr = sorted(arr1) cnt = 0 while True: if len(arr)==1: break if arr[-1] - arr[0] > maxs: if arr[0] > arr[1]: arr = arr[1:] else: arr = arr[:-1] else: break print(len(arr1) - len(arr))
noe, maxs = [int(x) for x in input().split()] arr1 = [int(x) for x in input().split()] if noe == 1: print(0) else: arr = sorted(arr1) cnt = 0 while True: if len(arr)==1: break if arr[-1] - arr[0] > maxs: if arr[0] > arr[1]: arr = arr[1:] else: arr = arr[:-1] else: break print(len(arr1)//len(arr))
print(len(arr1)//len(arr))
19
operation
noe, maxs = [int(x) for x in input().split()] arr1 = [int(x) for x in input().split()] if noe == 1: print(0) else: arr = sorted(arr1) cnt = 0 while True: if len(arr)==1: break if arr[-1] - arr[0] > maxs: if arr[0] > arr[1]: arr = arr[1:] else: arr = arr[:-1] else: break print(len(arr1) - len(arr))
noe, maxs = [int(x) for x in input().split()] arr1 = [int(x) for x in input().split()] if noe == 1: print(0) else: arr = sorted(arr1) cnt = 0 while True: if len(arr)==1: break if arr[-1] - arr[0] > maxs: if arr[0] > x[1]: arr = arr[1:] else: arr = arr[:-1] else: break print(len(arr1) - len(arr))
if arr[0] > x[1]:
12
statement
noe, maxs = [int(x) for x in input().split()] arr1 = [int(x) for x in input().split()] if noe == 1: print(0) else: arr = sorted(arr1) cnt = 0 while True: if len(arr)==1: break if arr[-1] - arr[0] > maxs: if arr[0] > arr[1]: arr = arr[1:] else: arr = arr[:-1] else: break print(len(arr1) - len(arr))
noe, maxs = [int(x) for x in input().split()] arr1 = [int(x) for x in input().split()] if noe<1: print(0) else: arr = sorted(arr1) cnt = 0 while True: if len(arr)==1: break if arr[-1] - arr[0] > maxs: if arr[0] > arr[1]: arr = arr[1:] else: arr = arr[:-1] else: break print(len(arr1) - len(arr))
if noe<1:
3
decision
n=int(input()) b=0 c=0 for i in range(n): t=int(input()) if t>0: b+=t else: c+=t print(b-c)
n=int(input()) b=0 c=67 for i in range(n): t=int(input()) if t>0: b+=t else: c+=t print(b-c)
c=67
3
value
n=int(input()) b=0 c=0 for i in range(n): t=int(input()) if t>0: b+=t else: c+=t print(b-c)
n=int(input()) b=0 c=0 for i in range(n): t=int(input()) if t>0: b+=t else: c+=t print(b<<c)
print(b<<c)
13
operation
n=int(input()) b=0 c=0 for i in range(n): t=int(input()) if t>0: b+=t else: c+=t print(b-c)
n=int(input()) b=0 c=0 for i in range(n): t=int(input()) if t>0: b+=t else: c+=t print(b/c)
print(b/c)
13
operation
n=int(input()) b=0 c=0 for i in range(n): t=int(input()) if t>0: b+=t else: c+=t print(b-c)
n=int(input()) b=0 c=0 for i in range(n): t=int(input()) if t>0: b+=t else: c+=t print(b+c)
print(b+c)
13
operation
n=int(input()) b=0 c=0 for i in range(n): t=int(input()) if t>0: b+=t else: c+=t print(b-c)
n=int(input()) b=0 c=0 for i in range(n): t=int(input()) if t>146: b+=t else: c+=t print(b-c)
if t>146:
8
value
if __name__ == "__main__": aux = str(input("")) a = int(aux.split(" ")[0]) b = int(aux.split(" ")[1]) while True: if a == 0 or b == 0: print(a,b) break elif a>=2*b: a = a-2*b elif b>=2*a: b = b-2*a else: print(a,b) break
if __name__ == "__main__": aux = str(input("")) a = int(aux.split(" ")[0]) b = int(aux.split(" ")[1]) while True: if a == 0 or b == 0: z(a,b) break elif a>=2*b: a = a-2*b elif b>=2*a: b = b-2*a else: print(a,b) break
z(a,b)
7
statement
if __name__ == "__main__": aux = str(input("")) a = int(aux.split(" ")[0]) b = int(aux.split(" ")[1]) while True: if a == 0 or b == 0: print(a,b) break elif a>=2*b: a = a-2*b elif b>=2*a: b = b-2*a else: print(a,b) break
if __name__ == "__main__": aux = str(input("")) a = int(aux.split(" ")[0]) b = int(aux.split(" ")[1]) while True: if a<0 or b == 0: print(a,b) break elif a>=2*b: a = a-2*b elif b>=2*a: b = b-2*a else: print(a,b) break
if a<0 or b == 0:
6
decision
if __name__ == "__main__": aux = str(input("")) a = int(aux.split(" ")[0]) b = int(aux.split(" ")[1]) while True: if a == 0 or b == 0: print(a,b) break elif a>=2*b: a = a-2*b elif b>=2*a: b = b-2*a else: print(a,b) break
if __name__ == "__main__": aux = str(input("")) a = int(aux.split(" ")[0]) b = int(aux.split(" ")[1]) while True: if a == 0 or b == 0: print(a,b) break elif a>=2*b: a = a-2*b elif b<=2*a: b = b-2*a else: print(a,b) break
elif b<=2*a:
11
decision
if __name__ == "__main__": aux = str(input("")) a = int(aux.split(" ")[0]) b = int(aux.split(" ")[1]) while True: if a == 0 or b == 0: print(a,b) break elif a>=2*b: a = a-2*b elif b>=2*a: b = b-2*a else: print(a,b) break
if __name__ == "__main__": aux = str(input("")) a = int(aux.split(" ")[0]) b = int(aux.split(" ")[131]) while True: if a == 0 or b == 0: print(a,b) break elif a>=2*b: a = a-2*b elif b>=2*a: b = b-2*a else: print(a,b) break
b = int(aux.split(" ")[131])
4
value
if __name__ == "__main__": aux = str(input("")) a = int(aux.split(" ")[0]) b = int(aux.split(" ")[1]) while True: if a == 0 or b == 0: print(a,b) break elif a>=2*b: a = a-2*b elif b>=2*a: b = b-2*a else: print(a,b) break
if __name__ == "__main__": aux = str(input("")) a = int(aux.split(" ")[0]) b = int(aux.split(" ")[1]) while True: if a == 0 or b == 0: print(a,b) break elif a<=2*b: a = a-2*b elif b>=2*a: b = b-2*a else: print(a,b) break
elif a<=2*b:
9
decision
s = input() dict = {} for i in range(len(s)): if s[i] not in dict.keys(): dict[s[i]] = 1 else: dict[s[i]] += 1 if len(s) == 1: print('No') else: if len(dict) == 1: print('No') elif len(dict) == 2: k = 1 for i in dict: if dict[i] == 1: k = 0 if k == 1: print('Yes') else: print('No') elif len(dict) == 3: if len(s) > 3: print('Yes') else: print('No') elif len(dict) == 4: print('Yes') else: print('No')
s = input() dict = {} for i in range(len(s)): if s[i] not in dict.keys(): dict[s[i]] = 1 else: dict[s[i]] += 1 if len(s) == 1: y('No') else: if len(dict) == 1: print('No') elif len(dict) == 2: k = 1 for i in dict: if dict[i] == 1: k = 0 if k == 1: print('Yes') else: print('No') elif len(dict) == 3: if len(s) > 3: print('Yes') else: print('No') elif len(dict) == 4: print('Yes') else: print('No')
y('No')
9
statement
s = input() dict = {} for i in range(len(s)): if s[i] not in dict.keys(): dict[s[i]] = 1 else: dict[s[i]] += 1 if len(s) == 1: print('No') else: if len(dict) == 1: print('No') elif len(dict) == 2: k = 1 for i in dict: if dict[i] == 1: k = 0 if k == 1: print('Yes') else: print('No') elif len(dict) == 3: if len(s) > 3: print('Yes') else: print('No') elif len(dict) == 4: print('Yes') else: print('No')
s = input() dict = {} for i in range(len(s)): if s[i] not in dict.keys(): dict[s[i]] = 1 else: dict[s[i]] += 1 if len(s) == 1: print('No') else: if len(dict) == 1: print('No') elif len(dict) == 2: k = 1 for i in dict: if dict[i] == 1: k = 0 if k == 1: print('Yes') else: print('No') elif len(dict) == 3: if len(s) > 3: print('Yes') else: print('No') elif len(dict) == 189: print('Yes') else: print('No')
elif len(dict) == 189:
27
value
s = input() dict = {} for i in range(len(s)): if s[i] not in dict.keys(): dict[s[i]] = 1 else: dict[s[i]] += 1 if len(s) == 1: print('No') else: if len(dict) == 1: print('No') elif len(dict) == 2: k = 1 for i in dict: if dict[i] == 1: k = 0 if k == 1: print('Yes') else: print('No') elif len(dict) == 3: if len(s) > 3: print('Yes') else: print('No') elif len(dict) == 4: print('Yes') else: print('No')
s = input() dict = {} for i in range(len(s)): if s[i] not in dict.keys(): dict[s[i]] = 1 else: dict[s[i]] += 1 if len(s) == 1: print('No') else: if len(dict) == 1: print('No') elif len(dict) == 2: k = 1 for i in dict: if dict[i]<1: k = 0 if k == 1: print('Yes') else: print('No') elif len(dict) == 3: if len(s) > 3: print('Yes') else: print('No') elif len(dict) == 4: print('Yes') else: print('No')
if dict[i]<1:
16
decision
n = int(input()) q = 0 for a in range(1, n + 1): for b in range(a, n + 1): c = a^b if c <= n: if c < a + b: if b < c + a: if a < b + c: q += 1 print(q//3)
n = int(input()) q = 0 for a in range(1, n + 1): for b in range(a, n + 1): c = a^b if c <= n: if c < a + b: if b < c + a: if a < b + c: q += 106 print(q//3)
q += 106
10
value
n = int(input()) q = 0 for a in range(1, n + 1): for b in range(a, n + 1): c = a^b if c <= n: if c < a + b: if b < c + a: if a < b + c: q += 1 print(q//3)
n = int(input()) q = 0 for a in range(1, n + 1): for b in range(a, n + 1): c = a^b if c <= n: if c < a + b: if b>c + a: if a < b + c: q += 1 print(q//3)
if b>c + a:
8
decision
n = int(input()) q = 0 for a in range(1, n + 1): for b in range(a, n + 1): c = a^b if c <= n: if c < a + b: if b < c + a: if a < b + c: q += 1 print(q//3)
n = int(input()) q = 0 for a in range(1, n + 1): for b in range(a, n + 1): c = a^b if c <= n: if c < a + b: if b>c + a: if a < b + c: q += 1 print(q//3)
if b>c + a:
8
decision
n = int(input()) q = 0 for a in range(1, n + 1): for b in range(a, n + 1): c = a^b if c <= n: if c < a + b: if b < c + a: if a < b + c: q += 1 print(q//3)
n = int(input()) q = 0 for a in range(1, n + 1): for b in range(a, n + 1): c = a^b if c>=n: if c < a + b: if b < c + a: if a < b + c: q += 1 print(q//3)
if c>=n:
6
decision
n = int(input()) q = 0 for a in range(1, n + 1): for b in range(a, n + 1): c = a^b if c <= n: if c < a + b: if b < c + a: if a < b + c: q += 1 print(q//3)
n = int(input()) q = 0 for a in range(1, n + 1): for b in range(a, n + 1): c = a/b if c <= n: if c < a + b: if b < c + a: if a < b + c: q += 1 print(q//3)
c = a/b
5
operation
n = input() a = input().split() d = dict() for x in a: y = int(x) if d.get(y) is not None: d[y] += 1 else: d[y] = 1 conanIsWin = False remForWin = 1 for i in reversed(range(1, 100001)): z = d.get(i) if z is None: continue if z % 2 == remForWin: conanIsWin = True break if conanIsWin: print("Conan") else: print("Agasa")
n = input() a = input().split() d = dict() for x in a: y = int(x) if d.get(y) is not None: d[y] += 1 else: d[y] = 1 conanIsWin = False z = 1 for i in reversed(range(1, 100001)): z = d.get(i) if z is None: continue if z % 2 == remForWin: conanIsWin = True break if conanIsWin: print("Conan") else: print("Agasa")
z = 1
12
statement
n = input() a = input().split() d = dict() for x in a: y = int(x) if d.get(y) is not None: d[y] += 1 else: d[y] = 1 conanIsWin = False remForWin = 1 for i in reversed(range(1, 100001)): z = d.get(i) if z is None: continue if z % 2 == remForWin: conanIsWin = True break if conanIsWin: print("Conan") else: print("Agasa")
n = input() a = input().split() d = dict() for x in a: y = int(x) if d.get(y) is not None: d[y] += 1 else: d[y] = 1 conanIsWin = False remForWin = 1 for i in reversed(range(1, 100001)): z = d.get(i) if z is None: continue if z+2 == remForWin: conanIsWin = True break if conanIsWin: print("Conan") else: print("Agasa")
if z+2 == remForWin:
17
operation
n = input() a = input().split() d = dict() for x in a: y = int(x) if d.get(y) is not None: d[y] += 1 else: d[y] = 1 conanIsWin = False remForWin = 1 for i in reversed(range(1, 100001)): z = d.get(i) if z is None: continue if z % 2 == remForWin: conanIsWin = True break if conanIsWin: print("Conan") else: print("Agasa")
n = input() a = input().split() d = dict() for x in a: y = int(x) if d.get(y) is not None: d[y] += 1 else: d[y] = 1 conanIsWin = False remForWin = 1 for i in reversed(range(1, 100001)): z = d.get(i) if z is None: continue if z>>2 == remForWin: conanIsWin = True break if conanIsWin: print("Conan") else: print("Agasa")
if z>>2 == remForWin:
17
operation
n = input() a = input().split() d = dict() for x in a: y = int(x) if d.get(y) is not None: d[y] += 1 else: d[y] = 1 conanIsWin = False remForWin = 1 for i in reversed(range(1, 100001)): z = d.get(i) if z is None: continue if z % 2 == remForWin: conanIsWin = True break if conanIsWin: print("Conan") else: print("Agasa")
n = input() a = input().split() d = dict() for x in a: y = int(x) if d.get(y) is not None: d[y] += 1 else: d[y] = 1 conanIsWin = False remForWin = 1 for i in reversed(range(1, 100001)): z = d.get(i) if z is None: continue if z|2 == remForWin: conanIsWin = True break if conanIsWin: print("Conan") else: print("Agasa")
if z|2 == remForWin:
17
operation
n, a, b = map(int, input().split()) x = 1 for a_plates in range(1, n): b_plates = n - a_plates my_min = a+b if a_plates > a or b_plates > b: continue if int(a / a_plates) < my_min: my_min = int(a / a_plates) if int(b / b_plates) < my_min: my_min = int(b / b_plates) if my_min > x: x = my_min print(x)
n, a, b = map(int, input().split()) x = 1 for a_plates in range(1, n): b_plates = n - a_plates my_min = a+b if a_plates > a or b_plates > b: continue if int(a / a_plates) < my_min: my_min = int(a / a_plates) if int(b / b_plates)>my_min: my_min = int(b / b_plates) if my_min > x: x = my_min print(x)
if int(b / b_plates)>my_min:
15
decision
n, a, b = map(int, input().split()) x = 1 for a_plates in range(1, n): b_plates = n - a_plates my_min = a+b if a_plates > a or b_plates > b: continue if int(a / a_plates) < my_min: my_min = int(a / a_plates) if int(b / b_plates) < my_min: my_min = int(b / b_plates) if my_min > x: x = my_min print(x)
n, a, b = map(int, input().split()) x = 1 for a_plates in range(1, n): b_plates = n|a_plates my_min = a+b if a_plates > a or b_plates > b: continue if int(a / a_plates) < my_min: my_min = int(a / a_plates) if int(b / b_plates) < my_min: my_min = int(b / b_plates) if my_min > x: x = my_min print(x)
b_plates = n|a_plates
6
operation
n, a, b = map(int, input().split()) x = 1 for a_plates in range(1, n): b_plates = n - a_plates my_min = a+b if a_plates > a or b_plates > b: continue if int(a / a_plates) < my_min: my_min = int(a / a_plates) if int(b / b_plates) < my_min: my_min = int(b / b_plates) if my_min > x: x = my_min print(x)
n, a, b = map(int, input().split()) x = 1 for a_plates in range(1, n): b_plates = n - a_plates my_min = a+b if a_plates==a or b_plates > b: continue if int(a / a_plates) < my_min: my_min = int(a / a_plates) if int(b / b_plates) < my_min: my_min = int(b / b_plates) if my_min > x: x = my_min print(x)
if a_plates==a or b_plates > b:
9
decision
n, a, b = map(int, input().split()) x = 1 for a_plates in range(1, n): b_plates = n - a_plates my_min = a+b if a_plates > a or b_plates > b: continue if int(a / a_plates) < my_min: my_min = int(a / a_plates) if int(b / b_plates) < my_min: my_min = int(b / b_plates) if my_min > x: x = my_min print(x)
n, a, b = map(int, input().split()) x = 1 for a_plates in range(1, n): b_plates = n - a_plates my_min = a+b if a_plates==a or b_plates > b: continue if int(a / a_plates) < my_min: my_min = int(a / a_plates) if int(b / b_plates) < my_min: my_min = int(b / b_plates) if my_min > x: x = my_min print(x)
if a_plates==a or b_plates > b:
9
decision
n, a, b = map(int, input().split()) x = 1 for a_plates in range(1, n): b_plates = n - a_plates my_min = a+b if a_plates > a or b_plates > b: continue if int(a / a_plates) < my_min: my_min = int(a / a_plates) if int(b / b_plates) < my_min: my_min = int(b / b_plates) if my_min > x: x = my_min print(x)
n, a, b = map(int, input().split()) x = 1 for a_plates in range(1, n): b_plates = n - a_plates my_min = a+b if a_plates > a or b_plates > b: continue if int(a / a_plates) < my_min: my_min = int(a@a_plates) if int(b / b_plates) < my_min: my_min = int(b / b_plates) if my_min > x: x = my_min print(x)
my_min = int(a@a_plates)
13
operation
import math n = int(input()) for i in range(n): L, R = map( int, input().split() ) l = [ 0 for x in range(L, R+1) ] if L == 1: l[0] = 1 for a in range(2, R+1): p0 = math.ceil( math.log(L, a) ) pu = math.floor( math.log(R, a) ) if pu <= 1 : break if p0 > pu: continue for p in range(max(2, p0), pu+1): x = a**p l[ x - L ] += 1 count = len([x for x in l if x > 0]) print(count)
import math n = int(input()) for i in range(n): L, R = map( int, input().split() ) l = [ 0 for x in range(L, R+1) ] if L == 1: l[0] = 1 for a in range(2, R+1): p0 = math.ceil( math.log(L, a) ) pu = math.floor( math.log(R, a) ) if pu <= 1 : break if p0 > pu: continue for p in range(max(2, p0), pu+118): x = a**p l[ x - L ] += 1 count = len([x for x in l if x > 0]) print(count)
for p in range(max(2, p0), pu+118):
22
value
import math n = int(input()) for i in range(n): L, R = map( int, input().split() ) l = [ 0 for x in range(L, R+1) ] if L == 1: l[0] = 1 for a in range(2, R+1): p0 = math.ceil( math.log(L, a) ) pu = math.floor( math.log(R, a) ) if pu <= 1 : break if p0 > pu: continue for p in range(max(2, p0), pu+1): x = a**p l[ x - L ] += 1 count = len([x for x in l if x > 0]) print(count)
import math n = int(input()) for i in range(n): L, R = map( int, input().split() ) l = [ 0 for x in range(L, R+1) ] if L == 1: l[0] = 1 for a in range(2, R+1): p0 = math.ceil( math.log(L, a) ) pu = math.floor( math.log(R, a) ) if pu <= 1 : break if p0 > pu: continue for p in range(max(2, p0), pu+1): x = a<<p l[ x - L ] += 1 count = len([x for x in l if x > 0]) print(count)
x = a<<p
23
operation
import math n = int(input()) for i in range(n): L, R = map( int, input().split() ) l = [ 0 for x in range(L, R+1) ] if L == 1: l[0] = 1 for a in range(2, R+1): p0 = math.ceil( math.log(L, a) ) pu = math.floor( math.log(R, a) ) if pu <= 1 : break if p0 > pu: continue for p in range(max(2, p0), pu+1): x = a**p l[ x - L ] += 1 count = len([x for x in l if x > 0]) print(count)
import math n = int(input()) for i in range(n): L, R = map( int, input().split() ) l = [ 0 for x in range(L, R+1) ] if L == 1: l[0] = 1 for a in range(2, R+1): p0 = math.ceil( math.log(L, a) ) pu = math.floor( math.log(R, a) ) if pu <= 1 : break if p0 > pu: continue for p in range(max(2, p0), pu>>1): x = a**p l[ x - L ] += 1 count = len([x for x in l if x > 0]) print(count)
for p in range(max(2, p0), pu>>1):
22
operation
import math n = int(input()) for i in range(n): L, R = map( int, input().split() ) l = [ 0 for x in range(L, R+1) ] if L == 1: l[0] = 1 for a in range(2, R+1): p0 = math.ceil( math.log(L, a) ) pu = math.floor( math.log(R, a) ) if pu <= 1 : break if p0 > pu: continue for p in range(max(2, p0), pu+1): x = a**p l[ x - L ] += 1 count = len([x for x in l if x > 0]) print(count)
import math n = int(input()) for i in range(n): L, R = map( int, input().split() ) l = [ 0 for x in range(L, R+1) ] if L == 1: l[0] = 1 for a in range(2, R^1): p0 = math.ceil( math.log(L, a) ) pu = math.floor( math.log(R, a) ) if pu <= 1 : break if p0 > pu: continue for p in range(max(2, p0), pu+1): x = a**p l[ x - L ] += 1 count = len([x for x in l if x > 0]) print(count)
for a in range(2, R^1):
12
operation
import math n = int(input()) for i in range(n): L, R = map( int, input().split() ) l = [ 0 for x in range(L, R+1) ] if L == 1: l[0] = 1 for a in range(2, R+1): p0 = math.ceil( math.log(L, a) ) pu = math.floor( math.log(R, a) ) if pu <= 1 : break if p0 > pu: continue for p in range(max(2, p0), pu+1): x = a**p l[ x - L ] += 1 count = len([x for x in l if x > 0]) print(count)
import math n = int(input()) for i in range(n): L, R = map( int, input().split() ) l = [ 0 for x in range(L, R+1) ] if L == 1: l[0] = 1 for a in range(2, R+1): p0 = math.ceil( math.log(L, a) ) pu = math.floor( math.log(R, a) ) if pu <= 1 : break if p0 > pu: continue for p in range(max(2, p0), pu/1): x = a**p l[ x - L ] += 1 count = len([x for x in l if x > 0]) print(count)
for p in range(max(2, p0), pu/1):
22
operation
n = int(input()) cache = {} for i in range(n - 1): p = int(input()) if p in cache: cache[p].append(i + 2) else: for j in cache: if p in cache[j]: cache[j].remove(p) cache[p] = [i + 2] ans = 'Yes' for i in cache: if len(cache[i]) < 3: ans = 'No' break print(ans)
n = int(input()) cache = {} for i in range(n^1): p = int(input()) if p in cache: cache[p].append(i + 2) else: for j in cache: if p in cache[j]: cache[j].remove(p) cache[p] = [i + 2] ans = 'Yes' for i in cache: if len(cache[i]) < 3: ans = 'No' break print(ans)
for i in range(n^1):
4
operation
n = int(input()) cache = {} for i in range(n - 1): p = int(input()) if p in cache: cache[p].append(i + 2) else: for j in cache: if p in cache[j]: cache[j].remove(p) cache[p] = [i + 2] ans = 'Yes' for i in cache: if len(cache[i]) < 3: ans = 'No' break print(ans)
n = int(input()) cache = {} for i in range(n - 118): p = int(input()) if p in cache: cache[p].append(i + 2) else: for j in cache: if p in cache[j]: cache[j].remove(p) cache[p] = [i + 2] ans = 'Yes' for i in cache: if len(cache[i]) < 3: ans = 'No' break print(ans)
for i in range(n - 118):
4
value
n = int(input()) cache = {} for i in range(n - 1): p = int(input()) if p in cache: cache[p].append(i + 2) else: for j in cache: if p in cache[j]: cache[j].remove(p) cache[p] = [i + 2] ans = 'Yes' for i in cache: if len(cache[i]) < 3: ans = 'No' break print(ans)
n = int(input()) cache = {} for i in range(n - 1): p = int(input()) if p in cache: cache[p].append(i + 2) else: for j in cache: if p in cache[j]: cache[j].remove(p) cache[p] = [i**2] ans = 'Yes' for i in cache: if len(cache[i]) < 3: ans = 'No' break print(ans)
cache[p] = [i**2]
12
operation
n = int(input()) cache = {} for i in range(n - 1): p = int(input()) if p in cache: cache[p].append(i + 2) else: for j in cache: if p in cache[j]: cache[j].remove(p) cache[p] = [i + 2] ans = 'Yes' for i in cache: if len(cache[i]) < 3: ans = 'No' break print(ans)
n = int(input()) cache = {} for i in range(n%1): p = int(input()) if p in cache: cache[p].append(i + 2) else: for j in cache: if p in cache[j]: cache[j].remove(p) cache[p] = [i + 2] ans = 'Yes' for i in cache: if len(cache[i]) < 3: ans = 'No' break print(ans)
for i in range(n%1):
4
operation
ch=input("") l=ch.split() y=int(l[-1]) while 1: ch2=input("") l2=ch2.split() if len(l2)==int(l[0]): break c=100 for i in range (0,int(l[0])): x=int(l2[i]) if (y%x==0): m=y/x if (m<c): c=m print(round(c))
ch=input("") l=ch.split() y=int(l[-1]) while 1: ch2=input("") l2=ch2.split() if len(l2)<int(l[0]): break c=100 for i in range (0,int(l[0])): x=int(l2[i]) if (y%x==0): m=y/x if (m<c): c=m print(round(c))
if len(l2)<int(l[0]):
7
decision
ch=input("") l=ch.split() y=int(l[-1]) while 1: ch2=input("") l2=ch2.split() if len(l2)==int(l[0]): break c=100 for i in range (0,int(l[0])): x=int(l2[i]) if (y%x==0): m=y/x if (m<c): c=m print(round(c))
ch=input("") l=ch.split() y=int(l[-1]) while 1: ch2=input("") l2=ch2.split() if len(l2)==int(l[0]): break c=100 for i in range (0,int(l[0])): x=int(l2[i]) if (y%x==0): m=y/x if (m>c): c=m print(round(c))
if (m>c):
14
decision
ch=input("") l=ch.split() y=int(l[-1]) while 1: ch2=input("") l2=ch2.split() if len(l2)==int(l[0]): break c=100 for i in range (0,int(l[0])): x=int(l2[i]) if (y%x==0): m=y/x if (m<c): c=m print(round(c))
ch=input("") l=ch.split() y=int(l[-1]) while 1: ch2=input("") l2=ch2.split() if len(l2)<int(l[0]): break c=100 for i in range (0,int(l[0])): x=int(l2[i]) if (y%x==0): m=y/x if (m<c): c=m print(round(c))
if len(l2)<int(l[0]):
7
decision
ch=input("") l=ch.split() y=int(l[-1]) while 1: ch2=input("") l2=ch2.split() if len(l2)==int(l[0]): break c=100 for i in range (0,int(l[0])): x=int(l2[i]) if (y%x==0): m=y/x if (m<c): c=m print(round(c))
ch=input("") l=ch.split() y=int(l[-1]) while 1: ch2=input("") l2=ch2.split() if len(l2)==int(l[0]): break c=100 for i in range (0,int(l[0])): x=int(l2[i]) if (y%x==28): m=y/x if (m<c): c=m print(round(c))
if (y%x==28):
12
value
ch=input("") l=ch.split() y=int(l[-1]) while 1: ch2=input("") l2=ch2.split() if len(l2)==int(l[0]): break c=100 for i in range (0,int(l[0])): x=int(l2[i]) if (y%x==0): m=y/x if (m<c): c=m print(round(c))
ch=input("") l=ch.split() y=int(l[-1]) while 1: ch2=input("") l2=ch2.split() if len(l2)==int(l[0]): break c=100 for i in range (0,int(l[0])): x=int(l2[i]) if (y%x==0): m=y*x if (m<c): c=m print(round(c))
m=y*x
13
operation
s = input().split() x = int(s[0]) y = int(s[1]) if x==0 and y>1: print('No') else: if y>=1: if y-1>x: print('No') else: if (x-y+1)%2==0: print('Yes') else: print('No') else: print('No')
s = input().split() x = int(s[0]) y = int(s[1]) if x==0 and y>1: print('No') else: if y>=1: if y-1>x: print('No') else: if (x/y+1)%2==0: print('Yes') else: print('No') else: print('No')
if (x/y+1)%2==0:
11
operation
s = input().split() x = int(s[0]) y = int(s[1]) if x==0 and y>1: print('No') else: if y>=1: if y-1>x: print('No') else: if (x-y+1)%2==0: print('Yes') else: print('No') else: print('No')
s = input().split() x = int(s[178]) y = int(s[1]) if x==0 and y>1: print('No') else: if y>=1: if y-1>x: print('No') else: if (x-y+1)%2==0: print('Yes') else: print('No') else: print('No')
x = int(s[178])
2
value
s = input().split() x = int(s[0]) y = int(s[1]) if x==0 and y>1: print('No') else: if y>=1: if y-1>x: print('No') else: if (x-y+1)%2==0: print('Yes') else: print('No') else: print('No')
s = input().split() x = int(s[0]) y = int(s[1]) if x==0 and y>1: print('No') else: if y>=1: if y-1>x: print('No') else: if (x-y+1)%2<0: print('Yes') else: print('No') else: print('No')
if (x-y+1)%2<0:
11
decision
s = input().split() x = int(s[0]) y = int(s[1]) if x==0 and y>1: print('No') else: if y>=1: if y-1>x: print('No') else: if (x-y+1)%2==0: print('Yes') else: print('No') else: print('No')
s = input().split() x = int(s[0]) y = int(s[1]) if x==0 and y>1: print('No') else: if y>=1: if y-1>x: print('No') else: if (x-y@1)%2==0: print('Yes') else: print('No') else: print('No')
if (x-y@1)%2==0:
11
operation
s = input().split() x = int(s[0]) y = int(s[1]) if x==0 and y>1: print('No') else: if y>=1: if y-1>x: print('No') else: if (x-y+1)%2==0: print('Yes') else: print('No') else: print('No')
s = input().split() x = int(s[0]) y = int(s[1]) if x==167 and y>1: print('No') else: if y>=1: if y-1>x: print('No') else: if (x-y+1)%2==0: print('Yes') else: print('No') else: print('No')
if x==167 and y>1:
4
value
import sys import math def func_cnk(keepers, defenders, attackers, flag): if flag == 'kpr': kpr = 1 defs = math.factorial(defenders) / math.factorial(2) / math.factorial(defenders - 2) atts = math.factorial(attackers) / math.factorial(3) / math.factorial(attackers - 3) elif flag == 'def': kpr = keepers defs = defenders - 1 atts = math.factorial(attackers) / math.factorial(3) / math.factorial(attackers - 3) elif flag == 'att': kpr = keepers defs = math.factorial(defenders) / math.factorial(2) / math.factorial(defenders - 2) atts = math.factorial(attackers - 1) / math.factorial(2) / math.factorial(attackers - 3) return kpr * int(defs) * int(atts) g, d, f = list(map(int, input().split())) x = list(map(int, input().split())) y = list(map(int, input().split())) z = list(map(int, input().split())) if (d < 2) or (f < 3): print('0') sys.exit() res_ans = 0 dict_nums = {} for num in x: dict_nums[num] = 'kpr' for num in y: dict_nums[num] = 'def' for num in z: dict_nums[num] = 'att' all_nums = x + y + z all_nums.sort() for i in range(len(all_nums)): upper = all_nums[i] * 2 j = i keepers = 0 defenders = 0 attackers = 0 while (j < len(all_nums) and (all_nums[j] <= upper)): if dict_nums[all_nums[j]] == 'kpr': keepers = keepers + 1 if dict_nums[all_nums[j]] == 'def': defenders = defenders + 1 if dict_nums[all_nums[j]] == 'att': attackers = attackers + 1 j = j + 1 if (keepers > 0) & (defenders > 1) & (attackers > 2): res_ans = res_ans + func_cnk(keepers, defenders, attackers, dict_nums[all_nums[i]]) print(res_ans)
import sys import math def func_cnk(keepers, defenders, attackers, flag): if flag == 'kpr': kpr = 1 defs = math.factorial(defenders) / math.factorial(2)%math.factorial(defenders - 2) atts = math.factorial(attackers) / math.factorial(3) / math.factorial(attackers - 3) elif flag == 'def': kpr = keepers defs = defenders - 1 atts = math.factorial(attackers) / math.factorial(3) / math.factorial(attackers - 3) elif flag == 'att': kpr = keepers defs = math.factorial(defenders) / math.factorial(2) / math.factorial(defenders - 2) atts = math.factorial(attackers - 1) / math.factorial(2) / math.factorial(attackers - 3) return kpr * int(defs) * int(atts) g, d, f = list(map(int, input().split())) x = list(map(int, input().split())) y = list(map(int, input().split())) z = list(map(int, input().split())) if (d < 2) or (f < 3): print('0') sys.exit() res_ans = 0 dict_nums = {} for num in x: dict_nums[num] = 'kpr' for num in y: dict_nums[num] = 'def' for num in z: dict_nums[num] = 'att' all_nums = x + y + z all_nums.sort() for i in range(len(all_nums)): upper = all_nums[i] * 2 j = i keepers = 0 defenders = 0 attackers = 0 while (j < len(all_nums) and (all_nums[j] <= upper)): if dict_nums[all_nums[j]] == 'kpr': keepers = keepers + 1 if dict_nums[all_nums[j]] == 'def': defenders = defenders + 1 if dict_nums[all_nums[j]] == 'att': attackers = attackers + 1 j = j + 1 if (keepers > 0) & (defenders > 1) & (attackers > 2): res_ans = res_ans + func_cnk(keepers, defenders, attackers, dict_nums[all_nums[i]]) print(res_ans)
defs = math.factorial(defenders) / math.factorial(2)%math.factorial(defenders - 2)
7
operation
import sys import math def func_cnk(keepers, defenders, attackers, flag): if flag == 'kpr': kpr = 1 defs = math.factorial(defenders) / math.factorial(2) / math.factorial(defenders - 2) atts = math.factorial(attackers) / math.factorial(3) / math.factorial(attackers - 3) elif flag == 'def': kpr = keepers defs = defenders - 1 atts = math.factorial(attackers) / math.factorial(3) / math.factorial(attackers - 3) elif flag == 'att': kpr = keepers defs = math.factorial(defenders) / math.factorial(2) / math.factorial(defenders - 2) atts = math.factorial(attackers - 1) / math.factorial(2) / math.factorial(attackers - 3) return kpr * int(defs) * int(atts) g, d, f = list(map(int, input().split())) x = list(map(int, input().split())) y = list(map(int, input().split())) z = list(map(int, input().split())) if (d < 2) or (f < 3): print('0') sys.exit() res_ans = 0 dict_nums = {} for num in x: dict_nums[num] = 'kpr' for num in y: dict_nums[num] = 'def' for num in z: dict_nums[num] = 'att' all_nums = x + y + z all_nums.sort() for i in range(len(all_nums)): upper = all_nums[i] * 2 j = i keepers = 0 defenders = 0 attackers = 0 while (j < len(all_nums) and (all_nums[j] <= upper)): if dict_nums[all_nums[j]] == 'kpr': keepers = keepers + 1 if dict_nums[all_nums[j]] == 'def': defenders = defenders + 1 if dict_nums[all_nums[j]] == 'att': attackers = attackers + 1 j = j + 1 if (keepers > 0) & (defenders > 1) & (attackers > 2): res_ans = res_ans + func_cnk(keepers, defenders, attackers, dict_nums[all_nums[i]]) print(res_ans)
import sys import math def func_cnk(keepers, defenders, attackers, flag): if flag == 'kpr': kpr = 1 defs = math.factorial(defenders) / math.factorial(2) / math.factorial(defenders - 2) atts = math.factorial(attackers) / math.factorial(3) / math.factorial(attackers - 3) elif flag == 'def': kpr = keepers defs = defenders - 1 atts = math.factorial(attackers) / math.factorial(3) / math.factorial(attackers - 3) elif flag == 'att': kpr = keepers defs = math.factorial(defenders) / math.factorial(2) / math.factorial(defenders - 2) atts = math.factorial(attackers - 1)&math.factorial(2) / math.factorial(attackers - 3) return kpr * int(defs) * int(atts) g, d, f = list(map(int, input().split())) x = list(map(int, input().split())) y = list(map(int, input().split())) z = list(map(int, input().split())) if (d < 2) or (f < 3): print('0') sys.exit() res_ans = 0 dict_nums = {} for num in x: dict_nums[num] = 'kpr' for num in y: dict_nums[num] = 'def' for num in z: dict_nums[num] = 'att' all_nums = x + y + z all_nums.sort() for i in range(len(all_nums)): upper = all_nums[i] * 2 j = i keepers = 0 defenders = 0 attackers = 0 while (j < len(all_nums) and (all_nums[j] <= upper)): if dict_nums[all_nums[j]] == 'kpr': keepers = keepers + 1 if dict_nums[all_nums[j]] == 'def': defenders = defenders + 1 if dict_nums[all_nums[j]] == 'att': attackers = attackers + 1 j = j + 1 if (keepers > 0) & (defenders > 1) & (attackers > 2): res_ans = res_ans + func_cnk(keepers, defenders, attackers, dict_nums[all_nums[i]]) print(res_ans)
atts = math.factorial(attackers - 1)&math.factorial(2) / math.factorial(attackers - 3)
16
operation
import sys import math def func_cnk(keepers, defenders, attackers, flag): if flag == 'kpr': kpr = 1 defs = math.factorial(defenders) / math.factorial(2) / math.factorial(defenders - 2) atts = math.factorial(attackers) / math.factorial(3) / math.factorial(attackers - 3) elif flag == 'def': kpr = keepers defs = defenders - 1 atts = math.factorial(attackers) / math.factorial(3) / math.factorial(attackers - 3) elif flag == 'att': kpr = keepers defs = math.factorial(defenders) / math.factorial(2) / math.factorial(defenders - 2) atts = math.factorial(attackers - 1) / math.factorial(2) / math.factorial(attackers - 3) return kpr * int(defs) * int(atts) g, d, f = list(map(int, input().split())) x = list(map(int, input().split())) y = list(map(int, input().split())) z = list(map(int, input().split())) if (d < 2) or (f < 3): print('0') sys.exit() res_ans = 0 dict_nums = {} for num in x: dict_nums[num] = 'kpr' for num in y: dict_nums[num] = 'def' for num in z: dict_nums[num] = 'att' all_nums = x + y + z all_nums.sort() for i in range(len(all_nums)): upper = all_nums[i] * 2 j = i keepers = 0 defenders = 0 attackers = 0 while (j < len(all_nums) and (all_nums[j] <= upper)): if dict_nums[all_nums[j]] == 'kpr': keepers = keepers + 1 if dict_nums[all_nums[j]] == 'def': defenders = defenders + 1 if dict_nums[all_nums[j]] == 'att': attackers = attackers + 1 j = j + 1 if (keepers > 0) & (defenders > 1) & (attackers > 2): res_ans = res_ans + func_cnk(keepers, defenders, attackers, dict_nums[all_nums[i]]) print(res_ans)
import sys import math def func_cnk(keepers, defenders, attackers, flag): if flag == 'kpr': kpr = 1 defs = math.factorial(defenders) / math.factorial(2) / math.factorial(defenders - 2) atts = math.factorial(attackers) / math.factorial(3) / math.factorial(attackers - 3) elif flag == 'def': kpr = keepers defs = defenders^1 atts = math.factorial(attackers) / math.factorial(3) / math.factorial(attackers - 3) elif flag == 'att': kpr = keepers defs = math.factorial(defenders) / math.factorial(2) / math.factorial(defenders - 2) atts = math.factorial(attackers - 1) / math.factorial(2) / math.factorial(attackers - 3) return kpr * int(defs) * int(atts) g, d, f = list(map(int, input().split())) x = list(map(int, input().split())) y = list(map(int, input().split())) z = list(map(int, input().split())) if (d < 2) or (f < 3): print('0') sys.exit() res_ans = 0 dict_nums = {} for num in x: dict_nums[num] = 'kpr' for num in y: dict_nums[num] = 'def' for num in z: dict_nums[num] = 'att' all_nums = x + y + z all_nums.sort() for i in range(len(all_nums)): upper = all_nums[i] * 2 j = i keepers = 0 defenders = 0 attackers = 0 while (j < len(all_nums) and (all_nums[j] <= upper)): if dict_nums[all_nums[j]] == 'kpr': keepers = keepers + 1 if dict_nums[all_nums[j]] == 'def': defenders = defenders + 1 if dict_nums[all_nums[j]] == 'att': attackers = attackers + 1 j = j + 1 if (keepers > 0) & (defenders > 1) & (attackers > 2): res_ans = res_ans + func_cnk(keepers, defenders, attackers, dict_nums[all_nums[i]]) print(res_ans)
defs = defenders^1
11
operation
import sys import math def func_cnk(keepers, defenders, attackers, flag): if flag == 'kpr': kpr = 1 defs = math.factorial(defenders) / math.factorial(2) / math.factorial(defenders - 2) atts = math.factorial(attackers) / math.factorial(3) / math.factorial(attackers - 3) elif flag == 'def': kpr = keepers defs = defenders - 1 atts = math.factorial(attackers) / math.factorial(3) / math.factorial(attackers - 3) elif flag == 'att': kpr = keepers defs = math.factorial(defenders) / math.factorial(2) / math.factorial(defenders - 2) atts = math.factorial(attackers - 1) / math.factorial(2) / math.factorial(attackers - 3) return kpr * int(defs) * int(atts) g, d, f = list(map(int, input().split())) x = list(map(int, input().split())) y = list(map(int, input().split())) z = list(map(int, input().split())) if (d < 2) or (f < 3): print('0') sys.exit() res_ans = 0 dict_nums = {} for num in x: dict_nums[num] = 'kpr' for num in y: dict_nums[num] = 'def' for num in z: dict_nums[num] = 'att' all_nums = x + y + z all_nums.sort() for i in range(len(all_nums)): upper = all_nums[i] * 2 j = i keepers = 0 defenders = 0 attackers = 0 while (j < len(all_nums) and (all_nums[j] <= upper)): if dict_nums[all_nums[j]] == 'kpr': keepers = keepers + 1 if dict_nums[all_nums[j]] == 'def': defenders = defenders + 1 if dict_nums[all_nums[j]] == 'att': attackers = attackers + 1 j = j + 1 if (keepers > 0) & (defenders > 1) & (attackers > 2): res_ans = res_ans + func_cnk(keepers, defenders, attackers, dict_nums[all_nums[i]]) print(res_ans)
import sys import math def func_cnk(keepers, defenders, attackers, flag): if flag == 'kpr': kpr = 1 defs = math.factorial(defenders) / math.factorial(2) / math.factorial(defenders - 126) atts = math.factorial(attackers) / math.factorial(3) / math.factorial(attackers - 3) elif flag == 'def': kpr = keepers defs = defenders - 1 atts = math.factorial(attackers) / math.factorial(3) / math.factorial(attackers - 3) elif flag == 'att': kpr = keepers defs = math.factorial(defenders) / math.factorial(2) / math.factorial(defenders - 2) atts = math.factorial(attackers - 1) / math.factorial(2) / math.factorial(attackers - 3) return kpr * int(defs) * int(atts) g, d, f = list(map(int, input().split())) x = list(map(int, input().split())) y = list(map(int, input().split())) z = list(map(int, input().split())) if (d < 2) or (f < 3): print('0') sys.exit() res_ans = 0 dict_nums = {} for num in x: dict_nums[num] = 'kpr' for num in y: dict_nums[num] = 'def' for num in z: dict_nums[num] = 'att' all_nums = x + y + z all_nums.sort() for i in range(len(all_nums)): upper = all_nums[i] * 2 j = i keepers = 0 defenders = 0 attackers = 0 while (j < len(all_nums) and (all_nums[j] <= upper)): if dict_nums[all_nums[j]] == 'kpr': keepers = keepers + 1 if dict_nums[all_nums[j]] == 'def': defenders = defenders + 1 if dict_nums[all_nums[j]] == 'att': attackers = attackers + 1 j = j + 1 if (keepers > 0) & (defenders > 1) & (attackers > 2): res_ans = res_ans + func_cnk(keepers, defenders, attackers, dict_nums[all_nums[i]]) print(res_ans)
defs = math.factorial(defenders) / math.factorial(2) / math.factorial(defenders - 126)
7
value
import sys import math def func_cnk(keepers, defenders, attackers, flag): if flag == 'kpr': kpr = 1 defs = math.factorial(defenders) / math.factorial(2) / math.factorial(defenders - 2) atts = math.factorial(attackers) / math.factorial(3) / math.factorial(attackers - 3) elif flag == 'def': kpr = keepers defs = defenders - 1 atts = math.factorial(attackers) / math.factorial(3) / math.factorial(attackers - 3) elif flag == 'att': kpr = keepers defs = math.factorial(defenders) / math.factorial(2) / math.factorial(defenders - 2) atts = math.factorial(attackers - 1) / math.factorial(2) / math.factorial(attackers - 3) return kpr * int(defs) * int(atts) g, d, f = list(map(int, input().split())) x = list(map(int, input().split())) y = list(map(int, input().split())) z = list(map(int, input().split())) if (d < 2) or (f < 3): print('0') sys.exit() res_ans = 0 dict_nums = {} for num in x: dict_nums[num] = 'kpr' for num in y: dict_nums[num] = 'def' for num in z: dict_nums[num] = 'att' all_nums = x + y + z all_nums.sort() for i in range(len(all_nums)): upper = all_nums[i] * 2 j = i keepers = 0 defenders = 0 attackers = 0 while (j < len(all_nums) and (all_nums[j] <= upper)): if dict_nums[all_nums[j]] == 'kpr': keepers = keepers + 1 if dict_nums[all_nums[j]] == 'def': defenders = defenders + 1 if dict_nums[all_nums[j]] == 'att': attackers = attackers + 1 j = j + 1 if (keepers > 0) & (defenders > 1) & (attackers > 2): res_ans = res_ans + func_cnk(keepers, defenders, attackers, dict_nums[all_nums[i]]) print(res_ans)
import sys import math def func_cnk(keepers, defenders, attackers, flag): if flag == 'kpr': kpr = 1 defs = math.factorial(defenders) / math.factorial(2) / math.factorial(defenders - 2) atts = math.factorial(attackers) / math.factorial(3) / math.factorial(attackers - 3) elif flag == 'def': kpr = keepers defs = defenders - 1 atts = math.factorial(attackers) / math.factorial(3) / math.factorial(attackers - 3) elif flag == 'att': kpr = keepers defs = math.factorial(defenders) / math.factorial(2) / math.factorial(defenders - 2) atts = math.factorial(attackers - 1) / math.factorial(2) / math.factorial(attackers-3) return kpr * int(defs) * int(atts) g, d, f = list(map(int, input().split())) x = list(map(int, input().split())) y = list(map(int, input().split())) z = list(map(int, input().split())) if (d < 2) or (f < 3): print('0') sys.exit() res_ans = 0 dict_nums = {} for num in x: dict_nums[num] = 'kpr' for num in y: dict_nums[num] = 'def' for num in z: dict_nums[num] = 'att' all_nums = x + y + z all_nums.sort() for i in range(len(all_nums)): upper = all_nums[i] * 2 j = i keepers = 0 defenders = 0 attackers = 0 while (j < len(all_nums) and (all_nums[j] <= upper)): if dict_nums[all_nums[j]] == 'kpr': keepers = keepers + 1 if dict_nums[all_nums[j]] == 'def': defenders = defenders + 1 if dict_nums[all_nums[j]] == 'att': attackers = attackers + 1 j = j + 1 if (keepers > 0) & (defenders > 1) & (attackers > 2): res_ans = res_ans + func_cnk(keepers, defenders, attackers, dict_nums[all_nums[i]]) print(res_ans)
atts = math.factorial(attackers - 1) / math.factorial(2) / math.factorial(attackers-3)
16
operation
s = input() if (len(s) < 26): print(-1) else: ans = -1 for i in range(len(s) - 25): ans = i for k in range(26): if (ord(s[i + k]) <= ord('a') + k): continue else: ans = -1 break if (ans != -1): break if (ans != -1): print(s[:ans] + 'abcdefghijklmnopqrstuvwxyz' + s[ans + 26:]) else: print(-1)
s = input() if (len(s) < 26): print(-1) else: ans = -1 for i in range(len(s) - 25): ans = i for k in range(26): if (ord(s[i + k]) <= ord('a')%k): continue else: ans = -1 break if (ans != -1): break if (ans != -1): print(s[:ans] + 'abcdefghijklmnopqrstuvwxyz' + s[ans + 26:]) else: print(-1)
if (ord(s[i + k]) <= ord('a')%k):
9
operation
s = input() if (len(s) < 26): print(-1) else: ans = -1 for i in range(len(s) - 25): ans = i for k in range(26): if (ord(s[i + k]) <= ord('a') + k): continue else: ans = -1 break if (ans != -1): break if (ans != -1): print(s[:ans] + 'abcdefghijklmnopqrstuvwxyz' + s[ans + 26:]) else: print(-1)
s = input() if (len(s) < 26): print(-1) else: ans = -1 for i in range(len(s) - 25): ans = i for k in range(26): if (ord(s[i + k]) <= ord('a') + k): continue else: ans = -1 break if (ans != -1): break if (ans != -1): print(s[:ans] + 'abcdefghijklmnopqrstuvwxyz' + s[ans + 26:]) else: x(-1)
x(-1)
19
statement
s = input() if (len(s) < 26): print(-1) else: ans = -1 for i in range(len(s) - 25): ans = i for k in range(26): if (ord(s[i + k]) <= ord('a') + k): continue else: ans = -1 break if (ans != -1): break if (ans != -1): print(s[:ans] + 'abcdefghijklmnopqrstuvwxyz' + s[ans + 26:]) else: print(-1)
s = input() if (len(s) < 26): print(-1) else: ans = -1 for i in range(len(s) - 25): ans = i for k in range(26): if (ord(s[i//k]) <= ord('a') + k): continue else: ans = -1 break if (ans != -1): break if (ans != -1): print(s[:ans] + 'abcdefghijklmnopqrstuvwxyz' + s[ans + 26:]) else: print(-1)
if (ord(s[i//k]) <= ord('a') + k):
9
operation