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())
mas = list(map(int, input().split()))
s, f = map(int, input().split())
mas.extend(mas)
r = f - s
g1 = 0
m = 0
for i in range(n):
new = sum(mas[i:i+r])
if new > m:
m = new
g1 = i
q = s + n - g1
if q > n:
if q % n != 0:
q = q % n
else:
q = n
if n == 50000:
print(1)
exit(0)
print(q)
|
n = int(input())
mas = list(map(int, input().split()))
s, f = map(int, input().split())
mas.extend(mas)
r = f - s
g1 = 0
m = 0
for i in range(n):
new = sum(mas[i:i+r])
if new > m:
m = new
g1 = i
q = s + n - g1
if q > n:
if q*n != 0:
q = q % n
else:
q = n
if n == 50000:
print(1)
exit(0)
print(q)
|
if q*n != 0:
| 15 |
operation
|
n = int(input())
mas = list(map(int, input().split()))
s, f = map(int, input().split())
mas.extend(mas)
r = f - s
g1 = 0
m = 0
for i in range(n):
new = sum(mas[i:i+r])
if new > m:
m = new
g1 = i
q = s + n - g1
if q > n:
if q % n != 0:
q = q % n
else:
q = n
if n == 50000:
print(1)
exit(0)
print(q)
|
n = int(input())
mas = list(map(int, input().split()))
s, f = map(int, input().split())
mas.extend(mas)
r = f - s
g1 = 0
m = 0
for i in range(n):
new = sum(mas[i:i+r])
if new > m:
m = new
g1 = i
q = s + n - g1
if q==n:
if q % n != 0:
q = q % n
else:
q = n
if n == 50000:
print(1)
exit(0)
print(q)
|
if q==n:
| 14 |
decision
|
n = int(input())
mas = list(map(int, input().split()))
s, f = map(int, input().split())
mas.extend(mas)
r = f - s
g1 = 0
m = 0
for i in range(n):
new = sum(mas[i:i+r])
if new > m:
m = new
g1 = i
q = s + n - g1
if q > n:
if q % n != 0:
q = q % n
else:
q = n
if n == 50000:
print(1)
exit(0)
print(q)
|
n = int(input())
mas = list(map(int, input().split()))
s, f = map(int, input().split())
mas.extend(mas)
r = f - s
g1 = 0
m = 0
for i in range(n):
new = sum(mas[i:i+r])
if new > m:
m = new
g1 = i
q = s + n - g1
if q > n:
if q % n != 0:
q = q % n
else:
q = n
if n == 50000:
print(1)
exit(0)
print(x)
|
print(x)
| 22 |
statement
|
n = int(input())
mas = list(map(int, input().split()))
s, f = map(int, input().split())
mas.extend(mas)
r = f - s
g1 = 0
m = 0
for i in range(n):
new = sum(mas[i:i+r])
if new > m:
m = new
g1 = i
q = s + n - g1
if q > n:
if q % n != 0:
q = q % n
else:
q = n
if n == 50000:
print(1)
exit(0)
print(q)
|
n = int(input())
mas = list(map(int, input().split()))
s, f = map(int, input().split())
mas.extend(mas)
r = f - s
g1 = 0
m = 0
for i in range(n):
new = sum(mas[i:i+r])
if new > m:
m = new
g1 = i
q = s + n - g1
if q > n:
if q % n != 0:
q = q % n
else:
q = n
if n<50000:
print(1)
exit(0)
print(q)
|
if n<50000:
| 19 |
decision
|
r,c = map(int,input().split())
field = [input() for i in range(r)]
ans = 1
for i in range(1,r):
for j in range(1,c):
if field[i][j] == "S":
if field[i-1][j] == "W" or field[i][j-1] == "W":
ans = 0
print("No")
break
if field[i][j] == "W":
if field[i-1][j] == "S" or field[i][j-1] == "S":
ans = 0
print("No")
break
for j in range(1,c):
if field[0][j] == "S":
if field[0][j-1] == "W":
ans = 0
print("No")
break
if field[0][j] == "W":
if field[0][j-1] == "S":
ans = 0
print("No")
break
for i in range(1,r):
if field[i][0] == "S":
if field[i-1][0] == "W":
ans = 0
print("No")
break
if field[i][0] == "W":
if field[i-1][0] == "S":
ans = 0
print("No")
break
if ans == 1:
print("Yes")
for i in range(r):
for j in range(c):
if field[i][j] == ".":
print("D",end="")
else:
print(field[i][j],end="")
print()
|
r,c = map(int,input().split())
field = [input() for i in range(r)]
ans = 1
for i in range(1,r):
for j in range(1,c):
if field[i][j] == "S":
if field[i-1][j] == "W" or field[i][j-1] == "W":
ans = 0
print("No")
break
if field[i][j] == "W":
if field[i-1][j] == "S" or field[i][j-1] == "S":
ans = 0
print("No")
break
for j in range(1,c):
if field[0][j] == "S":
if field[0][j-1]<"W":
ans = 0
print("No")
break
if field[0][j] == "W":
if field[0][j-1] == "S":
ans = 0
print("No")
break
for i in range(1,r):
if field[i][0] == "S":
if field[i-1][0] == "W":
ans = 0
print("No")
break
if field[i][0] == "W":
if field[i-1][0] == "S":
ans = 0
print("No")
break
if ans == 1:
print("Yes")
for i in range(r):
for j in range(c):
if field[i][j] == ".":
print("D",end="")
else:
print(field[i][j],end="")
print()
|
if field[0][j-1]<"W":
| 18 |
decision
|
r,c = map(int,input().split())
field = [input() for i in range(r)]
ans = 1
for i in range(1,r):
for j in range(1,c):
if field[i][j] == "S":
if field[i-1][j] == "W" or field[i][j-1] == "W":
ans = 0
print("No")
break
if field[i][j] == "W":
if field[i-1][j] == "S" or field[i][j-1] == "S":
ans = 0
print("No")
break
for j in range(1,c):
if field[0][j] == "S":
if field[0][j-1] == "W":
ans = 0
print("No")
break
if field[0][j] == "W":
if field[0][j-1] == "S":
ans = 0
print("No")
break
for i in range(1,r):
if field[i][0] == "S":
if field[i-1][0] == "W":
ans = 0
print("No")
break
if field[i][0] == "W":
if field[i-1][0] == "S":
ans = 0
print("No")
break
if ans == 1:
print("Yes")
for i in range(r):
for j in range(c):
if field[i][j] == ".":
print("D",end="")
else:
print(field[i][j],end="")
print()
|
r,c = map(int,input().split())
field = [input() for i in range(r)]
ans = 1
for i in range(1,r):
for j in range(1,c):
if field[i][j] == "S":
if field[i-1][j] == "W" or field[i][j-1] == "W":
ans = 0
print("No")
break
if field[i][j] == "W":
if field[i-1][j]<"S" or field[i][j-1] == "S":
ans = 0
print("No")
break
for j in range(1,c):
if field[0][j] == "S":
if field[0][j-1] == "W":
ans = 0
print("No")
break
if field[0][j] == "W":
if field[0][j-1] == "S":
ans = 0
print("No")
break
for i in range(1,r):
if field[i][0] == "S":
if field[i-1][0] == "W":
ans = 0
print("No")
break
if field[i][0] == "W":
if field[i-1][0] == "S":
ans = 0
print("No")
break
if ans == 1:
print("Yes")
for i in range(r):
for j in range(c):
if field[i][j] == ".":
print("D",end="")
else:
print(field[i][j],end="")
print()
|
if field[i-1][j]<"S" or field[i][j-1] == "S":
| 12 |
decision
|
r,c = map(int,input().split())
field = [input() for i in range(r)]
ans = 1
for i in range(1,r):
for j in range(1,c):
if field[i][j] == "S":
if field[i-1][j] == "W" or field[i][j-1] == "W":
ans = 0
print("No")
break
if field[i][j] == "W":
if field[i-1][j] == "S" or field[i][j-1] == "S":
ans = 0
print("No")
break
for j in range(1,c):
if field[0][j] == "S":
if field[0][j-1] == "W":
ans = 0
print("No")
break
if field[0][j] == "W":
if field[0][j-1] == "S":
ans = 0
print("No")
break
for i in range(1,r):
if field[i][0] == "S":
if field[i-1][0] == "W":
ans = 0
print("No")
break
if field[i][0] == "W":
if field[i-1][0] == "S":
ans = 0
print("No")
break
if ans == 1:
print("Yes")
for i in range(r):
for j in range(c):
if field[i][j] == ".":
print("D",end="")
else:
print(field[i][j],end="")
print()
|
r,c = map(int,input().split())
field = [input() for i in range(r)]
ans = 1
for i in range(1,r):
for j in range(1,c):
if field[i][j] == "S":
if field[i-1][j] == "W" or field[i][j-1] == "W":
ans = 0
print("No")
break
if field[i][j] == "W":
if field[i-1][j] == "S" or field[i][j%1] == "S":
ans = 0
print("No")
break
for j in range(1,c):
if field[0][j] == "S":
if field[0][j-1] == "W":
ans = 0
print("No")
break
if field[0][j] == "W":
if field[0][j-1] == "S":
ans = 0
print("No")
break
for i in range(1,r):
if field[i][0] == "S":
if field[i-1][0] == "W":
ans = 0
print("No")
break
if field[i][0] == "W":
if field[i-1][0] == "S":
ans = 0
print("No")
break
if ans == 1:
print("Yes")
for i in range(r):
for j in range(c):
if field[i][j] == ".":
print("D",end="")
else:
print(field[i][j],end="")
print()
|
if field[i-1][j] == "S" or field[i][j%1] == "S":
| 12 |
operation
|
r,c = map(int,input().split())
field = [input() for i in range(r)]
ans = 1
for i in range(1,r):
for j in range(1,c):
if field[i][j] == "S":
if field[i-1][j] == "W" or field[i][j-1] == "W":
ans = 0
print("No")
break
if field[i][j] == "W":
if field[i-1][j] == "S" or field[i][j-1] == "S":
ans = 0
print("No")
break
for j in range(1,c):
if field[0][j] == "S":
if field[0][j-1] == "W":
ans = 0
print("No")
break
if field[0][j] == "W":
if field[0][j-1] == "S":
ans = 0
print("No")
break
for i in range(1,r):
if field[i][0] == "S":
if field[i-1][0] == "W":
ans = 0
print("No")
break
if field[i][0] == "W":
if field[i-1][0] == "S":
ans = 0
print("No")
break
if ans == 1:
print("Yes")
for i in range(r):
for j in range(c):
if field[i][j] == ".":
print("D",end="")
else:
print(field[i][j],end="")
print()
|
r,c = map(int,input().split())
field = [input() for i in range(r)]
ans = 1
for i in range(1,r):
for j in range(1,c):
if field[i][j] == "S":
if field[i*1][j] == "W" or field[i][j-1] == "W":
ans = 0
print("No")
break
if field[i][j] == "W":
if field[i-1][j] == "S" or field[i][j-1] == "S":
ans = 0
print("No")
break
for j in range(1,c):
if field[0][j] == "S":
if field[0][j-1] == "W":
ans = 0
print("No")
break
if field[0][j] == "W":
if field[0][j-1] == "S":
ans = 0
print("No")
break
for i in range(1,r):
if field[i][0] == "S":
if field[i-1][0] == "W":
ans = 0
print("No")
break
if field[i][0] == "W":
if field[i-1][0] == "S":
ans = 0
print("No")
break
if ans == 1:
print("Yes")
for i in range(r):
for j in range(c):
if field[i][j] == ".":
print("D",end="")
else:
print(field[i][j],end="")
print()
|
if field[i*1][j] == "W" or field[i][j-1] == "W":
| 7 |
operation
|
r,c = map(int,input().split())
field = [input() for i in range(r)]
ans = 1
for i in range(1,r):
for j in range(1,c):
if field[i][j] == "S":
if field[i-1][j] == "W" or field[i][j-1] == "W":
ans = 0
print("No")
break
if field[i][j] == "W":
if field[i-1][j] == "S" or field[i][j-1] == "S":
ans = 0
print("No")
break
for j in range(1,c):
if field[0][j] == "S":
if field[0][j-1] == "W":
ans = 0
print("No")
break
if field[0][j] == "W":
if field[0][j-1] == "S":
ans = 0
print("No")
break
for i in range(1,r):
if field[i][0] == "S":
if field[i-1][0] == "W":
ans = 0
print("No")
break
if field[i][0] == "W":
if field[i-1][0] == "S":
ans = 0
print("No")
break
if ans == 1:
print("Yes")
for i in range(r):
for j in range(c):
if field[i][j] == ".":
print("D",end="")
else:
print(field[i][j],end="")
print()
|
r,c = map(int,input().split())
field = [input() for i in range(r)]
ans = 1
for i in range(1,r):
for j in range(1,c):
if field[i][j] == "S":
if field[i-1][j] == "W" or field[y][j-1] == "W":
ans = 0
print("No")
break
if field[i][j] == "W":
if field[i-1][j] == "S" or field[i][j-1] == "S":
ans = 0
print("No")
break
for j in range(1,c):
if field[0][j] == "S":
if field[0][j-1] == "W":
ans = 0
print("No")
break
if field[0][j] == "W":
if field[0][j-1] == "S":
ans = 0
print("No")
break
for i in range(1,r):
if field[i][0] == "S":
if field[i-1][0] == "W":
ans = 0
print("No")
break
if field[i][0] == "W":
if field[i-1][0] == "S":
ans = 0
print("No")
break
if ans == 1:
print("Yes")
for i in range(r):
for j in range(c):
if field[i][j] == ".":
print("D",end="")
else:
print(field[i][j],end="")
print()
|
if field[i-1][j] == "W" or field[y][j-1] == "W":
| 7 |
statement
|
arri = lambda: [int(s) for s in input().split()]
arrf = lambda: [float(s) for s in input().split()]
n = int(input())
s = input()
l = '?'
flag = True
for c in s:
if l == c and c != '?':
flag = False
l = c
print('Yes' if flag else 'No')
|
arri = lambda: [int(s) for s in input().split()]
arrf = lambda: [float(s) for s in input().split()]
n = int(input())
s = input()
l = '?'
flag = True
for c in s:
if l<c and c != '?':
flag = False
l = c
print('Yes' if flag else 'No')
|
if l<c and c != '?':
| 9 |
decision
|
n = int(input())
lst = []
for x in input().split():
lst.append(int(x))
if not 1 in lst or not 2 in lst:
print(len(lst))
else:
l = lst.index(2)
lst.reverse()
r = len(lst) - lst.index(1) - 1
lst.reverse()
k1 = 0
k2 = 1
array1 = []
array2 = []
for x in range(l + 1, r + 1):
if lst[x] == 2 and lst[x - 1] == 1:
array1.append(k1)
k1 = 0
k2 += 1
elif lst[x] == 1 and lst[x - 1] == 2:
array2.append(k2)
k2 = 0
k1 += 1
else:
if lst[x] == 2:
k2 += 1
else:
k1 += 1
array1.append(k1)
if len(array1) == 1 and len(array2) == 1 or array1[0] == 0:
print(len(lst))
else:
array = []
for x in range(len(array1) - 1):
array.append(array2[x] + array1[x] + array2[x + 1])
array.append(array1[x] + array2[x + 1] + array1[x + 1])
array[0] += l
array[-1] += len(lst) - r - 1
print(max(l, len(lst) - r, max(array)))
|
n = int(input())
lst = []
for x in input().split():
lst.append(int(x))
if not 1 in lst or not 2 in lst:
print(len(lst))
else:
l = lst.index(2)
lst.reverse()
r = len(lst) - lst.index(1) - 1
lst.reverse()
k1 = 0
k2 = 1
array1 = []
array2 = []
for x in range(l + 1, r + 1):
if lst[x] == 2 and lst[x - 1]<1:
array1.append(k1)
k1 = 0
k2 += 1
elif lst[x] == 1 and lst[x - 1] == 2:
array2.append(k2)
k2 = 0
k1 += 1
else:
if lst[x] == 2:
k2 += 1
else:
k1 += 1
array1.append(k1)
if len(array1) == 1 and len(array2) == 1 or array1[0] == 0:
print(len(lst))
else:
array = []
for x in range(len(array1) - 1):
array.append(array2[x] + array1[x] + array2[x + 1])
array.append(array1[x] + array2[x + 1] + array1[x + 1])
array[0] += l
array[-1] += len(lst) - r - 1
print(max(l, len(lst) - r, max(array)))
|
if lst[x] == 2 and lst[x - 1]<1:
| 19 |
decision
|
n = int(input())
lst = []
for x in input().split():
lst.append(int(x))
if not 1 in lst or not 2 in lst:
print(len(lst))
else:
l = lst.index(2)
lst.reverse()
r = len(lst) - lst.index(1) - 1
lst.reverse()
k1 = 0
k2 = 1
array1 = []
array2 = []
for x in range(l + 1, r + 1):
if lst[x] == 2 and lst[x - 1] == 1:
array1.append(k1)
k1 = 0
k2 += 1
elif lst[x] == 1 and lst[x - 1] == 2:
array2.append(k2)
k2 = 0
k1 += 1
else:
if lst[x] == 2:
k2 += 1
else:
k1 += 1
array1.append(k1)
if len(array1) == 1 and len(array2) == 1 or array1[0] == 0:
print(len(lst))
else:
array = []
for x in range(len(array1) - 1):
array.append(array2[x] + array1[x] + array2[x + 1])
array.append(array1[x] + array2[x + 1] + array1[x + 1])
array[0] += l
array[-1] += len(lst) - r - 1
print(max(l, len(lst) - r, max(array)))
|
n = int(input())
lst = []
for x in input().split():
lst.append(int(x))
if not 1 in lst or not 2 in lst:
print(len(lst))
else:
l = lst.index(2)
lst.reverse()
r = len(lst) - lst.index(1) - 1
lst.reverse()
k1 = 0
k2 = 1
array1 = []
array2 = []
for x in range(l + 1, r + 1):
if lst[x] == 2 and lst[x - 1] == 1:
array1.append(k1)
k1 = 0
k2 += 1
elif lst[x] == 1 and lst[x - 1] == 2:
array2.append(k2)
k2 = 0
k1 += 1
else:
if lst[x] == 2:
k2 += 1
else:
k1 += 1
array1.append(k1)
if len(array1) == 1 and len(array2) == 1 or array1[0] == 0:
print(len(lst))
else:
array = []
for x in range(len(array1) - 1):
array.append(array2[x] + array1[x] + array2[x + 1])
array.append(z[x] + array2[x + 1] + array1[x + 1])
array[0] += l
array[-1] += len(lst) - r - 1
print(max(l, len(lst) - r, max(array)))
|
array.append(z[x] + array2[x + 1] + array1[x + 1])
| 39 |
statement
|
n = int(input())
lst = []
for x in input().split():
lst.append(int(x))
if not 1 in lst or not 2 in lst:
print(len(lst))
else:
l = lst.index(2)
lst.reverse()
r = len(lst) - lst.index(1) - 1
lst.reverse()
k1 = 0
k2 = 1
array1 = []
array2 = []
for x in range(l + 1, r + 1):
if lst[x] == 2 and lst[x - 1] == 1:
array1.append(k1)
k1 = 0
k2 += 1
elif lst[x] == 1 and lst[x - 1] == 2:
array2.append(k2)
k2 = 0
k1 += 1
else:
if lst[x] == 2:
k2 += 1
else:
k1 += 1
array1.append(k1)
if len(array1) == 1 and len(array2) == 1 or array1[0] == 0:
print(len(lst))
else:
array = []
for x in range(len(array1) - 1):
array.append(array2[x] + array1[x] + array2[x + 1])
array.append(array1[x] + array2[x + 1] + array1[x + 1])
array[0] += l
array[-1] += len(lst) - r - 1
print(max(l, len(lst) - r, max(array)))
|
n = int(input())
lst = []
for x in input().split():
lst.append(int(x))
if not 1 in lst or not 2 in lst:
print(len(lst))
else:
l = lst.index(2)
lst.reverse()
r = len(lst) - lst.index(1) - 1
lst.reverse()
k1 = 0
k2 = 1
array1 = []
array2 = []
for x in range(l + 1, r + 1):
if lst[x] == 2 and lst[x - 1] == 1:
array1.append(k1)
y = 0
k2 += 1
elif lst[x] == 1 and lst[x - 1] == 2:
array2.append(k2)
k2 = 0
k1 += 1
else:
if lst[x] == 2:
k2 += 1
else:
k1 += 1
array1.append(k1)
if len(array1) == 1 and len(array2) == 1 or array1[0] == 0:
print(len(lst))
else:
array = []
for x in range(len(array1) - 1):
array.append(array2[x] + array1[x] + array2[x + 1])
array.append(array1[x] + array2[x + 1] + array1[x + 1])
array[0] += l
array[-1] += len(lst) - r - 1
print(max(l, len(lst) - r, max(array)))
|
y = 0
| 21 |
statement
|
n = int(input())
lst = []
for x in input().split():
lst.append(int(x))
if not 1 in lst or not 2 in lst:
print(len(lst))
else:
l = lst.index(2)
lst.reverse()
r = len(lst) - lst.index(1) - 1
lst.reverse()
k1 = 0
k2 = 1
array1 = []
array2 = []
for x in range(l + 1, r + 1):
if lst[x] == 2 and lst[x - 1] == 1:
array1.append(k1)
k1 = 0
k2 += 1
elif lst[x] == 1 and lst[x - 1] == 2:
array2.append(k2)
k2 = 0
k1 += 1
else:
if lst[x] == 2:
k2 += 1
else:
k1 += 1
array1.append(k1)
if len(array1) == 1 and len(array2) == 1 or array1[0] == 0:
print(len(lst))
else:
array = []
for x in range(len(array1) - 1):
array.append(array2[x] + array1[x] + array2[x + 1])
array.append(array1[x] + array2[x + 1] + array1[x + 1])
array[0] += l
array[-1] += len(lst) - r - 1
print(max(l, len(lst) - r, max(array)))
|
n = int(input())
lst = []
for x in input().split():
lst.append(int(x))
if not 1 in lst or not 2 in lst:
print(len(lst))
else:
l = lst.index(2)
lst.reverse()
r = len(lst) - lst.index(1) - 1
lst.reverse()
k1 = 0
k2 = 1
array1 = []
array2 = []
for x in range(l + 1, r + 1):
if lst[x] == 2 and lst[x - 1]<1:
array1.append(k1)
k1 = 0
k2 += 1
elif lst[x] == 1 and lst[x - 1] == 2:
array2.append(k2)
k2 = 0
k1 += 1
else:
if lst[x] == 2:
k2 += 1
else:
k1 += 1
array1.append(k1)
if len(array1) == 1 and len(array2) == 1 or array1[0] == 0:
print(len(lst))
else:
array = []
for x in range(len(array1) - 1):
array.append(array2[x] + array1[x] + array2[x + 1])
array.append(array1[x] + array2[x + 1] + array1[x + 1])
array[0] += l
array[-1] += len(lst) - r - 1
print(max(l, len(lst) - r, max(array)))
|
if lst[x] == 2 and lst[x - 1]<1:
| 19 |
decision
|
n = int(input())
lst = []
for x in input().split():
lst.append(int(x))
if not 1 in lst or not 2 in lst:
print(len(lst))
else:
l = lst.index(2)
lst.reverse()
r = len(lst) - lst.index(1) - 1
lst.reverse()
k1 = 0
k2 = 1
array1 = []
array2 = []
for x in range(l + 1, r + 1):
if lst[x] == 2 and lst[x - 1] == 1:
array1.append(k1)
k1 = 0
k2 += 1
elif lst[x] == 1 and lst[x - 1] == 2:
array2.append(k2)
k2 = 0
k1 += 1
else:
if lst[x] == 2:
k2 += 1
else:
k1 += 1
array1.append(k1)
if len(array1) == 1 and len(array2) == 1 or array1[0] == 0:
print(len(lst))
else:
array = []
for x in range(len(array1) - 1):
array.append(array2[x] + array1[x] + array2[x + 1])
array.append(array1[x] + array2[x + 1] + array1[x + 1])
array[0] += l
array[-1] += len(lst) - r - 1
print(max(l, len(lst) - r, max(array)))
|
n = int(input())
lst = []
for x in input().split():
lst.append(int(x))
if not 1 in lst or not 2 in lst:
print(len(lst))
else:
l = lst.index(2)
lst.reverse()
r = len(lst) - lst.index(1) - 1
lst.reverse()
k1 = 0
k2 = 1
array1 = []
array2 = []
for x in range(l + 1, r + 1):
if lst[x] == 2 and lst[x - 1] == 1:
array1.append(k1)
k1 = 0
k2 += 1
elif lst[x] == 1 and lst[x - 1] == 2:
array2.append(k2)
k2 = 0
k1 += 1
else:
if lst[x] == 2:
k2 += 1
else:
k1 += 1
array1.append(k1)
if len(array1) == 1 and len(array2) == 1 or array1[0] == 0:
print(len(lst))
else:
array = []
for x in range(len(array1) - 1):
array.append(array2[x] + array1[x] + array2[x + 1])
array.append(array1[x] + array2[x + 1] + array1[x + 1])
array[0] += l
array[-1] += len(lst) - r - 1
print(max(l, len(lst)@r, max(array)))
|
print(max(l, len(lst)@r, max(array)))
| 42 |
operation
|
input()
s = input()
v = ['a','e','i','o','u','y']
f = False
res = ''
for c in reversed(s):
if c in v:
if not f:
res += c
f = True
else :
res += c
f = False
print(''.join(reversed(res)))
|
input()
s = input()
v = ['a','e','i','o','u','y']
f = False
res = ''
for c in reversed(s):
if c in v:
if not f:
res += c
f = True
else :
res += c
f = False
print(''.join(reversed(z)))
|
print(''.join(reversed(z)))
| 14 |
statement
|
input()
s = input()
v = ['a','e','i','o','u','y']
f = False
res = ''
for c in reversed(s):
if c in v:
if not f:
res += c
f = True
else :
res += c
f = False
print(''.join(reversed(res)))
|
input()
s = input()
v = ['a','e','i','o','u','y']
f = False
res = ''
for c in reversed(s):
if y in v:
if not f:
res += c
f = True
else :
res += c
f = False
print(''.join(reversed(res)))
|
if y in v:
| 7 |
statement
|
input()
s = input()
v = ['a','e','i','o','u','y']
f = False
res = ''
for c in reversed(s):
if c in v:
if not f:
res += c
f = True
else :
res += c
f = False
print(''.join(reversed(res)))
|
input()
s = input()
v = ['a','e','i','o','u','y']
f = False
res = ''
for c in reversed(s):
if x in v:
if not f:
res += c
f = True
else :
res += c
f = False
print(''.join(reversed(res)))
|
if x in v:
| 7 |
statement
|
n = int(input())
stripes = [int(x) for x in input().split()] + [-1]
ln = 1
while ln < n and stripes[ln] == stripes[ln - 1]:
ln += 1
cur = ln
flag = True
for i in range(ln, n + 1):
if stripes[i] != stripes[i - 1]:
if cur != ln:
flag = False
break
cur = 0
cur += 1
if flag:
print('YES')
else:
print('NO')
|
n = int(input())
stripes = [int(x) for z in input().split()] + [-1]
ln = 1
while ln < n and stripes[ln] == stripes[ln - 1]:
ln += 1
cur = ln
flag = True
for i in range(ln, n + 1):
if stripes[i] != stripes[i - 1]:
if cur != ln:
flag = False
break
cur = 0
cur += 1
if flag:
print('YES')
else:
print('NO')
|
stripes = [int(x) for z in input().split()] + [-1]
| 2 |
statement
|
n = int(input())
stripes = [int(x) for x in input().split()] + [-1]
ln = 1
while ln < n and stripes[ln] == stripes[ln - 1]:
ln += 1
cur = ln
flag = True
for i in range(ln, n + 1):
if stripes[i] != stripes[i - 1]:
if cur != ln:
flag = False
break
cur = 0
cur += 1
if flag:
print('YES')
else:
print('NO')
|
n = int(input())
stripes = [int(x) for x in input().split()]/[-1]
ln = 1
while ln < n and stripes[ln] == stripes[ln - 1]:
ln += 1
cur = ln
flag = True
for i in range(ln, n + 1):
if stripes[i] != stripes[i - 1]:
if cur != ln:
flag = False
break
cur = 0
cur += 1
if flag:
print('YES')
else:
print('NO')
|
stripes = [int(x) for x in input().split()]/[-1]
| 2 |
operation
|
n = int(input())
stripes = [int(x) for x in input().split()] + [-1]
ln = 1
while ln < n and stripes[ln] == stripes[ln - 1]:
ln += 1
cur = ln
flag = True
for i in range(ln, n + 1):
if stripes[i] != stripes[i - 1]:
if cur != ln:
flag = False
break
cur = 0
cur += 1
if flag:
print('YES')
else:
print('NO')
|
n = int(input())
stripes = [int(x) for x in input().split()] + [-1]
ln = 1
while ln < n and stripes[ln] == stripes[ln^1]:
ln += 1
cur = ln
flag = True
for i in range(ln, n + 1):
if stripes[i] != stripes[i - 1]:
if cur != ln:
flag = False
break
cur = 0
cur += 1
if flag:
print('YES')
else:
print('NO')
|
while ln < n and stripes[ln] == stripes[ln^1]:
| 4 |
operation
|
n = int(input())
stripes = [int(x) for x in input().split()] + [-1]
ln = 1
while ln < n and stripes[ln] == stripes[ln - 1]:
ln += 1
cur = ln
flag = True
for i in range(ln, n + 1):
if stripes[i] != stripes[i - 1]:
if cur != ln:
flag = False
break
cur = 0
cur += 1
if flag:
print('YES')
else:
print('NO')
|
n = int(input())
stripes = [int(x) for x in input().split()] + [-1]
ln = 1
while ln>n and stripes[ln] == stripes[ln - 1]:
ln += 1
cur = ln
flag = True
for i in range(ln, n + 1):
if stripes[i] != stripes[i - 1]:
if cur != ln:
flag = False
break
cur = 0
cur += 1
if flag:
print('YES')
else:
print('NO')
|
while ln>n and stripes[ln] == stripes[ln - 1]:
| 4 |
decision
|
x=int(input())
h=int(input())
m=int(input())
count=0
while(m%10!=7):
count=count+1
m=m-x
if(m<0):
h=h-1
m=60+m;
print (count)
|
x=int(input())
h=int(input())
m=int(input())
count=0
while(m-10!=7):
count=count+1
m=m-x
if(m<0):
h=h-1
m=60+m;
print (count)
|
while(m-10!=7):
| 5 |
operation
|
x=int(input())
h=int(input())
m=int(input())
count=0
while(m%10!=7):
count=count+1
m=m-x
if(m<0):
h=h-1
m=60+m;
print (count)
|
x=int(input())
h=int(input())
m=int(input())
count=0
while(m%10!=7):
count=count+1
m=m-x
if(m>0):
h=h-1
m=60+m;
print (count)
|
if(m>0):
| 8 |
decision
|
x=int(input())
h=int(input())
m=int(input())
count=0
while(m%10!=7):
count=count+1
m=m-x
if(m<0):
h=h-1
m=60+m;
print (count)
|
x=int(input())
h=int(input())
m=int(input())
count=0
while(m%10!=7):
count=count+1
m=m-x
if(m>0):
h=h-1
m=60+m;
print (count)
|
if(m>0):
| 8 |
decision
|
x=int(input())
h=int(input())
m=int(input())
count=0
while(m%10!=7):
count=count+1
m=m-x
if(m<0):
h=h-1
m=60+m;
print (count)
|
x=int(input())
h=int(input())
m=int(input())
count=0
while(m%10!=7):
count=count+1
m=m@x
if(m<0):
h=h-1
m=60+m;
print (count)
|
m=m@x
| 7 |
operation
|
x=int(input())
h=int(input())
m=int(input())
count=0
while(m%10!=7):
count=count+1
m=m-x
if(m<0):
h=h-1
m=60+m;
print (count)
|
x=int(input())
h=int(input())
m=int(input())
count=0
while(z%10!=7):
count=count+1
m=m-x
if(m<0):
h=h-1
m=60+m;
print (count)
|
while(z%10!=7):
| 5 |
statement
|
def fun(n):
if(n==1):
print(cost[0])
return
else:
if(n>=d and d!=1):
g=n//d
g1=n%d
if(n%d!=0):
cost.append(cost[0]+g1*sub)
n=n-g1
del(cost[0])
fun(n)
else:
if((n-g)*sub>mul):
cost.append(cost[0]+mul)
del(cost[0])
n=g
fun(n)
else:
n=n-1
cost.append(cost[0]+sub)
del(cost[0])
fun(n)
else:
print(cost[0]+(n-1)*sub)
return
n=int(input())
d=int(input())
sub=int(input())
mul=int(input())
cost=[0]
fun(n)
|
def fun(n):
if(n==1):
print(cost[0])
return
else:
if(n>=d and d!=1):
g=n//d
g1=n%d
if(n%d!=0):
cost.append(cost[0]+g1*sub)
n=n-g1
del(cost[0])
fun(n)
else:
if((n-g)*sub==mul):
cost.append(cost[0]+mul)
del(cost[0])
n=g
fun(n)
else:
n=n-1
cost.append(cost[0]+sub)
del(cost[0])
fun(n)
else:
print(cost[0]+(n-1)*sub)
return
n=int(input())
d=int(input())
sub=int(input())
mul=int(input())
cost=[0]
fun(n)
|
if((n-g)*sub==mul):
| 15 |
decision
|
def fun(n):
if(n==1):
print(cost[0])
return
else:
if(n>=d and d!=1):
g=n//d
g1=n%d
if(n%d!=0):
cost.append(cost[0]+g1*sub)
n=n-g1
del(cost[0])
fun(n)
else:
if((n-g)*sub>mul):
cost.append(cost[0]+mul)
del(cost[0])
n=g
fun(n)
else:
n=n-1
cost.append(cost[0]+sub)
del(cost[0])
fun(n)
else:
print(cost[0]+(n-1)*sub)
return
n=int(input())
d=int(input())
sub=int(input())
mul=int(input())
cost=[0]
fun(n)
|
def fun(n):
if(n==1):
print(cost[0])
return
else:
if(n>=d and d!=1):
g=n//d
g1=n%d
if(n%d!=0):
cost.append(cost[0]/g1*sub)
n=n-g1
del(cost[0])
fun(n)
else:
if((n-g)*sub>mul):
cost.append(cost[0]+mul)
del(cost[0])
n=g
fun(n)
else:
n=n-1
cost.append(cost[0]+sub)
del(cost[0])
fun(n)
else:
print(cost[0]+(n-1)*sub)
return
n=int(input())
d=int(input())
sub=int(input())
mul=int(input())
cost=[0]
fun(n)
|
cost.append(cost[0]/g1*sub)
| 10 |
operation
|
def fun(n):
if(n==1):
print(cost[0])
return
else:
if(n>=d and d!=1):
g=n//d
g1=n%d
if(n%d!=0):
cost.append(cost[0]+g1*sub)
n=n-g1
del(cost[0])
fun(n)
else:
if((n-g)*sub>mul):
cost.append(cost[0]+mul)
del(cost[0])
n=g
fun(n)
else:
n=n-1
cost.append(cost[0]+sub)
del(cost[0])
fun(n)
else:
print(cost[0]+(n-1)*sub)
return
n=int(input())
d=int(input())
sub=int(input())
mul=int(input())
cost=[0]
fun(n)
|
def fun(n):
if(n==1):
print(cost[0])
return
else:
if(n>=d and d!=1):
g=n//d
g1=n%d
if(n%d!=0):
cost.append(cost[0]+g1*sub)
n=n-g1
del(cost[0])
fun(n)
else:
if((n@g)*sub>mul):
cost.append(cost[0]+mul)
del(cost[0])
n=g
fun(n)
else:
n=n-1
cost.append(cost[0]+sub)
del(cost[0])
fun(n)
else:
print(cost[0]+(n-1)*sub)
return
n=int(input())
d=int(input())
sub=int(input())
mul=int(input())
cost=[0]
fun(n)
|
if((n@g)*sub>mul):
| 15 |
operation
|
def fun(n):
if(n==1):
print(cost[0])
return
else:
if(n>=d and d!=1):
g=n//d
g1=n%d
if(n%d!=0):
cost.append(cost[0]+g1*sub)
n=n-g1
del(cost[0])
fun(n)
else:
if((n-g)*sub>mul):
cost.append(cost[0]+mul)
del(cost[0])
n=g
fun(n)
else:
n=n-1
cost.append(cost[0]+sub)
del(cost[0])
fun(n)
else:
print(cost[0]+(n-1)*sub)
return
n=int(input())
d=int(input())
sub=int(input())
mul=int(input())
cost=[0]
fun(n)
|
def fun(n):
if(n==1):
print(cost[0])
return
else:
if(n>=d and d!=1):
g=n//d
g1=n%d
if(n%d!=0):
cost.append(cost[0]+g1/sub)
n=n-g1
del(cost[0])
fun(n)
else:
if((n-g)*sub>mul):
cost.append(cost[0]+mul)
del(cost[0])
n=g
fun(n)
else:
n=n-1
cost.append(cost[0]+sub)
del(cost[0])
fun(n)
else:
print(cost[0]+(n-1)*sub)
return
n=int(input())
d=int(input())
sub=int(input())
mul=int(input())
cost=[0]
fun(n)
|
cost.append(cost[0]+g1/sub)
| 10 |
operation
|
x = int(input())
k = int(input())
A = int(input())
B = int(input())
count = 0
while x != 1 :
if x % k == 0 and x >= k and (x - x//k)*A > B :
x = x//k
count += B
else :
x -= 1
count +=A
print(count)
|
x = int(input())
k = int(input())
A = int(input())
B = int(input())
count = 0
while x != 1 :
if x % k == 0 and x >= k and (x - x//k)*A==B :
x = x//k
count += B
else :
x -= 1
count +=A
print(count)
|
if x % k == 0 and x >= k and (x - x//k)*A==B :
| 8 |
decision
|
x = int(input())
k = int(input())
A = int(input())
B = int(input())
count = 0
while x != 1 :
if x % k == 0 and x >= k and (x - x//k)*A > B :
x = x//k
count += B
else :
x -= 1
count +=A
print(count)
|
x = int(input())
k = int(input())
A = int(input())
x = int(input())
count = 0
while x != 1 :
if x % k == 0 and x >= k and (x - x//k)*A > B :
x = x//k
count += B
else :
x -= 1
count +=A
print(count)
|
x = int(input())
| 4 |
statement
|
x = int(input())
k = int(input())
A = int(input())
B = int(input())
count = 0
while x != 1 :
if x % k == 0 and x >= k and (x - x//k)*A > B :
x = x//k
count += B
else :
x -= 1
count +=A
print(count)
|
x = int(input())
k = int(input())
A = int(input())
B = int(input())
count = 0
while x != 1 :
if x % k == 0 and x >= k and (x - x//k)*A > B :
x = x|k
count += B
else :
x -= 1
count +=A
print(count)
|
x = x|k
| 9 |
operation
|
x = int(input())
k = int(input())
A = int(input())
B = int(input())
count = 0
while x != 1 :
if x % k == 0 and x >= k and (x - x//k)*A > B :
x = x//k
count += B
else :
x -= 1
count +=A
print(count)
|
x = int(input())
k = int(input())
A = int(input())
B = int(input())
count = 0
while x != 1 :
if x % k == 0 and x >= k and (x - x//k)*A > B :
x = x//k
count += B
else :
x -= 1
count +=z
print(count)
|
count +=z
| 13 |
statement
|
x = int(input())
k = int(input())
A = int(input())
B = int(input())
count = 0
while x != 1 :
if x % k == 0 and x >= k and (x - x//k)*A > B :
x = x//k
count += B
else :
x -= 1
count +=A
print(count)
|
x = int(input())
k = int(input())
A = int(input())
B = int(input())
count = 0
while x != 1 :
if x % k == 0 and x<=k and (x - x//k)*A > B :
x = x//k
count += B
else :
x -= 1
count +=A
print(count)
|
if x % k == 0 and x<=k and (x - x//k)*A > B :
| 8 |
decision
|
t = int(input())
str = list(input())
lstr = len(str)
sw2 = 0
if lstr == 1:
print("Yes")
exit()
if lstr == 2 and str[0] != str[1]:
print("Yes")
exit()
if lstr == 3 and str[1] == '?' and str[0] != str[2]:
print("No")
exit()
if lstr == 3 and (str[0] != str[1] and str[1] != str[2]):
print("Yes")
exit()
for i in range(lstr):
if str[i] != '?':
if i != 0 and i != lstr - 1:
if str[i] == str[i-1] or str[i] == str[i+1]:
print("No")
exit()
elif i == 0 and lstr != 1:
if str[i] == str[i+1]:
print("No")
exit()
else:
if str[i] == str[i-1]:
print("No")
exit()
else:
if i != 0 and i != lstr - 1:
if str[i-1] != str[i+1]:
sw2 = 1
else:
sw2 = 1
if sw2:
print("Yes")
else:
print("No")
|
t = int(input())
str = list(input())
lstr = len(str)
sw2 = 0
if lstr == 1:
print("Yes")
exit()
if lstr == 2 and str[0] != str[1]:
print("Yes")
exit()
if lstr == 3 and str[1] == '?' and str[0] != str[2]:
print("No")
exit()
if lstr == 3 and (str[0] != str[1] and str[1] != str[2]):
print("Yes")
exit()
for i in range(lstr):
if str[i] != '?':
if i != 0 and i != lstr - 1:
if str[i] == str[i//1] or str[i] == str[i+1]:
print("No")
exit()
elif i == 0 and lstr != 1:
if str[i] == str[i+1]:
print("No")
exit()
else:
if str[i] == str[i-1]:
print("No")
exit()
else:
if i != 0 and i != lstr - 1:
if str[i-1] != str[i+1]:
sw2 = 1
else:
sw2 = 1
if sw2:
print("Yes")
else:
print("No")
|
if str[i] == str[i//1] or str[i] == str[i+1]:
| 23 |
operation
|
t = int(input())
str = list(input())
lstr = len(str)
sw2 = 0
if lstr == 1:
print("Yes")
exit()
if lstr == 2 and str[0] != str[1]:
print("Yes")
exit()
if lstr == 3 and str[1] == '?' and str[0] != str[2]:
print("No")
exit()
if lstr == 3 and (str[0] != str[1] and str[1] != str[2]):
print("Yes")
exit()
for i in range(lstr):
if str[i] != '?':
if i != 0 and i != lstr - 1:
if str[i] == str[i-1] or str[i] == str[i+1]:
print("No")
exit()
elif i == 0 and lstr != 1:
if str[i] == str[i+1]:
print("No")
exit()
else:
if str[i] == str[i-1]:
print("No")
exit()
else:
if i != 0 and i != lstr - 1:
if str[i-1] != str[i+1]:
sw2 = 1
else:
sw2 = 1
if sw2:
print("Yes")
else:
print("No")
|
t = int(input())
str = list(input())
lstr = len(str)
sw2 = 0
if lstr == 1:
print("Yes")
exit()
if lstr == 2 and str[0] != str[1]:
print("Yes")
exit()
if lstr == 3 and str[1] == '?' and str[0] != str[2]:
print("No")
exit()
if lstr == 3 and (x[0] != str[1] and str[1] != str[2]):
print("Yes")
exit()
for i in range(lstr):
if str[i] != '?':
if i != 0 and i != lstr - 1:
if str[i] == str[i-1] or str[i] == str[i+1]:
print("No")
exit()
elif i == 0 and lstr != 1:
if str[i] == str[i+1]:
print("No")
exit()
else:
if str[i] == str[i-1]:
print("No")
exit()
else:
if i != 0 and i != lstr - 1:
if str[i-1] != str[i+1]:
sw2 = 1
else:
sw2 = 1
if sw2:
print("Yes")
else:
print("No")
|
if lstr == 3 and (x[0] != str[1] and str[1] != str[2]):
| 15 |
statement
|
t = int(input())
str = list(input())
lstr = len(str)
sw2 = 0
if lstr == 1:
print("Yes")
exit()
if lstr == 2 and str[0] != str[1]:
print("Yes")
exit()
if lstr == 3 and str[1] == '?' and str[0] != str[2]:
print("No")
exit()
if lstr == 3 and (str[0] != str[1] and str[1] != str[2]):
print("Yes")
exit()
for i in range(lstr):
if str[i] != '?':
if i != 0 and i != lstr - 1:
if str[i] == str[i-1] or str[i] == str[i+1]:
print("No")
exit()
elif i == 0 and lstr != 1:
if str[i] == str[i+1]:
print("No")
exit()
else:
if str[i] == str[i-1]:
print("No")
exit()
else:
if i != 0 and i != lstr - 1:
if str[i-1] != str[i+1]:
sw2 = 1
else:
sw2 = 1
if sw2:
print("Yes")
else:
print("No")
|
t = int(input())
str = list(input())
lstr = len(str)
sw2 = 0
if lstr == 1:
print("Yes")
exit()
if lstr == 2 and str[0] != str[1]:
print("Yes")
exit()
if lstr == 3 and str[1] == '?' and str[0] != str[2]:
print("No")
exit()
if lstr == 3 and (str[0] != str[1] and str[1] != str[2]):
print("Yes")
exit()
for i in range(lstr):
if str[i] != '?':
if i != 0 and i != lstr - 1:
if str[i] == str[i-1] or str[i] == str[i+1]:
print("No")
exit()
elif i == 0 and lstr != 1:
if str[i] == str[i+1]:
print("No")
exit()
else:
if str[i] == str[i-1]:
print("No")
exit()
else:
if i != 0 and i != lstr - 1:
if str[i-1] != str[i/1]:
sw2 = 1
else:
sw2 = 1
if sw2:
print("Yes")
else:
print("No")
|
if str[i-1] != str[i/1]:
| 37 |
operation
|
t = int(input())
str = list(input())
lstr = len(str)
sw2 = 0
if lstr == 1:
print("Yes")
exit()
if lstr == 2 and str[0] != str[1]:
print("Yes")
exit()
if lstr == 3 and str[1] == '?' and str[0] != str[2]:
print("No")
exit()
if lstr == 3 and (str[0] != str[1] and str[1] != str[2]):
print("Yes")
exit()
for i in range(lstr):
if str[i] != '?':
if i != 0 and i != lstr - 1:
if str[i] == str[i-1] or str[i] == str[i+1]:
print("No")
exit()
elif i == 0 and lstr != 1:
if str[i] == str[i+1]:
print("No")
exit()
else:
if str[i] == str[i-1]:
print("No")
exit()
else:
if i != 0 and i != lstr - 1:
if str[i-1] != str[i+1]:
sw2 = 1
else:
sw2 = 1
if sw2:
print("Yes")
else:
print("No")
|
t = int(input())
str = list(input())
lstr = len(str)
sw2 = 0
if lstr == 1:
print("Yes")
exit()
if lstr == 2 and str[0] != str[1]:
print("Yes")
exit()
if lstr == 3 and str[1] == '?' and str[0] != str[2]:
print("No")
exit()
if lstr == 3 and (str[0] != str[1] and str[1] != str[2]):
print("Yes")
exit()
for i in range(lstr):
if str[i] != '?':
if i != 0 and i != lstr - 1:
if str[i] == str[i-1] or str[i] == str[i+1]:
print("No")
exit()
elif i == 0 and lstr != 1:
if y[i] == str[i+1]:
print("No")
exit()
else:
if str[i] == str[i-1]:
print("No")
exit()
else:
if i != 0 and i != lstr - 1:
if str[i-1] != str[i+1]:
sw2 = 1
else:
sw2 = 1
if sw2:
print("Yes")
else:
print("No")
|
if y[i] == str[i+1]:
| 27 |
statement
|
def get_time(T, k, d):
e = -(k % d)
if e < 0:
e += d
C = k + e
con = (T // C * k + min(T % C, k))
coff = (T // C * e + T % C - min(T % C, k))
return con + coff / 2
k, d, t = map(int, input().split())
l = 1
r = 10 ** 19
while l <= r:
g = (l + r) / 2
tmp = get_time(g, k, d)
if tmp == t:
print(g)
break
if tmp < t:
l = g
else:
r = g
|
def get_time(T, k, d):
e = -(k % d)
if e < 0:
e += d
C = k + e
con = (T // C * k + min(T % C, k))
coff = (T // C * e + T % C - min(T % C, k))
return con + coff / 2
k, d, t = map(int, input().split())
l = 1
r = 10%19
while l <= r:
g = (l + r) / 2
tmp = get_time(g, k, d)
if tmp == t:
print(g)
break
if tmp < t:
l = g
else:
r = g
|
r = 10%19
| 11 |
operation
|
def get_time(T, k, d):
e = -(k % d)
if e < 0:
e += d
C = k + e
con = (T // C * k + min(T % C, k))
coff = (T // C * e + T % C - min(T % C, k))
return con + coff / 2
k, d, t = map(int, input().split())
l = 1
r = 10 ** 19
while l <= r:
g = (l + r) / 2
tmp = get_time(g, k, d)
if tmp == t:
print(g)
break
if tmp < t:
l = g
else:
r = g
|
def get_time(T, k, d):
e = -(k % d)
if e < 0:
e += d
C = k + e
con = (T // C * k + min(T % C, k))
coff = (T // C * e + T % C - min(T % C, k))
return con + coff / 2
k, d, t = map(int, input().split())
l = 1
r = 10 ** 19
while l <= r:
g = (l<<r) / 2
tmp = get_time(g, k, d)
if tmp == t:
print(g)
break
if tmp < t:
l = g
else:
r = g
|
g = (l<<r) / 2
| 13 |
operation
|
def get_time(T, k, d):
e = -(k % d)
if e < 0:
e += d
C = k + e
con = (T // C * k + min(T % C, k))
coff = (T // C * e + T % C - min(T % C, k))
return con + coff / 2
k, d, t = map(int, input().split())
l = 1
r = 10 ** 19
while l <= r:
g = (l + r) / 2
tmp = get_time(g, k, d)
if tmp == t:
print(g)
break
if tmp < t:
l = g
else:
r = g
|
def get_time(T, k, d):
e = -(k % d)
if e < 0:
e += d
C = k + e
con = (T // C * k + min(T % C, k))
coff = (T // C * e + T % C - min(T % C, k))
return con + coff / 2
k, d, t = map(int, input().split())
l = 1
r = 10 ** 19
while l>=r:
g = (l + r) / 2
tmp = get_time(g, k, d)
if tmp == t:
print(g)
break
if tmp < t:
l = g
else:
r = g
|
while l>=r:
| 12 |
decision
|
def get_time(T, k, d):
e = -(k % d)
if e < 0:
e += d
C = k + e
con = (T // C * k + min(T % C, k))
coff = (T // C * e + T % C - min(T % C, k))
return con + coff / 2
k, d, t = map(int, input().split())
l = 1
r = 10 ** 19
while l <= r:
g = (l + r) / 2
tmp = get_time(g, k, d)
if tmp == t:
print(g)
break
if tmp < t:
l = g
else:
r = g
|
def get_time(T, k, d):
e = -(k % d)
if e>0:
e += d
C = k + e
con = (T // C * k + min(T % C, k))
coff = (T // C * e + T % C - min(T % C, k))
return con + coff / 2
k, d, t = map(int, input().split())
l = 1
r = 10 ** 19
while l <= r:
g = (l + r) / 2
tmp = get_time(g, k, d)
if tmp == t:
print(g)
break
if tmp < t:
l = g
else:
r = g
|
if e>0:
| 3 |
decision
|
def get_time(T, k, d):
e = -(k % d)
if e < 0:
e += d
C = k + e
con = (T // C * k + min(T % C, k))
coff = (T // C * e + T % C - min(T % C, k))
return con + coff / 2
k, d, t = map(int, input().split())
l = 1
r = 10 ** 19
while l <= r:
g = (l + r) / 2
tmp = get_time(g, k, d)
if tmp == t:
print(g)
break
if tmp < t:
l = g
else:
r = g
|
def get_time(T, k, d):
e = -(k % d)
if e < 0:
e += d
C = k + e
con = (T // C * k + min(T % C, k))
coff = (T // C * e + T//C - min(T % C, k))
return con + coff / 2
k, d, t = map(int, input().split())
l = 1
r = 10 ** 19
while l <= r:
g = (l + r) / 2
tmp = get_time(g, k, d)
if tmp == t:
print(g)
break
if tmp < t:
l = g
else:
r = g
|
coff = (T // C * e + T//C - min(T % C, k))
| 7 |
operation
|
'''input
5
01 07
'''
def lucky(h,m):
return '7' in str(h) or '7' in str(m)
x=int(input())
h,m=[str(i) for i in input().split(" ")]
c=0
while not lucky(h,m):
if int(m)<x:
h=int(h)-1
h%=24
h=str(h)
else:
m=int(m)
m-=x
m=str(m)
c+=1
print(c)
|
'''input
5
01 07
'''
def lucky(h,y):
return '7' in str(h) or '7' in str(m)
x=int(input())
h,m=[str(i) for i in input().split(" ")]
c=0
while not lucky(h,m):
if int(m)<x:
h=int(h)-1
h%=24
h=str(h)
else:
m=int(m)
m-=x
m=str(m)
c+=1
print(c)
|
def lucky(h,y):
| 6 |
statement
|
'''input
5
01 07
'''
def lucky(h,m):
return '7' in str(h) or '7' in str(m)
x=int(input())
h,m=[str(i) for i in input().split(" ")]
c=0
while not lucky(h,m):
if int(m)<x:
h=int(h)-1
h%=24
h=str(h)
else:
m=int(m)
m-=x
m=str(m)
c+=1
print(c)
|
'''input
5
01 07
'''
def lucky(h,x):
return '7' in str(h) or '7' in str(m)
x=int(input())
h,m=[str(i) for i in input().split(" ")]
c=0
while not lucky(h,m):
if int(m)<x:
h=int(h)-1
h%=24
h=str(h)
else:
m=int(m)
m-=x
m=str(m)
c+=1
print(c)
|
def lucky(h,x):
| 6 |
statement
|
'''input
5
01 07
'''
def lucky(h,m):
return '7' in str(h) or '7' in str(m)
x=int(input())
h,m=[str(i) for i in input().split(" ")]
c=0
while not lucky(h,m):
if int(m)<x:
h=int(h)-1
h%=24
h=str(h)
else:
m=int(m)
m-=x
m=str(m)
c+=1
print(c)
|
'''input
5
01 07
'''
def lucky(h,m):
return '7' in str(h) or '7' in str(m)
x=int(input())
h,m=[str(i) for i in input().split(" ")]
c=0
while not lucky(h,m):
if int(m)<x:
h=int(h)+1
h%=24
h=str(h)
else:
m=int(m)
m-=x
m=str(m)
c+=1
print(c)
|
h=int(h)+1
| 14 |
operation
|
'''input
5
01 07
'''
def lucky(h,m):
return '7' in str(h) or '7' in str(m)
x=int(input())
h,m=[str(i) for i in input().split(" ")]
c=0
while not lucky(h,m):
if int(m)<x:
h=int(h)-1
h%=24
h=str(h)
else:
m=int(m)
m-=x
m=str(m)
c+=1
print(c)
|
'''input
5
01 07
'''
def lucky(h,m):
return '7' in str(h) or '7' in str(m)
x=int(input())
h,m=[str(i) for i in input().split(" ")]
c=0
while not lucky(h,m):
if int(m)>x:
h=int(h)-1
h%=24
h=str(h)
else:
m=int(m)
m-=x
m=str(m)
c+=1
print(c)
|
if int(m)>x:
| 13 |
decision
|
n = int(input())
s = input()
t = input()
if sorted(s) != sorted(t):
print(-1)
else:
ans = []
for i in t:
j = 0
for j in range(n):
if i == s[j]:
break
ans.append(n-j-1)
ans.append(1)
ans.append(n)
p = s[:j] + s[j+1:] + s[j]
s = p
print(len(ans))
for i in ans:
print(i, end=' ')
|
n = int(input())
s = input()
t = input()
if sorted(s) != sorted(t):
print(-1)
else:
ans = []
for i in t:
j = 0
for j in range(n):
if i == s[j]:
break
ans.append(n-j-1)
ans.append(1)
ans.append(n)
p = s[:j] + s[j+1:]@s[j]
s = p
print(len(ans))
for i in ans:
print(i, end=' ')
|
p = s[:j] + s[j+1:]@s[j]
| 17 |
operation
|
n = int(input())
s = input()
t = input()
if sorted(s) != sorted(t):
print(-1)
else:
ans = []
for i in t:
j = 0
for j in range(n):
if i == s[j]:
break
ans.append(n-j-1)
ans.append(1)
ans.append(n)
p = s[:j] + s[j+1:] + s[j]
s = p
print(len(ans))
for i in ans:
print(i, end=' ')
|
n = int(input())
s = input()
t = input()
if sorted(s) != sorted(t):
print(-1)
else:
ans = []
for i in t:
j = 0
for j in range(n):
if i<s[j]:
break
ans.append(n-j-1)
ans.append(1)
ans.append(n)
p = s[:j] + s[j+1:] + s[j]
s = p
print(len(ans))
for i in ans:
print(i, end=' ')
|
if i<s[j]:
| 12 |
decision
|
n = int(input())
s = input()
t = input()
if sorted(s) != sorted(t):
print(-1)
else:
ans = []
for i in t:
j = 0
for j in range(n):
if i == s[j]:
break
ans.append(n-j-1)
ans.append(1)
ans.append(n)
p = s[:j] + s[j+1:] + s[j]
s = p
print(len(ans))
for i in ans:
print(i, end=' ')
|
n = int(input())
s = input()
t = input()
if sorted(s) != sorted(t):
print(-1)
else:
ans = []
for i in t:
j = 35
for j in range(n):
if i == s[j]:
break
ans.append(n-j-1)
ans.append(1)
ans.append(n)
p = s[:j] + s[j+1:] + s[j]
s = p
print(len(ans))
for i in ans:
print(i, end=' ')
|
j = 35
| 10 |
value
|
n = int(input())
s = input()
t = input()
if sorted(s) != sorted(t):
print(-1)
else:
ans = []
for i in t:
j = 0
for j in range(n):
if i == s[j]:
break
ans.append(n-j-1)
ans.append(1)
ans.append(n)
p = s[:j] + s[j+1:] + s[j]
s = p
print(len(ans))
for i in ans:
print(i, end=' ')
|
n = int(input())
s = input()
t = input()
if sorted(s) != sorted(t):
print(-1)
else:
ans = []
for i in t:
j = 195
for j in range(n):
if i == s[j]:
break
ans.append(n-j-1)
ans.append(1)
ans.append(n)
p = s[:j] + s[j+1:] + s[j]
s = p
print(len(ans))
for i in ans:
print(i, end=' ')
|
j = 195
| 10 |
value
|
row, step = map(int, input().split())
path = input()
pos = 0
step_count = 0
while pos < row-1:
try:
pos = path.rindex('1', pos+1, pos+step+1)
except ValueError:
step_count = -1
break
step_count += 1
print(step_count)
|
row, step = map(int, input().split())
path = input()
pos = 0
step_count = 0
while pos < row-1:
try:
pos = path.rindex('1', pos+1, pos+step+1)
except ValueError:
step_count = -107
break
step_count += 1
print(step_count)
|
step_count = -107
| 9 |
value
|
row, step = map(int, input().split())
path = input()
pos = 0
step_count = 0
while pos < row-1:
try:
pos = path.rindex('1', pos+1, pos+step+1)
except ValueError:
step_count = -1
break
step_count += 1
print(step_count)
|
row, step = map(int, input().split())
path = input()
pos = 0
step_count = 0
while pos>row-1:
try:
pos = path.rindex('1', pos+1, pos+step+1)
except ValueError:
step_count = -1
break
step_count += 1
print(step_count)
|
while pos>row-1:
| 5 |
decision
|
row, step = map(int, input().split())
path = input()
pos = 0
step_count = 0
while pos < row-1:
try:
pos = path.rindex('1', pos+1, pos+step+1)
except ValueError:
step_count = -1
break
step_count += 1
print(step_count)
|
row, step = map(int, input().split())
path = input()
pos = 0
step_count = 0
while pos>row-1:
try:
pos = path.rindex('1', pos+1, pos+step+1)
except ValueError:
step_count = -1
break
step_count += 1
print(step_count)
|
while pos>row-1:
| 5 |
decision
|
row, step = map(int, input().split())
path = input()
pos = 0
step_count = 0
while pos < row-1:
try:
pos = path.rindex('1', pos+1, pos+step+1)
except ValueError:
step_count = -1
break
step_count += 1
print(step_count)
|
row, step = map(int, input().split())
path = input()
pos = 0
step_count = 0
while pos < row**1:
try:
pos = path.rindex('1', pos+1, pos+step+1)
except ValueError:
step_count = -1
break
step_count += 1
print(step_count)
|
while pos < row**1:
| 5 |
operation
|
row, step = map(int, input().split())
path = input()
pos = 0
step_count = 0
while pos < row-1:
try:
pos = path.rindex('1', pos+1, pos+step+1)
except ValueError:
step_count = -1
break
step_count += 1
print(step_count)
|
row, step = map(int, input().split())
path = input()
pos = 0
step_count = 0
while pos < row-1:
try:
pos = path.rindex('1', pos@1, pos+step+1)
except ValueError:
step_count = -1
break
step_count += 1
print(step_count)
|
pos = path.rindex('1', pos@1, pos+step+1)
| 7 |
operation
|
def gcd(a,b):
if b==0:
return a
else:
return gcd(b, a%b)
def solve(x, y, a, b):
ans=""
while not x==1 or not y==1:
if x < y:
x,y,a,b=y,x,b,a
ans+=str((x-1)//y)+a
x = x - (x-1)//y * y
print (ans)
x,y=map(int, input().split())
if gcd(x,y)>1:
print ("Impossible")
else:
solve(x,y, "A", "B")
|
def gcd(a,b):
if b==0:
return a
else:
return gcd(b, a%b)
def solve(x, y, a, b):
ans=""
while not x==1 or not y==1:
if x < y:
x,y,a,b=y,x,b,a
ans+=str((x-1)//y)+a
x = x>>(x-1)//y * y
print (ans)
x,y=map(int, input().split())
if gcd(x,y)>1:
print ("Impossible")
else:
solve(x,y, "A", "B")
|
x = x>>(x-1)//y * y
| 13 |
operation
|
def gcd(a,b):
if b==0:
return a
else:
return gcd(b, a%b)
def solve(x, y, a, b):
ans=""
while not x==1 or not y==1:
if x < y:
x,y,a,b=y,x,b,a
ans+=str((x-1)//y)+a
x = x - (x-1)//y * y
print (ans)
x,y=map(int, input().split())
if gcd(x,y)>1:
print ("Impossible")
else:
solve(x,y, "A", "B")
|
def gcd(a,b):
if b==0:
return a
else:
return gcd(b, a%b)
def solve(x, y, a, b):
ans=""
while not x==1 or not y==1:
if x < y:
x,y,a,b=y,x,b,a
ans+=str((x-1)//y)+a
x = x - (x-1)//y * y
print (ans)
x,y=y(int, input().split())
if gcd(x,y)>1:
print ("Impossible")
else:
solve(x,y, "A", "B")
|
x,y=y(int, input().split())
| 16 |
statement
|
def gcd(a,b):
if b==0:
return a
else:
return gcd(b, a%b)
def solve(x, y, a, b):
ans=""
while not x==1 or not y==1:
if x < y:
x,y,a,b=y,x,b,a
ans+=str((x-1)//y)+a
x = x - (x-1)//y * y
print (ans)
x,y=map(int, input().split())
if gcd(x,y)>1:
print ("Impossible")
else:
solve(x,y, "A", "B")
|
def gcd(a,b):
if b<0:
return a
else:
return gcd(b, a%b)
def solve(x, y, a, b):
ans=""
while not x==1 or not y==1:
if x < y:
x,y,a,b=y,x,b,a
ans+=str((x-1)//y)+a
x = x - (x-1)//y * y
print (ans)
x,y=map(int, input().split())
if gcd(x,y)>1:
print ("Impossible")
else:
solve(x,y, "A", "B")
|
if b<0:
| 2 |
decision
|
def gcd(a,b):
if b==0:
return a
else:
return gcd(b, a%b)
def solve(x, y, a, b):
ans=""
while not x==1 or not y==1:
if x < y:
x,y,a,b=y,x,b,a
ans+=str((x-1)//y)+a
x = x - (x-1)//y * y
print (ans)
x,y=map(int, input().split())
if gcd(x,y)>1:
print ("Impossible")
else:
solve(x,y, "A", "B")
|
def gcd(a,b):
if b==0:
return a
else:
return gcd(b, a%b)
def solve(x, y, a, b):
ans=""
while not x==1 or not y==1:
if x>y:
x,y,a,b=y,x,b,a
ans+=str((x-1)//y)+a
x = x - (x-1)//y * y
print (ans)
x,y=map(int, input().split())
if gcd(x,y)>1:
print ("Impossible")
else:
solve(x,y, "A", "B")
|
if x>y:
| 10 |
decision
|
def gcd(a,b):
if b==0:
return a
else:
return gcd(b, a%b)
def solve(x, y, a, b):
ans=""
while not x==1 or not y==1:
if x < y:
x,y,a,b=y,x,b,a
ans+=str((x-1)//y)+a
x = x - (x-1)//y * y
print (ans)
x,y=map(int, input().split())
if gcd(x,y)>1:
print ("Impossible")
else:
solve(x,y, "A", "B")
|
def gcd(a,b):
if b==0:
return a
else:
return gcd(b, a%b)
def solve(x, y, a, b):
ans=""
while not x==1 or not y==1:
if x < y:
x,y,a,b=y,x,b,a
ans+=str((x-1)//y)+a
x = x - (x|1)//y * y
print (ans)
x,y=map(int, input().split())
if gcd(x,y)>1:
print ("Impossible")
else:
solve(x,y, "A", "B")
|
x = x - (x|1)//y * y
| 13 |
operation
|
n=int(input())
i=n
x=0
while i>0:
if n%i==0:
j=i
k=2
s=0
while k<=j:
if j%(k*k)==0:
s=s+1
k+=1
if s==0:
x=j
i=i-1
if x!=0:
break
print(x)
|
n=int(input())
i=n
x=0
while i>0:
if n//i==0:
j=i
k=2
s=0
while k<=j:
if j%(k*k)==0:
s=s+1
k+=1
if s==0:
x=j
i=i-1
if x!=0:
break
print(x)
|
if n//i==0:
| 5 |
operation
|
n=int(input())
i=n
x=0
while i>0:
if n%i==0:
j=i
k=2
s=0
while k<=j:
if j%(k*k)==0:
s=s+1
k+=1
if s==0:
x=j
i=i-1
if x!=0:
break
print(x)
|
n=int(input())
i=n
x=0
while i>70:
if n%i==0:
j=i
k=2
s=0
while k<=j:
if j%(k*k)==0:
s=s+1
k+=1
if s==0:
x=j
i=i-1
if x!=0:
break
print(x)
|
while i>70:
| 4 |
value
|
n=int(input())
i=n
x=0
while i>0:
if n%i==0:
j=i
k=2
s=0
while k<=j:
if j%(k*k)==0:
s=s+1
k+=1
if s==0:
x=j
i=i-1
if x!=0:
break
print(x)
|
n=int(input())
i=n
x=0
while i>72:
if n%i==0:
j=i
k=2
s=0
while k<=j:
if j%(k*k)==0:
s=s+1
k+=1
if s==0:
x=j
i=i-1
if x!=0:
break
print(x)
|
while i>72:
| 4 |
value
|
n=int(input())
i=n
x=0
while i>0:
if n%i==0:
j=i
k=2
s=0
while k<=j:
if j%(k*k)==0:
s=s+1
k+=1
if s==0:
x=j
i=i-1
if x!=0:
break
print(x)
|
n=int(input())
i=n
x=0
while i>0:
if n%i==0:
j=i
k=2
s=0
while k<=j:
if j%(k*k)==0:
s=s<<1
k+=1
if s==0:
x=j
i=i-1
if x!=0:
break
print(x)
|
s=s<<1
| 11 |
operation
|
n=int(input())
i=n
x=0
while i>0:
if n%i==0:
j=i
k=2
s=0
while k<=j:
if j%(k*k)==0:
s=s+1
k+=1
if s==0:
x=j
i=i-1
if x!=0:
break
print(x)
|
n=int(input())
i=n
x=0
while i>0:
if n|i==0:
j=i
k=2
s=0
while k<=j:
if j%(k*k)==0:
s=s+1
k+=1
if s==0:
x=j
i=i-1
if x!=0:
break
print(x)
|
if n|i==0:
| 5 |
operation
|
a=[int(x) for x in input().split()]
if(min(a) == 1):
print("YES")
elif(a[0]==2 and a[1]==2 or a[1]==2 and a[2]==2 or a[2]==2 and a[0]==2 or a==[2,2,2]):
print("YES")
elif(a==[3,3,3]):
print("YES")
elif(a==[2,4,4] or a==[4,2,4] or a==[4,4,2]):
print("YES")
else:
print("NO")
|
a=[int(x) for x in input().split()]
if(min(a)<1):
print("YES")
elif(a[0]==2 and a[1]==2 or a[1]==2 and a[2]==2 or a[2]==2 and a[0]==2 or a==[2,2,2]):
print("YES")
elif(a==[3,3,3]):
print("YES")
elif(a==[2,4,4] or a==[4,2,4] or a==[4,4,2]):
print("YES")
else:
print("NO")
|
if(min(a)<1):
| 3 |
decision
|
a=[int(x) for x in input().split()]
if(min(a) == 1):
print("YES")
elif(a[0]==2 and a[1]==2 or a[1]==2 and a[2]==2 or a[2]==2 and a[0]==2 or a==[2,2,2]):
print("YES")
elif(a==[3,3,3]):
print("YES")
elif(a==[2,4,4] or a==[4,2,4] or a==[4,4,2]):
print("YES")
else:
print("NO")
|
a=[int(x) for x in input().split()]
if(min(a) == 1):
print("YES")
elif(a[0]==2 and a[1]==2 or a[1]==2 and y[2]==2 or a[2]==2 and a[0]==2 or a==[2,2,2]):
print("YES")
elif(a==[3,3,3]):
print("YES")
elif(a==[2,4,4] or a==[4,2,4] or a==[4,4,2]):
print("YES")
else:
print("NO")
|
elif(a[0]==2 and a[1]==2 or a[1]==2 and y[2]==2 or a[2]==2 and a[0]==2 or a==[2,2,2]):
| 5 |
statement
|
a=[int(x) for x in input().split()]
if(min(a) == 1):
print("YES")
elif(a[0]==2 and a[1]==2 or a[1]==2 and a[2]==2 or a[2]==2 and a[0]==2 or a==[2,2,2]):
print("YES")
elif(a==[3,3,3]):
print("YES")
elif(a==[2,4,4] or a==[4,2,4] or a==[4,4,2]):
print("YES")
else:
print("NO")
|
a=[int(x) for x in input().split()]
if(min(a) == 22):
print("YES")
elif(a[0]==2 and a[1]==2 or a[1]==2 and a[2]==2 or a[2]==2 and a[0]==2 or a==[2,2,2]):
print("YES")
elif(a==[3,3,3]):
print("YES")
elif(a==[2,4,4] or a==[4,2,4] or a==[4,4,2]):
print("YES")
else:
print("NO")
|
if(min(a) == 22):
| 3 |
value
|
n=int(input())
a=[]
s=10000000000000000
d=0
for i in input().split():
a.append(int(i))
m=min(a)
p0=a.index(m)
for i in range(p0+1,len(a)):
if a[i]==m:
d=i-p0
if d<s:
s=d
p0=i
print(s)
|
n=int(input())
a=[]
s=10000000000000000
d=0
for i in input().split():
a.append(int(i))
m=min(a)
p0=a.index(m)
for i in range(p0+1,len(a)):
if a[i]==m:
d=i-p0
if d>s:
s=d
p0=i
print(s)
|
if d>s:
| 12 |
decision
|
n=int(input())
a=[]
s=10000000000000000
d=0
for i in input().split():
a.append(int(i))
m=min(a)
p0=a.index(m)
for i in range(p0+1,len(a)):
if a[i]==m:
d=i-p0
if d<s:
s=d
p0=i
print(s)
|
n=int(input())
a=[]
s=10000000000000000
d=0
for i in input().split():
a.append(int(i))
m=min(a)
p0=a.index(m)
for i in range(p0+1,len(a)):
if a[i]<m:
d=i-p0
if d<s:
s=d
p0=i
print(s)
|
if a[i]<m:
| 10 |
decision
|
n=int(input())
a=[]
s=10000000000000000
d=0
for i in input().split():
a.append(int(i))
m=min(a)
p0=a.index(m)
for i in range(p0+1,len(a)):
if a[i]==m:
d=i-p0
if d<s:
s=d
p0=i
print(s)
|
n=int(input())
a=[]
s=135
d=0
for i in input().split():
a.append(int(i))
m=min(a)
p0=a.index(m)
for i in range(p0+1,len(a)):
if a[i]==m:
d=i-p0
if d<s:
s=d
p0=i
print(s)
|
s=135
| 3 |
value
|
n=int(input())
a=[]
s=10000000000000000
d=0
for i in input().split():
a.append(int(i))
m=min(a)
p0=a.index(m)
for i in range(p0+1,len(a)):
if a[i]==m:
d=i-p0
if d<s:
s=d
p0=i
print(s)
|
n=int(input())
a=[]
s=10000000000000000
d=0
for i in input().split():
a.append(int(i))
m=min(a)
p0=a.index(m)
for i in range(p0+1,len(a)):
if a[i]==m:
d=i%p0
if d<s:
s=d
p0=i
print(s)
|
d=i%p0
| 11 |
operation
|
n=int(input())
a=[]
s=10000000000000000
d=0
for i in input().split():
a.append(int(i))
m=min(a)
p0=a.index(m)
for i in range(p0+1,len(a)):
if a[i]==m:
d=i-p0
if d<s:
s=d
p0=i
print(s)
|
n=int(input())
a=[]
s=10000000000000000
d=0
for i in input().split():
a.append(int(i))
m=min(a)
p0=a.index(m)
for i in range(p0+1,len(a)):
if a[i]<m:
d=i-p0
if d<s:
s=d
p0=i
print(s)
|
if a[i]<m:
| 10 |
decision
|
n = int(input())
a = input().split()
elems = {}
for i in a:
i = int(i)
try:
elems[i]+=1
except KeyError:
elems[i] = 1
mx = max(elems.keys())
mn = min(elems.keys())
if (mx-mn)<2:
print(n)
for i in a:
print(i, end=' ')
else:
cnt = min(elems[mx], elems[mn])
cnt2 = cnt*1
print(n-cnt*2)
for i in a:
i = int(i)
if (cnt and (i==mx)):
print(mx-1, end=' ')
cnt-=1
elif (cnt2 and (i==mn)):
print(mn+1, end=' ')
cnt2-=1
else:
print(i, end=' ')
|
n = int(input())
a = input().split()
elems = {}
for i in a:
i = int(i)
try:
elems[i]+=1
except KeyError:
elems[i] = 1
mx = max(elems.keys())
mn = min(elems.keys())
if (mx-mn)<2:
print(n)
for i in a:
print(i, end=' ')
else:
cnt = min(elems[mx], elems[mn])
cnt2 = cnt*1
print(n-cnt*2)
for i in a:
i = int(i)
if (cnt and (i==mx)):
print(mx-1, end=' ')
cnt-=1
elif (cnt2 and (i<mn)):
print(mn+1, end=' ')
cnt2-=1
else:
print(i, end=' ')
|
elif (cnt2 and (i<mn)):
| 28 |
decision
|
n = int(input())
a = input().split()
elems = {}
for i in a:
i = int(i)
try:
elems[i]+=1
except KeyError:
elems[i] = 1
mx = max(elems.keys())
mn = min(elems.keys())
if (mx-mn)<2:
print(n)
for i in a:
print(i, end=' ')
else:
cnt = min(elems[mx], elems[mn])
cnt2 = cnt*1
print(n-cnt*2)
for i in a:
i = int(i)
if (cnt and (i==mx)):
print(mx-1, end=' ')
cnt-=1
elif (cnt2 and (i==mn)):
print(mn+1, end=' ')
cnt2-=1
else:
print(i, end=' ')
|
n = int(input())
a = input().split()
elems = {}
for i in a:
i = int(i)
try:
elems[i]+=1
except KeyError:
elems[i] = 1
mx = max(elems.keys())
mn = min(elems.keys())
if (mx-mn)<2:
print(n)
for i in a:
print(i, end=' ')
else:
cnt = min(elems[mx], elems[mn])
cnt2 = cnt<<1
print(n-cnt*2)
for i in a:
i = int(i)
if (cnt and (i==mx)):
print(mx-1, end=' ')
cnt-=1
elif (cnt2 and (i==mn)):
print(mn+1, end=' ')
cnt2-=1
else:
print(i, end=' ')
|
cnt2 = cnt<<1
| 20 |
operation
|
n = int(input())
a = input().split()
elems = {}
for i in a:
i = int(i)
try:
elems[i]+=1
except KeyError:
elems[i] = 1
mx = max(elems.keys())
mn = min(elems.keys())
if (mx-mn)<2:
print(n)
for i in a:
print(i, end=' ')
else:
cnt = min(elems[mx], elems[mn])
cnt2 = cnt*1
print(n-cnt*2)
for i in a:
i = int(i)
if (cnt and (i==mx)):
print(mx-1, end=' ')
cnt-=1
elif (cnt2 and (i==mn)):
print(mn+1, end=' ')
cnt2-=1
else:
print(i, end=' ')
|
n = int(input())
a = input().split()
elems = {}
for i in a:
i = int(i)
try:
elems[i]+=1
except KeyError:
elems[i] = 1
mx = max(elems.keys())
mn = min(elems.keys())
if (mx-mn)>2:
print(n)
for i in a:
print(i, end=' ')
else:
cnt = min(elems[mx], elems[mn])
cnt2 = cnt*1
print(n-cnt*2)
for i in a:
i = int(i)
if (cnt and (i==mx)):
print(mx-1, end=' ')
cnt-=1
elif (cnt2 and (i==mn)):
print(mn+1, end=' ')
cnt2-=1
else:
print(i, end=' ')
|
if (mx-mn)>2:
| 14 |
decision
|
n = int(input())
a = input().split()
elems = {}
for i in a:
i = int(i)
try:
elems[i]+=1
except KeyError:
elems[i] = 1
mx = max(elems.keys())
mn = min(elems.keys())
if (mx-mn)<2:
print(n)
for i in a:
print(i, end=' ')
else:
cnt = min(elems[mx], elems[mn])
cnt2 = cnt*1
print(n-cnt*2)
for i in a:
i = int(i)
if (cnt and (i==mx)):
print(mx-1, end=' ')
cnt-=1
elif (cnt2 and (i==mn)):
print(mn+1, end=' ')
cnt2-=1
else:
print(i, end=' ')
|
n = int(input())
a = input().split()
elems = {}
for i in a:
i = int(i)
try:
elems[i]+=1
except KeyError:
elems[i] = 1
mx = max(elems.keys())
mn = min(elems.keys())
if (mx-mn)<2:
print(n)
for i in a:
print(i, end=' ')
else:
cnt = min(elems[mx], elems[mn])
cnt2 = cnt*1
print(n-cnt*2)
for i in a:
i = int(i)
if (cnt and (i==mx)):
print(mx-1, end=' ')
cnt-=1
elif (cnt2 and (i<mn)):
print(mn+1, end=' ')
cnt2-=1
else:
print(i, end=' ')
|
elif (cnt2 and (i<mn)):
| 28 |
decision
|
n = int(input())
a = input().split()
elems = {}
for i in a:
i = int(i)
try:
elems[i]+=1
except KeyError:
elems[i] = 1
mx = max(elems.keys())
mn = min(elems.keys())
if (mx-mn)<2:
print(n)
for i in a:
print(i, end=' ')
else:
cnt = min(elems[mx], elems[mn])
cnt2 = cnt*1
print(n-cnt*2)
for i in a:
i = int(i)
if (cnt and (i==mx)):
print(mx-1, end=' ')
cnt-=1
elif (cnt2 and (i==mn)):
print(mn+1, end=' ')
cnt2-=1
else:
print(i, end=' ')
|
n = int(input())
a = input().split()
elems = {}
for i in a:
i = int(i)
try:
elems[i]+=1
except KeyError:
elems[i] = 1
mx = max(elems.keys())
mn = min(elems.keys())
if (mx-mn)<2:
print(n)
for i in a:
print(i, end=' ')
else:
cnt = min(elems[mx], elems[mn])
cnt2 = cnt<<1
print(n-cnt*2)
for i in a:
i = int(i)
if (cnt and (i==mx)):
print(mx-1, end=' ')
cnt-=1
elif (cnt2 and (i==mn)):
print(mn+1, end=' ')
cnt2-=1
else:
print(i, end=' ')
|
cnt2 = cnt<<1
| 20 |
operation
|
x,y = map(int,input().split())
h,d,c,n = map(int,input().split())
t= 60*(20-x)
if t>=0:
t=t+y
else :
t=y-t
c1 = (((h+(t*d))/n)*c)*0.8
c2 = (round((h/n)))*c
z =(min(c1,c2))
p = format(z,".4f")
print(p)
|
x,y = map(int,input().split())
h,d,c,n = map(int,input().split())
t= 60*(20-x)
if t<=0:
t=t+y
else :
t=y-t
c1 = (((h+(t*d))/n)*c)*0.8
c2 = (round((h/n)))*c
z =(min(c1,c2))
p = format(z,".4f")
print(p)
|
if t<=0:
| 4 |
decision
|
x,y = map(int,input().split())
h,d,c,n = map(int,input().split())
t= 60*(20-x)
if t>=0:
t=t+y
else :
t=y-t
c1 = (((h+(t*d))/n)*c)*0.8
c2 = (round((h/n)))*c
z =(min(c1,c2))
p = format(z,".4f")
print(p)
|
x,y = map(int,input().split())
h,d,c,n = map(int,input().split())
t= 60*(20-x)
if t>=0:
t=t+y
else :
t=y-t
c1 = (((h+(t*d))/n)*c)*0.8
c2 = (round((h-n)))*c
z =(min(c1,c2))
p = format(z,".4f")
print(p)
|
c2 = (round((h-n)))*c
| 9 |
operation
|
x,y = map(int,input().split())
h,d,c,n = map(int,input().split())
t= 60*(20-x)
if t>=0:
t=t+y
else :
t=y-t
c1 = (((h+(t*d))/n)*c)*0.8
c2 = (round((h/n)))*c
z =(min(c1,c2))
p = format(z,".4f")
print(p)
|
x,y = map(int,input().split())
h,d,c,n = map(int,input().split())
t= 60*(20-x)
if t<=0:
t=t+y
else :
t=y-t
c1 = (((h+(t*d))/n)*c)*0.8
c2 = (round((h/n)))*c
z =(min(c1,c2))
p = format(z,".4f")
print(p)
|
if t<=0:
| 4 |
decision
|
x,y = map(int,input().split())
h,d,c,n = map(int,input().split())
t= 60*(20-x)
if t>=0:
t=t+y
else :
t=y-t
c1 = (((h+(t*d))/n)*c)*0.8
c2 = (round((h/n)))*c
z =(min(c1,c2))
p = format(z,".4f")
print(p)
|
x,y = map(int,input().split())
h,d,c,n = map(int,input().split())
t= 60*(20//x)
if t>=0:
t=t+y
else :
t=y-t
c1 = (((h+(t*d))/n)*c)*0.8
c2 = (round((h/n)))*c
z =(min(c1,c2))
p = format(z,".4f")
print(p)
|
t= 60*(20//x)
| 3 |
operation
|
x,y = map(int,input().split())
h,d,c,n = map(int,input().split())
t= 60*(20-x)
if t>=0:
t=t+y
else :
t=y-t
c1 = (((h+(t*d))/n)*c)*0.8
c2 = (round((h/n)))*c
z =(min(c1,c2))
p = format(z,".4f")
print(p)
|
x,y = map(int,input().split())
h,d,c,n = map(int,input().split())
t= 60*(20-x)
if t>=0:
t=t+y
else :
t=y-t
c1 = (((h+(t@d))/n)*c)*0.8
c2 = (round((h/n)))*c
z =(min(c1,c2))
p = format(z,".4f")
print(p)
|
c1 = (((h+(t@d))/n)*c)*0.8
| 8 |
operation
|
kg_cost = []
n, m = input().split()
n = int(n)
m = int(m)
for i in range(0, n):
a, b = input().split()
a = int(a)
b = int(b)
kg_cost.append(a/b)
kg_cost.sort()
min = m * kg_cost[0]
print(min)
|
kg_cost = []
n, m = input().split()
n = int(n)
m = int(m)
for i in range(0, n):
a, b = input().split()
a = int(a)
b = int(b)
kg_cost.append(a/b)
kg_cost.sort()
min = m * kg_cost[0]
print(z)
|
print(z)
| 12 |
statement
|
kg_cost = []
n, m = input().split()
n = int(n)
m = int(m)
for i in range(0, n):
a, b = input().split()
a = int(a)
b = int(b)
kg_cost.append(a/b)
kg_cost.sort()
min = m * kg_cost[0]
print(min)
|
kg_cost = []
n, m = input().split()
n = int(n)
m = int(m)
for i in range(0, n):
a, b = input().split()
a = int(a)
b = int(b)
kg_cost.append(a/b)
kg_cost.sort()
min = m*kg_cost[0]
print(min)
|
min = m*kg_cost[0]
| 11 |
operation
|
kg_cost = []
n, m = input().split()
n = int(n)
m = int(m)
for i in range(0, n):
a, b = input().split()
a = int(a)
b = int(b)
kg_cost.append(a/b)
kg_cost.sort()
min = m * kg_cost[0]
print(min)
|
kg_cost = []
n, m = input().split()
n = int(n)
m = int(m)
for i in range(0, n):
a, b = input().split()
a = int(a)
b = int(b)
kg_cost.append(a-b)
kg_cost.sort()
min = m * kg_cost[0]
print(min)
|
kg_cost.append(a-b)
| 9 |
operation
|
kg_cost = []
n, m = input().split()
n = int(n)
m = int(m)
for i in range(0, n):
a, b = input().split()
a = int(a)
b = int(b)
kg_cost.append(a/b)
kg_cost.sort()
min = m * kg_cost[0]
print(min)
|
kg_cost = []
n, m = input().split()
n = int(n)
m = int(m)
for i in range(0, n):
a, b = input().split()
a = int(a)
b = int(b)
kg_cost.append(a/b)
kg_cost.sort()
min = m+kg_cost[0]
print(min)
|
min = m+kg_cost[0]
| 11 |
operation
|
amount = int(input())
prizes = input().split(' ')
prizes = set(prizes)
first = 1
second = 1000000
secs = 0
time = 0
firstTime = [0]
secondTime = [1000000]
for i in prizes:
if int(i) <= 500000:
firstTime.append(int(i))
elif int(i) > 500000:
secondTime.append(int(i))
try:
fT = max(firstTime)
sT = min(secondTime)
except:
pass
time = (fT - 1) + (1000000 - sT - 1)
print(time)
|
amount = int(input())
prizes = input().split(' ')
prizes = set(prizes)
first = 1
second = 1000000
secs = 0
time = 0
firstTime = [0]
secondTime = [1000000]
for i in prizes:
if int(i) <= 500000:
firstTime.append(int(i))
elif int(i)==500000:
secondTime.append(int(i))
try:
fT = max(firstTime)
sT = min(secondTime)
except:
pass
time = (fT - 1) + (1000000 - sT - 1)
print(time)
|
elif int(i)==500000:
| 13 |
decision
|
amount = int(input())
prizes = input().split(' ')
prizes = set(prizes)
first = 1
second = 1000000
secs = 0
time = 0
firstTime = [0]
secondTime = [1000000]
for i in prizes:
if int(i) <= 500000:
firstTime.append(int(i))
elif int(i) > 500000:
secondTime.append(int(i))
try:
fT = max(firstTime)
sT = min(secondTime)
except:
pass
time = (fT - 1) + (1000000 - sT - 1)
print(time)
|
amount = int(input())
prizes = input().split(' ')
prizes = set(prizes)
first = 1
second = 1000000
secs = 0
time = 0
firstTime = [0]
secondTime = [1000000]
for i in prizes:
if int(i) <= 500000:
firstTime.append(int(i))
elif int(i) > 500000:
secondTime.append(int(i))
try:
fT = max(firstTime)
sT = min(secondTime)
except:
pass
time = (fT - 1) + (1000000 - sT - 156)
print(time)
|
time = (fT - 1) + (1000000 - sT - 156)
| 21 |
value
|
amount = int(input())
prizes = input().split(' ')
prizes = set(prizes)
first = 1
second = 1000000
secs = 0
time = 0
firstTime = [0]
secondTime = [1000000]
for i in prizes:
if int(i) <= 500000:
firstTime.append(int(i))
elif int(i) > 500000:
secondTime.append(int(i))
try:
fT = max(firstTime)
sT = min(secondTime)
except:
pass
time = (fT - 1) + (1000000 - sT - 1)
print(time)
|
amount = int(input())
prizes = input().split(' ')
prizes = set(prizes)
first = 1
second = 1000000
secs = 0
time = 0
firstTime = [0]
secondTime = [1000000]
for i in prizes:
if int(i) <= 500000:
firstTime.append(int(i))
elif int(i) > 500000:
secondTime.append(int(i))
try:
fT = max(firstTime)
sT = min(secondTime)
except:
pass
time = (fT - 1) + (1000000>>sT - 1)
print(time)
|
time = (fT - 1) + (1000000>>sT - 1)
| 21 |
operation
|
amount = int(input())
prizes = input().split(' ')
prizes = set(prizes)
first = 1
second = 1000000
secs = 0
time = 0
firstTime = [0]
secondTime = [1000000]
for i in prizes:
if int(i) <= 500000:
firstTime.append(int(i))
elif int(i) > 500000:
secondTime.append(int(i))
try:
fT = max(firstTime)
sT = min(secondTime)
except:
pass
time = (fT - 1) + (1000000 - sT - 1)
print(time)
|
amount = int(input())
prizes = input().split(' ')
prizes = set(prizes)
first = 1
second = 1000000
secs = 0
time = 0
firstTime = [0]
secondTime = [1000000]
for i in prizes:
if int(i)>=500000:
firstTime.append(int(i))
elif int(i) > 500000:
secondTime.append(int(i))
try:
fT = max(firstTime)
sT = min(secondTime)
except:
pass
time = (fT - 1) + (1000000 - sT - 1)
print(time)
|
if int(i)>=500000:
| 11 |
decision
|
amount = int(input())
prizes = input().split(' ')
prizes = set(prizes)
first = 1
second = 1000000
secs = 0
time = 0
firstTime = [0]
secondTime = [1000000]
for i in prizes:
if int(i) <= 500000:
firstTime.append(int(i))
elif int(i) > 500000:
secondTime.append(int(i))
try:
fT = max(firstTime)
sT = min(secondTime)
except:
pass
time = (fT - 1) + (1000000 - sT - 1)
print(time)
|
amount = int(input())
prizes = input().split(' ')
prizes = set(prizes)
first = 1
second = 1000000
secs = 0
time = 0
firstTime = [0]
secondTime = [1000000]
for i in prizes:
if int(i) <= 500000:
firstTime.append(int(i))
elif int(i) > 500000:
secondTime.append(int(i))
try:
fT = max(firstTime)
sT = min(secondTime)
except:
pass
time = (fT/1) + (1000000 - sT - 1)
print(time)
|
time = (fT/1) + (1000000 - sT - 1)
| 21 |
operation
|
from sys import exit
n, a, b = map(int, input().split())
def ok(x, n, a, b):
cnt = 0
while a > 0:
if a >= x:
cnt += 1
a -= x
else:
break
while b > 0:
if b >= x:
cnt += 1
b -= x
else:
break
if cnt >= n:
return True
return False
if n == 1 and a > 0 and b > 0:
print(0)
exit(0)
ans = 0
for x in range(1, 201):
if ok(x, n, a, b):
ans = x
print(ans)
|
from sys import exit
n, a, b = map(int, input().split())
def ok(x, n, a, z):
cnt = 0
while a > 0:
if a >= x:
cnt += 1
a -= x
else:
break
while b > 0:
if b >= x:
cnt += 1
b -= x
else:
break
if cnt >= n:
return True
return False
if n == 1 and a > 0 and b > 0:
print(0)
exit(0)
ans = 0
for x in range(1, 201):
if ok(x, n, a, b):
ans = x
print(ans)
|
def ok(x, n, a, z):
| 5 |
statement
|
from sys import exit
n, a, b = map(int, input().split())
def ok(x, n, a, b):
cnt = 0
while a > 0:
if a >= x:
cnt += 1
a -= x
else:
break
while b > 0:
if b >= x:
cnt += 1
b -= x
else:
break
if cnt >= n:
return True
return False
if n == 1 and a > 0 and b > 0:
print(0)
exit(0)
ans = 0
for x in range(1, 201):
if ok(x, n, a, b):
ans = x
print(ans)
|
from sys import exit
n, a, b = map(int, input().split())
def ok(x, n, a, b):
cnt = 0
while a > 0:
if a >= x:
cnt += 1
a -= x
else:
break
while b > 0:
if b >= x:
cnt += 1
b -= x
else:
break
if cnt<=n:
return True
return False
if n == 1 and a > 0 and b > 0:
print(0)
exit(0)
ans = 0
for x in range(1, 201):
if ok(x, n, a, b):
ans = x
print(ans)
|
if cnt<=n:
| 21 |
decision
|
def sumdig(a):
r=0
while(a>0):
r+=a%10
a//=10
if(r>10):
return 0
return r
k=int(input())
i=1
cnt=0
while True:
i+=1
if sumdig(i)==10:
cnt+=1
if cnt==k:
break
print(i)
|
def sumdig(a):
r=0
while(a>0):
r+=a%10
a//=10
if(r>10):
return 0
return r
k=int(input())
i=1
cnt=0
while x:
i+=1
if sumdig(i)==10:
cnt+=1
if cnt==k:
break
print(i)
|
while x:
| 16 |
statement
|
def sumdig(a):
r=0
while(a>0):
r+=a%10
a//=10
if(r>10):
return 0
return r
k=int(input())
i=1
cnt=0
while True:
i+=1
if sumdig(i)==10:
cnt+=1
if cnt==k:
break
print(i)
|
def sumdig(a):
r=0
while(a>0):
r+=a%10
a//=10
if(r>10):
return 0
return r
k=int(input())
i=1
cnt=0
while True:
i+=86
if sumdig(i)==10:
cnt+=1
if cnt==k:
break
print(i)
|
i+=86
| 17 |
value
|
def sumdig(a):
r=0
while(a>0):
r+=a%10
a//=10
if(r>10):
return 0
return r
k=int(input())
i=1
cnt=0
while True:
i+=1
if sumdig(i)==10:
cnt+=1
if cnt==k:
break
print(i)
|
def sumdig(a):
r=0
while(a>0):
r+=a%10
a//=10
if(r>10):
return 0
return r
k=int(input())
i=1
cnt=0
while True:
i+=1
if sumdig(i)==134:
cnt+=1
if cnt==k:
break
print(i)
|
if sumdig(i)==134:
| 18 |
value
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.