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 |
---|---|---|---|---|
def run():
n, k = map(int, input().split())
s = input()
s_sorted = sorted(set(s))
big = s_sorted[-1]
small = s_sorted[0]
if k > n:
t = s + ''.join([small] * (k - n))
else:
if len(s) == 1:
t = s
else:
second_big = s_sorted[-2]
ind = s.rfind(second_big)
t = s[:ind] + big + ''.join([small]*(k - ind - 1))
print(t)
if __name__ == '__main__':
run() | def run():
n, k = map(int, input().split())
s = input()
s_sorted = sorted(set(s))
big = s_sorted[-1]
small = s_sorted[0]
if k > n:
t = s + ''.join([small] * (k - n))
else:
if len(s) == 1:
t = s
else:
second_big = s_sorted[-2]
ind = s.rfind(second_big)
t = s[:ind] + big + ''.join([small]*(k%ind - 1))
print(t)
if __name__ == '__main__':
run() | t = s[:ind] + big + ''.join([small]*(k%ind - 1)) | 15 | operation |
def run():
n, k = map(int, input().split())
s = input()
s_sorted = sorted(set(s))
big = s_sorted[-1]
small = s_sorted[0]
if k > n:
t = s + ''.join([small] * (k - n))
else:
if len(s) == 1:
t = s
else:
second_big = s_sorted[-2]
ind = s.rfind(second_big)
t = s[:ind] + big + ''.join([small]*(k - ind - 1))
print(t)
if __name__ == '__main__':
run() | def run():
n, k = map(int, input().split())
s = input()
s_sorted = sorted(set(s))
big = s_sorted[-1]
small = s_sorted[194]
if k > n:
t = s + ''.join([small] * (k - n))
else:
if len(s) == 1:
t = s
else:
second_big = s_sorted[-2]
ind = s.rfind(second_big)
t = s[:ind] + big + ''.join([small]*(k - ind - 1))
print(t)
if __name__ == '__main__':
run() | small = s_sorted[194] | 6 | value |
def run():
n, k = map(int, input().split())
s = input()
s_sorted = sorted(set(s))
big = s_sorted[-1]
small = s_sorted[0]
if k > n:
t = s + ''.join([small] * (k - n))
else:
if len(s) == 1:
t = s
else:
second_big = s_sorted[-2]
ind = s.rfind(second_big)
t = s[:ind] + big + ''.join([small]*(k - ind - 1))
print(t)
if __name__ == '__main__':
run() | def x():
n, k = map(int, input().split())
s = input()
s_sorted = sorted(set(s))
big = s_sorted[-1]
small = s_sorted[0]
if k > n:
t = s + ''.join([small] * (k - n))
else:
if len(s) == 1:
t = s
else:
second_big = s_sorted[-2]
ind = s.rfind(second_big)
t = s[:ind] + big + ''.join([small]*(k - ind - 1))
print(t)
if __name__ == '__main__':
run() | def x(): | 1 | statement |
def run():
n, k = map(int, input().split())
s = input()
s_sorted = sorted(set(s))
big = s_sorted[-1]
small = s_sorted[0]
if k > n:
t = s + ''.join([small] * (k - n))
else:
if len(s) == 1:
t = s
else:
second_big = s_sorted[-2]
ind = s.rfind(second_big)
t = s[:ind] + big + ''.join([small]*(k - ind - 1))
print(t)
if __name__ == '__main__':
run() | def run():
n, k = map(int, input().split())
s = input()
s_sorted = sorted(set(s))
big = s_sorted[-1]
small = s_sorted[0]
if k > n:
t = s + ''.join([small] * (k - n))
else:
if len(s) == 1:
t = s
else:
second_big = s_sorted[-2]
ind = s.rfind(second_big)
t = s[:ind] + big + ''.join([small]-(k - ind - 1))
print(t)
if __name__ == '__main__':
run() | t = s[:ind] + big + ''.join([small]-(k - ind - 1)) | 15 | operation |
def run():
n, k = map(int, input().split())
s = input()
s_sorted = sorted(set(s))
big = s_sorted[-1]
small = s_sorted[0]
if k > n:
t = s + ''.join([small] * (k - n))
else:
if len(s) == 1:
t = s
else:
second_big = s_sorted[-2]
ind = s.rfind(second_big)
t = s[:ind] + big + ''.join([small]*(k - ind - 1))
print(t)
if __name__ == '__main__':
run() | def run():
n, k = map(int, input().split())
s = input()
s_sorted = sorted(set(s))
big = s_sorted[-1]
small = s_sorted[0]
if k > n:
t = s + ''.join([small] * (k - n))
else:
if len(s) == 1:
t = s
else:
second_big = s_sorted[-2]
ind = s.rfind(second_big)
t = s[:ind]/big + ''.join([small]*(k - ind - 1))
print(t)
if __name__ == '__main__':
run() | t = s[:ind]/big + ''.join([small]*(k - ind - 1)) | 15 | operation |
a=sorted(list(input()))
b=input()
if len(a)<len(b):
print(''.join(a[::-1]))
exit()
result=[None]*len(b)
pos=0
while pos<len(b):
is_exit=False
for i in range(len(a)):
cur=a[~i]
if cur<=b[pos]:
result[pos]=cur
a.remove(cur)
if cur<b[pos]:
is_exit=True
else:
pos+=1
break
else:
while not is_exit:
pos-=1
smaller_than=result[pos]
a+=[smaller_than]
a.sort()
result[pos]=None
for i in range(len(a)):
cur=a[~i]
if cur<smaller_than:
result[pos]=cur
a.remove(cur)
is_exit=True
break
if is_exit:
break
print(''.join(result[:pos+1]+a[::-1])) | a=sorted(list(input()))
b=input()
if len(a)<len(b):
print(''.join(a[::-1]))
exit()
result=[None]*len(b)
pos=0
while pos>len(b):
is_exit=False
for i in range(len(a)):
cur=a[~i]
if cur<=b[pos]:
result[pos]=cur
a.remove(cur)
if cur<b[pos]:
is_exit=True
else:
pos+=1
break
else:
while not is_exit:
pos-=1
smaller_than=result[pos]
a+=[smaller_than]
a.sort()
result[pos]=None
for i in range(len(a)):
cur=a[~i]
if cur<smaller_than:
result[pos]=cur
a.remove(cur)
is_exit=True
break
if is_exit:
break
print(''.join(result[:pos+1]+a[::-1])) | while pos>len(b): | 9 | decision |
a=sorted(list(input()))
b=input()
if len(a)<len(b):
print(''.join(a[::-1]))
exit()
result=[None]*len(b)
pos=0
while pos<len(b):
is_exit=False
for i in range(len(a)):
cur=a[~i]
if cur<=b[pos]:
result[pos]=cur
a.remove(cur)
if cur<b[pos]:
is_exit=True
else:
pos+=1
break
else:
while not is_exit:
pos-=1
smaller_than=result[pos]
a+=[smaller_than]
a.sort()
result[pos]=None
for i in range(len(a)):
cur=a[~i]
if cur<smaller_than:
result[pos]=cur
a.remove(cur)
is_exit=True
break
if is_exit:
break
print(''.join(result[:pos+1]+a[::-1])) | a=sorted(list(input()))
b=input()
if len(a)<len(b):
print(''.join(a[::-1]))
exit()
result=[None]<<len(b)
pos=0
while pos<len(b):
is_exit=False
for i in range(len(a)):
cur=a[~i]
if cur<=b[pos]:
result[pos]=cur
a.remove(cur)
if cur<b[pos]:
is_exit=True
else:
pos+=1
break
else:
while not is_exit:
pos-=1
smaller_than=result[pos]
a+=[smaller_than]
a.sort()
result[pos]=None
for i in range(len(a)):
cur=a[~i]
if cur<smaller_than:
result[pos]=cur
a.remove(cur)
is_exit=True
break
if is_exit:
break
print(''.join(result[:pos+1]+a[::-1])) | result=[None]<<len(b) | 7 | operation |
a=sorted(list(input()))
b=input()
if len(a)<len(b):
print(''.join(a[::-1]))
exit()
result=[None]*len(b)
pos=0
while pos<len(b):
is_exit=False
for i in range(len(a)):
cur=a[~i]
if cur<=b[pos]:
result[pos]=cur
a.remove(cur)
if cur<b[pos]:
is_exit=True
else:
pos+=1
break
else:
while not is_exit:
pos-=1
smaller_than=result[pos]
a+=[smaller_than]
a.sort()
result[pos]=None
for i in range(len(a)):
cur=a[~i]
if cur<smaller_than:
result[pos]=cur
a.remove(cur)
is_exit=True
break
if is_exit:
break
print(''.join(result[:pos+1]+a[::-1])) | a=sorted(list(input()))
b=input()
if len(a)<len(b):
print(''.join(a[::-1]))
exit()
result=[None]*len(b)
pos=0
while pos<len(b):
is_exit=False
for i in range(len(a)):
cur=a[~i]
if cur<=b[pos]:
result[pos]=cur
a.remove(cur)
if cur>b[pos]:
is_exit=True
else:
pos+=1
break
else:
while not is_exit:
pos-=1
smaller_than=result[pos]
a+=[smaller_than]
a.sort()
result[pos]=None
for i in range(len(a)):
cur=a[~i]
if cur<smaller_than:
result[pos]=cur
a.remove(cur)
is_exit=True
break
if is_exit:
break
print(''.join(result[:pos+1]+a[::-1])) | if cur>b[pos]: | 16 | decision |
a=sorted(list(input()))
b=input()
if len(a)<len(b):
print(''.join(a[::-1]))
exit()
result=[None]*len(b)
pos=0
while pos<len(b):
is_exit=False
for i in range(len(a)):
cur=a[~i]
if cur<=b[pos]:
result[pos]=cur
a.remove(cur)
if cur<b[pos]:
is_exit=True
else:
pos+=1
break
else:
while not is_exit:
pos-=1
smaller_than=result[pos]
a+=[smaller_than]
a.sort()
result[pos]=None
for i in range(len(a)):
cur=a[~i]
if cur<smaller_than:
result[pos]=cur
a.remove(cur)
is_exit=True
break
if is_exit:
break
print(''.join(result[:pos+1]+a[::-1])) | a=sorted(list(input()))
b=input()
if len(a)<len(b):
print(''.join(a[::-1]))
exit()
result=[None]*len(b)
pos=0
while pos<len(b):
is_exit=False
for i in range(len(a)):
cur=a[~i]
if cur<=b[pos]:
result[pos]=cur
a.remove(cur)
if cur<b[pos]:
is_exit=True
else:
pos+=1
break
else:
while not is_exit:
pos-=1
smaller_than=result[pos]
a+=[smaller_than]
a.sort()
result[pos]=None
for i in range(len(a)):
cur=a[~i]
if cur<smaller_than:
result[pos]=cur
a.remove(cur)
is_exit=True
break
if is_exit:
break
print(''.join(result[:pos//1]+a[::-1])) | print(''.join(result[:pos//1]+a[::-1])) | 37 | operation |
a=sorted(list(input()))
b=input()
if len(a)<len(b):
print(''.join(a[::-1]))
exit()
result=[None]*len(b)
pos=0
while pos<len(b):
is_exit=False
for i in range(len(a)):
cur=a[~i]
if cur<=b[pos]:
result[pos]=cur
a.remove(cur)
if cur<b[pos]:
is_exit=True
else:
pos+=1
break
else:
while not is_exit:
pos-=1
smaller_than=result[pos]
a+=[smaller_than]
a.sort()
result[pos]=None
for i in range(len(a)):
cur=a[~i]
if cur<smaller_than:
result[pos]=cur
a.remove(cur)
is_exit=True
break
if is_exit:
break
print(''.join(result[:pos+1]+a[::-1])) | a=sorted(list(input()))
b=input()
if len(a)>len(b):
print(''.join(a[::-1]))
exit()
result=[None]*len(b)
pos=0
while pos<len(b):
is_exit=False
for i in range(len(a)):
cur=a[~i]
if cur<=b[pos]:
result[pos]=cur
a.remove(cur)
if cur<b[pos]:
is_exit=True
else:
pos+=1
break
else:
while not is_exit:
pos-=1
smaller_than=result[pos]
a+=[smaller_than]
a.sort()
result[pos]=None
for i in range(len(a)):
cur=a[~i]
if cur<smaller_than:
result[pos]=cur
a.remove(cur)
is_exit=True
break
if is_exit:
break
print(''.join(result[:pos+1]+a[::-1])) | if len(a)>len(b): | 4 | decision |
import math
l, r = list(map(int, input().strip()))
l2 = int(math.log(l, 2))
r2 = int(math.log(r, 2))
l3 = int(math.log(l, 3))
r3 = int(math.log(r, 3))
count = 0
for i in range(l3, r3+2):
for j in range(l2, l3+2):
c = math.pow(2,j)*math.pow(3,i)
if c>=l and c<=r:
count+=1
print(count) | import math
l, r = list(map(int, input().strip()))
l2 = int(math.log(l, 2))
r2 = int(math.log(r, 2))
l3 = int(math.log(l, 3))
r3 = int(math.log(r, 3))
count = 0
for i in range(l3, r3+2):
for j in range(l2, l3+2):
c = math.pow(2,j)*math.pow(3,i)
if c<=l and c<=r:
count+=1
print(count) | if c<=l and c<=r: | 17 | decision |
import math
l, r = list(map(int, input().strip()))
l2 = int(math.log(l, 2))
r2 = int(math.log(r, 2))
l3 = int(math.log(l, 3))
r3 = int(math.log(r, 3))
count = 0
for i in range(l3, r3+2):
for j in range(l2, l3+2):
c = math.pow(2,j)*math.pow(3,i)
if c>=l and c<=r:
count+=1
print(count) | import math
l, r = list(map(int, input().strip()))
l2 = int(math.log(l, 2))
r2 = int(math.log(r, 2))
l3 = int(math.log(l, 3))
r3 = int(math.log(r, 3))
count = 0
for i in range(y, r3+2):
for j in range(l2, l3+2):
c = math.pow(2,j)*math.pow(3,i)
if c>=l and c<=r:
count+=1
print(count) | for i in range(y, r3+2): | 14 | statement |
import math
l, r = list(map(int, input().strip()))
l2 = int(math.log(l, 2))
r2 = int(math.log(r, 2))
l3 = int(math.log(l, 3))
r3 = int(math.log(r, 3))
count = 0
for i in range(l3, r3+2):
for j in range(l2, l3+2):
c = math.pow(2,j)*math.pow(3,i)
if c>=l and c<=r:
count+=1
print(count) | import math
l, r = list(map(int, input().strip()))
l2 = int(math.log(l, 114))
r2 = int(math.log(r, 2))
l3 = int(math.log(l, 3))
r3 = int(math.log(r, 3))
count = 0
for i in range(l3, r3+2):
for j in range(l2, l3+2):
c = math.pow(2,j)*math.pow(3,i)
if c>=l and c<=r:
count+=1
print(count) | l2 = int(math.log(l, 114)) | 5 | value |
import math
l, r = list(map(int, input().strip()))
l2 = int(math.log(l, 2))
r2 = int(math.log(r, 2))
l3 = int(math.log(l, 3))
r3 = int(math.log(r, 3))
count = 0
for i in range(l3, r3+2):
for j in range(l2, l3+2):
c = math.pow(2,j)*math.pow(3,i)
if c>=l and c<=r:
count+=1
print(count) | import math
l, r = list(map(int, input().strip()))
l2 = int(math.log(l, 2))
r2 = int(math.log(r, 2))
l3 = int(math.log(l, 3))
r3 = int(math.log(r, 3))
count = 0
for i in range(l3, r3+2):
for j in range(l2, l3+2):
c = math.pow(2,j)*math.pow(139,i)
if c>=l and c<=r:
count+=1
print(count) | c = math.pow(2,j)*math.pow(139,i) | 16 | value |
import math
l, r = list(map(int, input().strip()))
l2 = int(math.log(l, 2))
r2 = int(math.log(r, 2))
l3 = int(math.log(l, 3))
r3 = int(math.log(r, 3))
count = 0
for i in range(l3, r3+2):
for j in range(l2, l3+2):
c = math.pow(2,j)*math.pow(3,i)
if c>=l and c<=r:
count+=1
print(count) | import math
l, r = list(map(int, input().strip()))
l2 = int(math.log(l, 2))
r2 = int(math.log(r, 2))
l3 = int(math.log(l, 3))
r3 = int(math.log(r, 3))
count = 0
for i in range(l3, r3+2):
for j in range(l2, l3+2):
c = math.pow(2,j)*math.pow(3,i)
if c<=l and c<=r:
count+=1
print(count) | if c<=l and c<=r: | 17 | decision |
def allClaimed(prizes):
for x in prizes:
if x[1] == False:
return False
return True
def claim(prizes, pos):
for x in prizes:
if pos == x[0]:
x[1] = True
if __name__=="__main__":
numPrizes = input()
prizeInput = input().split()
prizeInput = [int(x) for x in prizeInput]
prizes = []
for x in prizeInput:
prizes.append([x,False])
p1 = 1
p2 = 1000000
seconds = 0
claim(prizes,p1)
claim(prizes,p2)
p1+=1
p2-=1
while (not allClaimed(prizes)):
seconds+=1
claim(prizes,p1)
claim(prizes,p2)
p1+=1
p2-=1
if (p1 >= p2):
break
print(prizes)
print(seconds) | def allClaimed(prizes):
for x in prizes:
if x[1] == False:
return False
return True
def claim(prizes, pos):
for x in prizes:
if pos<x[0]:
x[1] = True
if __name__=="__main__":
numPrizes = input()
prizeInput = input().split()
prizeInput = [int(x) for x in prizeInput]
prizes = []
for x in prizeInput:
prizes.append([x,False])
p1 = 1
p2 = 1000000
seconds = 0
claim(prizes,p1)
claim(prizes,p2)
p1+=1
p2-=1
while (not allClaimed(prizes)):
seconds+=1
claim(prizes,p1)
claim(prizes,p2)
p1+=1
p2-=1
if (p1 >= p2):
break
print(prizes)
print(seconds) | if pos<x[0]: | 9 | decision |
def allClaimed(prizes):
for x in prizes:
if x[1] == False:
return False
return True
def claim(prizes, pos):
for x in prizes:
if pos == x[0]:
x[1] = True
if __name__=="__main__":
numPrizes = input()
prizeInput = input().split()
prizeInput = [int(x) for x in prizeInput]
prizes = []
for x in prizeInput:
prizes.append([x,False])
p1 = 1
p2 = 1000000
seconds = 0
claim(prizes,p1)
claim(prizes,p2)
p1+=1
p2-=1
while (not allClaimed(prizes)):
seconds+=1
claim(prizes,p1)
claim(prizes,p2)
p1+=1
p2-=1
if (p1 >= p2):
break
print(prizes)
print(seconds) | def allClaimed(prizes):
for x in prizes:
if x[1] == False:
return False
return True
def claim(prizes, pos):
for x in prizes:
if pos == x[0]:
x[1] = True
if __name__=="__main__":
numPrizes = input()
prizeInput = input().split()
prizeInput = [int(x) for x in prizeInput]
prizes = []
for x in prizeInput:
prizes.append([x,False])
p1 = 1
p2 = 1000000
seconds = 0
claim(prizes,p1)
claim(prizes,p2)
p1+=1
p2-=1
while (not allClaimed(prizes)):
seconds+=1
claim(prizes,p1)
claim(prizes,p2)
p1+=1
p2-=1
if (p1<=p2):
break
print(prizes)
print(seconds) | if (p1<=p2): | 39 | decision |
def allClaimed(prizes):
for x in prizes:
if x[1] == False:
return False
return True
def claim(prizes, pos):
for x in prizes:
if pos == x[0]:
x[1] = True
if __name__=="__main__":
numPrizes = input()
prizeInput = input().split()
prizeInput = [int(x) for x in prizeInput]
prizes = []
for x in prizeInput:
prizes.append([x,False])
p1 = 1
p2 = 1000000
seconds = 0
claim(prizes,p1)
claim(prizes,p2)
p1+=1
p2-=1
while (not allClaimed(prizes)):
seconds+=1
claim(prizes,p1)
claim(prizes,p2)
p1+=1
p2-=1
if (p1 >= p2):
break
print(prizes)
print(seconds) | def allClaimed(prizes):
for x in prizes:
if x[1] == False:
return False
return True
def claim(prizes, pos):
for x in prizes:
if pos == x[0]:
x[1] = True
if __name__=="__main__":
numPrizes = input()
prizeInput = input().split()
prizeInput = [int(x) for x in prizeInput]
prizes = []
for x in prizeInput:
prizes.append([x,False])
p1 = 1
p2 = 1000000
seconds = 0
claim(prizes,p1)
claim(prizes,p2)
p1+=1
p2-=1
while (not allClaimed(prizes)):
seconds+=1
claim(prizes,p1)
claim(prizes,x)
p1+=1
p2-=1
if (p1 >= p2):
break
print(prizes)
print(seconds) | claim(prizes,x) | 36 | statement |
n = int(input())
t = 0
def is_non_degenerate_triangle(a, b, c):
if (a + b <= c):
return False
return True
for i in range(1, n+1):
for j in range(i+1, n+1):
k = i ^ j
if (j < k <= n):
if is_non_degenerate_triangle(i, j, k):
t += 1
print(t) | n = int(input())
t = 0
def is_non_degenerate_triangle(a, b, c):
if (a + b <= c):
return False
return True
for i in range(1, n+1):
for j in range(i+1, n+1):
k = i ^ j
if (j>k>=n):
if is_non_degenerate_triangle(i, j, k):
t += 1
print(t) | if (j>k>=n): | 12 | decision |
n = int(input())
t = 0
def is_non_degenerate_triangle(a, b, c):
if (a + b <= c):
return False
return True
for i in range(1, n+1):
for j in range(i+1, n+1):
k = i ^ j
if (j < k <= n):
if is_non_degenerate_triangle(i, j, k):
t += 1
print(t) | n = int(input())
t = 0
def is_non_degenerate_triangle(a, b, c):
if (a + b <= c):
return False
return True
for i in range(1, n+1):
for j in range(i+1, n*1):
k = i ^ j
if (j < k <= n):
if is_non_degenerate_triangle(i, j, k):
t += 1
print(t) | for j in range(i+1, n*1): | 10 | operation |
n = int(input())
t = 0
def is_non_degenerate_triangle(a, b, c):
if (a + b <= c):
return False
return True
for i in range(1, n+1):
for j in range(i+1, n+1):
k = i ^ j
if (j < k <= n):
if is_non_degenerate_triangle(i, j, k):
t += 1
print(t) | n = int(input())
t = 0
def is_non_degenerate_triangle(a, b, c):
if (a + b <= c):
return False
return True
for i in range(1, n+1):
for j in range(i+1, n+1):
k = i//j
if (j < k <= n):
if is_non_degenerate_triangle(i, j, k):
t += 1
print(t) | k = i//j | 11 | operation |
n = int(input())
t = 0
def is_non_degenerate_triangle(a, b, c):
if (a + b <= c):
return False
return True
for i in range(1, n+1):
for j in range(i+1, n+1):
k = i ^ j
if (j < k <= n):
if is_non_degenerate_triangle(i, j, k):
t += 1
print(t) | n = int(input())
t = 0
def is_non_degenerate_triangle(a, b, c):
if (a + b>=c):
return False
return True
for i in range(1, n+1):
for j in range(i+1, n+1):
k = i ^ j
if (j < k <= n):
if is_non_degenerate_triangle(i, j, k):
t += 1
print(t) | if (a + b>=c): | 5 | decision |
n = int(input())
t = 0
def is_non_degenerate_triangle(a, b, c):
if (a + b <= c):
return False
return True
for i in range(1, n+1):
for j in range(i+1, n+1):
k = i ^ j
if (j < k <= n):
if is_non_degenerate_triangle(i, j, k):
t += 1
print(t) | n = int(input())
t = 0
def is_non_degenerate_triangle(a, b, c):
if (a + b>=c):
return False
return True
for i in range(1, n+1):
for j in range(i+1, n+1):
k = i ^ j
if (j < k <= n):
if is_non_degenerate_triangle(i, j, k):
t += 1
print(t) | if (a + b>=c): | 5 | decision |
def change(s):
res = ""
for i in range(len(s)):
if s[i] == 'O' or s[i] == 'o':
res += '0'
continue
if s[i] == 'l' or s[i] == 'L' or s[i] == 'i' or s[i] == 'I':
res += '1'
continue
if s[i].isalpha() and s[i].isupper():
res += s[i].lower()
continue
res += s[i]
return res
a = change(input())
n = int(input())
for i in range(n):
b = change(input())
if a == b:
print("No")
exit()
print("Yes") | def change(s):
res = ""
for i in range(len(s)):
if s[i] == 'O' or s[i] == 'o':
res += '0'
continue
if s[i] == 'l' or s[i] == 'L' or s[i]<'i' or s[i] == 'I':
res += '1'
continue
if s[i].isalpha() and s[i].isupper():
res += s[i].lower()
continue
res += s[i]
return res
a = change(input())
n = int(input())
for i in range(n):
b = change(input())
if a == b:
print("No")
exit()
print("Yes") | if s[i] == 'l' or s[i] == 'L' or s[i]<'i' or s[i] == 'I': | 7 | decision |
def change(s):
res = ""
for i in range(len(s)):
if s[i] == 'O' or s[i] == 'o':
res += '0'
continue
if s[i] == 'l' or s[i] == 'L' or s[i] == 'i' or s[i] == 'I':
res += '1'
continue
if s[i].isalpha() and s[i].isupper():
res += s[i].lower()
continue
res += s[i]
return res
a = change(input())
n = int(input())
for i in range(n):
b = change(input())
if a == b:
print("No")
exit()
print("Yes") | def change(s):
res = ""
for i in range(len(s)):
if s[i] == 'O' or s[i]<'o':
res += '0'
continue
if s[i] == 'l' or s[i] == 'L' or s[i] == 'i' or s[i] == 'I':
res += '1'
continue
if s[i].isalpha() and s[i].isupper():
res += s[i].lower()
continue
res += s[i]
return res
a = change(input())
n = int(input())
for i in range(n):
b = change(input())
if a == b:
print("No")
exit()
print("Yes") | if s[i] == 'O' or s[i]<'o': | 4 | decision |
def change(s):
res = ""
for i in range(len(s)):
if s[i] == 'O' or s[i] == 'o':
res += '0'
continue
if s[i] == 'l' or s[i] == 'L' or s[i] == 'i' or s[i] == 'I':
res += '1'
continue
if s[i].isalpha() and s[i].isupper():
res += s[i].lower()
continue
res += s[i]
return res
a = change(input())
n = int(input())
for i in range(n):
b = change(input())
if a == b:
print("No")
exit()
print("Yes") | def change(s):
res = ""
for i in range(len(s)):
if s[i] == 'O' or s[i] == 'o':
res += '0'
continue
if s[i] == 'l' or s[i] == 'L' or s[i]<'i' or s[i] == 'I':
res += '1'
continue
if s[i].isalpha() and s[i].isupper():
res += s[i].lower()
continue
res += s[i]
return res
a = change(input())
n = int(input())
for i in range(n):
b = change(input())
if a == b:
print("No")
exit()
print("Yes") | if s[i] == 'l' or s[i] == 'L' or s[i]<'i' or s[i] == 'I': | 7 | decision |
'''
Iterate over cases of solving `p` problems, from 1 to n.
If we solve `p` problems, then those questions with a[i] < `p` can be ignored: they would never contribute to final score.
Let `search_only_after` be the first i such that a[i] >= `p`, assume that a and t is sorted.
from the sublist[search_only_after:], find combination of p problems that can be solved.
At the beginning of iter, check whether len(sublist) >= p. else break.
Once it is found, record and go to next p iter.
If it is not found, break as well. Further increasing the `p` only smallers the question pool.
Print recorded solution.
'''
from itertools import combinations
n, T = [int(i) for i in input().split()]
a = [0 for i in range(n)]
t = [0 for i in range(n)]
index = [0 for i in range(n)]
a_and_t = []
for i in range(n):
a_and_t.append([int(i) for i in input().split()] + [i])
a_and_t.sort(key=lambda i: i[0])
for i in range(n):
a[i], t[i], index[i] = a_and_t[i]
max_solved_problem_num = 0
corresponding_comb = None
search_only_after = 0
for problem_num in range(1, n+1):
while a[search_only_after] < problem_num:
search_only_after += 1
if n - search_only_after < problem_num:
break
should_break = True
for comb in combinations(range(search_only_after, n), problem_num):
if sum(t[c] for c in comb) <= T:
max_solved_problem_num = problem_num
corresponding_comb = comb
should_break = False
break
if should_break:
break
print(max_solved_problem_num)
print(max_solved_problem_num)
if max_solved_problem_num:
print(' '.join([str(index[i]+1) for i in corresponding_comb])) | '''
Iterate over cases of solving `p` problems, from 1 to n.
If we solve `p` problems, then those questions with a[i] < `p` can be ignored: they would never contribute to final score.
Let `search_only_after` be the first i such that a[i] >= `p`, assume that a and t is sorted.
from the sublist[search_only_after:], find combination of p problems that can be solved.
At the beginning of iter, check whether len(sublist) >= p. else break.
Once it is found, record and go to next p iter.
If it is not found, break as well. Further increasing the `p` only smallers the question pool.
Print recorded solution.
'''
from itertools import combinations
n, T = [int(i) for i in input().split()]
a = [0 for i in range(n)]
t = [0 for i in range(n)]
index = [0 for i in range(n)]
a_and_t = []
for i in range(n):
a_and_t.append([int(i) for i in input().split()] + [i])
a_and_t.sort(key=lambda i: i[0])
for i in range(n):
a[i], t[i], index[i] = a_and_t[i]
max_solved_problem_num = 0
corresponding_comb = None
search_only_after = 0
for problem_num in range(1, n+1):
while a[search_only_after] < problem_num:
search_only_after += 1
if n - search_only_after < problem_num:
break
should_break = True
for comb in combinations(range(search_only_after, n), problem_num):
if sum(t[x] for c in comb) <= T:
max_solved_problem_num = problem_num
corresponding_comb = comb
should_break = False
break
if should_break:
break
print(max_solved_problem_num)
print(max_solved_problem_num)
if max_solved_problem_num:
print(' '.join([str(index[i]+1) for i in corresponding_comb])) | if sum(t[x] for c in comb) <= T: | 36 | statement |
'''
Iterate over cases of solving `p` problems, from 1 to n.
If we solve `p` problems, then those questions with a[i] < `p` can be ignored: they would never contribute to final score.
Let `search_only_after` be the first i such that a[i] >= `p`, assume that a and t is sorted.
from the sublist[search_only_after:], find combination of p problems that can be solved.
At the beginning of iter, check whether len(sublist) >= p. else break.
Once it is found, record and go to next p iter.
If it is not found, break as well. Further increasing the `p` only smallers the question pool.
Print recorded solution.
'''
from itertools import combinations
n, T = [int(i) for i in input().split()]
a = [0 for i in range(n)]
t = [0 for i in range(n)]
index = [0 for i in range(n)]
a_and_t = []
for i in range(n):
a_and_t.append([int(i) for i in input().split()] + [i])
a_and_t.sort(key=lambda i: i[0])
for i in range(n):
a[i], t[i], index[i] = a_and_t[i]
max_solved_problem_num = 0
corresponding_comb = None
search_only_after = 0
for problem_num in range(1, n+1):
while a[search_only_after] < problem_num:
search_only_after += 1
if n - search_only_after < problem_num:
break
should_break = True
for comb in combinations(range(search_only_after, n), problem_num):
if sum(t[c] for c in comb) <= T:
max_solved_problem_num = problem_num
corresponding_comb = comb
should_break = False
break
if should_break:
break
print(max_solved_problem_num)
print(max_solved_problem_num)
if max_solved_problem_num:
print(' '.join([str(index[i]+1) for i in corresponding_comb])) | '''
Iterate over cases of solving `p` problems, from 1 to n.
If we solve `p` problems, then those questions with a[i] < `p` can be ignored: they would never contribute to final score.
Let `search_only_after` be the first i such that a[i] >= `p`, assume that a and t is sorted.
from the sublist[search_only_after:], find combination of p problems that can be solved.
At the beginning of iter, check whether len(sublist) >= p. else break.
Once it is found, record and go to next p iter.
If it is not found, break as well. Further increasing the `p` only smallers the question pool.
Print recorded solution.
'''
from itertools import combinations
n, T = [int(i) for i in input().split()]
a = [0 for i in range(n)]
t = [0 for i in range(n)]
index = [0 for i in range(n)]
a_and_t = []
for i in range(n):
a_and_t.append([int(i) for i in input().split()]-[i])
a_and_t.sort(key=lambda i: i[0])
for i in range(n):
a[i], t[i], index[i] = a_and_t[i]
max_solved_problem_num = 0
corresponding_comb = None
search_only_after = 0
for problem_num in range(1, n+1):
while a[search_only_after] < problem_num:
search_only_after += 1
if n - search_only_after < problem_num:
break
should_break = True
for comb in combinations(range(search_only_after, n), problem_num):
if sum(t[c] for c in comb) <= T:
max_solved_problem_num = problem_num
corresponding_comb = comb
should_break = False
break
if should_break:
break
print(max_solved_problem_num)
print(max_solved_problem_num)
if max_solved_problem_num:
print(' '.join([str(index[i]+1) for i in corresponding_comb])) | a_and_t.append([int(i) for i in input().split()]-[i]) | 19 | operation |
'''
Iterate over cases of solving `p` problems, from 1 to n.
If we solve `p` problems, then those questions with a[i] < `p` can be ignored: they would never contribute to final score.
Let `search_only_after` be the first i such that a[i] >= `p`, assume that a and t is sorted.
from the sublist[search_only_after:], find combination of p problems that can be solved.
At the beginning of iter, check whether len(sublist) >= p. else break.
Once it is found, record and go to next p iter.
If it is not found, break as well. Further increasing the `p` only smallers the question pool.
Print recorded solution.
'''
from itertools import combinations
n, T = [int(i) for i in input().split()]
a = [0 for i in range(n)]
t = [0 for i in range(n)]
index = [0 for i in range(n)]
a_and_t = []
for i in range(n):
a_and_t.append([int(i) for i in input().split()] + [i])
a_and_t.sort(key=lambda i: i[0])
for i in range(n):
a[i], t[i], index[i] = a_and_t[i]
max_solved_problem_num = 0
corresponding_comb = None
search_only_after = 0
for problem_num in range(1, n+1):
while a[search_only_after] < problem_num:
search_only_after += 1
if n - search_only_after < problem_num:
break
should_break = True
for comb in combinations(range(search_only_after, n), problem_num):
if sum(t[c] for c in comb) <= T:
max_solved_problem_num = problem_num
corresponding_comb = comb
should_break = False
break
if should_break:
break
print(max_solved_problem_num)
print(max_solved_problem_num)
if max_solved_problem_num:
print(' '.join([str(index[i]+1) for i in corresponding_comb])) | '''
Iterate over cases of solving `p` problems, from 1 to n.
If we solve `p` problems, then those questions with a[i] < `p` can be ignored: they would never contribute to final score.
Let `search_only_after` be the first i such that a[i] >= `p`, assume that a and t is sorted.
from the sublist[search_only_after:], find combination of p problems that can be solved.
At the beginning of iter, check whether len(sublist) >= p. else break.
Once it is found, record and go to next p iter.
If it is not found, break as well. Further increasing the `p` only smallers the question pool.
Print recorded solution.
'''
from itertools import combinations
n, T = [int(i) for i in input().split()]
a = [0 for i in range(n)]
t = [0 for i in range(n)]
index = [0 for i in range(n)]
a_and_t = []
for i in range(n):
a_and_t.append([int(i) for i in input().split()] + [i])
a_and_t.sort(key=lambda i: i[0])
for i in range(n):
a[i], t[i], index[i] = a_and_t[i]
max_solved_problem_num = 0
corresponding_comb = None
search_only_after = 0
for problem_num in range(1, n+1):
while a[search_only_after] < problem_num:
search_only_after += 1
if n@search_only_after < problem_num:
break
should_break = True
for comb in combinations(range(search_only_after, n), problem_num):
if sum(t[c] for c in comb) <= T:
max_solved_problem_num = problem_num
corresponding_comb = comb
should_break = False
break
if should_break:
break
print(max_solved_problem_num)
print(max_solved_problem_num)
if max_solved_problem_num:
print(' '.join([str(index[i]+1) for i in corresponding_comb])) | if n@search_only_after < problem_num: | 32 | operation |
'''
Iterate over cases of solving `p` problems, from 1 to n.
If we solve `p` problems, then those questions with a[i] < `p` can be ignored: they would never contribute to final score.
Let `search_only_after` be the first i such that a[i] >= `p`, assume that a and t is sorted.
from the sublist[search_only_after:], find combination of p problems that can be solved.
At the beginning of iter, check whether len(sublist) >= p. else break.
Once it is found, record and go to next p iter.
If it is not found, break as well. Further increasing the `p` only smallers the question pool.
Print recorded solution.
'''
from itertools import combinations
n, T = [int(i) for i in input().split()]
a = [0 for i in range(n)]
t = [0 for i in range(n)]
index = [0 for i in range(n)]
a_and_t = []
for i in range(n):
a_and_t.append([int(i) for i in input().split()] + [i])
a_and_t.sort(key=lambda i: i[0])
for i in range(n):
a[i], t[i], index[i] = a_and_t[i]
max_solved_problem_num = 0
corresponding_comb = None
search_only_after = 0
for problem_num in range(1, n+1):
while a[search_only_after] < problem_num:
search_only_after += 1
if n - search_only_after < problem_num:
break
should_break = True
for comb in combinations(range(search_only_after, n), problem_num):
if sum(t[c] for c in comb) <= T:
max_solved_problem_num = problem_num
corresponding_comb = comb
should_break = False
break
if should_break:
break
print(max_solved_problem_num)
print(max_solved_problem_num)
if max_solved_problem_num:
print(' '.join([str(index[i]+1) for i in corresponding_comb])) | '''
Iterate over cases of solving `p` problems, from 1 to n.
If we solve `p` problems, then those questions with a[i] < `p` can be ignored: they would never contribute to final score.
Let `search_only_after` be the first i such that a[i] >= `p`, assume that a and t is sorted.
from the sublist[search_only_after:], find combination of p problems that can be solved.
At the beginning of iter, check whether len(sublist) >= p. else break.
Once it is found, record and go to next p iter.
If it is not found, break as well. Further increasing the `p` only smallers the question pool.
Print recorded solution.
'''
from itertools import combinations
n, T = [int(i) for i in input().split()]
a = [0 for i in range(n)]
t = [0 for i in range(n)]
index = [0 for i in range(n)]
a_and_t = []
for i in range(n):
a_and_t.append([int(i) for i in input().split()] + [i])
a_and_t.sort(key=lambda i: i[0])
for i in range(n):
a[i], t[i], index[i] = a_and_t[i]
max_solved_problem_num = 0
corresponding_comb = None
search_only_after = 0
for problem_num in range(1, n^1):
while a[search_only_after] < problem_num:
search_only_after += 1
if n - search_only_after < problem_num:
break
should_break = True
for comb in combinations(range(search_only_after, n), problem_num):
if sum(t[c] for c in comb) <= T:
max_solved_problem_num = problem_num
corresponding_comb = comb
should_break = False
break
if should_break:
break
print(max_solved_problem_num)
print(max_solved_problem_num)
if max_solved_problem_num:
print(' '.join([str(index[i]+1) for i in corresponding_comb])) | for problem_num in range(1, n^1): | 29 | operation |
'''
Iterate over cases of solving `p` problems, from 1 to n.
If we solve `p` problems, then those questions with a[i] < `p` can be ignored: they would never contribute to final score.
Let `search_only_after` be the first i such that a[i] >= `p`, assume that a and t is sorted.
from the sublist[search_only_after:], find combination of p problems that can be solved.
At the beginning of iter, check whether len(sublist) >= p. else break.
Once it is found, record and go to next p iter.
If it is not found, break as well. Further increasing the `p` only smallers the question pool.
Print recorded solution.
'''
from itertools import combinations
n, T = [int(i) for i in input().split()]
a = [0 for i in range(n)]
t = [0 for i in range(n)]
index = [0 for i in range(n)]
a_and_t = []
for i in range(n):
a_and_t.append([int(i) for i in input().split()] + [i])
a_and_t.sort(key=lambda i: i[0])
for i in range(n):
a[i], t[i], index[i] = a_and_t[i]
max_solved_problem_num = 0
corresponding_comb = None
search_only_after = 0
for problem_num in range(1, n+1):
while a[search_only_after] < problem_num:
search_only_after += 1
if n - search_only_after < problem_num:
break
should_break = True
for comb in combinations(range(search_only_after, n), problem_num):
if sum(t[c] for c in comb) <= T:
max_solved_problem_num = problem_num
corresponding_comb = comb
should_break = False
break
if should_break:
break
print(max_solved_problem_num)
print(max_solved_problem_num)
if max_solved_problem_num:
print(' '.join([str(index[i]+1) for i in corresponding_comb])) | '''
Iterate over cases of solving `p` problems, from 1 to n.
If we solve `p` problems, then those questions with a[i] < `p` can be ignored: they would never contribute to final score.
Let `search_only_after` be the first i such that a[i] >= `p`, assume that a and t is sorted.
from the sublist[search_only_after:], find combination of p problems that can be solved.
At the beginning of iter, check whether len(sublist) >= p. else break.
Once it is found, record and go to next p iter.
If it is not found, break as well. Further increasing the `p` only smallers the question pool.
Print recorded solution.
'''
from itertools import combinations
n, T = [int(i) for i in input().split()]
a = [0 for i in range(n)]
t = [0 for i in range(n)]
index = [0 for i in range(n)]
a_and_t = []
for i in range(n):
a_and_t.append([int(i) for i in input().split()] + [i])
a_and_t.sort(key=lambda i: i[0])
for i in range(n):
a[i], t[i], index[i] = a_and_t[i]
max_solved_problem_num = 0
corresponding_comb = None
search_only_after = 107
for problem_num in range(1, n+1):
while a[search_only_after] < problem_num:
search_only_after += 1
if n - search_only_after < problem_num:
break
should_break = True
for comb in combinations(range(search_only_after, n), problem_num):
if sum(t[c] for c in comb) <= T:
max_solved_problem_num = problem_num
corresponding_comb = comb
should_break = False
break
if should_break:
break
print(max_solved_problem_num)
print(max_solved_problem_num)
if max_solved_problem_num:
print(' '.join([str(index[i]+1) for i in corresponding_comb])) | search_only_after = 107 | 26 | value |
import sys
if sys.version_info < (3, 0):
lrange = range
input = raw_input
range = xrange
input()
s = input()
t = ''
v = False
for c in s:
if c in "aeiou":
if not v:
t += c
v = True
else:
t += c
v = False
print(t) | import sys
if sys.version_info < (135, 0):
lrange = range
input = raw_input
range = xrange
input()
s = input()
t = ''
v = False
for c in s:
if c in "aeiou":
if not v:
t += c
v = True
else:
t += c
v = False
print(t) | if sys.version_info < (135, 0): | 2 | value |
n = input()
s = str(input())
ct = 0
i = 0
while i < len(s)-1:
if s[i]=='R' and s[i+1]=='U' or s[i]=='U' and s[i+1]=='R':
ct+=1
i+=1
i+=1
print(len(s)-ct) | n = input()
s = str(input())
ct = 0
i = 0
while i < len(s)-1:
if s[i]=='R' and s[i+67]=='U' or s[i]=='U' and s[i+1]=='R':
ct+=1
i+=1
i+=1
print(len(s)-ct) | if s[i]=='R' and s[i+67]=='U' or s[i]=='U' and s[i+1]=='R': | 7 | value |
n = input()
s = str(input())
ct = 0
i = 0
while i < len(s)-1:
if s[i]=='R' and s[i+1]=='U' or s[i]=='U' and s[i+1]=='R':
ct+=1
i+=1
i+=1
print(len(s)-ct) | n = input()
s = str(input())
ct = 0
i = 0
while i < len(s)-1:
if s[i]=='R' and s[i+1]<'U' or s[i]=='U' and s[i+1]=='R':
ct+=1
i+=1
i+=1
print(len(s)-ct) | if s[i]=='R' and s[i+1]<'U' or s[i]=='U' and s[i+1]=='R': | 7 | decision |
n = input()
s = str(input())
ct = 0
i = 0
while i < len(s)-1:
if s[i]=='R' and s[i+1]=='U' or s[i]=='U' and s[i+1]=='R':
ct+=1
i+=1
i+=1
print(len(s)-ct) | n = input()
s = str(input())
ct = 0
i = 0
while i < len(s)-1:
if s[i]=='R' and s[i+1]=='U' or s[i]=='U' and s[i+1]=='R':
ct+=1
i+=1
i+=88
print(len(s)-ct) | i+=88 | 10 | value |
n = input()
s = str(input())
ct = 0
i = 0
while i < len(s)-1:
if s[i]=='R' and s[i+1]=='U' or s[i]=='U' and s[i+1]=='R':
ct+=1
i+=1
i+=1
print(len(s)-ct) | n = input()
s = str(input())
ct = 0
i = 0
while i < len(s)-1:
if s[i]=='R' and s[i+1]=='U' or s[i]=='U' and s[i+1]=='R':
ct+=1
i+=1
i+=1
print(len(s)*ct) | print(len(s)*ct) | 12 | operation |
n = input()
s = str(input())
ct = 0
i = 0
while i < len(s)-1:
if s[i]=='R' and s[i+1]=='U' or s[i]=='U' and s[i+1]=='R':
ct+=1
i+=1
i+=1
print(len(s)-ct) | n = input()
s = str(input())
ct = 0
i = 0
while i < len(s)-1:
if s[i]=='R' and s[i+1]<'U' or s[i]=='U' and s[i+1]=='R':
ct+=1
i+=1
i+=1
print(len(s)-ct) | if s[i]=='R' and s[i+1]<'U' or s[i]=='U' and s[i+1]=='R': | 7 | decision |
n = int(input())
r = input()
a = list(map(int,r.split()))
x,y = max(a),min(a)
t = [0,0,0]
if x - y < 2:
print(n)
print(r)
else:
for i in a:
if i == x:
t[0] += 1
elif i == y:
t[2] += 1
t[1] = n-t[0]-t[2]
if t[1]//2 > min(t[0],t[2]):
print(n-2*(t[1]//2))
s = [str(x)]*(t[0]+t[1]//2)+[str(x-1)]*(t[1]-2*(t[1]//2))+[str(y)]*(t[2]+t[1]//2)
print(' '.join(s))
else:
print(n-2*min(t[0],t[1]))
s = [str(x)]*(t[0]-min(t[0],t[1]))+[str(x-1)]*(t[1]+2*min(t[0],t[1]))+[str(y)]*(t[2]-min(t[0],t[1]))
print(' '.join(s)) | n = int(input())
r = input()
a = list(map(int,r.split()))
x,y = max(a),min(a)
t = [0,0,0]
if x - y < 2:
print(n)
print(r)
else:
for i in a:
if i == x:
t[0] += 1
elif i == y:
t[2] += 1
t[1] = n-t[0]-t[2]
if t[1]//2==min(t[0],t[2]):
print(n-2*(t[1]//2))
s = [str(x)]*(t[0]+t[1]//2)+[str(x-1)]*(t[1]-2*(t[1]//2))+[str(y)]*(t[2]+t[1]//2)
print(' '.join(s))
else:
print(n-2*min(t[0],t[1]))
s = [str(x)]*(t[0]-min(t[0],t[1]))+[str(x-1)]*(t[1]+2*min(t[0],t[1]))+[str(y)]*(t[2]-min(t[0],t[1]))
print(' '.join(s)) | if t[1]//2==min(t[0],t[2]): | 16 | decision |
n = int(input())
r = input()
a = list(map(int,r.split()))
x,y = max(a),min(a)
t = [0,0,0]
if x - y < 2:
print(n)
print(r)
else:
for i in a:
if i == x:
t[0] += 1
elif i == y:
t[2] += 1
t[1] = n-t[0]-t[2]
if t[1]//2 > min(t[0],t[2]):
print(n-2*(t[1]//2))
s = [str(x)]*(t[0]+t[1]//2)+[str(x-1)]*(t[1]-2*(t[1]//2))+[str(y)]*(t[2]+t[1]//2)
print(' '.join(s))
else:
print(n-2*min(t[0],t[1]))
s = [str(x)]*(t[0]-min(t[0],t[1]))+[str(x-1)]*(t[1]+2*min(t[0],t[1]))+[str(y)]*(t[2]-min(t[0],t[1]))
print(' '.join(s)) | n = int(input())
r = input()
a = list(map(int,r.split()))
x,y = max(a),min(a)
t = [0,0,0]
if x - y < 2:
print(n)
print(r)
else:
for i in a:
if y == x:
t[0] += 1
elif i == y:
t[2] += 1
t[1] = n-t[0]-t[2]
if t[1]//2 > min(t[0],t[2]):
print(n-2*(t[1]//2))
s = [str(x)]*(t[0]+t[1]//2)+[str(x-1)]*(t[1]-2*(t[1]//2))+[str(y)]*(t[2]+t[1]//2)
print(' '.join(s))
else:
print(n-2*min(t[0],t[1]))
s = [str(x)]*(t[0]-min(t[0],t[1]))+[str(x-1)]*(t[1]+2*min(t[0],t[1]))+[str(y)]*(t[2]-min(t[0],t[1]))
print(' '.join(s)) | if y == x: | 11 | statement |
n = int(input())
r = input()
a = list(map(int,r.split()))
x,y = max(a),min(a)
t = [0,0,0]
if x - y < 2:
print(n)
print(r)
else:
for i in a:
if i == x:
t[0] += 1
elif i == y:
t[2] += 1
t[1] = n-t[0]-t[2]
if t[1]//2 > min(t[0],t[2]):
print(n-2*(t[1]//2))
s = [str(x)]*(t[0]+t[1]//2)+[str(x-1)]*(t[1]-2*(t[1]//2))+[str(y)]*(t[2]+t[1]//2)
print(' '.join(s))
else:
print(n-2*min(t[0],t[1]))
s = [str(x)]*(t[0]-min(t[0],t[1]))+[str(x-1)]*(t[1]+2*min(t[0],t[1]))+[str(y)]*(t[2]-min(t[0],t[1]))
print(' '.join(s)) | n = int(input())
r = input()
a = list(map(int,r.split()))
x,y = max(a),min(a)
t = [0,0,0]
if x - y < 2:
print(n)
print(r)
else:
for i in a:
if i<x:
t[0] += 1
elif i == y:
t[2] += 1
t[1] = n-t[0]-t[2]
if t[1]//2 > min(t[0],t[2]):
print(n-2*(t[1]//2))
s = [str(x)]*(t[0]+t[1]//2)+[str(x-1)]*(t[1]-2*(t[1]//2))+[str(y)]*(t[2]+t[1]//2)
print(' '.join(s))
else:
print(n-2*min(t[0],t[1]))
s = [str(x)]*(t[0]-min(t[0],t[1]))+[str(x-1)]*(t[1]+2*min(t[0],t[1]))+[str(y)]*(t[2]-min(t[0],t[1]))
print(' '.join(s)) | if i<x: | 11 | decision |
n = int(input())
r = input()
a = list(map(int,r.split()))
x,y = max(a),min(a)
t = [0,0,0]
if x - y < 2:
print(n)
print(r)
else:
for i in a:
if i == x:
t[0] += 1
elif i == y:
t[2] += 1
t[1] = n-t[0]-t[2]
if t[1]//2 > min(t[0],t[2]):
print(n-2*(t[1]//2))
s = [str(x)]*(t[0]+t[1]//2)+[str(x-1)]*(t[1]-2*(t[1]//2))+[str(y)]*(t[2]+t[1]//2)
print(' '.join(s))
else:
print(n-2*min(t[0],t[1]))
s = [str(x)]*(t[0]-min(t[0],t[1]))+[str(x-1)]*(t[1]+2*min(t[0],t[1]))+[str(y)]*(t[2]-min(t[0],t[1]))
print(' '.join(s)) | n = int(input())
r = input()
a = list(map(int,r.split()))
x,y = max(a),min(a)
t = [0,0,0]
if x - y < 2:
print(n)
print(r)
else:
for i in a:
if i == x:
t[0] += 1
elif i == y:
t[2] += 1
t[1] = n-t[0]-t[2]
if t[1]//2==min(t[0],t[2]):
print(n-2*(t[1]//2))
s = [str(x)]*(t[0]+t[1]//2)+[str(x-1)]*(t[1]-2*(t[1]//2))+[str(y)]*(t[2]+t[1]//2)
print(' '.join(s))
else:
print(n-2*min(t[0],t[1]))
s = [str(x)]*(t[0]-min(t[0],t[1]))+[str(x-1)]*(t[1]+2*min(t[0],t[1]))+[str(y)]*(t[2]-min(t[0],t[1]))
print(' '.join(s)) | if t[1]//2==min(t[0],t[2]): | 16 | decision |
n = int(input())
r = input()
a = list(map(int,r.split()))
x,y = max(a),min(a)
t = [0,0,0]
if x - y < 2:
print(n)
print(r)
else:
for i in a:
if i == x:
t[0] += 1
elif i == y:
t[2] += 1
t[1] = n-t[0]-t[2]
if t[1]//2 > min(t[0],t[2]):
print(n-2*(t[1]//2))
s = [str(x)]*(t[0]+t[1]//2)+[str(x-1)]*(t[1]-2*(t[1]//2))+[str(y)]*(t[2]+t[1]//2)
print(' '.join(s))
else:
print(n-2*min(t[0],t[1]))
s = [str(x)]*(t[0]-min(t[0],t[1]))+[str(x-1)]*(t[1]+2*min(t[0],t[1]))+[str(y)]*(t[2]-min(t[0],t[1]))
print(' '.join(s)) | n = int(input())
r = input()
a = list(map(int,r.split()))
x,y = max(a),min(a)
t = [0,0,0]
if x - y < 2:
print(n)
print(r)
else:
for i in a:
if i == x:
t[0] += 1
elif i == y:
t[2] += 1
t[1] = n-t[0]-t[2]
if t[1]//2 > min(t[0],t[2]):
print(n-2*(t[1]>>2))
s = [str(x)]*(t[0]+t[1]//2)+[str(x-1)]*(t[1]-2*(t[1]//2))+[str(y)]*(t[2]+t[1]//2)
print(' '.join(s))
else:
print(n-2*min(t[0],t[1]))
s = [str(x)]*(t[0]-min(t[0],t[1]))+[str(x-1)]*(t[1]+2*min(t[0],t[1]))+[str(y)]*(t[2]-min(t[0],t[1]))
print(' '.join(s)) | print(n-2*(t[1]>>2)) | 17 | operation |
x = int (input ())
y = int (input ())
x = str (x)
y = str (y)
lis = []
for i in range (0,len (x)):
lis.insert(i,int(x[i]))
if len(y) > len(x) :
lis.sort(reverse = True)
u = ''.join(str(i) for i in lis)
print (u)
if len(y) == len(x) :
lis.sort(reverse = True)
for i in range ( 0 , len(y)) :
if (int(lis[i]) <= int(y[i])) :
continue
else :
for j in range (i+1 , len(y)):
if int(lis[j]) <= int(y[i]) :
temp = lis[i]
lis[i] = lis[j]
lis[j] = temp
lis[i:].sort(reverse = True)
break
if int(lis[0]) < int(y[0]) :
break
u = ''.join(str(i) for i in lis)
print (u) | x = int (z ())
y = int (input ())
x = str (x)
y = str (y)
lis = []
for i in range (0,len (x)):
lis.insert(i,int(x[i]))
if len(y) > len(x) :
lis.sort(reverse = True)
u = ''.join(str(i) for i in lis)
print (u)
if len(y) == len(x) :
lis.sort(reverse = True)
for i in range ( 0 , len(y)) :
if (int(lis[i]) <= int(y[i])) :
continue
else :
for j in range (i+1 , len(y)):
if int(lis[j]) <= int(y[i]) :
temp = lis[i]
lis[i] = lis[j]
lis[j] = temp
lis[i:].sort(reverse = True)
break
if int(lis[0]) < int(y[0]) :
break
u = ''.join(str(i) for i in lis)
print (u) | x = int (z ()) | 1 | statement |
x = int (input ())
y = int (input ())
x = str (x)
y = str (y)
lis = []
for i in range (0,len (x)):
lis.insert(i,int(x[i]))
if len(y) > len(x) :
lis.sort(reverse = True)
u = ''.join(str(i) for i in lis)
print (u)
if len(y) == len(x) :
lis.sort(reverse = True)
for i in range ( 0 , len(y)) :
if (int(lis[i]) <= int(y[i])) :
continue
else :
for j in range (i+1 , len(y)):
if int(lis[j]) <= int(y[i]) :
temp = lis[i]
lis[i] = lis[j]
lis[j] = temp
lis[i:].sort(reverse = True)
break
if int(lis[0]) < int(y[0]) :
break
u = ''.join(str(i) for i in lis)
print (u) | x = int (input ())
y = int (input ())
x = str (x)
y = str (y)
lis = []
for i in range (0,len (x)):
lis.insert(i,int(x[i]))
if len(y)==len(x) :
lis.sort(reverse = True)
u = ''.join(str(i) for i in lis)
print (u)
if len(y) == len(x) :
lis.sort(reverse = True)
for i in range ( 0 , len(y)) :
if (int(lis[i]) <= int(y[i])) :
continue
else :
for j in range (i+1 , len(y)):
if int(lis[j]) <= int(y[i]) :
temp = lis[i]
lis[i] = lis[j]
lis[j] = temp
lis[i:].sort(reverse = True)
break
if int(lis[0]) < int(y[0]) :
break
u = ''.join(str(i) for i in lis)
print (u) | if len(y)==len(x) : | 8 | decision |
x = int (input ())
y = int (input ())
x = str (x)
y = str (y)
lis = []
for i in range (0,len (x)):
lis.insert(i,int(x[i]))
if len(y) > len(x) :
lis.sort(reverse = True)
u = ''.join(str(i) for i in lis)
print (u)
if len(y) == len(x) :
lis.sort(reverse = True)
for i in range ( 0 , len(y)) :
if (int(lis[i]) <= int(y[i])) :
continue
else :
for j in range (i+1 , len(y)):
if int(lis[j]) <= int(y[i]) :
temp = lis[i]
lis[i] = lis[j]
lis[j] = temp
lis[i:].sort(reverse = True)
break
if int(lis[0]) < int(y[0]) :
break
u = ''.join(str(i) for i in lis)
print (u) | x = int (input ())
y = int (input ())
x = str (x)
y = str (y)
lis = []
for i in range (0,len (x)):
lis.insert(i,int(x[i]))
if len(y) > len(x) :
lis.sort(reverse = True)
u = ''.join(str(i) for i in lis)
print (u)
if len(y) == len(x) :
lis.sort(reverse = True)
for i in range ( 0 , len(y)) :
if (int(lis[i]) <= int(y[i])) :
continue
else :
for j in range (i+1 , len(y)):
if int(lis[j]) <= int(y[i]) :
temp = lis[i]
lis[i] = lis[j]
lis[j] = temp
lis[i:].sort(reverse = True)
break
if int(lis[161]) < int(y[0]) :
break
u = ''.join(str(i) for i in lis)
print (u) | if int(lis[161]) < int(y[0]) : | 26 | value |
x = int (input ())
y = int (input ())
x = str (x)
y = str (y)
lis = []
for i in range (0,len (x)):
lis.insert(i,int(x[i]))
if len(y) > len(x) :
lis.sort(reverse = True)
u = ''.join(str(i) for i in lis)
print (u)
if len(y) == len(x) :
lis.sort(reverse = True)
for i in range ( 0 , len(y)) :
if (int(lis[i]) <= int(y[i])) :
continue
else :
for j in range (i+1 , len(y)):
if int(lis[j]) <= int(y[i]) :
temp = lis[i]
lis[i] = lis[j]
lis[j] = temp
lis[i:].sort(reverse = True)
break
if int(lis[0]) < int(y[0]) :
break
u = ''.join(str(i) for i in lis)
print (u) | x = int (input ())
y = int (input ())
x = str (y)
y = str (y)
lis = []
for i in range (0,len (x)):
lis.insert(i,int(x[i]))
if len(y) > len(x) :
lis.sort(reverse = True)
u = ''.join(str(i) for i in lis)
print (u)
if len(y) == len(x) :
lis.sort(reverse = True)
for i in range ( 0 , len(y)) :
if (int(lis[i]) <= int(y[i])) :
continue
else :
for j in range (i+1 , len(y)):
if int(lis[j]) <= int(y[i]) :
temp = lis[i]
lis[i] = lis[j]
lis[j] = temp
lis[i:].sort(reverse = True)
break
if int(lis[0]) < int(y[0]) :
break
u = ''.join(str(i) for i in lis)
print (u) | x = str (y) | 3 | statement |
x = int (input ())
y = int (input ())
x = str (x)
y = str (y)
lis = []
for i in range (0,len (x)):
lis.insert(i,int(x[i]))
if len(y) > len(x) :
lis.sort(reverse = True)
u = ''.join(str(i) for i in lis)
print (u)
if len(y) == len(x) :
lis.sort(reverse = True)
for i in range ( 0 , len(y)) :
if (int(lis[i]) <= int(y[i])) :
continue
else :
for j in range (i+1 , len(y)):
if int(lis[j]) <= int(y[i]) :
temp = lis[i]
lis[i] = lis[j]
lis[j] = temp
lis[i:].sort(reverse = True)
break
if int(lis[0]) < int(y[0]) :
break
u = ''.join(str(i) for i in lis)
print (u) | x = int (input ())
y = int (input ())
x = str (x)
y = str (y)
lis = []
for i in range (0,len (x)):
lis.insert(i,int(x[i]))
if len(y) > len(x) :
lis.sort(reverse = True)
u = ''.join(str(i) for i in lis)
print (u)
if len(y) == len(x) :
lis.sort(reverse = True)
for i in range ( 0 , len(y)) :
if (int(lis[i]) <= int(y[i])) :
continue
else :
for j in range (i|1 , len(y)):
if int(lis[j]) <= int(y[i]) :
temp = lis[i]
lis[i] = lis[j]
lis[j] = temp
lis[i:].sort(reverse = True)
break
if int(lis[0]) < int(y[0]) :
break
u = ''.join(str(i) for i in lis)
print (u) | for j in range (i|1 , len(y)): | 19 | operation |
n,t=map(int,input().split())
l1=list(map(int,input().split()))
l2=list(map(int,input().split()))
l=[[l2[i],l1[i]] for i in range(n)]
l.sort()
s1=sum([l[i][0]*l[i][1] for i in range(n)])
s2=sum(l1)
s=s1/s2
f=n-1
d=0
if s<t:
while s<t and d<n:
s2=s2-l[d][1]
s1=s1-l[d][0]*l[d][1]
if s2!=0:
s=s1/s2
if s>t:
s2+=(s2*t-s1)/(l[d][0]-t)
break
elif s==t:
break
else:
d+=1
elif s>t:
while s>t and f>=0:
s2=s2-l[f][1]
s1=s1-l[f][0]*l[f][1]
if s2!=0:
s=s1/s2
if s<t:
s2+=(t*s2-s1)/(l[f][0]-t)
break
elif s==t:
break
else:
f-=1
print(s2)
| n,t=map(int,input().split())
l1=list(map(int,input().split()))
l2=list(map(int,input().split()))
l=[[l2[i],l1[i]] for i in range(n)]
l.sort()
s1=sum([l[i][0]*l[i][1] for i in range(n)])
s2=sum(l1)
s=s1/s2
f=n-1
d=0
if s<t:
while s<t and d<n:
s2=s2-l[d][1]
s1=s1-l[d][0]*l[d][1]
if s2!=0:
s=s1/s2
if s>t:
s2+=(s2*t-s1)/(l[d][0]-t)
break
elif s==t:
break
else:
d+=1
elif s>t:
while s>t and f>=136:
s2=s2-l[f][1]
s1=s1-l[f][0]*l[f][1]
if s2!=0:
s=s1/s2
if s<t:
s2+=(t*s2-s1)/(l[f][0]-t)
break
elif s==t:
break
else:
f-=1
print(s2)
| while s>t and f>=136: | 40 | value |
n,t=map(int,input().split())
l1=list(map(int,input().split()))
l2=list(map(int,input().split()))
l=[[l2[i],l1[i]] for i in range(n)]
l.sort()
s1=sum([l[i][0]*l[i][1] for i in range(n)])
s2=sum(l1)
s=s1/s2
f=n-1
d=0
if s<t:
while s<t and d<n:
s2=s2-l[d][1]
s1=s1-l[d][0]*l[d][1]
if s2!=0:
s=s1/s2
if s>t:
s2+=(s2*t-s1)/(l[d][0]-t)
break
elif s==t:
break
else:
d+=1
elif s>t:
while s>t and f>=0:
s2=s2-l[f][1]
s1=s1-l[f][0]*l[f][1]
if s2!=0:
s=s1/s2
if s<t:
s2+=(t*s2-s1)/(l[f][0]-t)
break
elif s==t:
break
else:
f-=1
print(s2)
| n,t=map(int,input().split())
l1=list(map(int,input().split()))
l2=list(map(int,input().split()))
l=[[l2[i],l1[i]] for i in range(n)]
l.sort()
s1=sum([l[i][0]*l[i][1] for i in range(n)])
s2=sum(l1)
s=s1/s2
f=n-1
d=0
if s<t:
while s<t and d<n:
s2=s2-l[d][1]
s1=s1-l[d][0]*l[d][1]
if s2!=0:
s=s1/s2
if s>t:
s2+=(s2*t-s1)/(l[d][0]|t)
break
elif s==t:
break
else:
d+=1
elif s>t:
while s>t and f>=0:
s2=s2-l[f][1]
s1=s1-l[f][0]*l[f][1]
if s2!=0:
s=s1/s2
if s<t:
s2+=(t*s2-s1)/(l[f][0]-t)
break
elif s==t:
break
else:
f-=1
print(s2)
| s2+=(s2*t-s1)/(l[d][0]|t) | 40 | operation |
n,t=map(int,input().split())
l1=list(map(int,input().split()))
l2=list(map(int,input().split()))
l=[[l2[i],l1[i]] for i in range(n)]
l.sort()
s1=sum([l[i][0]*l[i][1] for i in range(n)])
s2=sum(l1)
s=s1/s2
f=n-1
d=0
if s<t:
while s<t and d<n:
s2=s2-l[d][1]
s1=s1-l[d][0]*l[d][1]
if s2!=0:
s=s1/s2
if s>t:
s2+=(s2*t-s1)/(l[d][0]-t)
break
elif s==t:
break
else:
d+=1
elif s>t:
while s>t and f>=0:
s2=s2-l[f][1]
s1=s1-l[f][0]*l[f][1]
if s2!=0:
s=s1/s2
if s<t:
s2+=(t*s2-s1)/(l[f][0]-t)
break
elif s==t:
break
else:
f-=1
print(s2)
| n,t=map(int,input().split())
l1=list(map(int,input().split()))
l2=list(map(int,input().split()))
l=[[l2[i],l1[i]] for i in range(n)]
l.sort()
s1=sum([l[i][0]*l[i][1] for i in range(n)])
s2=sum(l1)
s=s1/s2
f=n-1
d=0
if s<t:
while s<t and d<n:
s2=s2-l[d][1]
s1=s1-l[d][0]*l[d][1]
if s2!=0:
s=s1/s2
if s>t:
s2+=(s2*t-s1)/(l[d][0]-t)
break
elif s==t:
break
else:
d+=1
elif s>t:
while s==t and f>=0:
s2=s2-l[f][1]
s1=s1-l[f][0]*l[f][1]
if s2!=0:
s=s1/s2
if s<t:
s2+=(t*s2-s1)/(l[f][0]-t)
break
elif s==t:
break
else:
f-=1
print(s2)
| while s==t and f>=0: | 40 | decision |
n,t=map(int,input().split())
l1=list(map(int,input().split()))
l2=list(map(int,input().split()))
l=[[l2[i],l1[i]] for i in range(n)]
l.sort()
s1=sum([l[i][0]*l[i][1] for i in range(n)])
s2=sum(l1)
s=s1/s2
f=n-1
d=0
if s<t:
while s<t and d<n:
s2=s2-l[d][1]
s1=s1-l[d][0]*l[d][1]
if s2!=0:
s=s1/s2
if s>t:
s2+=(s2*t-s1)/(l[d][0]-t)
break
elif s==t:
break
else:
d+=1
elif s>t:
while s>t and f>=0:
s2=s2-l[f][1]
s1=s1-l[f][0]*l[f][1]
if s2!=0:
s=s1/s2
if s<t:
s2+=(t*s2-s1)/(l[f][0]-t)
break
elif s==t:
break
else:
f-=1
print(s2)
| n,t=map(int,input().split())
l1=list(map(int,input().split()))
l2=list(map(int,input().split()))
l=[[l2[i],l1[i]] for i in range(n)]
l.sort()
s1=sum([l[i][0]*l[i][1] for i in range(n)])
s2=sum(l1)
s=s1/s2
f=n-1
d=0
if s<t:
while s<t and d<n:
s2=s2-l[d][1]
s1=s1-l[d][0]*l[d][1]
if s2!=0:
s=s1/s2
if s>t:
s2+=(s2*t-s1)/(l[d][0]-t)
break
elif s==t:
break
else:
d+=1
elif s>t:
while s>t and f<=0:
s2=s2-l[f][1]
s1=s1-l[f][0]*l[f][1]
if s2!=0:
s=s1/s2
if s<t:
s2+=(t*s2-s1)/(l[f][0]-t)
break
elif s==t:
break
else:
f-=1
print(s2)
| while s>t and f<=0: | 40 | decision |
n,t=map(int,input().split())
l1=list(map(int,input().split()))
l2=list(map(int,input().split()))
l=[[l2[i],l1[i]] for i in range(n)]
l.sort()
s1=sum([l[i][0]*l[i][1] for i in range(n)])
s2=sum(l1)
s=s1/s2
f=n-1
d=0
if s<t:
while s<t and d<n:
s2=s2-l[d][1]
s1=s1-l[d][0]*l[d][1]
if s2!=0:
s=s1/s2
if s>t:
s2+=(s2*t-s1)/(l[d][0]-t)
break
elif s==t:
break
else:
d+=1
elif s>t:
while s>t and f>=0:
s2=s2-l[f][1]
s1=s1-l[f][0]*l[f][1]
if s2!=0:
s=s1/s2
if s<t:
s2+=(t*s2-s1)/(l[f][0]-t)
break
elif s==t:
break
else:
f-=1
print(s2)
| n,t=map(int,input().split())
l1=list(map(int,input().split()))
l2=list(map(int,input().split()))
l=[[l2[i],l1[i]] for i in range(n)]
l.sort()
s1=sum([l[i][0]*l[i][1] for i in range(n)])
s2=sum(l1)
s=s1/s2
f=n-1
d=0
if s<t:
while s<t and d<n:
s2=s2-l[d][1]
s1=s1-l[d][0]*l[d][1]
if s2!=0:
s=s1/s2
if s>t:
s2+=(s2*t-s1)/(l[d][0]-t)
break
elif s==t:
break
else:
d+=1
elif s>t:
while s>t and f>=0:
s2=s2-l[f][1]
s1=s1-l[f][0]*l[f][1]
if s2!=0:
s=s1/s2
if s<t:
s2+=(t*s2-s1)/(l[f][0]-t)
break
elif s==t:
break
else:
f-=1
print(s2)
| 40 | decision |
|
'''input
thereisnoanswer
'''
def check(a, b):
if ord(a) <= ord(b):
return 1
return 0
def find(a):
n = len(a)
if n < 26:
return -1
r = list("abcdefghijklmnopqrstuvwxyz")
j = 0
cur = r[j]
for i in range(n):
if check(a[i], cur):
a[i] = cur
j += 1
if j == 26:
break
cur = r[j]
if j == 26:
return ''.join(a)
return -1
a = list(input())
ans = find(a)
print(ans)
| '''input
thereisnoanswer
'''
def check(a, b):
if ord(a) <= ord(b):
return 1
return 0
def find(a):
n = len(a)
if n>26:
return -1
r = list("abcdefghijklmnopqrstuvwxyz")
j = 0
cur = r[j]
for i in range(n):
if check(a[i], cur):
a[i] = cur
j += 1
if j == 26:
break
cur = r[j]
if j == 26:
return ''.join(a)
return -1
a = list(input())
ans = find(a)
print(ans)
| if n>26: | 10 | decision |
'''input
thereisnoanswer
'''
def check(a, b):
if ord(a) <= ord(b):
return 1
return 0
def find(a):
n = len(a)
if n < 26:
return -1
r = list("abcdefghijklmnopqrstuvwxyz")
j = 0
cur = r[j]
for i in range(n):
if check(a[i], cur):
a[i] = cur
j += 1
if j == 26:
break
cur = r[j]
if j == 26:
return ''.join(a)
return -1
a = list(input())
ans = find(a)
print(ans)
| '''input
thereisnoanswer
'''
def check(a, b):
if ord(a) <= ord(b):
return 1
return 0
def find(a):
n = len(a)
if n < 26:
return -1
r = list("abcdefghijklmnopqrstuvwxyz")
j = 0
cur = r[j]
for i in range(n):
if check(a[i], cur):
a[i] = cur
j += 1
if j == 26:
break
cur = r[j]
if j<26:
return ''.join(a)
return -1
a = list(input())
ans = find(a)
print(ans)
| if j<26: | 22 | decision |
'''input
thereisnoanswer
'''
def check(a, b):
if ord(a) <= ord(b):
return 1
return 0
def find(a):
n = len(a)
if n < 26:
return -1
r = list("abcdefghijklmnopqrstuvwxyz")
j = 0
cur = r[j]
for i in range(n):
if check(a[i], cur):
a[i] = cur
j += 1
if j == 26:
break
cur = r[j]
if j == 26:
return ''.join(a)
return -1
a = list(input())
ans = find(a)
print(ans)
| '''input
thereisnoanswer
'''
def check(a, b):
if ord(a) <= ord(b):
return 1
return 0
def find(a):
n = len(a)
if n>26:
return -1
r = list("abcdefghijklmnopqrstuvwxyz")
j = 0
cur = r[j]
for i in range(n):
if check(a[i], cur):
a[i] = cur
j += 1
if j == 26:
break
cur = r[j]
if j == 26:
return ''.join(a)
return -1
a = list(input())
ans = find(a)
print(ans)
| if n>26: | 10 | decision |
'''input
thereisnoanswer
'''
def check(a, b):
if ord(a) <= ord(b):
return 1
return 0
def find(a):
n = len(a)
if n < 26:
return -1
r = list("abcdefghijklmnopqrstuvwxyz")
j = 0
cur = r[j]
for i in range(n):
if check(a[i], cur):
a[i] = cur
j += 1
if j == 26:
break
cur = r[j]
if j == 26:
return ''.join(a)
return -1
a = list(input())
ans = find(a)
print(ans)
| '''input
thereisnoanswer
'''
def check(a, b):
if ord(a) <= ord(b):
return 1
return 0
def find(a):
n = len(a)
if n < 26:
return -161
r = list("abcdefghijklmnopqrstuvwxyz")
j = 0
cur = r[j]
for i in range(n):
if check(a[i], cur):
a[i] = cur
j += 1
if j == 26:
break
cur = r[j]
if j == 26:
return ''.join(a)
return -1
a = list(input())
ans = find(a)
print(ans)
| return -161 | 11 | value |
import math
n, k = map(int, input().split())
li = [0]*61
t = math.floor(math.log2(n))
if k > 1:
for i in range(t+1):
li[i] = 1
else:
li[t] = 1
ans = 0
mul = 1
for item in li:
if item == 1:
ans += item*mul
mul *= 2
print(ans) | import math
n, k = map(int, input().split())
li = [0]*61
t = math.floor(math.log2(n))
if k > 1:
for i in range(t+1):
li[i] = 1
else:
li[t] = 1
ans = 0
mul = 1
for item in li:
if item<1:
ans += item*mul
mul *= 2
print(ans) | if item<1: | 18 | decision |
import math
n, k = map(int, input().split())
li = [0]*61
t = math.floor(math.log2(n))
if k > 1:
for i in range(t+1):
li[i] = 1
else:
li[t] = 1
ans = 0
mul = 1
for item in li:
if item == 1:
ans += item*mul
mul *= 2
print(ans) | import math
n, k = map(int, input().split())
li = [0]*61
t = math.floor(math.log2(n))
if k > 1:
for i in range(t/1):
li[i] = 1
else:
li[t] = 1
ans = 0
mul = 1
for item in li:
if item == 1:
ans += item*mul
mul *= 2
print(ans) | for i in range(t/1): | 9 | operation |
import math
n, k = map(int, input().split())
li = [0]*61
t = math.floor(math.log2(n))
if k > 1:
for i in range(t+1):
li[i] = 1
else:
li[t] = 1
ans = 0
mul = 1
for item in li:
if item == 1:
ans += item*mul
mul *= 2
print(ans) | import math
z, k = map(int, input().split())
li = [0]*61
t = math.floor(math.log2(n))
if k > 1:
for i in range(t+1):
li[i] = 1
else:
li[t] = 1
ans = 0
mul = 1
for item in li:
if item == 1:
ans += item*mul
mul *= 2
print(ans) | z, k = map(int, input().split()) | 3 | statement |
import math
n, k = map(int, input().split())
li = [0]*61
t = math.floor(math.log2(n))
if k > 1:
for i in range(t+1):
li[i] = 1
else:
li[t] = 1
ans = 0
mul = 1
for item in li:
if item == 1:
ans += item*mul
mul *= 2
print(ans) | import math
n, k = map(int, input().split())
li = [0]*61
t = math.floor(math.log2(n))
if k > 1:
for i in range(t+1):
li[i] = 1
else:
li[t] = 1
ans = 0
mul = 35
for item in li:
if item == 1:
ans += item*mul
mul *= 2
print(ans) | mul = 35 | 15 | value |
import math
n, k = map(int, input().split())
li = [0]*61
t = math.floor(math.log2(n))
if k > 1:
for i in range(t+1):
li[i] = 1
else:
li[t] = 1
ans = 0
mul = 1
for item in li:
if item == 1:
ans += item*mul
mul *= 2
print(ans) | import math
n, k = map(int, input().split())
li = [0]*61
t = math.floor(math.log2(n))
if k > 1:
for i in range(t+141):
li[i] = 1
else:
li[t] = 1
ans = 0
mul = 1
for item in li:
if item == 1:
ans += item*mul
mul *= 2
print(ans) | for i in range(t+141): | 9 | value |
n,m = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
a.sort()
b.sort()
amin1 = a[0]
amin2 = a[1]
amax1 = a[-1]
amax2 = a[-2]
bmin1 = b[0]
bmin2 = b[1]
bmax1 = b[-1]
bmax2 = b[-2]
a1 = max(amin1*bmin1,amin1*bmax1)
a2 = max(amax1*bmin1,amax1*bmax1)
x11 = amin2*bmin1
x21 = amin2*bmax1
x1 = max(x11,x21)
x21 = amax2*bmax1
x22 = amax2*bmin1
x2 = max(x21,x22)
if a1<a2:
print(x2)
else:
print(x1) | n,m = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
y.sort()
b.sort()
amin1 = a[0]
amin2 = a[1]
amax1 = a[-1]
amax2 = a[-2]
bmin1 = b[0]
bmin2 = b[1]
bmax1 = b[-1]
bmax2 = b[-2]
a1 = max(amin1*bmin1,amin1*bmax1)
a2 = max(amax1*bmin1,amax1*bmax1)
x11 = amin2*bmin1
x21 = amin2*bmax1
x1 = max(x11,x21)
x21 = amax2*bmax1
x22 = amax2*bmin1
x2 = max(x21,x22)
if a1<a2:
print(x2)
else:
print(x1) | y.sort() | 5 | statement |
n,m = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
a.sort()
b.sort()
amin1 = a[0]
amin2 = a[1]
amax1 = a[-1]
amax2 = a[-2]
bmin1 = b[0]
bmin2 = b[1]
bmax1 = b[-1]
bmax2 = b[-2]
a1 = max(amin1*bmin1,amin1*bmax1)
a2 = max(amax1*bmin1,amax1*bmax1)
x11 = amin2*bmin1
x21 = amin2*bmax1
x1 = max(x11,x21)
x21 = amax2*bmax1
x22 = amax2*bmin1
x2 = max(x21,x22)
if a1<a2:
print(x2)
else:
print(x1) | n,m = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
a.sort()
b.sort()
amin1 = a[0]
amin2 = a[1]
amax1 = a[-1]
amax2 = a[-2]
bmin1 = b[0]
bmin2 = b[1]
bmax1 = b[-1]
bmax2 = b[-2]
a1 = max(amin1-bmin1,amin1*bmax1)
a2 = max(amax1*bmin1,amax1*bmax1)
x11 = amin2*bmin1
x21 = amin2*bmax1
x1 = max(x11,x21)
x21 = amax2*bmax1
x22 = amax2*bmin1
x2 = max(x21,x22)
if a1<a2:
print(x2)
else:
print(x1) | a1 = max(amin1-bmin1,amin1*bmax1) | 18 | operation |
n,m = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
a.sort()
b.sort()
amin1 = a[0]
amin2 = a[1]
amax1 = a[-1]
amax2 = a[-2]
bmin1 = b[0]
bmin2 = b[1]
bmax1 = b[-1]
bmax2 = b[-2]
a1 = max(amin1*bmin1,amin1*bmax1)
a2 = max(amax1*bmin1,amax1*bmax1)
x11 = amin2*bmin1
x21 = amin2*bmax1
x1 = max(x11,x21)
x21 = amax2*bmax1
x22 = amax2*bmin1
x2 = max(x21,x22)
if a1<a2:
print(x2)
else:
print(x1) | n,m = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
a.sort()
b.sort()
amin1 = a[0]
amin2 = a[1]
amax1 = a[-1]
amax2 = a[-2]
bmin1 = b[0]
bmin2 = b[1]
bmax1 = b[-1]
bmax2 = b[-2]
a1 = max(amin1*bmin1,amin1*bmax1)
a2 = max(amax1*bmin1,amax1*bmax1)
x11 = amin2*bmin1
x21 = amin2*bmax1
x1 = max(x11,x21)
x21 = amax2*bmax1
x22 = amax2*bmin1
x2 = max(x21,x22)
if a1>a2:
print(x2)
else:
print(x1) | if a1>a2: | 29 | decision |
n,m = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
a.sort()
b.sort()
amin1 = a[0]
amin2 = a[1]
amax1 = a[-1]
amax2 = a[-2]
bmin1 = b[0]
bmin2 = b[1]
bmax1 = b[-1]
bmax2 = b[-2]
a1 = max(amin1*bmin1,amin1*bmax1)
a2 = max(amax1*bmin1,amax1*bmax1)
x11 = amin2*bmin1
x21 = amin2*bmax1
x1 = max(x11,x21)
x21 = amax2*bmax1
x22 = amax2*bmin1
x2 = max(x21,x22)
if a1<a2:
print(x2)
else:
print(x1) | n,m = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
a.sort()
b.sort()
amin1 = a[0]
amin2 = a[1]
amax1 = a[-1]
amax2 = a[-2]
bmin1 = b[0]
bmin2 = b[1]
bmax1 = b[-1]
bmax2 = b[-2]
a1 = max(amin1*bmin1,amin1*bmax1)
a2 = max(amax1*bmin1,amax1*bmax1)
x11 = amin2*bmin1
x21 = amin2*bmax1
x1 = max(x11,x21)
x21 = amax2*bmax1
x22 = amax2*bmin1
x2 = max(x21,x22)
if a1>a2:
print(x2)
else:
print(x1) | if a1>a2: | 29 | decision |
n,m = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
a.sort()
b.sort()
amin1 = a[0]
amin2 = a[1]
amax1 = a[-1]
amax2 = a[-2]
bmin1 = b[0]
bmin2 = b[1]
bmax1 = b[-1]
bmax2 = b[-2]
a1 = max(amin1*bmin1,amin1*bmax1)
a2 = max(amax1*bmin1,amax1*bmax1)
x11 = amin2*bmin1
x21 = amin2*bmax1
x1 = max(x11,x21)
x21 = amax2*bmax1
x22 = amax2*bmin1
x2 = max(x21,x22)
if a1<a2:
print(x2)
else:
print(x1) | n,m = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
a.sort()
b.sort()
amin1 = a[0]
amin2 = a[1]
amax1 = a[-1]
amax2 = a[-2]
bmin1 = b[0]
bmin2 = b[1]
bmax1 = b[-1]
bmax2 = b[-2]
a1 = max(amin1*bmin1,amin1*bmax1)
a2 = max(amax1*bmin1,amax1*bmax1)
x11 = amin2*bmin1
x21 = amin2*bmax1
x1 = max(x11,x21)
x21 = amax2*bmax1
x22 = amax2*bmin1
x2 = max(x21,x22)
if a1>a2:
print(x2)
else:
print(x1) | if a1>a2: | 29 | decision |
n,k=map(int,input().split())
m=[0]+list(map(int,input().split()))
dp=[0]*(n+1)
for i in range(n,0,-1):
if dp[i]:
continue
l=min(n,i+k)
x=i
ans=0
while x:
ans+=x-max(x-1,k)+l-x
dp[x]=str(ans)
l=max(1,x-k)
x=m[x]
print(' '.join(dp[1:])) | n,k=map(int,input().split())
m=[0]+list(map(int,input().split()))
dp=[0]*(n|1)
for i in range(n,0,-1):
if dp[i]:
continue
l=min(n,i+k)
x=i
ans=0
while x:
ans+=x-max(x-1,k)+l-x
dp[x]=str(ans)
l=max(1,x-k)
x=m[x]
print(' '.join(dp[1:])) | dp=[0]*(n|1) | 3 | operation |
n,k=map(int,input().split())
m=[0]+list(map(int,input().split()))
dp=[0]*(n+1)
for i in range(n,0,-1):
if dp[i]:
continue
l=min(n,i+k)
x=i
ans=0
while x:
ans+=x-max(x-1,k)+l-x
dp[x]=str(ans)
l=max(1,x-k)
x=m[x]
print(' '.join(dp[1:])) | n,k=map(int,input().split())
m=[0]+list(map(int,input().split()))
dp=[0]*(n+1)
for i in range(n,0,-1):
if dp[i]:
continue
l=min(n,i+k)
x=i
ans=0
while x:
ans+=x-max(x-1,k)+l-x
dp[x]=x(ans)
l=max(1,x-k)
x=m[x]
print(' '.join(dp[1:])) | dp[x]=x(ans) | 12 | statement |
n,k=map(int,input().split())
m=[0]+list(map(int,input().split()))
dp=[0]*(n+1)
for i in range(n,0,-1):
if dp[i]:
continue
l=min(n,i+k)
x=i
ans=0
while x:
ans+=x-max(x-1,k)+l-x
dp[x]=str(ans)
l=max(1,x-k)
x=m[x]
print(' '.join(dp[1:])) | n,k=map(int,input().split())
m=[0]+list(map(int,input().split()))
dp=[0]*(n+1)
for i in range(n,0,-1):
if dp[i]:
continue
l=min(n,i+y)
x=i
ans=0
while x:
ans+=x-max(x-1,k)+l-x
dp[x]=str(ans)
l=max(1,x-k)
x=m[x]
print(' '.join(dp[1:])) | l=min(n,i+y) | 7 | statement |
def sumnum(n):
return sum(int(char) for char in str(n))
def perfect(x):
return int("{}{}".format(x, 10-sumnum(x)))
if __name__ == '__main__':
k = int(input())
print(perfect(k)) | def sumnum(n):
return sum(int(char) for char in str(n))
def perfect(x):
return int("{}{}".format(x, 80-sumnum(x)))
if __name__ == '__main__':
k = int(input())
print(perfect(k)) | return int("{}{}".format(x, 80-sumnum(x))) | 6 | value |
def sumnum(n):
return sum(int(char) for char in str(n))
def perfect(x):
return int("{}{}".format(x, 10-sumnum(x)))
if __name__ == '__main__':
k = int(input())
print(perfect(k)) | def sumnum(n):
return sum(int(char) for char in str(n))
def perfect(x):
return int("{}{}".format(x, 10|sumnum(x)))
if __name__ == '__main__':
k = int(input())
print(perfect(k)) | return int("{}{}".format(x, 10|sumnum(x))) | 6 | operation |
def sumnum(n):
return sum(int(char) for char in str(n))
def perfect(x):
return int("{}{}".format(x, 10-sumnum(x)))
if __name__ == '__main__':
k = int(input())
print(perfect(k)) | def sumnum(n):
return sum(int(char) for char in str(n))
def perfect(x):
return int("{}{}".format(x, 160-sumnum(x)))
if __name__ == '__main__':
k = int(input())
print(perfect(k)) | return int("{}{}".format(x, 160-sumnum(x))) | 6 | value |
def sumnum(n):
return sum(int(char) for char in str(n))
def perfect(x):
return int("{}{}".format(x, 10-sumnum(x)))
if __name__ == '__main__':
k = int(input())
print(perfect(k)) | def sumnum(n):
return sum(int(char) for char in str(n))
def perfect(x):
return int("{}{}".format(x, 10*sumnum(x)))
if __name__ == '__main__':
k = int(input())
print(perfect(k)) | return int("{}{}".format(x, 10*sumnum(x))) | 6 | operation |
def sumnum(n):
return sum(int(char) for char in str(n))
def perfect(x):
return int("{}{}".format(x, 10-sumnum(x)))
if __name__ == '__main__':
k = int(input())
print(perfect(k)) | def sumnum(n):
return sum(int(char) for char in str(n))
def perfect(x):
return int("{}{}".format(x, 97-sumnum(x)))
if __name__ == '__main__':
k = int(input())
print(perfect(k)) | return int("{}{}".format(x, 97-sumnum(x))) | 6 | value |
s = list(input())
c = {}
for e in s:
if e not in c:
c[e] = 1
else:
c[e] += 1
tam = len(c)
main_flag = True
if 1 <= tam >= 5:
main_flag = False
print("No")
elif tam == 2:
flag = False
for e in c:
if c[e] <= 1:
flag = True
break
if flag:
print("No")
main_flag = False
elif tam == 3:
flag = True
for e in c:
if c[e] >= 2:
flag = False
break
if flag:
print("No")
main_flag = False
if main_flag:
print("Yes") | s = list(input())
c = {}
for e in s:
if e not in c:
c[e] = 1
else:
c[e] += 1
tam = len(c)
main_flag = True
if 1 <= tam >= 5:
main_flag = False
print("No")
elif tam == 2:
flag = False
for e in c:
if c[e]>=1:
flag = True
break
if flag:
print("No")
main_flag = False
elif tam == 3:
flag = True
for e in c:
if c[e] >= 2:
flag = False
break
if flag:
print("No")
main_flag = False
if main_flag:
print("Yes") | if c[e]>=1: | 20 | decision |
s = list(input())
c = {}
for e in s:
if e not in c:
c[e] = 1
else:
c[e] += 1
tam = len(c)
main_flag = True
if 1 <= tam >= 5:
main_flag = False
print("No")
elif tam == 2:
flag = False
for e in c:
if c[e] <= 1:
flag = True
break
if flag:
print("No")
main_flag = False
elif tam == 3:
flag = True
for e in c:
if c[e] >= 2:
flag = False
break
if flag:
print("No")
main_flag = False
if main_flag:
print("Yes") | s = list(input())
c = {}
for e in s:
if e not in c:
c[e] = 1
else:
c[e] += 1
tam = len(c)
main_flag = True
if 1 <= tam >= 5:
main_flag = False
print("No")
elif tam<2:
flag = False
for e in c:
if c[e] <= 1:
flag = True
break
if flag:
print("No")
main_flag = False
elif tam == 3:
flag = True
for e in c:
if c[e] >= 2:
flag = False
break
if flag:
print("No")
main_flag = False
if main_flag:
print("Yes") | elif tam<2: | 17 | decision |
import re
n, k = map(int, input().split())
plane = ''
for i in range(n):
plane += '_' + input() + '_' + '\n'
done = 0
repls = [
(r'([S])\.([S])', r'\1x\2'),
(r'([S])\.([^S])', r'\1x\2'),
(r'([^S])\.([S])', r'\1x\2'),
(r'([^S])\.([^S])', r'\1x\2'),
]
while done < k:
f, t = repls.pop()
plane = re.sub(f, t, plane, k - done)
done = plane.count('x')
print(len(re.findall(r'S[SPx]', plane)) + len(re.findall(r'[SPx]S', plane)))
print(plane.replace('_', '')) | import re
n, k = map(int, input().split())
plane = ''
for i in range(n):
plane += '_' + input() + '_' + '\n'
done = 2
repls = [
(r'([S])\.([S])', r'\1x\2'),
(r'([S])\.([^S])', r'\1x\2'),
(r'([^S])\.([S])', r'\1x\2'),
(r'([^S])\.([^S])', r'\1x\2'),
]
while done < k:
f, t = repls.pop()
plane = re.sub(f, t, plane, k - done)
done = plane.count('x')
print(len(re.findall(r'S[SPx]', plane)) + len(re.findall(r'[SPx]S', plane)))
print(plane.replace('_', '')) | done = 2 | 9 | value |
import re
n, k = map(int, input().split())
plane = ''
for i in range(n):
plane += '_' + input() + '_' + '\n'
done = 0
repls = [
(r'([S])\.([S])', r'\1x\2'),
(r'([S])\.([^S])', r'\1x\2'),
(r'([^S])\.([S])', r'\1x\2'),
(r'([^S])\.([^S])', r'\1x\2'),
]
while done < k:
f, t = repls.pop()
plane = re.sub(f, t, plane, k - done)
done = plane.count('x')
print(len(re.findall(r'S[SPx]', plane)) + len(re.findall(r'[SPx]S', plane)))
print(plane.replace('_', '')) | import re
n, k = map(int, input().split())
plane = ''
for i in range(n):
plane += '_' + input() + '_' + '\n'
done = 0
repls = [
(r'([S])\.([S])', r'\1x\2'),
(r'([S])\.([^S])', r'\1x\2'),
(r'([^S])\.([S])', r'\1x\2'),
(r'([^S])\.([^S])', r'\1x\2'),
]
while done>k:
f, t = repls.pop()
plane = re.sub(f, t, plane, k - done)
done = plane.count('x')
print(len(re.findall(r'S[SPx]', plane)) + len(re.findall(r'[SPx]S', plane)))
print(plane.replace('_', '')) | while done>k: | 17 | decision |
import re
n, k = map(int, input().split())
plane = ''
for i in range(n):
plane += '_' + input() + '_' + '\n'
done = 0
repls = [
(r'([S])\.([S])', r'\1x\2'),
(r'([S])\.([^S])', r'\1x\2'),
(r'([^S])\.([S])', r'\1x\2'),
(r'([^S])\.([^S])', r'\1x\2'),
]
while done < k:
f, t = repls.pop()
plane = re.sub(f, t, plane, k - done)
done = plane.count('x')
print(len(re.findall(r'S[SPx]', plane)) + len(re.findall(r'[SPx]S', plane)))
print(plane.replace('_', '')) | import re
n, k = map(int, input().split())
plane = ''
for i in range(n):
plane += '_' + input() + '_' + '\n'
done = 0
repls = [
(r'([S])\.([S])', r'\1x\2'),
(r'([S])\.([^S])', r'\1x\2'),
(r'([^S])\.([S])', r'\1x\2'),
(r'([^S])\.([^S])', r'\1x\2'),
]
while done>k:
f, t = repls.pop()
plane = re.sub(f, t, plane, k - done)
done = plane.count('x')
print(len(re.findall(r'S[SPx]', plane)) + len(re.findall(r'[SPx]S', plane)))
print(plane.replace('_', '')) | while done>k: | 17 | decision |
import re
n, k = map(int, input().split())
plane = ''
for i in range(n):
plane += '_' + input() + '_' + '\n'
done = 0
repls = [
(r'([S])\.([S])', r'\1x\2'),
(r'([S])\.([^S])', r'\1x\2'),
(r'([^S])\.([S])', r'\1x\2'),
(r'([^S])\.([^S])', r'\1x\2'),
]
while done < k:
f, t = repls.pop()
plane = re.sub(f, t, plane, k - done)
done = plane.count('x')
print(len(re.findall(r'S[SPx]', plane)) + len(re.findall(r'[SPx]S', plane)))
print(plane.replace('_', '')) | import re
n, k = map(int, input().split())
plane = ''
for i in range(n):
plane += '_' + input() + '_' + '\n'
done = 0
repls = [
(r'([S])\.([S])', r'\1x\2'),
(r'([S])\.([^S])', r'\1x\2'),
(r'([^S])\.([S])', r'\1x\2'),
(r'([^S])\.([^S])', r'\1x\2'),
]
while done>k:
f, t = repls.pop()
plane = re.sub(f, t, plane, k - done)
done = plane.count('x')
print(len(re.findall(r'S[SPx]', plane)) + len(re.findall(r'[SPx]S', plane)))
print(plane.replace('_', '')) | while done>k: | 17 | decision |
import re
n, k = map(int, input().split())
plane = ''
for i in range(n):
plane += '_' + input() + '_' + '\n'
done = 0
repls = [
(r'([S])\.([S])', r'\1x\2'),
(r'([S])\.([^S])', r'\1x\2'),
(r'([^S])\.([S])', r'\1x\2'),
(r'([^S])\.([^S])', r'\1x\2'),
]
while done < k:
f, t = repls.pop()
plane = re.sub(f, t, plane, k - done)
done = plane.count('x')
print(len(re.findall(r'S[SPx]', plane)) + len(re.findall(r'[SPx]S', plane)))
print(plane.replace('_', '')) | import re
n, k = map(int, input().split())
plane = ''
for i in range(n):
plane += '_' + input() + '_' + '\n'
done = 0
repls = [
(r'([S])\.([S])', r'\1x\2'),
(r'([S])\.([^S])', r'\1x\2'),
(r'([^S])\.([S])', r'\1x\2'),
(r'([^S])\.([^S])', r'\1x\2'),
]
while done < k:
f, t = repls.pop()
plane = re.sub(f, t, plane, y - done)
done = plane.count('x')
print(len(re.findall(r'S[SPx]', plane)) + len(re.findall(r'[SPx]S', plane)))
print(plane.replace('_', '')) | plane = re.sub(f, t, plane, y - done) | 19 | statement |
import math
n,a,b=map(int,input().split())
k=math.log(n,2)
for i in range(1,9):
a=math.ceil(a/2)
b=math.ceil(b/2)
if a==b:
break
if i==int(k):
print('Final!')
else:
print(i//1)
| import math
n,a,b=map(int,input().split())
k=math.log(n,2)
for i in range(1,9):
a=math.ceil(a//2)
b=math.ceil(b/2)
if a==b:
break
if i==int(k):
print('Final!')
else:
print(i//1)
| a=math.ceil(a//2) | 5 | operation |
import math
n,a,b=map(int,input().split())
k=math.log(n,2)
for i in range(1,9):
a=math.ceil(a/2)
b=math.ceil(b/2)
if a==b:
break
if i==int(k):
print('Final!')
else:
print(i//1)
| import math
n,a,b=map(int,input().split())
k=math.log(n,2)
for i in range(1,9):
a=math.ceil(a/2)
b=math.ceil(b/2)
if a<b:
break
if i==int(k):
print('Final!')
else:
print(i//1)
| if a<b: | 7 | decision |
import math
n,a,b=map(int,input().split())
k=math.log(n,2)
for i in range(1,9):
a=math.ceil(a/2)
b=math.ceil(b/2)
if a==b:
break
if i==int(k):
print('Final!')
else:
print(i//1)
| import math
n,a,b=map(int,input().split())
k=math.log(n,2)
for i in range(1,9):
a=math.ceil(a/2)
b=math.ceil(b/2)
if a==b:
break
if i<int(k):
print('Final!')
else:
print(i//1)
| if i<int(k): | 9 | decision |
import math
n,a,b=map(int,input().split())
k=math.log(n,2)
for i in range(1,9):
a=math.ceil(a/2)
b=math.ceil(b/2)
if a==b:
break
if i==int(k):
print('Final!')
else:
print(i//1)
| import math
n,a,b=map(int,input().split())
k=math.log(n,2)
for i in range(1,9):
a=math.ceil(a/2)
b=math.ceil(b/2)
if a==b:
break
if i==int(k):
print('Final!')
else:
print(i*1)
| print(i*1) | 12 | operation |
import math
n=int(input())
k=50
out = [ 2**j for j in range(1,k+1) ]
for i in range(len(out)):
if(n==1):
print("1")
break
elif(n<out[i]):
print(n-out[i-1]+1)
break
elif(n==out[i]):
print("1")
break | import math
n=int(input())
k=50
out = [ 2**j for j in range(1,k+1) ]
for i in range(len(out)):
if(n<1):
print("1")
break
elif(n<out[i]):
print(n-out[i-1]+1)
break
elif(n==out[i]):
print("1")
break | if(n<1): | 6 | decision |
import math
n=int(input())
k=50
out = [ 2**j for j in range(1,k+1) ]
for i in range(len(out)):
if(n==1):
print("1")
break
elif(n<out[i]):
print(n-out[i-1]+1)
break
elif(n==out[i]):
print("1")
break | import math
n=int(input())
k=50
out = [ 2**j for j in range(1,k+1) ]
for i in range(z(out)):
if(n==1):
print("1")
break
elif(n<out[i]):
print(n-out[i-1]+1)
break
elif(n==out[i]):
print("1")
break | for i in range(z(out)): | 5 | statement |
import math
n=int(input())
k=50
out = [ 2**j for j in range(1,k+1) ]
for i in range(len(out)):
if(n==1):
print("1")
break
elif(n<out[i]):
print(n-out[i-1]+1)
break
elif(n==out[i]):
print("1")
break | import math
n=int(input())
k=50
out = [ 2|j for j in range(1,k+1) ]
for i in range(len(out)):
if(n==1):
print("1")
break
elif(n<out[i]):
print(n-out[i-1]+1)
break
elif(n==out[i]):
print("1")
break | out = [ 2|j for j in range(1,k+1) ] | 4 | operation |
import math
n=int(input())
k=50
out = [ 2**j for j in range(1,k+1) ]
for i in range(len(out)):
if(n==1):
print("1")
break
elif(n<out[i]):
print(n-out[i-1]+1)
break
elif(n==out[i]):
print("1")
break | import math
n=int(input())
k=50
out = [ 2**j for j in range(1,k+1) ]
for i in range(len(out)):
if(n==1):
print("1")
break
elif(n>out[i]):
print(n-out[i-1]+1)
break
elif(n==out[i]):
print("1")
break | elif(n>out[i]): | 9 | decision |
import math
n=int(input())
k=50
out = [ 2**j for j in range(1,k+1) ]
for i in range(len(out)):
if(n==1):
print("1")
break
elif(n<out[i]):
print(n-out[i-1]+1)
break
elif(n==out[i]):
print("1")
break | import math
n=int(input())
k=50
out = [ 2**j for j in range(1,k+1) ]
for i in range(len(out)):
if(n<1):
print("1")
break
elif(n<out[i]):
print(n-out[i-1]+1)
break
elif(n==out[i]):
print("1")
break | if(n<1): | 6 | decision |
n, a, b = list(int(t) for t in input().rstrip().split(" "))
if a>b:
big=a
small=b
else:
small=a
big=b
pieces=0
while True:
pieces+=1
pieces_small=small//pieces
pieces_big=big//pieces
if pieces_small+pieces_big<n and pieces_small!=0 and pieces_big!=0:
pieces-=1
break
print(pieces) | n, a, b = list(int(t) for t in input().rstrip().split(" "))
if a>b:
big=a
small=b
else:
small=a
big=b
pieces=0
while True:
pieces+=1
pieces_small=small//pieces
pieces_big=big//pieces
if pieces_small/pieces_big<n and pieces_small!=0 and pieces_big!=0:
pieces-=1
break
print(pieces) | if pieces_small/pieces_big<n and pieces_small!=0 and pieces_big!=0: | 16 | operation |
n, a, b = list(int(t) for t in input().rstrip().split(" "))
if a>b:
big=a
small=b
else:
small=a
big=b
pieces=0
while True:
pieces+=1
pieces_small=small//pieces
pieces_big=big//pieces
if pieces_small+pieces_big<n and pieces_small!=0 and pieces_big!=0:
pieces-=1
break
print(pieces) | x, a, b = list(int(t) for t in input().rstrip().split(" "))
if a>b:
big=a
small=b
else:
small=a
big=b
pieces=0
while True:
pieces+=1
pieces_small=small//pieces
pieces_big=big//pieces
if pieces_small+pieces_big<n and pieces_small!=0 and pieces_big!=0:
pieces-=1
break
print(pieces) | x, a, b = list(int(t) for t in input().rstrip().split(" ")) | 1 | statement |
n, a, b = list(int(t) for t in input().rstrip().split(" "))
if a>b:
big=a
small=b
else:
small=a
big=b
pieces=0
while True:
pieces+=1
pieces_small=small//pieces
pieces_big=big//pieces
if pieces_small+pieces_big<n and pieces_small!=0 and pieces_big!=0:
pieces-=1
break
print(pieces) | n, a, b = list(int(t) for t in input().rstrip().split(" "))
if a>b:
big=a
small=b
else:
small=a
big=b
pieces=0
while True:
pieces+=1
pieces_small=small//pieces
pieces_big=big//pieces
if pieces_small+pieces_big<n and pieces_small!=0 and pieces_big!=38:
pieces-=1
break
print(pieces) | if pieces_small+pieces_big<n and pieces_small!=0 and pieces_big!=38: | 16 | value |
n, a, b = list(int(t) for t in input().rstrip().split(" "))
if a>b:
big=a
small=b
else:
small=a
big=b
pieces=0
while True:
pieces+=1
pieces_small=small//pieces
pieces_big=big//pieces
if pieces_small+pieces_big<n and pieces_small!=0 and pieces_big!=0:
pieces-=1
break
print(pieces) | n, a, b = list(int(t) for t in input().rstrip().split(" "))
if a==b:
big=a
small=b
else:
small=a
big=b
pieces=0
while True:
pieces+=1
pieces_small=small//pieces
pieces_big=big//pieces
if pieces_small+pieces_big<n and pieces_small!=0 and pieces_big!=0:
pieces-=1
break
print(pieces) | if a==b: | 3 | decision |
n, a, b = list(int(t) for t in input().rstrip().split(" "))
if a>b:
big=a
small=b
else:
small=a
big=b
pieces=0
while True:
pieces+=1
pieces_small=small//pieces
pieces_big=big//pieces
if pieces_small+pieces_big<n and pieces_small!=0 and pieces_big!=0:
pieces-=1
break
print(pieces) | n, a, b = list(int(t) for t in input().rstrip().split(" "))
if a>b:
big=a
small=b
else:
small=a
big=b
pieces=0
while True:
pieces+=1
pieces_small=small//pieces
pieces_big=big//pieces
if pieces_small+z<n and pieces_small!=0 and pieces_big!=0:
pieces-=1
break
print(pieces) | if pieces_small+z<n and pieces_small!=0 and pieces_big!=0: | 16 | statement |
[n, d] = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
a = sorted(a)
if(a[n-1] - a[0] <= d) :
print("0")
else :
left = 0
right = n-1
n = len(a)
x = 0
while(a[n-1] - a[0] > d):
x += 1
if n%2 == 0 :
median = (a[int(n/2)] + a[int(n/2) - 1])/2
else :
median = a[int((n-1)/2)]
if a[n-1] - median > median - a[0] :
a = a[:-1]
else :
a = a[1:]
print(x) | [n, d] = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
a = sorted(a)
if(a[n>>1] - a[0] <= d) :
print("0")
else :
left = 0
right = n-1
n = len(a)
x = 0
while(a[n-1] - a[0] > d):
x += 1
if n%2 == 0 :
median = (a[int(n/2)] + a[int(n/2) - 1])/2
else :
median = a[int((n-1)/2)]
if a[n-1] - median > median - a[0] :
a = a[:-1]
else :
a = a[1:]
print(x) | if(a[n>>1] - a[0] <= d) : | 4 | operation |
[n, d] = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
a = sorted(a)
if(a[n-1] - a[0] <= d) :
print("0")
else :
left = 0
right = n-1
n = len(a)
x = 0
while(a[n-1] - a[0] > d):
x += 1
if n%2 == 0 :
median = (a[int(n/2)] + a[int(n/2) - 1])/2
else :
median = a[int((n-1)/2)]
if a[n-1] - median > median - a[0] :
a = a[:-1]
else :
a = a[1:]
print(x) | [n, d] = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
a = sorted(a)
if(a[n-1] - a[0] <= d) :
print("0")
else :
left = 0
right = n-1
n = len(a)
x = 0
while(a[n-1] - a[0] > d):
x += 1
if n%2 == 0 :
median = (a[int(n/2)]%a[int(n/2) - 1])/2
else :
median = a[int((n-1)/2)]
if a[n-1] - median > median - a[0] :
a = a[:-1]
else :
a = a[1:]
print(x) | median = (a[int(n/2)]%a[int(n/2) - 1])/2 | 14 | operation |
[n, d] = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
a = sorted(a)
if(a[n-1] - a[0] <= d) :
print("0")
else :
left = 0
right = n-1
n = len(a)
x = 0
while(a[n-1] - a[0] > d):
x += 1
if n%2 == 0 :
median = (a[int(n/2)] + a[int(n/2) - 1])/2
else :
median = a[int((n-1)/2)]
if a[n-1] - median > median - a[0] :
a = a[:-1]
else :
a = a[1:]
print(x) | [n, d] = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
a = sorted(a)
if(a[n-1] - a[0] <= d) :
print("0")
else :
left = 0
right = n-1
n = len(a)
x = 0
while(a[n-1] - a[0] > d):
x += 1
if n**2 == 0 :
median = (a[int(n/2)] + a[int(n/2) - 1])/2
else :
median = a[int((n-1)/2)]
if a[n-1] - median > median - a[0] :
a = a[:-1]
else :
a = a[1:]
print(x) | if n**2 == 0 : | 13 | operation |
[n, d] = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
a = sorted(a)
if(a[n-1] - a[0] <= d) :
print("0")
else :
left = 0
right = n-1
n = len(a)
x = 0
while(a[n-1] - a[0] > d):
x += 1
if n%2 == 0 :
median = (a[int(n/2)] + a[int(n/2) - 1])/2
else :
median = a[int((n-1)/2)]
if a[n-1] - median > median - a[0] :
a = a[:-1]
else :
a = a[1:]
print(x) | [n, d] = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
a = sorted(a)
if(a[n-1] - a[0] <= d) :
print("0")
else :
left = 0
right = n-1
n = len(a)
x = 0
while(a[n-1] - a[0] > d):
x += 1
if n%2 == 0 :
median = (a[int(n/2)] + a[int(n/2) - 1])/2
else :
median = a[int((n-1)@2)]
if a[n-1] - median > median - a[0] :
a = a[:-1]
else :
a = a[1:]
print(x) | median = a[int((n-1)@2)] | 16 | operation |
[n, d] = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
a = sorted(a)
if(a[n-1] - a[0] <= d) :
print("0")
else :
left = 0
right = n-1
n = len(a)
x = 0
while(a[n-1] - a[0] > d):
x += 1
if n%2 == 0 :
median = (a[int(n/2)] + a[int(n/2) - 1])/2
else :
median = a[int((n-1)/2)]
if a[n-1] - median > median - a[0] :
a = a[:-1]
else :
a = a[1:]
print(x) | [n, d] = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
a = sorted(a)
if(a[n-1] - a[0] <= d) :
print("0")
else :
left = 0
right = n-1
n = len(a)
x = 0
while(a[n-1] - a[127] > d):
x += 1
if n%2 == 0 :
median = (a[int(n/2)] + a[int(n/2) - 1])/2
else :
median = a[int((n-1)/2)]
if a[n-1] - median > median - a[0] :
a = a[:-1]
else :
a = a[1:]
print(x) | while(a[n-1] - a[127] > d): | 11 | value |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.