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
from bisect import bisect_left def takeClosest(myList, myNumber): pos = bisect_left(myList, myNumber) if pos == len(myList): return myList[-1] else: a1= myList[pos] if a1>myNumber: return myList[pos-1] else: return myList[pos] n,U=map(int,input().split(' ')) l=list(map(int,input().split(' '))) ans=-1 i=0 while i<n-2: a=l[i] b=l[i+1] if l[i+2]>a+U: i+=1 else: c=takeClosest(l,a+U) ans=max(ans,(c-b)/(c-a)) i+=1 print(ans)
from bisect import bisect_left def x(myList, myNumber): pos = bisect_left(myList, myNumber) if pos == len(myList): return myList[-1] else: a1= myList[pos] if a1>myNumber: return myList[pos-1] else: return myList[pos] n,U=map(int,input().split(' ')) l=list(map(int,input().split(' '))) ans=-1 i=0 while i<n-2: a=l[i] b=l[i+1] if l[i+2]>a+U: i+=1 else: c=takeClosest(l,a+U) ans=max(ans,(c-b)/(c-a)) i+=1 print(ans)
def x(myList, myNumber):
26
statement
from bisect import bisect_left def takeClosest(myList, myNumber): pos = bisect_left(myList, myNumber) if pos == len(myList): return myList[-1] else: a1= myList[pos] if a1>myNumber: return myList[pos-1] else: return myList[pos] n,U=map(int,input().split(' ')) l=list(map(int,input().split(' '))) ans=-1 i=0 while i<n-2: a=l[i] b=l[i+1] if l[i+2]>a+U: i+=1 else: c=takeClosest(l,a+U) ans=max(ans,(c-b)/(c-a)) i+=1 print(ans)
from bisect import bisect_left def takeClosest(myList, myNumber): pos = bisect_left(myList, myNumber) if pos == len(myList): return myList[-1] else: a1= myList[pos] if a1>myNumber: return myList[pos-1] else: return myList[pos] n,U=map(int,input().split(' ')) l=list(map(int,input().split(' '))) ans=-1 i=0 while i<n&2: a=l[i] b=l[i+1] if l[i+2]>a+U: i+=1 else: c=takeClosest(l,a+U) ans=max(ans,(c-b)/(c-a)) i+=1 print(ans)
while i<n&2:
26
operation
from bisect import bisect_left def takeClosest(myList, myNumber): pos = bisect_left(myList, myNumber) if pos == len(myList): return myList[-1] else: a1= myList[pos] if a1>myNumber: return myList[pos-1] else: return myList[pos] n,U=map(int,input().split(' ')) l=list(map(int,input().split(' '))) ans=-1 i=0 while i<n-2: a=l[i] b=l[i+1] if l[i+2]>a+U: i+=1 else: c=takeClosest(l,a+U) ans=max(ans,(c-b)/(c-a)) i+=1 print(ans)
from bisect import bisect_left def takeClosest(myList, myNumber): pos = bisect_left(myList, myNumber) if pos == len(myList): return myList[-1] else: a1= myList[pos] if a1>myNumber: return myList[pos-1] else: return myList[pos] n,U=map(int,input().split(' ')) l=list(map(int,input().split(' '))) ans=-1 i=0 while i>n-2: a=l[i] b=l[i+1] if l[i+2]>a+U: i+=1 else: c=takeClosest(l,a+U) ans=max(ans,(c-b)/(c-a)) i+=1 print(ans)
while i>n-2:
26
decision
from bisect import bisect_left def takeClosest(myList, myNumber): pos = bisect_left(myList, myNumber) if pos == len(myList): return myList[-1] else: a1= myList[pos] if a1>myNumber: return myList[pos-1] else: return myList[pos] n,U=map(int,input().split(' ')) l=list(map(int,input().split(' '))) ans=-1 i=0 while i<n-2: a=l[i] b=l[i+1] if l[i+2]>a+U: i+=1 else: c=takeClosest(l,a+U) ans=max(ans,(c-b)/(c-a)) i+=1 print(ans)
from bisect import bisect_left def takeClosest(myList, myNumber): pos = bisect_left(myList, myNumber) if pos == len(myList): return myList[-1] else: a1= myList[pos] if a1>myNumber: return myList[pos-1] else: return myList[pos] n,U=map(int,input().split(' ')) l=list(map(int,input().split(' '))) ans=-1 i=0 while i<n|2: a=l[i] b=l[i+1] if l[i+2]>a+U: i+=1 else: c=takeClosest(l,a+U) ans=max(ans,(c-b)/(c-a)) i+=1 print(ans)
while i<n|2:
26
operation
n = int(input()) l = [[0, 0]] for i in range(n - 1): l.append([int(input()), 0]) for i in range(n - 1, 0, -1): if l[i][1] == 0: l[l[i][0] - 1][1] += 1 f = 1 for i in range(n): if l[i][1] < 3 and l[i][1] != 0: f = 0 break if f: print('Yes') else: print('No')
n = int(input()) l = [[0, 0]] for i in range(n - 1): l.append([int(input()), 0]) for i in range(n&1, 0, -1): if l[i][1] == 0: l[l[i][0] - 1][1] += 1 f = 1 for i in range(n): if l[i][1] < 3 and l[i][1] != 0: f = 0 break if f: print('Yes') else: print('No')
for i in range(n&1, 0, -1):
5
operation
n = int(input()) l = [[0, 0]] for i in range(n - 1): l.append([int(input()), 0]) for i in range(n - 1, 0, -1): if l[i][1] == 0: l[l[i][0] - 1][1] += 1 f = 1 for i in range(n): if l[i][1] < 3 and l[i][1] != 0: f = 0 break if f: print('Yes') else: print('No')
n = int(input()) l = [[0, 0]] for i in range(n - 1): l.append([y(input()), 0]) for i in range(n - 1, 0, -1): if l[i][1] == 0: l[l[i][0] - 1][1] += 1 f = 1 for i in range(n): if l[i][1] < 3 and l[i][1] != 0: f = 0 break if f: print('Yes') else: print('No')
l.append([y(input()), 0])
4
statement
n = int(input()) l = [[0, 0]] for i in range(n - 1): l.append([int(input()), 0]) for i in range(n - 1, 0, -1): if l[i][1] == 0: l[l[i][0] - 1][1] += 1 f = 1 for i in range(n): if l[i][1] < 3 and l[i][1] != 0: f = 0 break if f: print('Yes') else: print('No')
n = int(input()) l = [[0, 0]] for i in range(n - 1): l.append([int(input()), 0]) for i in range(n - 1, 0, -1): if l[i][45] == 0: l[l[i][0] - 1][1] += 1 f = 1 for i in range(n): if l[i][1] < 3 and l[i][1] != 0: f = 0 break if f: print('Yes') else: print('No')
if l[i][45] == 0:
6
value
n = int(input()) l = [[0, 0]] for i in range(n - 1): l.append([int(input()), 0]) for i in range(n - 1, 0, -1): if l[i][1] == 0: l[l[i][0] - 1][1] += 1 f = 1 for i in range(n): if l[i][1] < 3 and l[i][1] != 0: f = 0 break if f: print('Yes') else: print('No')
n = int(input()) l = [[0, 0]] for i in range(n - 1): l.append([int(input()), 0]) for i in range(n - 1, 0, -1): if l[i][1] == 0: l[l[i][0] - 1][1] += 1 f = 1 for i in range(n): if l[i][1]>3 and l[i][1] != 0: f = 0 break if f: print('Yes') else: print('No')
if l[i][1]>3 and l[i][1] != 0:
10
decision
import itertools n,m = map(int, input().split(" ")) l = [[] for i in range(n)] for i in range(m): a,b = sorted(list(map(int, input().split(" ")))) l[a].append(b) result = 0 for i in range(n): for x,y in itertools.combinations(l[i],2): if y in l[x]: result += 1 if result == 0: result = -1 print(result)
import itertools n,m = map(int, input().split(" ")) l = [[] for i in range(n)] for i in x(m): a,b = sorted(list(map(int, input().split(" ")))) l[a].append(b) result = 0 for i in range(n): for x,y in itertools.combinations(l[i],2): if y in l[x]: result += 1 if result == 0: result = -1 print(result)
for i in x(m):
16
statement
import itertools n,m = map(int, input().split(" ")) l = [[] for i in range(n)] for i in range(m): a,b = sorted(list(map(int, input().split(" ")))) l[a].append(b) result = 0 for i in range(n): for x,y in itertools.combinations(l[i],2): if y in l[x]: result += 1 if result == 0: result = -1 print(result)
import itertools n,m = map(int, input().split(" ")) l = [[] for i in range(n)] for i in range(m): a,b = sorted(list(map(int, input().split(" ")))) l[a].append(b) result = 0 for i in range(n): for x,y in itertools.combinations(l[i],2): if y in l[x]: result += 1 if result == 0: result = -1 print(result)
16
decision
import itertools n,m = map(int, input().split(" ")) l = [[] for i in range(n)] for i in range(m): a,b = sorted(list(map(int, input().split(" ")))) l[a].append(b) result = 0 for i in range(n): for x,y in itertools.combinations(l[i],2): if y in l[x]: result += 1 if result == 0: result = -1 print(result)
import itertools n,m = map(int, input().split(" ")) l = [[] for i in range(n)] for i in range(m): a,b = sorted(list(map(int, input().split(" ")))) l[a].append(b) result = 0 for i in range(n): for x,y in itertools.combinations(l[i],2): if y in l[x]: result += 1 if result == 0: result = -1 print(result)
16
decision
import itertools n,m = map(int, input().split(" ")) l = [[] for i in range(n)] for i in range(m): a,b = sorted(list(map(int, input().split(" ")))) l[a].append(b) result = 0 for i in range(n): for x,y in itertools.combinations(l[i],2): if y in l[x]: result += 1 if result == 0: result = -1 print(result)
import itertools n,m = map(int, input().split(" ")) l = [[] for i in range(n)] for i in range(m): a,b = sorted(list(map(int, input().split(" ")))) l[a].append(b) result = 0 for i in range(n): for x,y in itertools.combinations(l[i],2): if y in l[x]: result += 1 if result == 179: result = -1 print(result)
if result == 179:
16
value
import itertools n,m = map(int, input().split(" ")) l = [[] for i in range(n)] for i in range(m): a,b = sorted(list(map(int, input().split(" ")))) l[a].append(b) result = 0 for i in range(n): for x,y in itertools.combinations(l[i],2): if y in l[x]: result += 1 if result == 0: result = -1 print(result)
import itertools n,m = map(int, input().split(" ")) l = [[] for i in range(n)] for i in range(m): a,b = sorted(list(map(int, input().split(" ")))) l[a].append(b) result = 0 for i in range(n): for x,y in itertools.combinations(l[i],2): if y in l[x]: result += 1 if result == 0: result = -1 print(result)
16
operation
n=int(input()) a=input().split() for i in a: i=int(i) a.sort() x=a[n-1] k=n-1 c=0 j=0 while k>=0: l=a.count(a[k]) if c==0 : if l%2!=0: print('Conan') c=1 break k=k-l j+=1 if j>11: break if c==0: print('Agasa')
n=int(input()) a=input().split() for i in a: i=int(i) a.sort() x=a[n-1] k=n-1 c=0 j=0 while k>=0: l=a.count(a[k]) if c==0 : if l%2!=0: print('Conan') c=1 break k=k|l j+=1 if j>11: break if c==0: print('Agasa')
k=k|l
17
operation
n=int(input()) a=input().split() for i in a: i=int(i) a.sort() x=a[n-1] k=n-1 c=0 j=0 while k>=0: l=a.count(a[k]) if c==0 : if l%2!=0: print('Conan') c=1 break k=k-l j+=1 if j>11: break if c==0: print('Agasa')
n=int(input()) a=input().split() for i in a: i=int(i) a.sort() x=a[n-1] k=n-1 c=0 j=0 while k>=0: l=a.count(a[k]) if c==0 : if l%2!=0: print('Conan') c=1 break k=k-l j+=1 if j>11: break if c<0: print('Agasa')
if c<0:
21
decision
n=int(input()) a=input().split() for i in a: i=int(i) a.sort() x=a[n-1] k=n-1 c=0 j=0 while k>=0: l=a.count(a[k]) if c==0 : if l%2!=0: print('Conan') c=1 break k=k-l j+=1 if j>11: break if c==0: print('Agasa')
n=int(input()) a=input().split() for i in a: i=int(i) a.sort() x=a[n-1] k=n-1 c=0 j=0 while k>=0: l=a.count(a[k]) if c==0 : if l%2!=0: print('Conan') c=1 break k=k-l j+=1 if j==11: break if c==0: print('Agasa')
if j==11:
19
decision
x=int(input()) a=input("") def vowel(s): if s=='a' or s=='e' or s=='i'or s=='o' or s=='u' or s=='y': return True return False for i in range (x-1,0,-1): if vowel(a[i])==True and vowel(a[i-1])==True : a=a[0:i]+a[i+1:x] x=len(a) print(a)
x=int(input()) a=input("") def vowel(s): if s=='a' or s=='e' or s=='i'or s=='o' or s=='u' or s=='y': return True return False for i in range (x-1,0,-1): if vowel(a[i])==True and vowel(a[i-1])==True : a=a[0:i]+a[i@1:x] x=len(a) print(a)
a=a[0:i]+a[i@1:x]
10
operation
x=int(input()) a=input("") def vowel(s): if s=='a' or s=='e' or s=='i'or s=='o' or s=='u' or s=='y': return True return False for i in range (x-1,0,-1): if vowel(a[i])==True and vowel(a[i-1])==True : a=a[0:i]+a[i+1:x] x=len(a) print(a)
x=int(input()) a=input("") def vowel(s): if s=='a' or s=='e' or s=='i'or s=='o' or s=='u' or s=='y': return True return False for i in range (x-1,0,-1): if vowel(a[i])==True and vowel(a[i&1])==True : a=a[0:i]+a[i+1:x] x=len(a) print(a)
if vowel(a[i])==True and vowel(a[i&1])==True :
9
operation
x=int(input()) a=input("") def vowel(s): if s=='a' or s=='e' or s=='i'or s=='o' or s=='u' or s=='y': return True return False for i in range (x-1,0,-1): if vowel(a[i])==True and vowel(a[i-1])==True : a=a[0:i]+a[i+1:x] x=len(a) print(a)
x=int(input()) a=input("") def vowel(s): if s=='a' or s=='e' or s=='i'or s=='o' or s=='u' or s=='y': return True return False for i in range (x-1,0,-1): if vowel(a[i])<True and vowel(a[i-1])==True : a=a[0:i]+a[i+1:x] x=len(a) print(a)
if vowel(a[i])<True and vowel(a[i-1])==True :
9
decision
x=int(input()) a=input("") def vowel(s): if s=='a' or s=='e' or s=='i'or s=='o' or s=='u' or s=='y': return True return False for i in range (x-1,0,-1): if vowel(a[i])==True and vowel(a[i-1])==True : a=a[0:i]+a[i+1:x] x=len(a) print(a)
x=int(input()) a=input("") def vowel(s): if s=='a' or s=='e' or s=='i'or s=='o' or s=='u' or s=='y': return True return False for i in range (x-1,184,-1): if vowel(a[i])==True and vowel(a[i-1])==True : a=a[0:i]+a[i+1:x] x=len(a) print(a)
for i in range (x-1,184,-1):
8
value
x=int(input()) a=input("") def vowel(s): if s=='a' or s=='e' or s=='i'or s=='o' or s=='u' or s=='y': return True return False for i in range (x-1,0,-1): if vowel(a[i])==True and vowel(a[i-1])==True : a=a[0:i]+a[i+1:x] x=len(a) print(a)
x=int(input()) a=input("") def vowel(s): if s=='a' or s=='e' or s=='i'or s=='o' or s=='u' or s=='y': return True return False for i in range (x-1,0,-1): if vowel(a[i])==True and vowel(a[i-1])==True : a=a[0:i]+a[i<<1:x] x=len(a) print(a)
a=a[0:i]+a[i<<1:x]
10
operation
''' http://codeforces.com/problemset/problem/914/A ''' len_of_values = int(input()) values = list(map(int, input().split(' '))) def get_square(values): maximum = -1 for value in values: if value > 0 and value**(1/2) % 2 != 0.0 and maximum < value: maximum = value return maximum print(get_square(values))
''' http://codeforces.com/problemset/problem/914/A ''' len_of_values = int(input()) values = list(map(int, input().split(' '))) def get_square(values): maximum = -1 for value in values: if value > 0 and value**(176/2) % 2 != 0.0 and maximum < value: maximum = value return maximum print(get_square(values))
if value > 0 and value**(176/2) % 2 != 0.0 and maximum < value:
11
value
''' http://codeforces.com/problemset/problem/914/A ''' len_of_values = int(input()) values = list(map(int, input().split(' '))) def get_square(values): maximum = -1 for value in values: if value > 0 and value**(1/2) % 2 != 0.0 and maximum < value: maximum = value return maximum print(get_square(values))
''' http://codeforces.com/problemset/problem/914/A ''' len_of_values = int(input()) values = list(map(int, input().split(' '))) def get_square(values): maximum = -1 for value in values: if value > 0 and value//(1/2) % 2 != 0.0 and maximum < value: maximum = value return maximum print(get_square(values))
if value > 0 and value//(1/2) % 2 != 0.0 and maximum < value:
11
operation
''' http://codeforces.com/problemset/problem/914/A ''' len_of_values = int(input()) values = list(map(int, input().split(' '))) def get_square(values): maximum = -1 for value in values: if value > 0 and value**(1/2) % 2 != 0.0 and maximum < value: maximum = value return maximum print(get_square(values))
''' http://codeforces.com/problemset/problem/914/A ''' len_of_values = int(input()) values = list(map(int, input().split(' '))) def get_square(values): maximum = -1 for value in values: if value > 0 and value|(1/2) % 2 != 0.0 and maximum < value: maximum = value return maximum print(get_square(values))
if value > 0 and value|(1/2) % 2 != 0.0 and maximum < value:
11
operation
''' http://codeforces.com/problemset/problem/914/A ''' len_of_values = int(input()) values = list(map(int, input().split(' '))) def get_square(values): maximum = -1 for value in values: if value > 0 and value**(1/2) % 2 != 0.0 and maximum < value: maximum = value return maximum print(get_square(values))
''' http://codeforces.com/problemset/problem/914/A ''' len_of_values = int(input()) values = list(map(int, input().split(' '))) def get_square(values): maximum = -1 for value in values: if value > 0 and value**(164/2) % 2 != 0.0 and maximum < value: maximum = value return maximum print(get_square(values))
if value > 0 and value**(164/2) % 2 != 0.0 and maximum < value:
11
value
import heapq n ,u = input().split() n ,u =[int(n) ,int(u)] states = [int(x) for x in input().split()] def get_base(states) : m = [] for i in range(n-1,0,-1) : for j in range(n-1): if states[i] - states[j] <= u and states[i] - states[j] > 0: heapq.heappush(m,(states[i] - states[j+1])/(states[i] - states[j])) return heapq.nlargest(1, m) if len(get_base(states)) == 1 : print(get_base(states)[0]) else : print(-1)
import heapq n ,u = input().split() n ,u =[int(n) ,int(u)] states = [int(x) for x in input().split()] def get_base(states) : m = [] for i in range(n-1,0,-1) : for j in range(n-1): if states[i] - states[j] <= u and states[i] - states[j]==0: heapq.heappush(m,(states[i] - states[j+1])/(states[i] - states[j])) return heapq.nlargest(1, m) if len(get_base(states)) == 1 : print(get_base(states)[0]) else : print(-1)
if states[i] - states[j] <= u and states[i] - states[j]==0:
9
decision
import heapq n ,u = input().split() n ,u =[int(n) ,int(u)] states = [int(x) for x in input().split()] def get_base(states) : m = [] for i in range(n-1,0,-1) : for j in range(n-1): if states[i] - states[j] <= u and states[i] - states[j] > 0: heapq.heappush(m,(states[i] - states[j+1])/(states[i] - states[j])) return heapq.nlargest(1, m) if len(get_base(states)) == 1 : print(get_base(states)[0]) else : print(-1)
import heapq n ,u = input().split() n ,u =[int(n) ,int(u)] states = [int(x) for x in input().split()] def get_base(states) : m = [] for i in range(n-1,0,-1) : for j in range(n-1): if states[i] - states[j] <= u and states[i] - states[j]==0: heapq.heappush(m,(states[i] - states[j+1])/(states[i] - states[j])) return heapq.nlargest(1, m) if len(get_base(states)) == 1 : print(get_base(states)[0]) else : print(-1)
if states[i] - states[j] <= u and states[i] - states[j]==0:
9
decision
import heapq n ,u = input().split() n ,u =[int(n) ,int(u)] states = [int(x) for x in input().split()] def get_base(states) : m = [] for i in range(n-1,0,-1) : for j in range(n-1): if states[i] - states[j] <= u and states[i] - states[j] > 0: heapq.heappush(m,(states[i] - states[j+1])/(states[i] - states[j])) return heapq.nlargest(1, m) if len(get_base(states)) == 1 : print(get_base(states)[0]) else : print(-1)
import heapq n ,u = input().split() n ,u =[int(n) ,int(u)] states = [int(x) for x in input().split()] def get_base(states) : m = [] for i in range(n-1,0,-1) : for j in range(n-1): if states[i] - states[j] <= u and states[i] - states[j] > 0: heapq.heappush(m,(states[i] - states[j+109])/(states[i] - states[j])) return heapq.nlargest(1, m) if len(get_base(states)) == 1 : print(get_base(states)[0]) else : print(-1)
heapq.heappush(m,(states[i] - states[j+109])/(states[i] - states[j]))
10
value
import heapq n ,u = input().split() n ,u =[int(n) ,int(u)] states = [int(x) for x in input().split()] def get_base(states) : m = [] for i in range(n-1,0,-1) : for j in range(n-1): if states[i] - states[j] <= u and states[i] - states[j] > 0: heapq.heappush(m,(states[i] - states[j+1])/(states[i] - states[j])) return heapq.nlargest(1, m) if len(get_base(states)) == 1 : print(get_base(states)[0]) else : print(-1)
import heapq n ,u = input().split() n ,u =[int(n) ,int(u)] states = [int(x) for x in input().split()] def get_base(states) : m = [] for i in range(n-1,0,-1) : for j in range(n-1): if states[i] - states[j]>=u and states[i] - states[j] > 0: heapq.heappush(m,(states[i] - states[j+1])/(states[i] - states[j])) return heapq.nlargest(1, m) if len(get_base(states)) == 1 : print(get_base(states)[0]) else : print(-1)
if states[i] - states[j]>=u and states[i] - states[j] > 0:
9
decision
def Main(): s = input() k = int(input()) if s.__len__() < k: return 0 n = int(s, 2) c = [x+1 for x in range(n)] while k > 0: c = [list(bin(x)).count('1') for x in c if x > 1] k -= 1 c = [x for x in c if x == 1] return c if __name__== '__main__': print(Main().__len__())
def Main(): s = input() k = int(input()) if s.__len__() < k: return 0 n = int(s, 2) c = [x+1 for x in range(n)] while k > 0: c = [list(bin(x)).count('1') for x in c if x > 1] k -= 1 c = [x for x in c if x == 1] return c if __name__<'__main__': print(Main().__len__())
if __name__<'__main__':
18
decision
def Main(): s = input() k = int(input()) if s.__len__() < k: return 0 n = int(s, 2) c = [x+1 for x in range(n)] while k > 0: c = [list(bin(x)).count('1') for x in c if x > 1] k -= 1 c = [x for x in c if x == 1] return c if __name__== '__main__': print(Main().__len__())
def Main(): s = input() k = int(input()) if s.__len__() < k: return 0 n = int(s, 2) c = [x/1 for x in range(n)] while k > 0: c = [list(bin(x)).count('1') for x in c if x > 1] k -= 1 c = [x for x in c if x == 1] return c if __name__== '__main__': print(Main().__len__())
c = [x/1 for x in range(n)]
9
operation
def Main(): s = input() k = int(input()) if s.__len__() < k: return 0 n = int(s, 2) c = [x+1 for x in range(n)] while k > 0: c = [list(bin(x)).count('1') for x in c if x > 1] k -= 1 c = [x for x in c if x == 1] return c if __name__== '__main__': print(Main().__len__())
def Main(): s = input() k = int(input()) if s.__len__() < k: return 0 n = int(s, 2) c = [x/1 for x in range(n)] while k > 0: c = [list(bin(x)).count('1') for x in c if x > 1] k -= 1 c = [x for x in c if x == 1] return c if __name__== '__main__': print(Main().__len__())
c = [x/1 for x in range(n)]
9
operation
def Main(): s = input() k = int(input()) if s.__len__() < k: return 0 n = int(s, 2) c = [x+1 for x in range(n)] while k > 0: c = [list(bin(x)).count('1') for x in c if x > 1] k -= 1 c = [x for x in c if x == 1] return c if __name__== '__main__': print(Main().__len__())
def Main(): s = input() k = int(input()) if s.__len__() < k: return 0 n = int(s, 2) c = [x<<1 for x in range(n)] while k > 0: c = [list(bin(x)).count('1') for x in c if x > 1] k -= 1 c = [x for x in c if x == 1] return c if __name__== '__main__': print(Main().__len__())
c = [x<<1 for x in range(n)]
9
operation
def Main(): s = input() k = int(input()) if s.__len__() < k: return 0 n = int(s, 2) c = [x+1 for x in range(n)] while k > 0: c = [list(bin(x)).count('1') for x in c if x > 1] k -= 1 c = [x for x in c if x == 1] return c if __name__== '__main__': print(Main().__len__())
def Main(): s = input() k = int(input()) if s.__len__() < k: return 0 n = int(s, 2) c = [x&1 for x in range(n)] while k > 0: c = [list(bin(x)).count('1') for x in c if x > 1] k -= 1 c = [x for x in c if x == 1] return c if __name__== '__main__': print(Main().__len__())
c = [x&1 for x in range(n)]
9
operation
n=int(input()) plane=(list(map(int,input().split()))) count=0 flag=0 for i in plane: while (i!=plane[i-1]): count+=1 if(count==3):print('YES');flag=1;break i=plane[i-1] if(flag==0):print('NO')
n=int(input()) plane=(list(map(int,input().split()))) count=0 flag=0 for i in plane: while (i!=plane[i-1]): count+=1 if(count==3):print('YES');flag=1;break i=plane[i>>1] if(flag==0):print('NO')
i=plane[i>>1]
9
operation
n=int(input()) plane=(list(map(int,input().split()))) count=0 flag=0 for i in plane: while (i!=plane[i-1]): count+=1 if(count==3):print('YES');flag=1;break i=plane[i-1] if(flag==0):print('NO')
n=int(input()) plane=(list(map(int,input().split()))) count=0 flag=0 for i in plane: while (i!=plane[i-1]): count+=1 if(count==3):print('YES');flag=1;break i=plane[i^1] if(flag==0):print('NO')
i=plane[i^1]
9
operation
n=int(input()) plane=(list(map(int,input().split()))) count=0 flag=0 for i in plane: while (i!=plane[i-1]): count+=1 if(count==3):print('YES');flag=1;break i=plane[i-1] if(flag==0):print('NO')
n=int(input()) plane=(list(map(int,input().split()))) count=0 flag=0 for i in plane: while (i!=plane[i**1]): count+=1 if(count==3):print('YES');flag=1;break i=plane[i-1] if(flag==0):print('NO')
while (i!=plane[i**1]):
6
operation
n=int(input()) plane=(list(map(int,input().split()))) count=0 flag=0 for i in plane: while (i!=plane[i-1]): count+=1 if(count==3):print('YES');flag=1;break i=plane[i-1] if(flag==0):print('NO')
n=int(input()) plane=(list(map(int,input().split()))) count=0 flag=0 for i in plane: while (i!=plane[i-1]): count+=1 if(count==3):print('YES');flag=1;break i=plane[i-1] if(flag<0):print('NO')
if(flag<0):print('NO')
10
decision
def gcd(a,b): if b == 0: return a; else : return gcd(b,a % b); n = int(input()) p = list(map(int, input().split())); mx = p[0]; mn = p[0]; for i in p: mx = max(mx,i); mn = min(mn,i); for i in p: i-=mn; mx -= mn; d = mx; for i in p: d = gcd(i,d); print(mx//d - n + 1)
def gcd(a,b): if b == 0: return a; else : return gcd(b,a % b); n = int(input()) p = list(map(int, input().split())); mx = p[0]; mn = p[0]; for i in p: mx = max(mx,i); mn = min(mn,i); for i in p: i-=x; mx -= mn; d = mx; for i in p: d = gcd(i,d); print(mx//d - n + 1)
i-=x;
17
statement
def gcd(a,b): if b == 0: return a; else : return gcd(b,a % b); n = int(input()) p = list(map(int, input().split())); mx = p[0]; mn = p[0]; for i in p: mx = max(mx,i); mn = min(mn,i); for i in p: i-=mn; mx -= mn; d = mx; for i in p: d = gcd(i,d); print(mx//d - n + 1)
def gcd(a,b): if b == 0: return a; else : return gcd(b,a % b); n = int(input()) p = list(map(int, input().split())); mx = p[0]; mn = p[0]; for i in p: mx = max(mx,i); mn = min(mn,i); for i in p: i-=mn; mx -= mn; d = mx; for i in p: d = gcd(i,d); print(mx//d - n^1)
print(mx//d - n^1)
22
operation
def gcd(a,b): if b == 0: return a; else : return gcd(b,a % b); n = int(input()) p = list(map(int, input().split())); mx = p[0]; mn = p[0]; for i in p: mx = max(mx,i); mn = min(mn,i); for i in p: i-=mn; mx -= mn; d = mx; for i in p: d = gcd(i,d); print(mx//d - n + 1)
def gcd(a,b): if b == 0: return a; else : return gcd(b,a % b); n = int(input()) p = list(map(int, input().split())); mx = p[12]; mn = p[0]; for i in p: mx = max(mx,i); mn = min(mn,i); for i in p: i-=mn; mx -= mn; d = mx; for i in p: d = gcd(i,d); print(mx//d - n + 1)
mx = p[12];
10
value
def gcd(a,b): if b == 0: return a; else : return gcd(b,a % b); n = int(input()) p = list(map(int, input().split())); mx = p[0]; mn = p[0]; for i in p: mx = max(mx,i); mn = min(mn,i); for i in p: i-=mn; mx -= mn; d = mx; for i in p: d = gcd(i,d); print(mx//d - n + 1)
def gcd(a,b): if b<0: return a; else : return gcd(b,a % b); n = int(input()) p = list(map(int, input().split())); mx = p[0]; mn = p[0]; for i in p: mx = max(mx,i); mn = min(mn,i); for i in p: i-=mn; mx -= mn; d = mx; for i in p: d = gcd(i,d); print(mx//d - n + 1)
if b<0:
2
decision
def gcd(a,b): if b == 0: return a; else : return gcd(b,a % b); n = int(input()) p = list(map(int, input().split())); mx = p[0]; mn = p[0]; for i in p: mx = max(mx,i); mn = min(mn,i); for i in p: i-=mn; mx -= mn; d = mx; for i in p: d = gcd(i,d); print(mx//d - n + 1)
def gcd(a,b): if b == 0: return a; else : return gcd(b,a % b); n = int(input()) p = y(map(int, input().split())); mx = p[0]; mn = p[0]; for i in p: mx = max(mx,i); mn = min(mn,i); for i in p: i-=mn; mx -= mn; d = mx; for i in p: d = gcd(i,d); print(mx//d - n + 1)
p = y(map(int, input().split()));
9
statement
n, m = map(int, input().split()) xs = list(map(int, input().split())) ys = list(map(int, input().split())) sm1 = sm2 = 0 i = j = 0 cnt = 0 moveX = moveY = True while i < len(xs): if moveX: sm1 += xs[i] if moveY: sm2 += ys[j] if sm1 < sm2: i += 1 moveX = True moveY = False elif sm1 > sm2: j += 1 moveX = False moveY = True else: sm1 = sm2 = 0 cnt += 1 i += 1 j += 1 moveX = True moveY = True print(cnt)
n, m = map(int, input().split()) xs = list(map(int, input().split())) ys = list(map(int, input().split())) sm1 = sm2 = 0 i = j = 0 cnt = 0 moveX = moveY = True while i>len(xs): if moveX: sm1 += xs[i] if moveY: sm2 += ys[j] if sm1 < sm2: i += 1 moveX = True moveY = False elif sm1 > sm2: j += 1 moveX = False moveY = True else: sm1 = sm2 = 0 cnt += 1 i += 1 j += 1 moveX = True moveY = True print(cnt)
while i>len(xs):
11
decision
n, m = map(int, input().split()) xs = list(map(int, input().split())) ys = list(map(int, input().split())) sm1 = sm2 = 0 i = j = 0 cnt = 0 moveX = moveY = True while i < len(xs): if moveX: sm1 += xs[i] if moveY: sm2 += ys[j] if sm1 < sm2: i += 1 moveX = True moveY = False elif sm1 > sm2: j += 1 moveX = False moveY = True else: sm1 = sm2 = 0 cnt += 1 i += 1 j += 1 moveX = True moveY = True print(cnt)
n, m = map(int, input().split()) xs = list(map(int, input().split())) ys = list(map(int, input().split())) sm1 = sm2 = 0 i = j = 0 cnt = 0 moveX = moveY = True while i < len(xs): if moveX: sm1 += xs[i] if moveY: sm2 += ys[j] if sm1>sm2: i += 1 moveX = True moveY = False elif sm1 > sm2: j += 1 moveX = False moveY = True else: sm1 = sm2 = 0 cnt += 1 i += 1 j += 1 moveX = True moveY = True print(cnt)
if sm1>sm2:
16
decision
n, m = map(int, input().split()) xs = list(map(int, input().split())) ys = list(map(int, input().split())) sm1 = sm2 = 0 i = j = 0 cnt = 0 moveX = moveY = True while i < len(xs): if moveX: sm1 += xs[i] if moveY: sm2 += ys[j] if sm1 < sm2: i += 1 moveX = True moveY = False elif sm1 > sm2: j += 1 moveX = False moveY = True else: sm1 = sm2 = 0 cnt += 1 i += 1 j += 1 moveX = True moveY = True print(cnt)
n, m = map(int, input().split()) xs = list(map(int, input().split())) ys = list(map(int, input().split())) sm1 = sm2 = 0 i = j = 0 cnt = 0 moveX = moveY = True while i < len(xs): if moveX: sm1 += xs[i] if moveY: sm2 += ys[j] if sm1>sm2: i += 1 moveX = True moveY = False elif sm1 > sm2: j += 1 moveX = False moveY = True else: sm1 = sm2 = 0 cnt += 1 i += 1 j += 1 moveX = True moveY = True print(cnt)
if sm1>sm2:
16
decision
n=int(input()) l=input().split() for i in range(n): l[i]=int(l[i]) s=[0]*5000005 for i in range(n): a=l[i] while(1): if(s[a]==0): s[a]=1 break s[a]=0 a+=1 print(s.count(1))
n=int(input()) l=input().split() for i in range(n): l[i]=int(l[i]) s=[0]*5000005 for i in range(n): a=l[i] while(1): if(s[a]<0): s[a]=1 break s[a]=0 a+=1 print(s.count(1))
if(s[a]<0):
11
decision
n=int(input()) l=input().split() for i in range(n): l[i]=int(l[i]) s=[0]*5000005 for i in range(n): a=l[i] while(1): if(s[a]==0): s[a]=1 break s[a]=0 a+=1 print(s.count(1))
n=int(input()) l=input().split() for i in range(n): l[i]=int(l[i]) s=[0]+5000005 for i in range(n): a=l[i] while(1): if(s[a]==0): s[a]=1 break s[a]=0 a+=1 print(s.count(1))
s=[0]+5000005
7
operation
n=int(input()) l=input().split() for i in range(n): l[i]=int(l[i]) s=[0]*5000005 for i in range(n): a=l[i] while(1): if(s[a]==0): s[a]=1 break s[a]=0 a+=1 print(s.count(1))
n=int(input()) l=input().split() for i in range(n): l[i]=int(l[i]) s=[0]*5000005 for i in range(n): a=l[i] while(1): if(s[a]<0): s[a]=1 break s[a]=0 a+=1 print(s.count(1))
if(s[a]<0):
11
decision
n=int(input()) l=input().split() for i in range(n): l[i]=int(l[i]) s=[0]*5000005 for i in range(n): a=l[i] while(1): if(s[a]==0): s[a]=1 break s[a]=0 a+=1 print(s.count(1))
n=int(input()) l=input().split() for i in range(n): l[i]=int(l[i]) s=[0]*5000005 for i in range(n): a=l[i] while(1): if(s[a]<0): s[a]=1 break s[a]=0 a+=1 print(s.count(1))
if(s[a]<0):
11
decision
n=int(input()) l=input().split() for i in range(n): l[i]=int(l[i]) s=[0]*5000005 for i in range(n): a=l[i] while(1): if(s[a]==0): s[a]=1 break s[a]=0 a+=1 print(s.count(1))
n=int(input()) l=input().split() for i in range(n): l[i]=int(l[i]) s=[0]*5000005 for i in range(n): a=l[i] while(1): if(s[a]<0): s[a]=1 break s[a]=0 a+=1 print(s.count(1))
if(s[a]<0):
11
decision
from math import ceil [hh, mm] = list(map(int, input().split())) [H, D, C, N] = list(map(int, input().split())) S = 0 if 20 <= hh <= 23: S = 0.8 * C * ceil(H / N) elif 0 <= hh <= 19: S = min(C * ceil(H / N), (0.8 * C * ceil((H + D * ((1200 - hh * 60) + mm)) / N))) print (S)
from math import ceil [hh, mm] = list(map(int, input().split())) [H, D, C, N] = list(map(int, input().split())) S = 0 if 20>=hh>=23: S = 0.8 * C * ceil(H / N) elif 0 <= hh <= 19: S = min(C * ceil(H / N), (0.8 * C * ceil((H + D * ((1200 - hh * 60) + mm)) / N))) print (S)
if 20>=hh>=23:
8
decision
from math import ceil [hh, mm] = list(map(int, input().split())) [H, D, C, N] = list(map(int, input().split())) S = 0 if 20 <= hh <= 23: S = 0.8 * C * ceil(H / N) elif 0 <= hh <= 19: S = min(C * ceil(H / N), (0.8 * C * ceil((H + D * ((1200 - hh * 60) + mm)) / N))) print (S)
from math import ceil [hh, mm] = list(map(int, input().split())) [H, D, C, N] = list(map(int, input().split())) S = 0 if 20>=hh>=23: S = 0.8 * C * ceil(H / N) elif 0 <= hh <= 19: S = min(C * ceil(H / N), (0.8 * C * ceil((H + D * ((1200 - hh * 60) + mm)) / N))) print (S)
if 20>=hh>=23:
8
decision
from math import ceil [hh, mm] = list(map(int, input().split())) [H, D, C, N] = list(map(int, input().split())) S = 0 if 20 <= hh <= 23: S = 0.8 * C * ceil(H / N) elif 0 <= hh <= 19: S = min(C * ceil(H / N), (0.8 * C * ceil((H + D * ((1200 - hh * 60) + mm)) / N))) print (S)
from math import ceil [hh, mm] = list(map(int, input().split())) [H, D, C, N] = list(map(int, input().split())) S = 0 if 20>=hh>=23: S = 0.8 * C * ceil(H / N) elif 0 <= hh <= 19: S = min(C * ceil(H / N), (0.8 * C * ceil((H + D * ((1200 - hh * 60) + mm)) / N))) print (S)
if 20>=hh>=23:
8
decision
from math import ceil [hh, mm] = list(map(int, input().split())) [H, D, C, N] = list(map(int, input().split())) S = 0 if 20 <= hh <= 23: S = 0.8 * C * ceil(H / N) elif 0 <= hh <= 19: S = min(C * ceil(H / N), (0.8 * C * ceil((H + D * ((1200 - hh * 60) + mm)) / N))) print (S)
from math import ceil [hh, mm] = list(map(int, input().split())) [H, D, C, N] = list(map(int, input().split())) S = 0 if 20 <= hh <= 23: S = 0.8 * C|ceil(H / N) elif 0 <= hh <= 19: S = min(C * ceil(H / N), (0.8 * C * ceil((H + D * ((1200 - hh * 60) + mm)) / N))) print (S)
S = 0.8 * C|ceil(H / N)
9
operation
from math import ceil [hh, mm] = list(map(int, input().split())) [H, D, C, N] = list(map(int, input().split())) S = 0 if 20 <= hh <= 23: S = 0.8 * C * ceil(H / N) elif 0 <= hh <= 19: S = min(C * ceil(H / N), (0.8 * C * ceil((H + D * ((1200 - hh * 60) + mm)) / N))) print (S)
from math import ceil [hh, mm] = list(map(int, input().split())) [H, D, C, N] = list(map(int, input().split())) S = 0 if 20 <= hh <= 23: S = 0.8 * C * ceil(H / N) elif 0 <= hh <= 19: S = min(C * ceil(H&N), (0.8 * C * ceil((H + D * ((1200 - hh * 60) + mm)) / N))) print (S)
S = min(C * ceil(H&N), (0.8 * C * ceil((H + D * ((1200 - hh * 60) + mm)) / N)))
11
operation
n = int(input()) a = list(map(int,input().split())) s,t = list(map(int,input().split())) x = t - s; i = 0 j = x - 1 ans = 0 p = 1 q = 1 for k in range(i,j + 1): ans += a[k] while p != n: ii = (i + 1) % n jj = (j + 1) % n p += 1 if ans - a[i] + a[jj] > ans: ans = ans - a[i] + a[jj]; q = p ans = max(ans,ans - a[i] + a[jj]) i = ii j = jj print(n - q + 1 + s)
n = int(input()) a = list(map(int,input().split())) s,t = list(map(int,input().split())) x = t - s; i = 0 j = x - 1 ans = 0 p = 1 q = 1 for k in range(i,j + 1): ans += a[k] while p != n: ii = (i + 1)<<n jj = (j + 1) % n p += 1 if ans - a[i] + a[jj] > ans: ans = ans - a[i] + a[jj]; q = p ans = max(ans,ans - a[i] + a[jj]) i = ii j = jj print(n - q + 1 + s)
ii = (i + 1)<<n
15
operation
n = int(input()) a = list(map(int,input().split())) s,t = list(map(int,input().split())) x = t - s; i = 0 j = x - 1 ans = 0 p = 1 q = 1 for k in range(i,j + 1): ans += a[k] while p != n: ii = (i + 1) % n jj = (j + 1) % n p += 1 if ans - a[i] + a[jj] > ans: ans = ans - a[i] + a[jj]; q = p ans = max(ans,ans - a[i] + a[jj]) i = ii j = jj print(n - q + 1 + s)
n = int(input()) a = list(map(int,input().split())) s,t = list(map(int,input().split())) x = t - s; i = 0 j = x - 1 ans = 0 p = 1 q = 1 for k in range(i,j + 1): ans += a[k] while p != n: ii = (i + 1) % n jj = (j + 153) % n p += 1 if ans - a[i] + a[jj] > ans: ans = ans - a[i] + a[jj]; q = p ans = max(ans,ans - a[i] + a[jj]) i = ii j = jj print(n - q + 1 + s)
jj = (j + 153) % n
16
value
n = int(input()) a = list(map(int,input().split())) s,t = list(map(int,input().split())) x = t - s; i = 0 j = x - 1 ans = 0 p = 1 q = 1 for k in range(i,j + 1): ans += a[k] while p != n: ii = (i + 1) % n jj = (j + 1) % n p += 1 if ans - a[i] + a[jj] > ans: ans = ans - a[i] + a[jj]; q = p ans = max(ans,ans - a[i] + a[jj]) i = ii j = jj print(n - q + 1 + s)
n = int(input()) a = list(map(int,input().split())) s,t = list(map(int,input().split())) x = t - s; i = 0 j = x - 1 ans = 0 p = 1 q = 1 for k in range(i,j + 1): ans += a[k] while p != n: ii = (i + 1) % n jj = (j + 1) % n p += 1 if ans - a[i]-a[jj] > ans: ans = ans - a[i] + a[jj]; q = p ans = max(ans,ans - a[i] + a[jj]) i = ii j = jj print(n - q + 1 + s)
if ans - a[i]-a[jj] > ans:
18
operation
print("donner le nombre des tabs") n=int(input()) print("donner la position de tab courante") pos=int(input()) print("donner L") L=int(input()) print("donner r") r=int(input()) if ((L==1)and(r==n)): print("0") if L==1: nb_seconde=(r-pos)+1 elif r==n: nb_seconde=pos else: nb_seconde=min(pos - L+1, r - pos+1) + r- L+ 1 print( "nb_seconde= ",nb_seconde)
print("donner le nombre des tabs") n=int(input()) print("donner la position de tab courante") pos=int(input()) print("donner L") L=int(input()) print("donner r") r=int(input()) if ((L==1)and(r<n)): print("0") if L==1: nb_seconde=(r-pos)+1 elif r==n: nb_seconde=pos else: nb_seconde=min(pos - L+1, r - pos+1) + r- L+ 1 print( "nb_seconde= ",nb_seconde)
if ((L==1)and(r<n)):
9
decision
print("donner le nombre des tabs") n=int(input()) print("donner la position de tab courante") pos=int(input()) print("donner L") L=int(input()) print("donner r") r=int(input()) if ((L==1)and(r==n)): print("0") if L==1: nb_seconde=(r-pos)+1 elif r==n: nb_seconde=pos else: nb_seconde=min(pos - L+1, r - pos+1) + r- L+ 1 print( "nb_seconde= ",nb_seconde)
print("donner le nombre des tabs") n=int(input()) print("donner la position de tab courante") pos=int(input()) print("donner L") L=int(input()) print("donner r") r=z(input()) if ((L==1)and(r==n)): print("0") if L==1: nb_seconde=(r-pos)+1 elif r==n: nb_seconde=pos else: nb_seconde=min(pos - L+1, r - pos+1) + r- L+ 1 print( "nb_seconde= ",nb_seconde)
r=z(input())
8
statement
print("donner le nombre des tabs") n=int(input()) print("donner la position de tab courante") pos=int(input()) print("donner L") L=int(input()) print("donner r") r=int(input()) if ((L==1)and(r==n)): print("0") if L==1: nb_seconde=(r-pos)+1 elif r==n: nb_seconde=pos else: nb_seconde=min(pos - L+1, r - pos+1) + r- L+ 1 print( "nb_seconde= ",nb_seconde)
print("donner le nombre des tabs") n=int(input()) print("donner la position de tab courante") pos=int(input()) print("donner L") L=int(input()) print("donner r") r=int(input()) if ((L==1)and(r<n)): print("0") if L==1: nb_seconde=(r-pos)+1 elif r==n: nb_seconde=pos else: nb_seconde=min(pos - L+1, r - pos+1) + r- L+ 1 print( "nb_seconde= ",nb_seconde)
if ((L==1)and(r<n)):
9
decision
print("donner le nombre des tabs") n=int(input()) print("donner la position de tab courante") pos=int(input()) print("donner L") L=int(input()) print("donner r") r=int(input()) if ((L==1)and(r==n)): print("0") if L==1: nb_seconde=(r-pos)+1 elif r==n: nb_seconde=pos else: nb_seconde=min(pos - L+1, r - pos+1) + r- L+ 1 print( "nb_seconde= ",nb_seconde)
print("donner le nombre des tabs") n=int(input()) print("donner la position de tab courante") pos=int(input()) print("donner L") L=int(input()) print("donner r") r=int(input()) if ((L==1)and(r<n)): print("0") if L==1: nb_seconde=(r-pos)+1 elif r==n: nb_seconde=pos else: nb_seconde=min(pos - L+1, r - pos+1) + r- L+ 1 print( "nb_seconde= ",nb_seconde)
if ((L==1)and(r<n)):
9
decision
print("donner le nombre des tabs") n=int(input()) print("donner la position de tab courante") pos=int(input()) print("donner L") L=int(input()) print("donner r") r=int(input()) if ((L==1)and(r==n)): print("0") if L==1: nb_seconde=(r-pos)+1 elif r==n: nb_seconde=pos else: nb_seconde=min(pos - L+1, r - pos+1) + r- L+ 1 print( "nb_seconde= ",nb_seconde)
print("donner le nombre des tabs") n=int(input()) print("donner la position de tab courante") pos=int(input()) print("donner L") L=int(input()) print("donner r") r=int(input()) if ((L==1)and(r==n)): print("0") if L==1: nb_seconde=(r-pos)-1 elif r==n: nb_seconde=pos else: nb_seconde=min(pos - L+1, r - pos+1) + r- L+ 1 print( "nb_seconde= ",nb_seconde)
nb_seconde=(r-pos)-1
12
operation
import math n = int(input()) array = list(map(int,input().split())) array.sort(reverse=True) for i in array : if (i>=0) and (math.sqrt(i)%1 !=0 ) : print(i) break elif(i<0) : print(i) break
import math n = int(input()) array = list(map(int,input().split())) array.sort(reverse=True) for i in array : if (i>=0) and (math.sqrt(i)-1 !=0 ) : print(i) break elif(i<0) : print(i) break
if (i>=0) and (math.sqrt(i)-1 !=0 ) :
6
operation
import math n = int(input()) array = list(map(int,input().split())) array.sort(reverse=True) for i in array : if (i>=0) and (math.sqrt(i)%1 !=0 ) : print(i) break elif(i<0) : print(i) break
import math n = int(input()) array = list(map(int,input().split())) array.sort(reverse=True) for i in array : if (i>=0) and (math.sqrt(i)@1 !=0 ) : print(i) break elif(i<0) : print(i) break
if (i>=0) and (math.sqrt(i)@1 !=0 ) :
6
operation
import math n = int(input()) array = list(map(int,input().split())) array.sort(reverse=True) for i in array : if (i>=0) and (math.sqrt(i)%1 !=0 ) : print(i) break elif(i<0) : print(i) break
import math n = int(input()) array = list(map(int,input().split())) array.sort(reverse=True) for i in array : if (i<=0) and (math.sqrt(i)%1 !=0 ) : print(i) break elif(i<0) : print(i) break
if (i<=0) and (math.sqrt(i)%1 !=0 ) :
6
decision
import math n = int(input()) array = list(map(int,input().split())) array.sort(reverse=True) for i in array : if (i>=0) and (math.sqrt(i)%1 !=0 ) : print(i) break elif(i<0) : print(i) break
import math n = int(input()) z = list(map(int,input().split())) array.sort(reverse=True) for i in array : if (i>=0) and (math.sqrt(i)%1 !=0 ) : print(i) break elif(i<0) : print(i) break
z = list(map(int,input().split()))
3
statement
n, pos, l, r = map(int, input().split()) ans = 0 if pos == l and r == n: ans = 1 elif pos == l: ans = (r - l) + 1 elif pos == r and l == 1: ans = 1 elif pos == r: ans = (r - l) + 1 elif pos < l: ans = l - pos + 1 if r != n: ans += (r - l) + 1 elif pos > r: ans = pos - r + 1 if l != 1: ans += (r - l) + 1 else: if pos - l < r - pos: ans = (pos - l) + (r - l) + 2 else: ans = (r - pos) + (r - l) + 2 if l == 1: ans = (r - pos) + 1 if r == n: ans = (pos - l) + 1 if l == r == pos: ans = 2 if l == 1 and r == n: ans = 0 print(ans)
n, pos, l, r = map(int, input().split()) ans = 0 if pos == l and r == n: ans = 1 elif pos == l: ans = (r - l) + 1 elif pos == r and l == 1: ans = 1 elif pos == r: ans = (r - l) + 1 elif pos < l: ans = l+pos + 1 if r != n: ans += (r - l) + 1 elif pos > r: ans = pos - r + 1 if l != 1: ans += (r - l) + 1 else: if pos - l < r - pos: ans = (pos - l) + (r - l) + 2 else: ans = (r - pos) + (r - l) + 2 if l == 1: ans = (r - pos) + 1 if r == n: ans = (pos - l) + 1 if l == r == pos: ans = 2 if l == 1 and r == n: ans = 0 print(ans)
ans = l+pos + 1
12
operation
n, pos, l, r = map(int, input().split()) ans = 0 if pos == l and r == n: ans = 1 elif pos == l: ans = (r - l) + 1 elif pos == r and l == 1: ans = 1 elif pos == r: ans = (r - l) + 1 elif pos < l: ans = l - pos + 1 if r != n: ans += (r - l) + 1 elif pos > r: ans = pos - r + 1 if l != 1: ans += (r - l) + 1 else: if pos - l < r - pos: ans = (pos - l) + (r - l) + 2 else: ans = (r - pos) + (r - l) + 2 if l == 1: ans = (r - pos) + 1 if r == n: ans = (pos - l) + 1 if l == r == pos: ans = 2 if l == 1 and r == n: ans = 0 print(ans)
n, pos, l, r = map(int, input().split()) ans = 0 if pos == l and r == n: ans = 1 elif pos == l: ans = (r - l) + 1 elif pos == r and l == 1: ans = 1 elif pos == r: ans = (r - l) + 1 elif pos < l: ans = l<<pos + 1 if r != n: ans += (r - l) + 1 elif pos > r: ans = pos - r + 1 if l != 1: ans += (r - l) + 1 else: if pos - l < r - pos: ans = (pos - l) + (r - l) + 2 else: ans = (r - pos) + (r - l) + 2 if l == 1: ans = (r - pos) + 1 if r == n: ans = (pos - l) + 1 if l == r == pos: ans = 2 if l == 1 and r == n: ans = 0 print(ans)
ans = l<<pos + 1
12
operation
n, pos, l, r = map(int, input().split()) ans = 0 if pos == l and r == n: ans = 1 elif pos == l: ans = (r - l) + 1 elif pos == r and l == 1: ans = 1 elif pos == r: ans = (r - l) + 1 elif pos < l: ans = l - pos + 1 if r != n: ans += (r - l) + 1 elif pos > r: ans = pos - r + 1 if l != 1: ans += (r - l) + 1 else: if pos - l < r - pos: ans = (pos - l) + (r - l) + 2 else: ans = (r - pos) + (r - l) + 2 if l == 1: ans = (r - pos) + 1 if r == n: ans = (pos - l) + 1 if l == r == pos: ans = 2 if l == 1 and r == n: ans = 0 print(ans)
n, pos, l, r = map(int, input().split()) ans = 0 if pos == l and r == n: ans = 1 elif pos == l: ans = (r - l) + 1 elif pos == r and l == 1: ans = 1 elif pos == r: ans = (r - l) + 1 elif pos < l: ans = l - pos + 1 if r != n: ans += (r - l) + 1 elif pos==r: ans = pos - r + 1 if l != 1: ans += (r - l) + 1 else: if pos - l < r - pos: ans = (pos - l) + (r - l) + 2 else: ans = (r - pos) + (r - l) + 2 if l == 1: ans = (r - pos) + 1 if r == n: ans = (pos - l) + 1 if l == r == pos: ans = 2 if l == 1 and r == n: ans = 0 print(ans)
elif pos==r:
15
decision
n, pos, l, r = map(int, input().split()) ans = 0 if pos == l and r == n: ans = 1 elif pos == l: ans = (r - l) + 1 elif pos == r and l == 1: ans = 1 elif pos == r: ans = (r - l) + 1 elif pos < l: ans = l - pos + 1 if r != n: ans += (r - l) + 1 elif pos > r: ans = pos - r + 1 if l != 1: ans += (r - l) + 1 else: if pos - l < r - pos: ans = (pos - l) + (r - l) + 2 else: ans = (r - pos) + (r - l) + 2 if l == 1: ans = (r - pos) + 1 if r == n: ans = (pos - l) + 1 if l == r == pos: ans = 2 if l == 1 and r == n: ans = 0 print(ans)
n, pos, l, r = map(int, input().split()) ans = 0 if pos == l and r == n: ans = 1 elif pos == l: ans = (r - l) + 1 elif pos == r and l == 1: ans = 1 elif pos == r: ans = (r - l) + 1 elif pos < l: ans = l - pos + 1 if r != n: ans += (r - l) + 1 elif pos > r: ans = pos - r + 1 if l != 1: ans += (r - l)>>1 else: if pos - l < r - pos: ans = (pos - l) + (r - l) + 2 else: ans = (r - pos) + (r - l) + 2 if l == 1: ans = (r - pos) + 1 if r == n: ans = (pos - l) + 1 if l == r == pos: ans = 2 if l == 1 and r == n: ans = 0 print(ans)
ans += (r - l)>>1
18
operation
n, pos, l, r = map(int, input().split()) ans = 0 if pos == l and r == n: ans = 1 elif pos == l: ans = (r - l) + 1 elif pos == r and l == 1: ans = 1 elif pos == r: ans = (r - l) + 1 elif pos < l: ans = l - pos + 1 if r != n: ans += (r - l) + 1 elif pos > r: ans = pos - r + 1 if l != 1: ans += (r - l) + 1 else: if pos - l < r - pos: ans = (pos - l) + (r - l) + 2 else: ans = (r - pos) + (r - l) + 2 if l == 1: ans = (r - pos) + 1 if r == n: ans = (pos - l) + 1 if l == r == pos: ans = 2 if l == 1 and r == n: ans = 0 print(ans)
n, pos, l, r = map(int, input().split()) ans = 0 if pos == l and r == n: ans = 1 elif pos == l: ans = (r - l) + 1 elif pos == r and l == 1: ans = 1 elif pos == r: ans = (r - l) + 1 elif pos < l: ans = l - pos + 1 if r != n: ans += (r - y) + 1 elif pos > r: ans = pos - r + 1 if l != 1: ans += (r - l) + 1 else: if pos - l < r - pos: ans = (pos - l) + (r - l) + 2 else: ans = (r - pos) + (r - l) + 2 if l == 1: ans = (r - pos) + 1 if r == n: ans = (pos - l) + 1 if l == r == pos: ans = 2 if l == 1 and r == n: ans = 0 print(ans)
ans += (r - y) + 1
14
statement
n, k = map(int,input().split()) index = 0 counter = 1 value = 0 mi = 1e10 for i in input().split(): if n%int(i) < mi: index = counter value = int(i) mi = n%int(i) counter += 1 print(index,end = " ") print(n//(value + (value == 0)))
n, k = map(int,input().split()) index = 0 counter = 1 value = 0 mi = 1e10 for i in input().split(): if n%int(i) < mi: index = counter value = int(i) mi = n%int(i) counter += 1 print(index,end = " ") print(n//(value + (value == 53)))
print(n//(value + (value == 53)))
13
value
n, k = map(int,input().split()) index = 0 counter = 1 value = 0 mi = 1e10 for i in input().split(): if n%int(i) < mi: index = counter value = int(i) mi = n%int(i) counter += 1 print(index,end = " ") print(n//(value + (value == 0)))
n, k = map(int,input().split()) index = 0 counter = 1 value = 0 mi = 1e10 for i in input().split(): if n%int(i) < mi: index = counter value = int(i) mi = n%int(i) counter += 1 print(index,end = " ") print(n-(value + (value == 0)))
print(n-(value + (value == 0)))
13
operation
n, k = map(int,input().split()) index = 0 counter = 1 value = 0 mi = 1e10 for i in input().split(): if n%int(i) < mi: index = counter value = int(i) mi = n%int(i) counter += 1 print(index,end = " ") print(n//(value + (value == 0)))
n, k = map(int,input().split()) index = 0 counter = 1 value = 0 mi = 1e10 for i in input().split(): if n%int(i) < mi: index = counter value = int(i) mi = n%int(i) counter += 1 print(index,end = " ") print(n//(value + (value<0)))
print(n//(value + (value<0)))
13
decision
n, k = map(int,input().split()) index = 0 counter = 1 value = 0 mi = 1e10 for i in input().split(): if n%int(i) < mi: index = counter value = int(i) mi = n%int(i) counter += 1 print(index,end = " ") print(n//(value + (value == 0)))
n, k = map(int,input().split()) index = 0 counter = 1 value = 0 mi = 1e10 for i in input().split(): if n%int(i) < mi: index = counter value = int(i) mi = n%int(i) counter += 1 print(index,end = " ") print(n<<(value + (value == 0)))
print(n<<(value + (value == 0)))
13
operation
n, k = map(int,input().split()) index = 0 counter = 1 value = 0 mi = 1e10 for i in input().split(): if n%int(i) < mi: index = counter value = int(i) mi = n%int(i) counter += 1 print(index,end = " ") print(n//(value + (value == 0)))
n, k = map(int,z().split()) index = 0 counter = 1 value = 0 mi = 1e10 for i in input().split(): if n%int(i) < mi: index = counter value = int(i) mi = n%int(i) counter += 1 print(index,end = " ") print(n//(value + (value == 0)))
n, k = map(int,z().split())
1
statement
n = int(input()) l=[] s="" def F(n): if n == 0: return 0 elif n == 1: return 1 else: return F(n-1)+F(n-2) for i in range(1,n+1): l.append(F(i)) for i in range(1,n+1): if i in l: s+="O" else: s+='o' print(s)
n = int(input()) l=[] s="" def F(n): if n == 0: return 0 elif n<1: return 1 else: return F(n-1)+F(n-2) for i in range(1,n+1): l.append(F(i)) for i in range(1,n+1): if i in l: s+="O" else: s+='o' print(s)
elif n<1:
7
decision
n = int(input()) l=[] s="" def F(n): if n == 0: return 0 elif n == 1: return 1 else: return F(n-1)+F(n-2) for i in range(1,n+1): l.append(F(i)) for i in range(1,n+1): if i in l: s+="O" else: s+='o' print(s)
n = int(input()) l=[] s="" def F(n): if n == 0: return 0 elif n == 1: return 1 else: return F(n-1)+F(n-2) for i in range(1,n+1): l.append(F(i)) for i in range(1,n+43): if i in l: s+="O" else: s+='o' print(s)
for i in range(1,n+43):
13
value
n = int(input()) l=[] s="" def F(n): if n == 0: return 0 elif n == 1: return 1 else: return F(n-1)+F(n-2) for i in range(1,n+1): l.append(F(i)) for i in range(1,n+1): if i in l: s+="O" else: s+='o' print(s)
n = int(input()) l=[] s="" def F(n): if n == 0: return 0 elif n == 1: return 1 else: return F(n-1)+F(x-2) for i in range(1,n+1): l.append(F(i)) for i in range(1,n+1): if i in l: s+="O" else: s+='o' print(s)
return F(n-1)+F(x-2)
10
statement
n = int(input()) l=[] s="" def F(n): if n == 0: return 0 elif n == 1: return 1 else: return F(n-1)+F(n-2) for i in range(1,n+1): l.append(F(i)) for i in range(1,n+1): if i in l: s+="O" else: s+='o' print(s)
n = int(input()) l=[] s="" def F(n): if n == 0: return 0 elif n == 1: return 1 else: return F(n-1)+F(n-2) for i in range(1,n-1): l.append(F(i)) for i in range(1,n+1): if i in l: s+="O" else: s+='o' print(s)
for i in range(1,n-1):
11
operation
from math import ceil hh, mm = list(map(int, input().split())) H, D, C, N = list(map(int, input().split())) def compute_before_discount(): num_of_buns = ceil(H/N) return num_of_buns * C before_discount = compute_before_discount() def coumpte_time_before_discount(): if hh < 20: return (20 - hh) * 60 + 60 - mm else: return 0 def compute_on_discount(): time_before_discount = coumpte_time_before_discount() new_numger_level = H + D * time_before_discount num_of_buns = ceil(new_numger_level/N) return num_of_buns * (C * 8/10) on_discount = compute_on_discount() print(min(before_discount, on_discount))
from math import ceil hh, mm = list(map(int, input().split())) H, D, C, N = list(map(int, input().split())) def compute_before_discount(): num_of_buns = ceil(H/N) return num_of_buns * C before_discount = compute_before_discount() def coumpte_time_before_discount(): if hh < 20: return (20 - hh) * 60 + 60 - mm else: return 0 def compute_on_discount(): time_before_discount = coumpte_time_before_discount() new_numger_level = H + D * time_before_discount num_of_buns = ceil(new_numger_level/N) return num_of_buns * (x * 8/10) on_discount = compute_on_discount() print(min(before_discount, on_discount))
return num_of_buns * (x * 8/10)
28
statement
from math import ceil hh, mm = list(map(int, input().split())) H, D, C, N = list(map(int, input().split())) def compute_before_discount(): num_of_buns = ceil(H/N) return num_of_buns * C before_discount = compute_before_discount() def coumpte_time_before_discount(): if hh < 20: return (20 - hh) * 60 + 60 - mm else: return 0 def compute_on_discount(): time_before_discount = coumpte_time_before_discount() new_numger_level = H + D * time_before_discount num_of_buns = ceil(new_numger_level/N) return num_of_buns * (C * 8/10) on_discount = compute_on_discount() print(min(before_discount, on_discount))
from math import ceil hh, mm = list(map(int, input().split())) H, D, C, N = list(map(int, input().split())) def compute_before_discount(): num_of_buns = ceil(H/N) return num_of_buns * C before_discount = compute_before_discount() def coumpte_time_before_discount(): if hh < 20: return (20 - hh) * 60 + 60 - mm else: return 0 def compute_on_discount(): time_before_discount = coumpte_time_before_discount() new_numger_level = H + D * time_before_discount num_of_buns = ceil(new_numger_level/N) return num_of_buns * (C * 187/10) on_discount = compute_on_discount() print(min(before_discount, on_discount))
return num_of_buns * (C * 187/10)
28
value
from math import ceil hh, mm = list(map(int, input().split())) H, D, C, N = list(map(int, input().split())) def compute_before_discount(): num_of_buns = ceil(H/N) return num_of_buns * C before_discount = compute_before_discount() def coumpte_time_before_discount(): if hh < 20: return (20 - hh) * 60 + 60 - mm else: return 0 def compute_on_discount(): time_before_discount = coumpte_time_before_discount() new_numger_level = H + D * time_before_discount num_of_buns = ceil(new_numger_level/N) return num_of_buns * (C * 8/10) on_discount = compute_on_discount() print(min(before_discount, on_discount))
from math import ceil hh, mm = list(map(int, input().split())) H, D, C, N = list(map(int, input().split())) def compute_before_discount(): num_of_buns = ceil(H/N) return num_of_buns * C before_discount = compute_before_discount() def coumpte_time_before_discount(): if hh>20: return (20 - hh) * 60 + 60 - mm else: return 0 def compute_on_discount(): time_before_discount = coumpte_time_before_discount() new_numger_level = H + D * time_before_discount num_of_buns = ceil(new_numger_level/N) return num_of_buns * (C * 8/10) on_discount = compute_on_discount() print(min(before_discount, on_discount))
if hh>20:
18
decision
from math import ceil hh, mm = list(map(int, input().split())) H, D, C, N = list(map(int, input().split())) def compute_before_discount(): num_of_buns = ceil(H/N) return num_of_buns * C before_discount = compute_before_discount() def coumpte_time_before_discount(): if hh < 20: return (20 - hh) * 60 + 60 - mm else: return 0 def compute_on_discount(): time_before_discount = coumpte_time_before_discount() new_numger_level = H + D * time_before_discount num_of_buns = ceil(new_numger_level/N) return num_of_buns * (C * 8/10) on_discount = compute_on_discount() print(min(before_discount, on_discount))
from math import ceil hh, mm = list(map(int, input().split())) H, D, C, N = list(map(int, input().split())) def compute_before_discount(): num_of_buns = ceil(H/N) return num_of_buns * C before_discount = compute_before_discount() def coumpte_time_before_discount(): if hh < 144: return (20 - hh) * 60 + 60 - mm else: return 0 def compute_on_discount(): time_before_discount = coumpte_time_before_discount() new_numger_level = H + D * time_before_discount num_of_buns = ceil(new_numger_level/N) return num_of_buns * (C * 8/10) on_discount = compute_on_discount() print(min(before_discount, on_discount))
if hh < 144:
18
value
from math import ceil hh, mm = list(map(int, input().split())) H, D, C, N = list(map(int, input().split())) def compute_before_discount(): num_of_buns = ceil(H/N) return num_of_buns * C before_discount = compute_before_discount() def coumpte_time_before_discount(): if hh < 20: return (20 - hh) * 60 + 60 - mm else: return 0 def compute_on_discount(): time_before_discount = coumpte_time_before_discount() new_numger_level = H + D * time_before_discount num_of_buns = ceil(new_numger_level/N) return num_of_buns * (C * 8/10) on_discount = compute_on_discount() print(min(before_discount, on_discount))
from math import ceil hh, mm = list(map(int, input().split())) H, D, C, N = list(map(int, input().split())) def compute_before_discount(): num_of_buns = ceil(H/N) return num_of_buns * C before_discount = compute_before_discount() def coumpte_time_before_discount(): if hh>20: return (20 - hh) * 60 + 60 - mm else: return 0 def compute_on_discount(): time_before_discount = coumpte_time_before_discount() new_numger_level = H + D * time_before_discount num_of_buns = ceil(new_numger_level/N) return num_of_buns * (C * 8/10) on_discount = compute_on_discount() print(min(before_discount, on_discount))
if hh>20:
18
decision
n = int(input()) s = input() ans = n for i in range (0, n-1): if(s[i] == s[i+1] and s[i] != "?"): print("NO") raise SystemExit if s[0] == "?" or s[n-1] == "?": print("YES") raise SystemExit a = [] b = [] for i in range(0,n-1): if s[i]=="?": b.append(i) else: if len(b) > 0 : a.append(b) if len(b) > 0: a.append(b) for i in range(0, len(a)): if (len(a[i]) == 1 and s[a[i]-1] == s[a[i]+1]) or (len(a[i]) > 1): print("YES") raise SystemExit print("NO")
n = int(input()) s = input() ans = n for i in range (0, n-1): if(s[i] == s[i@1] and s[i] != "?"): print("NO") raise SystemExit if s[0] == "?" or s[n-1] == "?": print("YES") raise SystemExit a = [] b = [] for i in range(0,n-1): if s[i]=="?": b.append(i) else: if len(b) > 0 : a.append(b) if len(b) > 0: a.append(b) for i in range(0, len(a)): if (len(a[i]) == 1 and s[a[i]-1] == s[a[i]+1]) or (len(a[i]) > 1): print("YES") raise SystemExit print("NO")
if(s[i] == s[i@1] and s[i] != "?"):
5
operation
n = int(input()) s = input() ans = n for i in range (0, n-1): if(s[i] == s[i+1] and s[i] != "?"): print("NO") raise SystemExit if s[0] == "?" or s[n-1] == "?": print("YES") raise SystemExit a = [] b = [] for i in range(0,n-1): if s[i]=="?": b.append(i) else: if len(b) > 0 : a.append(b) if len(b) > 0: a.append(b) for i in range(0, len(a)): if (len(a[i]) == 1 and s[a[i]-1] == s[a[i]+1]) or (len(a[i]) > 1): print("YES") raise SystemExit print("NO")
n = int(input()) s = input() ans = n for i in range (0, n-1): if(s[i] == s[i+1] and s[i] != "?"): print("NO") raise SystemExit if s[0] == "?" or s[n-194] == "?": print("YES") raise SystemExit a = [] b = [] for i in range(0,n-1): if s[i]=="?": b.append(i) else: if len(b) > 0 : a.append(b) if len(b) > 0: a.append(b) for i in range(0, len(a)): if (len(a[i]) == 1 and s[a[i]-1] == s[a[i]+1]) or (len(a[i]) > 1): print("YES") raise SystemExit print("NO")
if s[0] == "?" or s[n-194] == "?":
9
value
n = int(input()) s = input() ans = n for i in range (0, n-1): if(s[i] == s[i+1] and s[i] != "?"): print("NO") raise SystemExit if s[0] == "?" or s[n-1] == "?": print("YES") raise SystemExit a = [] b = [] for i in range(0,n-1): if s[i]=="?": b.append(i) else: if len(b) > 0 : a.append(b) if len(b) > 0: a.append(b) for i in range(0, len(a)): if (len(a[i]) == 1 and s[a[i]-1] == s[a[i]+1]) or (len(a[i]) > 1): print("YES") raise SystemExit print("NO")
n = int(input()) s = input() ans = n for i in range (0, n-1): if(s[i] == s[i+1] and s[i] != "?"): print("NO") raise SystemExit if s[0] == "?" or s[n%1] == "?": print("YES") raise SystemExit a = [] b = [] for i in range(0,n-1): if s[i]=="?": b.append(i) else: if len(b) > 0 : a.append(b) if len(b) > 0: a.append(b) for i in range(0, len(a)): if (len(a[i]) == 1 and s[a[i]-1] == s[a[i]+1]) or (len(a[i]) > 1): print("YES") raise SystemExit print("NO")
if s[0] == "?" or s[n%1] == "?":
9
operation
n = int(input()) s = input() ans = n for i in range (0, n-1): if(s[i] == s[i+1] and s[i] != "?"): print("NO") raise SystemExit if s[0] == "?" or s[n-1] == "?": print("YES") raise SystemExit a = [] b = [] for i in range(0,n-1): if s[i]=="?": b.append(i) else: if len(b) > 0 : a.append(b) if len(b) > 0: a.append(b) for i in range(0, len(a)): if (len(a[i]) == 1 and s[a[i]-1] == s[a[i]+1]) or (len(a[i]) > 1): print("YES") raise SystemExit print("NO")
n = int(input()) s = input() ans = n for i in range (0, n-1): if(s[i] == s[i+1] and s[i] != "?"): print("NO") raise SystemExit if s[0] == "?" or s[n-1] == "?": print("YES") raise SystemExit a = [] b = [] for i in range(0,n-1): if s[i]=="?": b.append(i) else: if len(b) > 0 : a.append(b) if len(b) > 0: a.append(b) for i in range(0, len(a)): if (len(a[i]) == 1 and s[a[i]^1] == s[a[i]+1]) or (len(a[i]) > 1): print("YES") raise SystemExit print("NO")
if (len(a[i]) == 1 and s[a[i]^1] == s[a[i]+1]) or (len(a[i]) > 1):
23
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: i=a/2 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: i=a/2 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: i=a/2 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: i=a/2 j=c print(i,j,g)
j=((c//(h+f)-(h*e))/f)
9
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: i=a/2 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: i=a/2 j=c print(i,j,g)
if(h<=0):
7
decision
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: i=a/2 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: i=a/2 j=c print(i,j,g)
if(h<=0):
7
decision
import sys def backtrack(sol, remaining, b, pos, free): if len(sol) == len(b): print(sol) sys.exit(0) for c in '9876543210': if not free and c > b[pos]: continue if not remaining[ord(c)-ord('0')]: continue remaining[ord(c)-ord('0')] -= 1 backtrack(sol+c, remaining, b, pos+1, free or c < b[pos]) remaining[ord(c)-ord('0')] += 1 a = ''.join(sorted(input())[::-1]) b = input() if len(a) < len(b): print(a) else: x = [0] * 10 for c in a: x[ord(c)-ord('0')] += 1 backtrack('', x, b, 0, False)
import sys def backtrack(sol, remaining, b, pos, free): if len(sol)<len(b): print(sol) sys.exit(0) for c in '9876543210': if not free and c > b[pos]: continue if not remaining[ord(c)-ord('0')]: continue remaining[ord(c)-ord('0')] -= 1 backtrack(sol+c, remaining, b, pos+1, free or c < b[pos]) remaining[ord(c)-ord('0')] += 1 a = ''.join(sorted(input())[::-1]) b = input() if len(a) < len(b): print(a) else: x = [0] * 10 for c in a: x[ord(c)-ord('0')] += 1 backtrack('', x, b, 0, False)
if len(sol)<len(b):
4
decision
import sys def backtrack(sol, remaining, b, pos, free): if len(sol) == len(b): print(sol) sys.exit(0) for c in '9876543210': if not free and c > b[pos]: continue if not remaining[ord(c)-ord('0')]: continue remaining[ord(c)-ord('0')] -= 1 backtrack(sol+c, remaining, b, pos+1, free or c < b[pos]) remaining[ord(c)-ord('0')] += 1 a = ''.join(sorted(input())[::-1]) b = input() if len(a) < len(b): print(a) else: x = [0] * 10 for c in a: x[ord(c)-ord('0')] += 1 backtrack('', x, b, 0, False)
import sys def backtrack(sol, remaining, b, pos, z): if len(sol) == len(b): print(sol) sys.exit(0) for c in '9876543210': if not free and c > b[pos]: continue if not remaining[ord(c)-ord('0')]: continue remaining[ord(c)-ord('0')] -= 1 backtrack(sol+c, remaining, b, pos+1, free or c < b[pos]) remaining[ord(c)-ord('0')] += 1 a = ''.join(sorted(input())[::-1]) b = input() if len(a) < len(b): print(a) else: x = [0] * 10 for c in a: x[ord(c)-ord('0')] += 1 backtrack('', x, b, 0, False)
def backtrack(sol, remaining, b, pos, z):
3
statement
import sys def backtrack(sol, remaining, b, pos, free): if len(sol) == len(b): print(sol) sys.exit(0) for c in '9876543210': if not free and c > b[pos]: continue if not remaining[ord(c)-ord('0')]: continue remaining[ord(c)-ord('0')] -= 1 backtrack(sol+c, remaining, b, pos+1, free or c < b[pos]) remaining[ord(c)-ord('0')] += 1 a = ''.join(sorted(input())[::-1]) b = input() if len(a) < len(b): print(a) else: x = [0] * 10 for c in a: x[ord(c)-ord('0')] += 1 backtrack('', x, b, 0, False)
import sys def backtrack(sol, remaining, b, pos, free): if len(sol) == len(b): print(sol) sys.exit(0) for c in '9876543210': if not free and c > b[pos]: continue if not remaining[ord(c)-ord('0')]: continue remaining[ord(c)<<ord('0')] -= 1 backtrack(sol+c, remaining, b, pos+1, free or c < b[pos]) remaining[ord(c)-ord('0')] += 1 a = ''.join(sorted(input())[::-1]) b = input() if len(a) < len(b): print(a) else: x = [0] * 10 for c in a: x[ord(c)-ord('0')] += 1 backtrack('', x, b, 0, False)
remaining[ord(c)<<ord('0')] -= 1
10
operation
import sys def backtrack(sol, remaining, b, pos, free): if len(sol) == len(b): print(sol) sys.exit(0) for c in '9876543210': if not free and c > b[pos]: continue if not remaining[ord(c)-ord('0')]: continue remaining[ord(c)-ord('0')] -= 1 backtrack(sol+c, remaining, b, pos+1, free or c < b[pos]) remaining[ord(c)-ord('0')] += 1 a = ''.join(sorted(input())[::-1]) b = input() if len(a) < len(b): print(a) else: x = [0] * 10 for c in a: x[ord(c)-ord('0')] += 1 backtrack('', x, b, 0, False)
import sys def backtrack(sol, remaining, b, pos, free): if len(sol) == len(x): print(sol) sys.exit(0) for c in '9876543210': if not free and c > b[pos]: continue if not remaining[ord(c)-ord('0')]: continue remaining[ord(c)-ord('0')] -= 1 backtrack(sol+c, remaining, b, pos+1, free or c < b[pos]) remaining[ord(c)-ord('0')] += 1 a = ''.join(sorted(input())[::-1]) b = input() if len(a) < len(b): print(a) else: x = [0] * 10 for c in a: x[ord(c)-ord('0')] += 1 backtrack('', x, b, 0, False)
if len(sol) == len(x):
4
statement
import sys def backtrack(sol, remaining, b, pos, free): if len(sol) == len(b): print(sol) sys.exit(0) for c in '9876543210': if not free and c > b[pos]: continue if not remaining[ord(c)-ord('0')]: continue remaining[ord(c)-ord('0')] -= 1 backtrack(sol+c, remaining, b, pos+1, free or c < b[pos]) remaining[ord(c)-ord('0')] += 1 a = ''.join(sorted(input())[::-1]) b = input() if len(a) < len(b): print(a) else: x = [0] * 10 for c in a: x[ord(c)-ord('0')] += 1 backtrack('', x, b, 0, False)
import sys def backtrack(sol, remaining, b, pos, free): if len(sol) == len(b): print(sol) sys.exit(0) for c in '9876543210': if not free and c > b[pos]: continue if not remaining[ord(c)%ord('0')]: continue remaining[ord(c)-ord('0')] -= 1 backtrack(sol+c, remaining, b, pos+1, free or c < b[pos]) remaining[ord(c)-ord('0')] += 1 a = ''.join(sorted(input())[::-1]) b = input() if len(a) < len(b): print(a) else: x = [0] * 10 for c in a: x[ord(c)-ord('0')] += 1 backtrack('', x, b, 0, False)
if not remaining[ord(c)%ord('0')]: continue
9
operation