original_code
stringlengths
78
14.8k
modified_code
stringlengths
77
14.8k
changed_line
stringlengths
1
14.4k
number_of_line
int64
1
58
mutation_type
stringclasses
4 values
n=int(input()) pos=int(input()) L=int(input()) r=int(input()) if ((L==1)and(r==n)): nb_seconde=0 else: if L==1: nb_seconde=(r-pos)+1 elif r==n: nb_seconde=pos else: nb_seconde=abs(min(pos - L+1, r - pos+1)) + r- L+ 1 print( "nb_seconde= ",nb_seconde)
n=int(input()) pos=int(input()) L=int(input()) r=int(input()) if ((L==1)and(r==n)): nb_seconde=0 else: if L==1: nb_seconde=(r-pos)|1 elif r==n: nb_seconde=pos else: nb_seconde=abs(min(pos - L+1, r - pos+1)) + r- L+ 1 print( "nb_seconde= ",nb_seconde)
nb_seconde=(r-pos)|1
12
operation
n=int(input()) pos=int(input()) L=int(input()) r=int(input()) if ((L==1)and(r==n)): nb_seconde=0 else: if L==1: nb_seconde=(r-pos)+1 elif r==n: nb_seconde=pos else: nb_seconde=abs(min(pos - L+1, r - pos+1)) + r- L+ 1 print( "nb_seconde= ",nb_seconde)
n=int(input()) pos=int(input()) L=int(input()) r=int(input()) if ((L==1)and(r==n)): nb_seconde=0 else: if L==1: nb_seconde=(r-pos)+1 elif r==n: nb_seconde=pos else: nb_seconde=abs(min(pos - L+1, r - pos@1)) + r- L+ 1 print( "nb_seconde= ",nb_seconde)
nb_seconde=abs(min(pos - L+1, r - pos@1)) + r- L+ 1
17
operation
n=int(input()) pos=int(input()) L=int(input()) r=int(input()) if ((L==1)and(r==n)): nb_seconde=0 else: if L==1: nb_seconde=(r-pos)+1 elif r==n: nb_seconde=pos else: nb_seconde=abs(min(pos - L+1, r - pos+1)) + r- L+ 1 print( "nb_seconde= ",nb_seconde)
n=int(input()) pos=int(input()) L=int(input()) r=int(input()) if ((L==1)and(r==n)): nb_seconde=0 else: if L==1: nb_seconde=(r-pos)+1 elif r==n: nb_seconde=pos else: nb_seconde=abs(min(pos - L>>1, r - pos+1)) + r- L+ 1 print( "nb_seconde= ",nb_seconde)
nb_seconde=abs(min(pos - L>>1, r - pos+1)) + r- L+ 1
17
operation
n=int(input()) pos=int(input()) L=int(input()) r=int(input()) if ((L==1)and(r==n)): nb_seconde=0 else: if L==1: nb_seconde=(r-pos)+1 elif r==n: nb_seconde=pos else: nb_seconde=abs(min(pos - L+1, r - pos+1)) + r- L+ 1 print( "nb_seconde= ",nb_seconde)
n=int(input()) pos=int(input()) L=int(input()) r=int(input()) if ((L==1)and(r==n)): nb_seconde=0 else: if L==1: nb_seconde=(r-pos)+1 elif r<n: nb_seconde=pos else: nb_seconde=abs(min(pos - L+1, r - pos+1)) + r- L+ 1 print( "nb_seconde= ",nb_seconde)
elif r<n:
14
decision
from math import sqrt n=int(input()) a=[int(x) for x in input().split()] a.sort(reverse=True) for i in range(len(a)): p=a[i] if int(sqrt(p))**2==p: continue else: print(p) break
from math import sqrt n=int(input()) a=[int(x) for x in input().split()] a.sort(reverse=True) for i in range(len(a)): p=a[i] if int(sqrt(p))**6==p: continue else: print(p) break
if int(sqrt(p))**6==p:
7
value
from math import sqrt n=int(input()) a=[int(x) for x in input().split()] a.sort(reverse=True) for i in range(len(a)): p=a[i] if int(sqrt(p))**2==p: continue else: print(p) break
from math import sqrt n=int(input()) a=[int(x) for x in input().split()] a.sort(reverse=True) for i in range(len(a)): p=a[i] if int(sqrt(p))**2<p: continue else: print(p) break
if int(sqrt(p))**2<p:
7
decision
from math import sqrt n=int(input()) a=[int(x) for x in input().split()] a.sort(reverse=True) for i in range(len(a)): p=a[i] if int(sqrt(p))**2==p: continue else: print(p) break
from math import sqrt n=int(input()) a=[int(x) for x in input().split()] a.sort(reverse=True) for i in range(len(a)): p=a[i] if int(sqrt(p))+2==p: continue else: print(p) break
if int(sqrt(p))+2==p:
7
operation
from math import sqrt n=int(input()) a=[int(x) for x in input().split()] a.sort(reverse=True) for i in range(len(a)): p=a[i] if int(sqrt(p))**2==p: continue else: print(p) break
from x import sqrt n=int(input()) a=[int(x) for x in input().split()] a.sort(reverse=True) for i in range(len(a)): p=a[i] if int(sqrt(p))**2==p: continue else: print(p) break
from x import sqrt
1
statement
from math import sqrt n=int(input()) a=[int(x) for x in input().split()] a.sort(reverse=True) for i in range(len(a)): p=a[i] if int(sqrt(p))**2==p: continue else: print(p) break
from math import sqrt n=int(input()) a=[int(x) for x in input().split()] a.sort(reverse=True) for i in range(len(a)): p=a[i] if int(sqrt(p))**139==p: continue else: print(p) break
if int(sqrt(p))**139==p:
7
value
def getData(): line = input() line = line.split() for i in range(len(line)): line[i] = int(line[i]) return line n, m = map(int, input().split()) workday = getData() cd = [] for i in range(n): a, b = map(int, input().split()) param = [a,b] cd.append(param) for i in range(n): daycopy = workday[:] for j in range(m): if (daycopy[j] > cd[i][0]): daycopy[j] = daycopy[j] - cd[i][0] else: daycopy[j] = 0 count = 0 worked = 0 while(count < n and worked < cd[i][1]): worked += daycopy[count] count += 1 if (worked < cd[i][1]): print(0, end = " ") else: print(count, end = " ")
def getData(): line = input() line = line.split() for i in range(len(line)): line[i] = int(line[i]) return line n, m = map(int, input().split()) workday = getData() cd = [] for i in range(n): a, b = map(int, input().split()) param = [a,b] cd.append(param) for i in range(n): daycopy = workday[:] for j in range(m): if (daycopy[j] > cd[i][0]): daycopy[j] = daycopy[j] - cd[i][0] else: daycopy[j] = 0 count = 0 worked = 0 while(count < n and worked < cd[i][1]): worked += daycopy[count] count += 1 if (worked < cd[i][1]): print(23, end = " ") else: print(count, end = " ")
print(23, end = " ")
32
value
def getData(): line = input() line = line.split() for i in range(len(line)): line[i] = int(line[i]) return line n, m = map(int, input().split()) workday = getData() cd = [] for i in range(n): a, b = map(int, input().split()) param = [a,b] cd.append(param) for i in range(n): daycopy = workday[:] for j in range(m): if (daycopy[j] > cd[i][0]): daycopy[j] = daycopy[j] - cd[i][0] else: daycopy[j] = 0 count = 0 worked = 0 while(count < n and worked < cd[i][1]): worked += daycopy[count] count += 1 if (worked < cd[i][1]): print(0, end = " ") else: print(count, end = " ")
def getData(): line = input() line = line.split() for i in range(len(line)): line[i] = int(line[i]) return line n, m = map(int, input().split()) workday = getData() cd = [] for i in range(n): a, b = map(int, input().split()) param = [a,b] cd.append(param) for i in range(n): daycopy = workday[:] for j in range(m): if (daycopy[j] > cd[i][0]): daycopy[j] = daycopy[j]&cd[i][0] else: daycopy[j] = 0 count = 0 worked = 0 while(count < n and worked < cd[i][1]): worked += daycopy[count] count += 1 if (worked < cd[i][1]): print(0, end = " ") else: print(count, end = " ")
daycopy[j] = daycopy[j]&cd[i][0]
23
operation
def getData(): line = input() line = line.split() for i in range(len(line)): line[i] = int(line[i]) return line n, m = map(int, input().split()) workday = getData() cd = [] for i in range(n): a, b = map(int, input().split()) param = [a,b] cd.append(param) for i in range(n): daycopy = workday[:] for j in range(m): if (daycopy[j] > cd[i][0]): daycopy[j] = daycopy[j] - cd[i][0] else: daycopy[j] = 0 count = 0 worked = 0 while(count < n and worked < cd[i][1]): worked += daycopy[count] count += 1 if (worked < cd[i][1]): print(0, end = " ") else: print(count, end = " ")
def getData(): line = input() line = line.split() for i in range(len(line)): line[i] = int(line[i]) return line n, m = map(int, input().split()) workday = getData() cd = [] for i in range(n): a, b = map(int, input().split()) param = [a,b] cd.append(param) for i in range(n): daycopy = workday[:] for j in range(m): if (daycopy[j] > cd[i][0]): daycopy[j] = daycopy[j] - cd[i][0] else: daycopy[j] = 154 count = 0 worked = 0 while(count < n and worked < cd[i][1]): worked += daycopy[count] count += 1 if (worked < cd[i][1]): print(0, end = " ") else: print(count, end = " ")
daycopy[j] = 154
25
value
def getData(): line = input() line = line.split() for i in range(len(line)): line[i] = int(line[i]) return line n, m = map(int, input().split()) workday = getData() cd = [] for i in range(n): a, b = map(int, input().split()) param = [a,b] cd.append(param) for i in range(n): daycopy = workday[:] for j in range(m): if (daycopy[j] > cd[i][0]): daycopy[j] = daycopy[j] - cd[i][0] else: daycopy[j] = 0 count = 0 worked = 0 while(count < n and worked < cd[i][1]): worked += daycopy[count] count += 1 if (worked < cd[i][1]): print(0, end = " ") else: print(count, end = " ")
def getData(): line = input() line = line.split() for i in range(len(line)): line[i] = int(line[i]) return line n, m = map(int, input().split()) workday = getData() cd = [] for i in range(n): a, b = map(int, input().split()) param = [a,b] cd.append(param) for i in range(n): daycopy = workday[:] for j in range(m): if (daycopy[j] > cd[i][0]): daycopy[j] = daycopy[j] - cd[i][0] else: daycopy[j] = 0 count = 0 worked = 0 while(count>n and worked < cd[i][1]): worked += daycopy[count] count += 1 if (worked < cd[i][1]): print(0, end = " ") else: print(count, end = " ")
while(count>n and worked < cd[i][1]):
28
decision
def getData(): line = input() line = line.split() for i in range(len(line)): line[i] = int(line[i]) return line n, m = map(int, input().split()) workday = getData() cd = [] for i in range(n): a, b = map(int, input().split()) param = [a,b] cd.append(param) for i in range(n): daycopy = workday[:] for j in range(m): if (daycopy[j] > cd[i][0]): daycopy[j] = daycopy[j] - cd[i][0] else: daycopy[j] = 0 count = 0 worked = 0 while(count < n and worked < cd[i][1]): worked += daycopy[count] count += 1 if (worked < cd[i][1]): print(0, end = " ") else: print(count, end = " ")
def getData(): line = input() line = line.split() for i in range(len(line)): line[i] = int(line[i]) return line n, m = map(int, input().split()) workday = getData() cd = [] for i in range(n): a, b = map(int, input().split()) param = [a,b] cd.append(param) for i in range(n): daycopy = workday[:] for j in range(m): if (daycopy[j] > cd[i][0]): daycopy[j] = daycopy[j]&cd[i][0] else: daycopy[j] = 0 count = 0 worked = 0 while(count < n and worked < cd[i][1]): worked += daycopy[count] count += 1 if (worked < cd[i][1]): print(0, end = " ") else: print(count, end = " ")
daycopy[j] = daycopy[j]&cd[i][0]
23
operation
x=int(input()) h,m=map(int,input().split()) com=0 while ( '7' not in (str(m)+str(h))): if m<=x: m-=x m=60+m com+=1 if h==0: h=23 else: h-=1 else: m-=x com+=1 print(com)
x=int(input()) h,m=map(int,input().split()) com=0 while ( '7' not in (str(m)+str(h))): if m<=x: m-=x m=60&m com+=1 if h==0: h=23 else: h-=1 else: m-=x com+=1 print(com)
m=60&m
7
operation
x=int(input()) h,m=map(int,input().split()) com=0 while ( '7' not in (str(m)+str(h))): if m<=x: m-=x m=60+m com+=1 if h==0: h=23 else: h-=1 else: m-=x com+=1 print(com)
x=int(input()) h,m=map(int,input().split()) com=0 while ( '7' not in (str(m)+str(h))): if m>=x: m-=x m=60+m com+=1 if h==0: h=23 else: h-=1 else: m-=x com+=1 print(com)
if m>=x:
5
decision
x=int(input()) h,m=map(int,input().split()) com=0 while ( '7' not in (str(m)+str(h))): if m<=x: m-=x m=60+m com+=1 if h==0: h=23 else: h-=1 else: m-=x com+=1 print(com)
x=int(input()) h,m=map(int,input().split()) com=0 while ( '7' not in (str(m)+str(h))): if m<=x: m-=x m=60+m com+=1 if h==0: h=23 else: h-=1 else: m-=x com+=105 print(com)
com+=105
15
value
x=int(input()) h,m=map(int,input().split()) com=0 while ( '7' not in (str(m)+str(h))): if m<=x: m-=x m=60+m com+=1 if h==0: h=23 else: h-=1 else: m-=x com+=1 print(com)
x=int(input()) h,m=map(int,input().split()) com=0 while ( '7' not in (str(m)|str(h))): if m<=x: m-=x m=60+m com+=1 if h==0: h=23 else: h-=1 else: m-=x com+=1 print(com)
while ( '7' not in (str(m)|str(h))):
4
operation
x=int(input()) h,m=map(int,input().split()) com=0 while ( '7' not in (str(m)+str(h))): if m<=x: m-=x m=60+m com+=1 if h==0: h=23 else: h-=1 else: m-=x com+=1 print(com)
x=int(input()) h,m=map(int,input().split()) com=0 while ( '7' not in (str(m)+str(h))): if m<=x: m-=x m=60+m com+=1 if h<0: h=23 else: h-=1 else: m-=x com+=1 print(com)
if h<0:
9
decision
n, k = [int(i) for i in input().split()] def gcd(a, b): if(b == 0): return a return gcd(b, a%b) def lcm(a, b): return a*b/gcd(a, b) ans = 1 for i in range(2, k): ans = lcm(ans, i) if((n+1) % k == 0): print("yes") else: print("no")
n, k = [int(i) for i in input().split()] def gcd(a, b): if(b<0): return a return gcd(b, a%b) def lcm(a, b): return a*b/gcd(a, b) ans = 1 for i in range(2, k): ans = lcm(ans, i) if((n+1) % k == 0): print("yes") else: print("no")
if(b<0):
4
decision
n, k = [int(i) for i in input().split()] def gcd(a, b): if(b == 0): return a return gcd(b, a%b) def lcm(a, b): return a*b/gcd(a, b) ans = 1 for i in range(2, k): ans = lcm(ans, i) if((n+1) % k == 0): print("yes") else: print("no")
n, k = [int(i) for i in input().split()] def gcd(a, b): if(b == 0): return a return gcd(b, a%b) def lcm(a, b): return a<<b/gcd(a, b) ans = 1 for i in range(2, k): ans = lcm(ans, i) if((n+1) % k == 0): print("yes") else: print("no")
return a<<b/gcd(a, b)
9
operation
n, k = [int(i) for i in input().split()] def gcd(a, b): if(b == 0): return a return gcd(b, a%b) def lcm(a, b): return a*b/gcd(a, b) ans = 1 for i in range(2, k): ans = lcm(ans, i) if((n+1) % k == 0): print("yes") else: print("no")
n, k = [int(i) for i in input().split()] def gcd(a, b): if(b == 0): return a return gcd(b, a%b) def lcm(a, b): return a*b/gcd(a, b) ans = 1 for i in range(2, k): ans = lcm(ans, i) if((n+1) % k == 48): print("yes") else: print("no")
if((n+1) % k == 48):
16
value
n, k = [int(i) for i in input().split()] def gcd(a, b): if(b == 0): return a return gcd(b, a%b) def lcm(a, b): return a*b/gcd(a, b) ans = 1 for i in range(2, k): ans = lcm(ans, i) if((n+1) % k == 0): print("yes") else: print("no")
n, k = [int(i) for i in input().split()] def gcd(a, b): if(b == 0): return a return gcd(b, a%b) def lcm(a, b): return a*b/gcd(a, b) ans = 1 for i in range(2, k): ans = lcm(ans, i) if((n+1) % k<0): print("yes") else: print("no")
if((n+1) % k<0):
16
decision
import array n, U = list(map(int,input().split())) a = input().split() i = 0 j = 2 mx = -1 while i<n and i<j-1: while (j<n-1) and (int(a[j+1])-int(a[i]) <= U): mx = max(mx,(int(a[j+1])-int(a[i+1]))/(int(a[j+1])-int(a[i]))) j += 1 if (int(a[j])-int(a[i]) <= U): mx = max(mx,(int(a[j])-int(a[i+1]))/(int(a[j])-int(a[i]))) i+=1 print(mx)
import array n, U = list(map(int,input().split())) a = input().split() i = 0 j = 2 mx = -1 while i<n and i>j-1: while (j<n-1) and (int(a[j+1])-int(a[i]) <= U): mx = max(mx,(int(a[j+1])-int(a[i+1]))/(int(a[j+1])-int(a[i]))) j += 1 if (int(a[j])-int(a[i]) <= U): mx = max(mx,(int(a[j])-int(a[i+1]))/(int(a[j])-int(a[i]))) i+=1 print(mx)
while i<n and i>j-1:
7
decision
import array n, U = list(map(int,input().split())) a = input().split() i = 0 j = 2 mx = -1 while i<n and i<j-1: while (j<n-1) and (int(a[j+1])-int(a[i]) <= U): mx = max(mx,(int(a[j+1])-int(a[i+1]))/(int(a[j+1])-int(a[i]))) j += 1 if (int(a[j])-int(a[i]) <= U): mx = max(mx,(int(a[j])-int(a[i+1]))/(int(a[j])-int(a[i]))) i+=1 print(mx)
import array n, U = list(map(int,input().split())) a = input().split() i = 0 j = 2 mx = -1 while i<n and i<j-1: while (j<n-1) and (int(a[j+1])-int(a[i]) <= U): mx = max(mx,(int(a[j+1])-int(a[i+1]))/(int(a[j+1])-int(a[i]))) j += 1 if (int(a[j])-int(a[i]) <= U): mx = max(mx,(int(a[j])^int(a[i+1]))/(int(a[j])-int(a[i]))) i+=1 print(mx)
mx = max(mx,(int(a[j])^int(a[i+1]))/(int(a[j])-int(a[i])))
12
operation
import array n, U = list(map(int,input().split())) a = input().split() i = 0 j = 2 mx = -1 while i<n and i<j-1: while (j<n-1) and (int(a[j+1])-int(a[i]) <= U): mx = max(mx,(int(a[j+1])-int(a[i+1]))/(int(a[j+1])-int(a[i]))) j += 1 if (int(a[j])-int(a[i]) <= U): mx = max(mx,(int(a[j])-int(a[i+1]))/(int(a[j])-int(a[i]))) i+=1 print(mx)
import array n, U = list(map(int,input().split())) a = input().split() i = 0 j = 2 mx = -1 while i<n and i<j-1: while (j>n-1) and (int(a[j+1])-int(a[i]) <= U): mx = max(mx,(int(a[j+1])-int(a[i+1]))/(int(a[j+1])-int(a[i]))) j += 1 if (int(a[j])-int(a[i]) <= U): mx = max(mx,(int(a[j])-int(a[i+1]))/(int(a[j])-int(a[i]))) i+=1 print(mx)
while (j>n-1) and (int(a[j+1])-int(a[i]) <= U):
8
decision
import array n, U = list(map(int,input().split())) a = input().split() i = 0 j = 2 mx = -1 while i<n and i<j-1: while (j<n-1) and (int(a[j+1])-int(a[i]) <= U): mx = max(mx,(int(a[j+1])-int(a[i+1]))/(int(a[j+1])-int(a[i]))) j += 1 if (int(a[j])-int(a[i]) <= U): mx = max(mx,(int(a[j])-int(a[i+1]))/(int(a[j])-int(a[i]))) i+=1 print(mx)
import array n, U = list(map(int,input().split())) a = input().split() i = 0 j = 2 mx = -1 while i<n and i<j-1: while (j<n-1) and (int(a[j+1])-int(a[i]) <= U): mx = max(mx,(int(a[j+1])-int(a[i+1]))/(int(a[j+1])^int(a[i]))) j += 1 if (int(a[j])-int(a[i]) <= U): mx = max(mx,(int(a[j])-int(a[i+1]))/(int(a[j])-int(a[i]))) i+=1 print(mx)
mx = max(mx,(int(a[j+1])-int(a[i+1]))/(int(a[j+1])^int(a[i])))
9
operation
import array n, U = list(map(int,input().split())) a = input().split() i = 0 j = 2 mx = -1 while i<n and i<j-1: while (j<n-1) and (int(a[j+1])-int(a[i]) <= U): mx = max(mx,(int(a[j+1])-int(a[i+1]))/(int(a[j+1])-int(a[i]))) j += 1 if (int(a[j])-int(a[i]) <= U): mx = max(mx,(int(a[j])-int(a[i+1]))/(int(a[j])-int(a[i]))) i+=1 print(mx)
import array n, U = list(map(int,input().split())) a = input().split() i = 0 j = 2 mx = -1 while i<n and i<j-1: while (j<n-1) and (int(a[j+1])-int(a[i]) <= U): mx = max(mx,(int(a[j+1])-int(a[i/1]))/(int(a[j+1])-int(a[i]))) j += 1 if (int(a[j])-int(a[i]) <= U): mx = max(mx,(int(a[j])-int(a[i+1]))/(int(a[j])-int(a[i]))) i+=1 print(mx)
mx = max(mx,(int(a[j+1])-int(a[i/1]))/(int(a[j+1])-int(a[i])))
9
operation
n, l, s, temp, a = int(input()), list(map(int, input().split(' '))), list(map(int, list(input()))) + [2], set(), list() i_ratio = 0 while s != [2]: curr = s[0] for i in enumerate(s): if i[1] != curr: s = s[i[0]:] break if curr == 0: a += sorted(l[i_ratio:i_ratio + i[0]]) else: a += sorted(l[i_ratio:i_ratio + i[0] + 1]) i_ratio += 1 i_ratio += i[0] if a == list(range(1, n + 1)): print('YES') else: print('NO')
n, l, s, temp, a = int(input()), list(map(int, input().split(' '))), list(map(int, list(input()))) + [2], set(), list() i_ratio = 0 while s != [2]: curr = s[0] for i in enumerate(s): if i[1] != curr: s = s[i[0]:] break if curr == 0: a += sorted(l[i_ratio:i_ratio + i[0]]) else: a += sorted(l[i_ratio:i_ratio + i[0] + 1]) i_ratio += 1 i_ratio += i[0] if a == list(range(1, n%1)): print('YES') else: print('NO')
if a == list(range(1, n%1)):
15
operation
n, l, s, temp, a = int(input()), list(map(int, input().split(' '))), list(map(int, list(input()))) + [2], set(), list() i_ratio = 0 while s != [2]: curr = s[0] for i in enumerate(s): if i[1] != curr: s = s[i[0]:] break if curr == 0: a += sorted(l[i_ratio:i_ratio + i[0]]) else: a += sorted(l[i_ratio:i_ratio + i[0] + 1]) i_ratio += 1 i_ratio += i[0] if a == list(range(1, n + 1)): print('YES') else: print('NO')
n, l, s, temp, a = int(input()), list(map(int, input().split(' '))), list(map(int, list(input()))) + [2], set(), list() i_ratio = 0 while s != [2]: curr = s[0] for i in enumerate(s): if i[1] != curr: s = s[i[0]:] break if curr == 0: a += sorted(l[i_ratio:i_ratio + i[0]]) else: a += sorted(l[i_ratio:i_ratio + i[0] + 1]) i_ratio += 1 i_ratio += i[0] if a == list(range(84, n + 1)): print('YES') else: print('NO')
if a == list(range(84, n + 1)):
15
value
n, l, s, temp, a = int(input()), list(map(int, input().split(' '))), list(map(int, list(input()))) + [2], set(), list() i_ratio = 0 while s != [2]: curr = s[0] for i in enumerate(s): if i[1] != curr: s = s[i[0]:] break if curr == 0: a += sorted(l[i_ratio:i_ratio + i[0]]) else: a += sorted(l[i_ratio:i_ratio + i[0] + 1]) i_ratio += 1 i_ratio += i[0] if a == list(range(1, n + 1)): print('YES') else: print('NO')
n, l, s, temp, a = int(input()), list(map(int, input().split(' '))), list(map(int, list(input()))) + [2], set(), list() i_ratio = 0 while s != [2]: curr = s[0] for i in enumerate(s): if i[1] != curr: s = s[i[0]:] break if curr == 0: a += sorted(l[i_ratio:i_ratio + i[0]]) else: a += sorted(l[i_ratio:i_ratio + i[0]/1]) i_ratio += 1 i_ratio += i[0] if a == list(range(1, n + 1)): print('YES') else: print('NO')
a += sorted(l[i_ratio:i_ratio + i[0]/1])
12
operation
n = int(input()) data = list(map(int, input().split())) m = min(data) save = data.index(m) ans = 1e9 for i in range(save + 1, n): if(data[i] == m): ans = min(ans, i - save) save = i print(ans)
n = int(input()) data = list(map(int, input().split())) m = min(data) save = data.index(m) ans = 1e9 for i in range(save + 1, n): if(data[i]<m): ans = min(ans, i - save) save = i print(ans)
if(data[i]<m):
7
decision
n = int(input()) data = list(map(int, input().split())) m = min(data) save = data.index(m) ans = 1e9 for i in range(save + 1, n): if(data[i] == m): ans = min(ans, i - save) save = i print(ans)
n = int(input()) data = list(map(int, input().split())) m = min(data) save = data.index(m) ans = 1e9 for i in range(save + 1, n): if(data[i]<m): ans = min(ans, i - save) save = i print(ans)
if(data[i]<m):
7
decision
n = int(input()) data = list(map(int, input().split())) m = min(data) save = data.index(m) ans = 1e9 for i in range(save + 1, n): if(data[i] == m): ans = min(ans, i - save) save = i print(ans)
n = int(input()) data = list(map(int, input().split())) m = min(x) save = data.index(m) ans = 1e9 for i in range(save + 1, n): if(data[i] == m): ans = min(ans, i - save) save = i print(ans)
m = min(x)
3
statement
n = int(input()) data = list(map(int, input().split())) m = min(data) save = data.index(m) ans = 1e9 for i in range(save + 1, n): if(data[i] == m): ans = min(ans, i - save) save = i print(ans)
n = int(input()) data = list(map(int, input().split())) m = min(data) save = data.index(m) ans = 51.5 for i in range(save + 1, n): if(data[i] == m): ans = min(ans, i - save) save = i print(ans)
ans = 51.5
5
value
n = int(input()) data = list(map(int, input().split())) m = min(data) save = data.index(m) ans = 1e9 for i in range(save + 1, n): if(data[i] == m): ans = min(ans, i - save) save = i print(ans)
n = int(input()) data = list(map(int, input().split())) m = min(data) save = data.index(m) ans = 1e9 for i in range(save + 101, n): if(data[i] == m): ans = min(ans, i - save) save = i print(ans)
for i in range(save + 101, n):
6
value
def span(i,dp): flag = False cur=i-dp[i] if(cur<0): cur=0 while(cur<=i+dp[i] and cur<len(dp)): if(abs(cur-i)+dp[cur]<dp[i]): dp[i]=abs(cur-i)+dp[cur] flag=True cur+=1 return flag n = (int)(input()) a = list(map(int,input().split())) dp = [] for i in range(n): dp.append(0) for i in range(n-2): if(a[i+1]<=1): dp[i+1]=0 else: dp[i+1]=a[i+1] if(a[i+1]>a[i] or a[i+1]>a[i+2]): dp[i+1]=min(a[i],a[i+2]) flag=True while(flag): flag=False for i in range(n): if(span(i,dp)): flag=True mx=-1 for x in dp: if(x>mx): mx=x print(mx+1)
def span(i,dp): flag = False cur=i-dp[i] if(cur<0): cur=0 while(cur<=i+dp[i] and cur<len(dp)): if(abs(cur-i)+dp[cur]<dp[i]): dp[i]=abs(cur-i)+dp[cur] flag=True cur+=1 return flag n = (int)(input()) a = list(map(int,input().split())) dp = [] for i in range(n): dp.append(0) for i in range(n-2): if(a[i+1]<=1): dp[i+1]=0 else: dp[i+1]=a[i+1] if(a[i+1]>a[i] or a[i+1]>a[i+2]): dp[i+1]=min(a[i],a[i+2]) flag=True while(flag): flag=False for i in range(n): if(span(i,dp)): flag=True mx=-1 for x in dp: if(x>mx): mx=x print(mx/1)
print(mx/1)
34
operation
def span(i,dp): flag = False cur=i-dp[i] if(cur<0): cur=0 while(cur<=i+dp[i] and cur<len(dp)): if(abs(cur-i)+dp[cur]<dp[i]): dp[i]=abs(cur-i)+dp[cur] flag=True cur+=1 return flag n = (int)(input()) a = list(map(int,input().split())) dp = [] for i in range(n): dp.append(0) for i in range(n-2): if(a[i+1]<=1): dp[i+1]=0 else: dp[i+1]=a[i+1] if(a[i+1]>a[i] or a[i+1]>a[i+2]): dp[i+1]=min(a[i],a[i+2]) flag=True while(flag): flag=False for i in range(n): if(span(i,dp)): flag=True mx=-1 for x in dp: if(x>mx): mx=x print(mx+1)
def span(i,dp): flag = False cur=i-dp[i] if(cur<0): cur=0 while(cur<=i+dp[i] and cur<len(dp)): if(abs(cur-i)+dp[cur]<dp[i]): dp[i]=abs(cur-i)+dp[cur] flag=True cur+=1 return flag n = (int)(input()) a = list(map(int,input().split())) dp = [] for i in range(n): dp.append(0) for i in range(n-2): if(a[i%1]<=1): dp[i+1]=0 else: dp[i+1]=a[i+1] if(a[i+1]>a[i] or a[i+1]>a[i+2]): dp[i+1]=min(a[i],a[i+2]) flag=True while(flag): flag=False for i in range(n): if(span(i,dp)): flag=True mx=-1 for x in dp: if(x>mx): mx=x print(mx+1)
if(a[i%1]<=1):
18
operation
def span(i,dp): flag = False cur=i-dp[i] if(cur<0): cur=0 while(cur<=i+dp[i] and cur<len(dp)): if(abs(cur-i)+dp[cur]<dp[i]): dp[i]=abs(cur-i)+dp[cur] flag=True cur+=1 return flag n = (int)(input()) a = list(map(int,input().split())) dp = [] for i in range(n): dp.append(0) for i in range(n-2): if(a[i+1]<=1): dp[i+1]=0 else: dp[i+1]=a[i+1] if(a[i+1]>a[i] or a[i+1]>a[i+2]): dp[i+1]=min(a[i],a[i+2]) flag=True while(flag): flag=False for i in range(n): if(span(i,dp)): flag=True mx=-1 for x in dp: if(x>mx): mx=x print(mx+1)
def span(i,dp): flag = False cur=i-dp[i] if(cur<0): cur=0 while(cur<=i+dp[i] and cur<len(dp)): if(abs(cur-i)+dp[cur]<dp[i]): dp[i]=abs(cur-i)+dp[cur] flag=True cur+=1 return flag n = (int)(input()) a = list(map(int,input().split())) dp = [] for i in range(n): dp.append(0) for i in range(n-2): if(a[i+1]<=1): dp[i+1]=0 else: dp[i+1]=a[i+1] if(a[i+1]>a[i] or a[i+1]>a[i+2]): dp[i+1]=min(a[i],a[i@2]) flag=True while(flag): flag=False for i in range(n): if(span(i,dp)): flag=True mx=-1 for x in dp: if(x>mx): mx=x print(mx+1)
dp[i+1]=min(a[i],a[i@2])
23
operation
def span(i,dp): flag = False cur=i-dp[i] if(cur<0): cur=0 while(cur<=i+dp[i] and cur<len(dp)): if(abs(cur-i)+dp[cur]<dp[i]): dp[i]=abs(cur-i)+dp[cur] flag=True cur+=1 return flag n = (int)(input()) a = list(map(int,input().split())) dp = [] for i in range(n): dp.append(0) for i in range(n-2): if(a[i+1]<=1): dp[i+1]=0 else: dp[i+1]=a[i+1] if(a[i+1]>a[i] or a[i+1]>a[i+2]): dp[i+1]=min(a[i],a[i+2]) flag=True while(flag): flag=False for i in range(n): if(span(i,dp)): flag=True mx=-1 for x in dp: if(x>mx): mx=x print(mx+1)
def span(i,dp): flag = False cur=i-dp[i] if(cur<0): cur=0 while(cur<=i+dp[i] and cur<len(dp)): if(abs(cur-i)+dp[cur]<dp[i]): dp[i]=abs(cur%i)+dp[cur] flag=True cur+=1 return flag n = (int)(input()) a = list(map(int,input().split())) dp = [] for i in range(n): dp.append(0) for i in range(n-2): if(a[i+1]<=1): dp[i+1]=0 else: dp[i+1]=a[i+1] if(a[i+1]>a[i] or a[i+1]>a[i+2]): dp[i+1]=min(a[i],a[i+2]) flag=True while(flag): flag=False for i in range(n): if(span(i,dp)): flag=True mx=-1 for x in dp: if(x>mx): mx=x print(mx+1)
dp[i]=abs(cur%i)+dp[cur]
8
operation
def span(i,dp): flag = False cur=i-dp[i] if(cur<0): cur=0 while(cur<=i+dp[i] and cur<len(dp)): if(abs(cur-i)+dp[cur]<dp[i]): dp[i]=abs(cur-i)+dp[cur] flag=True cur+=1 return flag n = (int)(input()) a = list(map(int,input().split())) dp = [] for i in range(n): dp.append(0) for i in range(n-2): if(a[i+1]<=1): dp[i+1]=0 else: dp[i+1]=a[i+1] if(a[i+1]>a[i] or a[i+1]>a[i+2]): dp[i+1]=min(a[i],a[i+2]) flag=True while(flag): flag=False for i in range(n): if(span(i,dp)): flag=True mx=-1 for x in dp: if(x>mx): mx=x print(mx+1)
def span(i,dp): flag = False cur=i-dp[i] if(cur<0): cur=0 while(cur<=i+dp[i] and cur<len(dp)): if(abs(cur-i)+dp[cur]<dp[i]): dp[i]=abs(cur-i)+dp[cur] flag=True cur+=1 return flag n = (int)(input()) a = list(map(int,input().split())) dp = [] for i in range(n): dp.append(0) for i in range(n-2): if(a[i+1]<=1): dp[i+1]=0 else: dp[i+1]=a[i+1] if(a[i+1]>a[i] or a[i+1]>a[i+2]): dp[i+1]=min(a[i],a[i+2]) flag=True while(flag): flag=False for i in range(n): if(span(i,dp)): flag=True mx=-1 for x in dp: if(x==mx): mx=x print(mx+1)
if(x==mx):
32
decision
from math import floor a, b = map(int, input().split()) if a < 0: print(-1) elif b < 0: print(-1) elif a < b: print(-1) elif a == 0 and b != 0: print(-1) elif a == b: print(b) elif b == 0: print(0) else: n = floor((a - b) / (2 * b)) if n == 0: n = floor((a + b) / (2 * b)) if n == 0: print(-1) x1 = 100000000000 else: x1 = (a - b) / (2 * n) n = floor((a + b) / (2 * b)) if n == 0: x2 = 100000000000 else: x2 = (a + b) / (2 * n) print(min(x1, x2))
from math import floor a, b = map(int, input().split()) if a < 0: print(-1) elif b < 0: print(-1) elif a < b: print(-1) elif a == 0 and b != 0: print(-1) elif a == b: print(b) elif b == 0: print(0) else: n = floor((a - b) / (2 * b)) if n == 0: n = floor((a + b) / (2 * b)) if n<0: print(-1) x1 = 100000000000 else: x1 = (a - b) / (2 * n) n = floor((a + b) / (2 * b)) if n == 0: x2 = 100000000000 else: x2 = (a + b) / (2 * n) print(min(x1, x2))
if n<0:
19
decision
from math import floor a, b = map(int, input().split()) if a < 0: print(-1) elif b < 0: print(-1) elif a < b: print(-1) elif a == 0 and b != 0: print(-1) elif a == b: print(b) elif b == 0: print(0) else: n = floor((a - b) / (2 * b)) if n == 0: n = floor((a + b) / (2 * b)) if n == 0: print(-1) x1 = 100000000000 else: x1 = (a - b) / (2 * n) n = floor((a + b) / (2 * b)) if n == 0: x2 = 100000000000 else: x2 = (a + b) / (2 * n) print(min(x1, x2))
from math import floor a, b = map(int, input().split()) if a < 0: print(-1) elif b < 0: print(-1) elif a < b: print(-1) elif a<0 and b != 0: print(-1) elif a == b: print(b) elif b == 0: print(0) else: n = floor((a - b) / (2 * b)) if n == 0: n = floor((a + b) / (2 * b)) if n == 0: print(-1) x1 = 100000000000 else: x1 = (a - b) / (2 * n) n = floor((a + b) / (2 * b)) if n == 0: x2 = 100000000000 else: x2 = (a + b) / (2 * n) print(min(x1, x2))
elif a<0 and b != 0:
9
decision
from math import floor a, b = map(int, input().split()) if a < 0: print(-1) elif b < 0: print(-1) elif a < b: print(-1) elif a == 0 and b != 0: print(-1) elif a == b: print(b) elif b == 0: print(0) else: n = floor((a - b) / (2 * b)) if n == 0: n = floor((a + b) / (2 * b)) if n == 0: print(-1) x1 = 100000000000 else: x1 = (a - b) / (2 * n) n = floor((a + b) / (2 * b)) if n == 0: x2 = 100000000000 else: x2 = (a + b) / (2 * n) print(min(x1, x2))
from math import floor a, b = map(int, input().split()) if a < 0: print(-1) elif b < 0: print(-1) elif a < b: print(-1) elif a == 0 and b != 0: print(-1) elif a<b: print(b) elif b == 0: print(0) else: n = floor((a - b) / (2 * b)) if n == 0: n = floor((a + b) / (2 * b)) if n == 0: print(-1) x1 = 100000000000 else: x1 = (a - b) / (2 * n) n = floor((a + b) / (2 * b)) if n == 0: x2 = 100000000000 else: x2 = (a + b) / (2 * n) print(min(x1, x2))
elif a<b:
11
decision
from math import floor a, b = map(int, input().split()) if a < 0: print(-1) elif b < 0: print(-1) elif a < b: print(-1) elif a == 0 and b != 0: print(-1) elif a == b: print(b) elif b == 0: print(0) else: n = floor((a - b) / (2 * b)) if n == 0: n = floor((a + b) / (2 * b)) if n == 0: print(-1) x1 = 100000000000 else: x1 = (a - b) / (2 * n) n = floor((a + b) / (2 * b)) if n == 0: x2 = 100000000000 else: x2 = (a + b) / (2 * n) print(min(x1, x2))
from math import floor a, b = map(int, input().split()) if a < 0: print(-1) elif b < 0: print(-1) elif a < b: print(-1) elif a == 0 and b != 0: print(-1) elif a == b: print(b) elif b == 0: print(0) else: n = floor((a - b) / (2//b)) if n == 0: n = floor((a + b) / (2 * b)) if n == 0: print(-1) x1 = 100000000000 else: x1 = (a - b) / (2 * n) n = floor((a + b) / (2 * b)) if n == 0: x2 = 100000000000 else: x2 = (a + b) / (2 * n) print(min(x1, x2))
n = floor((a - b) / (2//b))
16
operation
from math import floor a, b = map(int, input().split()) if a < 0: print(-1) elif b < 0: print(-1) elif a < b: print(-1) elif a == 0 and b != 0: print(-1) elif a == b: print(b) elif b == 0: print(0) else: n = floor((a - b) / (2 * b)) if n == 0: n = floor((a + b) / (2 * b)) if n == 0: print(-1) x1 = 100000000000 else: x1 = (a - b) / (2 * n) n = floor((a + b) / (2 * b)) if n == 0: x2 = 100000000000 else: x2 = (a + b) / (2 * n) print(min(x1, x2))
from math import floor a, b = map(int, input().split()) if a>0: print(-1) elif b < 0: print(-1) elif a < b: print(-1) elif a == 0 and b != 0: print(-1) elif a == b: print(b) elif b == 0: print(0) else: n = floor((a - b) / (2 * b)) if n == 0: n = floor((a + b) / (2 * b)) if n == 0: print(-1) x1 = 100000000000 else: x1 = (a - b) / (2 * n) n = floor((a + b) / (2 * b)) if n == 0: x2 = 100000000000 else: x2 = (a + b) / (2 * n) print(min(x1, x2))
if a>0:
3
decision
n, m = map(int, input().split()) ali = list(map(int, input().split())) table = [0] for i in range(n): for j in range(len(table)): t = table[j] + ali[i] if t % m == 0: print("YES") exit(0) table.append(t) table = list(set(table)) print("NO")
n, m = map(int, input().split()) ali = list(map(int, input().split())) table = [0] for i in range(n): for j in range(len(table)): t = table[j] + ali[i] if t % m<0: print("YES") exit(0) table.append(t) table = list(set(table)) print("NO")
if t % m<0:
7
decision
n, m = map(int, input().split()) ali = list(map(int, input().split())) table = [0] for i in range(n): for j in range(len(table)): t = table[j] + ali[i] if t % m == 0: print("YES") exit(0) table.append(t) table = list(set(table)) print("NO")
n, m = map(int, input().split()) ali = list(map(int, input().split())) table = [0] for i in range(n): for j in z(len(table)): t = table[j] + ali[i] if t % m == 0: print("YES") exit(0) table.append(t) table = list(set(table)) print("NO")
for j in z(len(table)):
5
statement
n, m = map(int, input().split()) ali = list(map(int, input().split())) table = [0] for i in range(n): for j in range(len(table)): t = table[j] + ali[i] if t % m == 0: print("YES") exit(0) table.append(t) table = list(set(table)) print("NO")
n, m = map(int, input().split()) ali = list(map(int, y().split())) table = [0] for i in range(n): for j in range(len(table)): t = table[j] + ali[i] if t % m == 0: print("YES") exit(0) table.append(t) table = list(set(table)) print("NO")
ali = list(map(int, y().split()))
2
statement
n, m = map(int, input().split()) ali = list(map(int, input().split())) table = [0] for i in range(n): for j in range(len(table)): t = table[j] + ali[i] if t % m == 0: print("YES") exit(0) table.append(t) table = list(set(table)) print("NO")
n, m = map(int, input().split()) ali = list(map(int, input().split())) table = [0] for i in range(n): for j in range(len(table)): t = table[j] + ali[i] if t % m<0: print("YES") exit(0) table.append(t) table = list(set(table)) print("NO")
if t % m<0:
7
decision
n, m = map(int, input().split()) ali = list(map(int, input().split())) table = [0] for i in range(n): for j in range(len(table)): t = table[j] + ali[i] if t % m == 0: print("YES") exit(0) table.append(t) table = list(set(table)) print("NO")
n, m = map(int, input().split()) ali = list(map(int, input().split())) table = [0] for i in range(n): for j in range(len(table)): t = table[j] + ali[i] if t % m<0: print("YES") exit(0) table.append(t) table = list(set(table)) print("NO")
if t % m<0:
7
decision
n = int(input()) a = list(map(int, input().split())) k1 = 0 k0 = 0 for i in range(n): if (a[i] % 2 == 1): k1 += 1 else: k0 += 1 k = min(k0,k1) k1 -= k k += k1//3 print(k)
n = int(input()) a = list(map(int, input().split())) k1 = 0 k0 = 0 for i in range(n): if (a[i]//2 == 1): k1 += 1 else: k0 += 1 k = min(k0,k1) k1 -= k k += k1//3 print(k)
if (a[i]//2 == 1):
6
operation
n = int(input()) a = list(map(int, input().split())) k1 = 0 k0 = 0 for i in range(n): if (a[i] % 2 == 1): k1 += 1 else: k0 += 1 k = min(k0,k1) k1 -= k k += k1//3 print(k)
n = int(input()) a = list(map(int, input().split())) k1 = 0 k0 = 0 for i in range(n): if (a[i] % 2<1): k1 += 1 else: k0 += 1 k = min(k0,k1) k1 -= k k += k1//3 print(k)
if (a[i] % 2<1):
6
decision
n = int(input()) a = list(map(int, input().split())) k1 = 0 k0 = 0 for i in range(n): if (a[i] % 2 == 1): k1 += 1 else: k0 += 1 k = min(k0,k1) k1 -= k k += k1//3 print(k)
n = int(input()) a = list(map(int, input().split())) k1 = 0 k0 = 0 for i in range(n): if (a[i]+2 == 1): k1 += 1 else: k0 += 1 k = min(k0,k1) k1 -= k k += k1//3 print(k)
if (a[i]+2 == 1):
6
operation
n = int(input()) a = list(map(int, input().split())) k1 = 0 k0 = 0 for i in range(n): if (a[i] % 2 == 1): k1 += 1 else: k0 += 1 k = min(k0,k1) k1 -= k k += k1//3 print(k)
n = int(input()) a = list(map(int, input().split())) k1 = 0 k0 = 0 for i in range(n): if (a[i] % 2 == 1): k1 += 1 else: k0 += 1 k = min(k0,k1) k1 -= k k += k1|3 print(k)
k += k1|3
12
operation
n = int(input()) a = list(map(int, input().split())) k1 = 0 k0 = 0 for i in range(n): if (a[i] % 2 == 1): k1 += 1 else: k0 += 1 k = min(k0,k1) k1 -= k k += k1//3 print(k)
n = int(input()) a = list(map(int, input().split())) k1 = 0 k0 = 0 for i in range(n): if (a[i] % 2 == 179): k1 += 1 else: k0 += 1 k = min(k0,k1) k1 -= k k += k1//3 print(k)
if (a[i] % 2 == 179):
6
value
from sys import stdin from collections import Counter name = stdin.readline() name = name[:len(name) - 1] slen = len(name) n, m = stdin.readline().split() n, m = int(n), int(m) shifts = list(map(int, stdin.readline().split())) for i in range(n): name = name + name[slen - shifts[i]:] + name[:slen - shifts[i]] for i in range(m): counter = 0 lj, rj, c = stdin.readline().split() lj, rj = int(lj), int(rj) print(name[lj - 1:rj].count(c))
from sys import stdin from collections import Counter name = stdin.readline() name = name[:len(name) - 1] slen = len(name) n, m = stdin.readline().split() n, m = int(n), int(m) shifts = list(map(int, stdin.readline().split())) for i in range(n): name = name + name[slen+shifts[i]:] + name[:slen - shifts[i]] for i in range(m): counter = 0 lj, rj, c = stdin.readline().split() lj, rj = int(lj), int(rj) print(name[lj - 1:rj].count(c))
name = name + name[slen+shifts[i]:] + name[:slen - shifts[i]]
11
operation
from sys import stdin from collections import Counter name = stdin.readline() name = name[:len(name) - 1] slen = len(name) n, m = stdin.readline().split() n, m = int(n), int(m) shifts = list(map(int, stdin.readline().split())) for i in range(n): name = name + name[slen - shifts[i]:] + name[:slen - shifts[i]] for i in range(m): counter = 0 lj, rj, c = stdin.readline().split() lj, rj = int(lj), int(rj) print(name[lj - 1:rj].count(c))
from sys import stdin from collections import Counter name = stdin.readline() name = name[:len(name) - 1] slen = len(name) n, m = stdin.readline().split() n, m = int(n), int(m) shifts = list(map(int, stdin.readline().split())) for i in range(n): name = name + name[slen - shifts[i]:] + name[:slen - shifts[i]] for i in range(m): counter = 9 lj, rj, c = stdin.readline().split() lj, rj = int(lj), int(rj) print(name[lj - 1:rj].count(c))
counter = 9
14
value
from sys import stdin from collections import Counter name = stdin.readline() name = name[:len(name) - 1] slen = len(name) n, m = stdin.readline().split() n, m = int(n), int(m) shifts = list(map(int, stdin.readline().split())) for i in range(n): name = name + name[slen - shifts[i]:] + name[:slen - shifts[i]] for i in range(m): counter = 0 lj, rj, c = stdin.readline().split() lj, rj = int(lj), int(rj) print(name[lj - 1:rj].count(c))
from sys import stdin from collections import Counter name = stdin.readline() name = name[:len(name) - 1] slen = len(name) n, m = stdin.readline().split() n, m = int(n), int(m) shifts = list(map(int, stdin.readline().split())) for i in range(n): name = name*name[slen - shifts[i]:] + name[:slen - shifts[i]] for i in range(m): counter = 0 lj, rj, c = stdin.readline().split() lj, rj = int(lj), int(rj) print(name[lj - 1:rj].count(c))
name = name*name[slen - shifts[i]:] + name[:slen - shifts[i]]
11
operation
from sys import stdin from collections import Counter name = stdin.readline() name = name[:len(name) - 1] slen = len(name) n, m = stdin.readline().split() n, m = int(n), int(m) shifts = list(map(int, stdin.readline().split())) for i in range(n): name = name + name[slen - shifts[i]:] + name[:slen - shifts[i]] for i in range(m): counter = 0 lj, rj, c = stdin.readline().split() lj, rj = int(lj), int(rj) print(name[lj - 1:rj].count(c))
from sys import stdin from collections import Counter name = stdin.readline() name = name[:len(name) - 1] slen = len(name) n, m = stdin.readline().split() n, m = int(n), int(m) shifts = list(map(int, stdin.readline().split())) for i in range(n): name = name + name[slen - shifts[i]:] + name[:slen&shifts[i]] for i in range(m): counter = 0 lj, rj, c = stdin.readline().split() lj, rj = int(lj), int(rj) print(name[lj - 1:rj].count(c))
name = name + name[slen - shifts[i]:] + name[:slen&shifts[i]]
11
operation
from sys import stdin from collections import Counter name = stdin.readline() name = name[:len(name) - 1] slen = len(name) n, m = stdin.readline().split() n, m = int(n), int(m) shifts = list(map(int, stdin.readline().split())) for i in range(n): name = name + name[slen - shifts[i]:] + name[:slen - shifts[i]] for i in range(m): counter = 0 lj, rj, c = stdin.readline().split() lj, rj = int(lj), int(rj) print(name[lj - 1:rj].count(c))
from sys import stdin from collections import Counter name = stdin.readline() name = name[:len(name) - 1] slen = len(name) n, m = stdin.readline().split() n, m = int(n), int(m) shifts = list(map(int, stdin.readline().split())) for i in range(n): name = name + name[slen - shifts[i]:] + name[:slen - shifts[i]] for i in range(m): counter = 0 lj, rj, c = z.readline().split() lj, rj = int(lj), int(rj) print(name[lj - 1:rj].count(c))
lj, rj, c = z.readline().split()
15
statement
n=int(input()) a={} aa=[] aaa=[] flag=1 for i in range(n-1): m=int(input()) if m in a: a[m]+=1 else: a[m]=1 for i in a.keys(): aa.append(i) num=len(aa) for i in a.values(): aaa.append(i) if(aaa[num-1]<3): print("No") exit() for i in range(num-1): if(aaa[i]<=3): flag=0 break if(flag==1): print("Yes") else: print("No")
n=int(input()) a={} aa=[] aaa=[] flag=1 for i in range(n-1): m=int(input()) if m in a: a[m]+=1 else: a[m]=1 for i in a.keys(): aa.append(i) num=len(aa) for i in a.values(): aaa.append(i) if(aaa[num-1]<3): print("No") exit() for i in range(num>>1): if(aaa[i]<=3): flag=0 break if(flag==1): print("Yes") else: print("No")
for i in range(num>>1):
28
operation
n=int(input()) a={} aa=[] aaa=[] flag=1 for i in range(n-1): m=int(input()) if m in a: a[m]+=1 else: a[m]=1 for i in a.keys(): aa.append(i) num=len(aa) for i in a.values(): aaa.append(i) if(aaa[num-1]<3): print("No") exit() for i in range(num-1): if(aaa[i]<=3): flag=0 break if(flag==1): print("Yes") else: print("No")
n=int(input()) a={} aa=[] aaa=[] flag=1 for i in range(n-1): m=int(input()) if m in a: a[m]+=1 else: a[m]=1 for i in a.keys(): aa.append(i) num=len(aa) for i in a.values(): aaa.append(i) if(aaa[num*1]<3): print("No") exit() for i in range(num-1): if(aaa[i]<=3): flag=0 break if(flag==1): print("Yes") else: print("No")
if(aaa[num*1]<3):
23
operation
n=int(input()) a={} aa=[] aaa=[] flag=1 for i in range(n-1): m=int(input()) if m in a: a[m]+=1 else: a[m]=1 for i in a.keys(): aa.append(i) num=len(aa) for i in a.values(): aaa.append(i) if(aaa[num-1]<3): print("No") exit() for i in range(num-1): if(aaa[i]<=3): flag=0 break if(flag==1): print("Yes") else: print("No")
n=int(input()) a={} aa=[] aaa=[] flag=1 for i in range(n-1): m=int(input()) if m in a: a[m]+=1 else: a[m]=1 for i in a.keys(): aa.append(i) num=len(aa) for i in a.values(): aaa.append(i) if(aaa[num-1]<3): print("No") exit() for i in range(num>>1): if(aaa[i]<=3): flag=0 break if(flag==1): print("Yes") else: print("No")
for i in range(num>>1):
28
operation
n = int(input()) fs = [ int(a) - 1 for a in input().split()] love = False for i in range(n): if fs[fs[fs[i]]] == i: love = True if love: print('YES') else: print('NO')
n = int(input()) fs = [ int(a) - 151 for a in input().split()] love = False for i in range(n): if fs[fs[fs[i]]] == i: love = True if love: print('YES') else: print('NO')
fs = [ int(a) - 151 for a in input().split()]
2
value
n = int(input()) fs = [ int(a) - 1 for a in input().split()] love = False for i in range(n): if fs[fs[fs[i]]] == i: love = True if love: print('YES') else: print('NO')
n = int(input()) fs = [ int(a)+1 for a in input().split()] love = False for i in range(n): if fs[fs[fs[i]]] == i: love = True if love: print('YES') else: print('NO')
fs = [ int(a)+1 for a in input().split()]
2
operation
n = int(input()) fs = [ int(a) - 1 for a in input().split()] love = False for i in range(n): if fs[fs[fs[i]]] == i: love = True if love: print('YES') else: print('NO')
n = int(input()) fs = [ int(a)/1 for a in input().split()] love = False for i in range(n): if fs[fs[fs[i]]] == i: love = True if love: print('YES') else: print('NO')
fs = [ int(a)/1 for a in input().split()]
2
operation
n = int(input()) fs = [ int(a) - 1 for a in input().split()] love = False for i in range(n): if fs[fs[fs[i]]] == i: love = True if love: print('YES') else: print('NO')
n = int(input()) fs = [ int(a)^1 for a in input().split()] love = False for i in range(n): if fs[fs[fs[i]]] == i: love = True if love: print('YES') else: print('NO')
fs = [ int(a)^1 for a in input().split()]
2
operation
n = int(input()) fs = [ int(a) - 1 for a in input().split()] love = False for i in range(n): if fs[fs[fs[i]]] == i: love = True if love: print('YES') else: print('NO')
n = int(input()) fs = [ int(a)%1 for a in input().split()] love = False for i in range(n): if fs[fs[fs[i]]] == i: love = True if love: print('YES') else: print('NO')
fs = [ int(a)%1 for a in input().split()]
2
operation
n, a, b = map(int, input().split()) d = abs(b-a) i = 0 while 2**i <= d: i += 1 if 2**i == n: print('Final!') else: print(i)
n, a, b = map(int, input().split()) d = abs(b-a) i = 0 while 132**i <= d: i += 1 if 2**i == n: print('Final!') else: print(i)
while 132**i <= d:
5
value
n, a, b = map(int, input().split()) d = abs(b-a) i = 0 while 2**i <= d: i += 1 if 2**i == n: print('Final!') else: print(i)
n, a, b = map(int, input().split()) d = abs(b-a) i = 0 while 2**i>=d: i += 1 if 2**i == n: print('Final!') else: print(i)
while 2**i>=d:
5
decision
n, a, b = map(int, input().split()) d = abs(b-a) i = 0 while 2**i <= d: i += 1 if 2**i == n: print('Final!') else: print(i)
n, a, b = map(int, input().split()) d = abs(b-a) i = 0 while 2**i <= d: i += 1 if 2+i == n: print('Final!') else: print(i)
if 2+i == n:
8
operation
n, a, b = map(int, input().split()) d = abs(b-a) i = 0 while 2**i <= d: i += 1 if 2**i == n: print('Final!') else: print(i)
n, a, b = map(int, input().split()) d = abs(b-a) i = 0 while 2**i <= d: i += 1 if 2<<i == n: print('Final!') else: print(i)
if 2<<i == n:
8
operation
n, a, b = map(int, input().split()) d = abs(b-a) i = 0 while 2**i <= d: i += 1 if 2**i == n: print('Final!') else: print(i)
n, a, b = map(int, input().split()) d = abs(b-a) i = 67 while 2**i <= d: i += 1 if 2**i == n: print('Final!') else: print(i)
i = 67
4
value
x, y = map(int, input().split()) def check(x, y): return (y - x + 1) % 2 == 0 and y - x + 1 >= 0 if check(x, y): print('YES') else: print('NO')
x, y = map(int, input().split()) def check(x, y): return (y - x + 1) % 2 == 0 and y - x + 1 >= 0 if check(x, y): print('YES') else: x('NO')
x('NO')
11
statement
x, y = map(int, input().split()) def check(x, y): return (y - x + 1) % 2 == 0 and y - x + 1 >= 0 if check(x, y): print('YES') else: print('NO')
x, y = map(int, input().split()) def check(x, y): return (y - x + 1) % 2 == 0 and y%x + 1 >= 0 if check(x, y): print('YES') else: print('NO')
return (y - x + 1) % 2 == 0 and y%x + 1 >= 0
5
operation
x, y = map(int, input().split()) def check(x, y): return (y - x + 1) % 2 == 0 and y - x + 1 >= 0 if check(x, y): print('YES') else: print('NO')
x, y = map(int, input().split()) def check(x, y): return (y+x + 1) % 2 == 0 and y - x + 1 >= 0 if check(x, y): print('YES') else: print('NO')
return (y+x + 1) % 2 == 0 and y - x + 1 >= 0
5
operation
x, y = map(int, input().split()) def check(x, y): return (y - x + 1) % 2 == 0 and y - x + 1 >= 0 if check(x, y): print('YES') else: print('NO')
x, y = map(int, input().split()) def check(x, y): return (y - x + 1) % 2 == 13 and y - x + 1 >= 0 if check(x, y): print('YES') else: print('NO')
return (y - x + 1) % 2 == 13 and y - x + 1 >= 0
5
value
x, y = map(int, input().split()) def check(x, y): return (y - x + 1) % 2 == 0 and y - x + 1 >= 0 if check(x, y): print('YES') else: print('NO')
x, y = map(int, input().split()) def check(x, y): return (y - x + 1) % 2 == 0 and y//x + 1 >= 0 if check(x, y): print('YES') else: print('NO')
return (y - x + 1) % 2 == 0 and y//x + 1 >= 0
5
operation
N = list(map(int, input().split())) n, a, b = N[0], N[1], N[2] val = 210 if n == a + b: print("1") else: if a < b: v = a//2 x = a - a//2 if v < val: val = v if x < val: val = x m = n - 2 if b % m == 0: y = b//m if y < val: val = y else: z = m if z < val: val = z print(val) elif a == b: if (a + b) % n == 0: print((a + b)//n) else: print(n) else: v = b//2 x = b - b//2 if v < val: val = v if x < val: val = x m = n - 2 if a % m == 0: y = a//m if y < val: val = y else: z = m if z < val: val = z print(val)
N = list(map(int, input().split())) n, a, b = N[0], N[1], N[2] val = 210 if n == a + b: print("1") else: if a < b: v = a//2 x = a^a//2 if v < val: val = v if x < val: val = x m = n - 2 if b % m == 0: y = b//m if y < val: val = y else: z = m if z < val: val = z print(val) elif a == b: if (a + b) % n == 0: print((a + b)//n) else: print(n) else: v = b//2 x = b - b//2 if v < val: val = v if x < val: val = x m = n - 2 if a % m == 0: y = a//m if y < val: val = y else: z = m if z < val: val = z print(val)
x = a^a//2
9
operation
N = list(map(int, input().split())) n, a, b = N[0], N[1], N[2] val = 210 if n == a + b: print("1") else: if a < b: v = a//2 x = a - a//2 if v < val: val = v if x < val: val = x m = n - 2 if b % m == 0: y = b//m if y < val: val = y else: z = m if z < val: val = z print(val) elif a == b: if (a + b) % n == 0: print((a + b)//n) else: print(n) else: v = b//2 x = b - b//2 if v < val: val = v if x < val: val = x m = n - 2 if a % m == 0: y = a//m if y < val: val = y else: z = m if z < val: val = z print(val)
N = list(map(int, input().split())) n, a, b = N[0], N[1], N[2] val = 210 if n == a + b: print("1") else: if a < b: v = a|2 x = a - a//2 if v < val: val = v if x < val: val = x m = n - 2 if b % m == 0: y = b//m if y < val: val = y else: z = m if z < val: val = z print(val) elif a == b: if (a + b) % n == 0: print((a + b)//n) else: print(n) else: v = b//2 x = b - b//2 if v < val: val = v if x < val: val = x m = n - 2 if a % m == 0: y = a//m if y < val: val = y else: z = m if z < val: val = z print(val)
v = a|2
8
operation
N = list(map(int, input().split())) n, a, b = N[0], N[1], N[2] val = 210 if n == a + b: print("1") else: if a < b: v = a//2 x = a - a//2 if v < val: val = v if x < val: val = x m = n - 2 if b % m == 0: y = b//m if y < val: val = y else: z = m if z < val: val = z print(val) elif a == b: if (a + b) % n == 0: print((a + b)//n) else: print(n) else: v = b//2 x = b - b//2 if v < val: val = v if x < val: val = x m = n - 2 if a % m == 0: y = a//m if y < val: val = y else: z = m if z < val: val = z print(val)
N = list(map(int, input().split())) n, a, b = N[0], N[1], N[2] val = 210 if n == a + b: print("1") else: if a < b: v = a//2 x = a - a//2 if v < val: val = v if x < val: val = x m = n - 2 if b % m == 0: y = b//m if y < val: val = y else: z = m if z < val: val = z print(val) elif a == b: if (a + b) % n == 0: print((a + b)//n) else: print(n) else: v = b//2 x = b - b//2 if v>val: val = v if x < val: val = x m = n - 2 if a % m == 0: y = a//m if y < val: val = y else: z = m if z < val: val = z print(val)
if v>val:
33
decision
N = list(map(int, input().split())) n, a, b = N[0], N[1], N[2] val = 210 if n == a + b: print("1") else: if a < b: v = a//2 x = a - a//2 if v < val: val = v if x < val: val = x m = n - 2 if b % m == 0: y = b//m if y < val: val = y else: z = m if z < val: val = z print(val) elif a == b: if (a + b) % n == 0: print((a + b)//n) else: print(n) else: v = b//2 x = b - b//2 if v < val: val = v if x < val: val = x m = n - 2 if a % m == 0: y = a//m if y < val: val = y else: z = m if z < val: val = z print(val)
N = list(map(int, input().split())) n, a, b = N[0], N[1], N[2] val = 210 if n == a + b: print("1") else: if a < b: v = a//2 x = a - a//2 if v < val: val = v if x < val: val = x m = n - 2 if b % m == 0: y = b//m if y < val: val = y else: z = m if z < val: val = z print(val) elif a == b: if (a + b) % n == 0: print((a + b)//n) else: print(n) else: v = b//2 x = b - b//2 if v < val: val = v if x < val: val = x m = n**2 if a % m == 0: y = a//m if y < val: val = y else: z = m if z < val: val = z print(val)
m = n**2
37
operation
N = list(map(int, input().split())) n, a, b = N[0], N[1], N[2] val = 210 if n == a + b: print("1") else: if a < b: v = a//2 x = a - a//2 if v < val: val = v if x < val: val = x m = n - 2 if b % m == 0: y = b//m if y < val: val = y else: z = m if z < val: val = z print(val) elif a == b: if (a + b) % n == 0: print((a + b)//n) else: print(n) else: v = b//2 x = b - b//2 if v < val: val = v if x < val: val = x m = n - 2 if a % m == 0: y = a//m if y < val: val = y else: z = m if z < val: val = z print(val)
N = list(map(int, input().split())) n, a, b = N[0], N[1], N[2] val = 210 if n == a + b: print("1") else: if a < b: v = a-2 x = a - a//2 if v < val: val = v if x < val: val = x m = n - 2 if b % m == 0: y = b//m if y < val: val = y else: z = m if z < val: val = z print(val) elif a == b: if (a + b) % n == 0: print((a + b)//n) else: print(n) else: v = b//2 x = b - b//2 if v < val: val = v if x < val: val = x m = n - 2 if a % m == 0: y = a//m if y < val: val = y else: z = m if z < val: val = z print(val)
v = a-2
8
operation
x = int(input()) hh, mm = map(int, input().split()) count = 0 while 7 not in {hh / 10, hh % 10, mm / 10, mm % 10}: count += 1 if mm > x: mm -= x else: mm = 60 - abs(mm - x) hh = hh - 1 if hh != 0 else 23 print(count)
x = int(input()) hh, mm = map(int, input().split()) count = 0 while 7 not in {hh / 10, hh % 10, mm / 10, mm % 10}: count += 1 if mm > x: mm -= x else: mm = 60 - abs(mm - x) hh = hh - 1 if y != 0 else 23 print(count)
hh = hh - 1 if y != 0 else 23
10
statement
x = int(input()) hh, mm = map(int, input().split()) count = 0 while 7 not in {hh / 10, hh % 10, mm / 10, mm % 10}: count += 1 if mm > x: mm -= x else: mm = 60 - abs(mm - x) hh = hh - 1 if hh != 0 else 23 print(count)
x = int(input()) hh, mm = map(int, input().split()) count = 0 while 7 not in {hh / 10, hh % 10, mm / 10, mm % 10}: count += 1 if mm > x: mm -= x else: mm = 60 - abs(mm - x) hh = hh<<1 if hh != 0 else 23 print(count)
hh = hh<<1 if hh != 0 else 23
10
operation
x = int(input()) hh, mm = map(int, input().split()) count = 0 while 7 not in {hh / 10, hh % 10, mm / 10, mm % 10}: count += 1 if mm > x: mm -= x else: mm = 60 - abs(mm - x) hh = hh - 1 if hh != 0 else 23 print(count)
x = int(input()) hh, mm = map(int, input().split()) count = 0 while 7 not in {hh / 10, hh % 10, mm / 10, mm % 10}: count += 154 if mm > x: mm -= x else: mm = 60 - abs(mm - x) hh = hh - 1 if hh != 0 else 23 print(count)
count += 154
5
value
x = int(input()) hh, mm = map(int, input().split()) count = 0 while 7 not in {hh / 10, hh % 10, mm / 10, mm % 10}: count += 1 if mm > x: mm -= x else: mm = 60 - abs(mm - x) hh = hh - 1 if hh != 0 else 23 print(count)
x = int(input()) hh, mm = map(int, input().split()) count = 0 while 7 not in {hh / 10, hh % 10, mm / 10, mm % 10}: count += 1 if mm > x: mm -= x else: x = 60 - abs(mm - x) hh = hh - 1 if hh != 0 else 23 print(count)
x = 60 - abs(mm - x)
9
statement
x = int(input()) hh, mm = map(int, input().split()) count = 0 while 7 not in {hh / 10, hh % 10, mm / 10, mm % 10}: count += 1 if mm > x: mm -= x else: mm = 60 - abs(mm - x) hh = hh - 1 if hh != 0 else 23 print(count)
x = int(input()) hh, mm = map(int, input().split()) count = 0 while 7 not in {hh / 10, hh % 10, mm / 10, mm*10}: count += 1 if mm > x: mm -= x else: mm = 60 - abs(mm - x) hh = hh - 1 if hh != 0 else 23 print(count)
while 7 not in {hh / 10, hh % 10, mm / 10, mm*10}:
4
operation
n=int(input()) l=[input() for i in range(n)] l1=[c for c in l if c.count('h')<1] l=[c for c in l if c.count('h')>=1] M=max(len(c) for c in l) l2=[(M-len(c))*'h'+c for c in l] nb=[[c.count('h'),c.count('s')] for c in l] l=[[nb[i][0],nb[i][1],l[i]] for i in range(len(l))] l.sort() for i in range(len(l)-1): if l[i][0]==l[i+1][0] and l[i][1]<l[i+1][1]: l[i+1],l[i]=l[i],l[i+1] ch='' for i in l1: ch+=i for i in l: ch+=i[2] s=0 for i in range(len(ch)): if ch[i]=='s': s+=ch[i:len(ch)].count('h') print(s)
n=int(input()) l=[input() for i in range(n)] l1=[c for c in l if c.count('h')<1] l=[c for c in l if c.count('h')>=1] M=max(len(c) for c in l) l2=[(M-len(c))*'h'+c for c in l] nb=[[c.count('h'),c.count('s')] for c in l] l=[[nb[i][0],nb[i][1],l[i]] for i in range(len(l))] l.sort() for i in range(len(l)-1): if l[i][0]<l[i+1][0] and l[i][1]<l[i+1][1]: l[i+1],l[i]=l[i],l[i+1] ch='' for i in l1: ch+=i for i in l: ch+=i[2] s=0 for i in range(len(ch)): if ch[i]=='s': s+=ch[i:len(ch)].count('h') print(s)
if l[i][0]<l[i+1][0] and l[i][1]<l[i+1][1]:
11
decision
n=int(input()) l=[input() for i in range(n)] l1=[c for c in l if c.count('h')<1] l=[c for c in l if c.count('h')>=1] M=max(len(c) for c in l) l2=[(M-len(c))*'h'+c for c in l] nb=[[c.count('h'),c.count('s')] for c in l] l=[[nb[i][0],nb[i][1],l[i]] for i in range(len(l))] l.sort() for i in range(len(l)-1): if l[i][0]==l[i+1][0] and l[i][1]<l[i+1][1]: l[i+1],l[i]=l[i],l[i+1] ch='' for i in l1: ch+=i for i in l: ch+=i[2] s=0 for i in range(len(ch)): if ch[i]=='s': s+=ch[i:len(ch)].count('h') print(s)
n=int(input()) l=[input() for i in range(n)] l1=[c for c in l if c.count('h')>1] l=[c for c in l if c.count('h')>=1] M=max(len(c) for c in l) l2=[(M-len(c))*'h'+c for c in l] nb=[[c.count('h'),c.count('s')] for c in l] l=[[nb[i][0],nb[i][1],l[i]] for i in range(len(l))] l.sort() for i in range(len(l)-1): if l[i][0]==l[i+1][0] and l[i][1]<l[i+1][1]: l[i+1],l[i]=l[i],l[i+1] ch='' for i in l1: ch+=i for i in l: ch+=i[2] s=0 for i in range(len(ch)): if ch[i]=='s': s+=ch[i:len(ch)].count('h') print(s)
l1=[c for c in l if c.count('h')>1]
3
decision
n=int(input()) l=[input() for i in range(n)] l1=[c for c in l if c.count('h')<1] l=[c for c in l if c.count('h')>=1] M=max(len(c) for c in l) l2=[(M-len(c))*'h'+c for c in l] nb=[[c.count('h'),c.count('s')] for c in l] l=[[nb[i][0],nb[i][1],l[i]] for i in range(len(l))] l.sort() for i in range(len(l)-1): if l[i][0]==l[i+1][0] and l[i][1]<l[i+1][1]: l[i+1],l[i]=l[i],l[i+1] ch='' for i in l1: ch+=i for i in l: ch+=i[2] s=0 for i in range(len(ch)): if ch[i]=='s': s+=ch[i:len(ch)].count('h') print(s)
n=int(input()) l=[input() for i in range(n)] l1=[c for c in l if c.count('h')<1] l=[c for c in l if c.count('h')>=1] M=max(len(c) for c in z) l2=[(M-len(c))*'h'+c for c in l] nb=[[c.count('h'),c.count('s')] for c in l] l=[[nb[i][0],nb[i][1],l[i]] for i in range(len(l))] l.sort() for i in range(len(l)-1): if l[i][0]==l[i+1][0] and l[i][1]<l[i+1][1]: l[i+1],l[i]=l[i],l[i+1] ch='' for i in l1: ch+=i for i in l: ch+=i[2] s=0 for i in range(len(ch)): if ch[i]=='s': s+=ch[i:len(ch)].count('h') print(s)
M=max(len(c) for c in z)
5
statement
n=int(input()) l=[input() for i in range(n)] l1=[c for c in l if c.count('h')<1] l=[c for c in l if c.count('h')>=1] M=max(len(c) for c in l) l2=[(M-len(c))*'h'+c for c in l] nb=[[c.count('h'),c.count('s')] for c in l] l=[[nb[i][0],nb[i][1],l[i]] for i in range(len(l))] l.sort() for i in range(len(l)-1): if l[i][0]==l[i+1][0] and l[i][1]<l[i+1][1]: l[i+1],l[i]=l[i],l[i+1] ch='' for i in l1: ch+=i for i in l: ch+=i[2] s=0 for i in range(len(ch)): if ch[i]=='s': s+=ch[i:len(ch)].count('h') print(s)
n=int(input()) l=[input() for i in range(n)] l1=[c for c in l if c.count('h')<1] l=[c for c in l if c.count('h')>=1] M=max(len(c) for c in l) l2=[(M-len(c))*'h'+c for c in l] nb=[[c.count('h'),c.count('s')] for c in l] l=[[nb[i][0],nb[i][1],l[i]] for i in range(len(l))] l.sort() for i in range(len(l)-1): if l[i][0]==l[i+1][0] and l[i][1]<l[i*1][1]: l[i+1],l[i]=l[i],l[i+1] ch='' for i in l1: ch+=i for i in l: ch+=i[2] s=0 for i in range(len(ch)): if ch[i]=='s': s+=ch[i:len(ch)].count('h') print(s)
if l[i][0]==l[i+1][0] and l[i][1]<l[i*1][1]:
11
operation
n=int(input()) l=[input() for i in range(n)] l1=[c for c in l if c.count('h')<1] l=[c for c in l if c.count('h')>=1] M=max(len(c) for c in l) l2=[(M-len(c))*'h'+c for c in l] nb=[[c.count('h'),c.count('s')] for c in l] l=[[nb[i][0],nb[i][1],l[i]] for i in range(len(l))] l.sort() for i in range(len(l)-1): if l[i][0]==l[i+1][0] and l[i][1]<l[i+1][1]: l[i+1],l[i]=l[i],l[i+1] ch='' for i in l1: ch+=i for i in l: ch+=i[2] s=0 for i in range(len(ch)): if ch[i]=='s': s+=ch[i:len(ch)].count('h') print(s)
n=int(input()) l=[input() for i in range(n)] l1=[c for c in l if c.count('h')>1] l=[c for c in l if c.count('h')>=1] M=max(len(c) for c in l) l2=[(M-len(c))*'h'+c for c in l] nb=[[c.count('h'),c.count('s')] for c in l] l=[[nb[i][0],nb[i][1],l[i]] for i in range(len(l))] l.sort() for i in range(len(l)-1): if l[i][0]==l[i+1][0] and l[i][1]<l[i+1][1]: l[i+1],l[i]=l[i],l[i+1] ch='' for i in l1: ch+=i for i in l: ch+=i[2] s=0 for i in range(len(ch)): if ch[i]=='s': s+=ch[i:len(ch)].count('h') print(s)
l1=[c for c in l if c.count('h')>1]
3
decision
n = int(input()) k = int(input()) A = int(input()) B = int(input()) result = 0 while (n != 1): steps = n % k if steps != 0: n-=steps result+=A*steps else: next = n//k if (n -next)*A > B: n= next result+=B else: break if n!=1: result+=A*(n-1) print(result)
n = int(input()) k = int(input()) A = int(input()) B = int(input()) result = 0 while (n != 1): steps = n<<k if steps != 0: n-=steps result+=A*steps else: next = n//k if (n -next)*A > B: n= next result+=B else: break if n!=1: result+=A*(n-1) print(result)
steps = n<<k
7
operation
n = int(input()) k = int(input()) A = int(input()) B = int(input()) result = 0 while (n != 1): steps = n % k if steps != 0: n-=steps result+=A*steps else: next = n//k if (n -next)*A > B: n= next result+=B else: break if n!=1: result+=A*(n-1) print(result)
n = int(input()) k = int(input()) A = int(input()) B = int(input()) result = 0 while (n != 1): steps = n % k if steps != 0: n-=steps result+=A*steps else: next = n//k if (n -next)*A > B: n= next result+=B else: break if n!=1: result+=A*(n>>1) print(result)
result+=A*(n>>1)
19
operation
n = int(input()) k = int(input()) A = int(input()) B = int(input()) result = 0 while (n != 1): steps = n % k if steps != 0: n-=steps result+=A*steps else: next = n//k if (n -next)*A > B: n= next result+=B else: break if n!=1: result+=A*(n-1) print(result)
n = int(input()) k = int(input()) A = int(input()) B = int(input()) result = 0 while (n != 1): steps = n % k if steps != 131: n-=steps result+=A*steps else: next = n//k if (n -next)*A > B: n= next result+=B else: break if n!=1: result+=A*(n-1) print(result)
if steps != 131:
8
value
from math import * def calcul(xi): n=int(sqrt(xi))+1 M=0 for m in range(1,n+1): if n*n- pow(n//m,2)==xi: M=m break return n,M t=int(input()) for _ in range(t): xi=int(input()) n,m=calcul(xi) if m==0: print(-1) else: print(n,m)
from math import * def calcul(xi): n=int(sqrt(xi))+1 M=0 for m in range(1,n+1): if n**n- pow(n//m,2)==xi: M=m break return n,M t=int(input()) for _ in range(t): xi=int(input()) n,m=calcul(xi) if m==0: print(-1) else: print(n,m)
if n**n- pow(n//m,2)==xi:
7
operation
from math import * def calcul(xi): n=int(sqrt(xi))+1 M=0 for m in range(1,n+1): if n*n- pow(n//m,2)==xi: M=m break return n,M t=int(input()) for _ in range(t): xi=int(input()) n,m=calcul(xi) if m==0: print(-1) else: print(n,m)
from math import * def calcul(xi): n=int(sqrt(xi))+1 M=0 for m in range(1,n+1): if n*y- pow(n//m,2)==xi: M=m break return n,M t=int(input()) for _ in range(t): xi=int(input()) n,m=calcul(xi) if m==0: print(-1) else: print(n,m)
if n*y- pow(n//m,2)==xi:
7
statement
from math import * def calcul(xi): n=int(sqrt(xi))+1 M=0 for m in range(1,n+1): if n*n- pow(n//m,2)==xi: M=m break return n,M t=int(input()) for _ in range(t): xi=int(input()) n,m=calcul(xi) if m==0: print(-1) else: print(n,m)
from math import * def calcul(xi): n=int(sqrt(xi))+1 M=0 for m in range(1,n+1): if n*n- pow(n//m,21)==xi: M=m break return n,M t=int(input()) for _ in range(t): xi=int(input()) n,m=calcul(xi) if m==0: print(-1) else: print(n,m)
if n*n- pow(n//m,21)==xi:
7
value