description stringlengths 171 4k | code stringlengths 94 3.98k | normalized_code stringlengths 57 4.99k |
|---|---|---|
The only difference between easy and hard versions is a number of elements in the array.
You are given an array $a$ consisting of $n$ integers. The value of the $i$-th element of the array is $a_i$.
You are also given a set of $m$ segments. The $j$-th segment is $[l_j; r_j]$, where $1 \le l_j \le r_j \le n$.
You can... | n, m = map(int, input().split())
x = list(map(int, input().split()))
q = [0] * m
for i in range(m):
q[i] = list(map(int, input().split()))
ans = 0
ansNum = 0
ansS = ""
for i in range(n):
maxVal = x[i]
maxIndex = i + 1
temp = [0] * n
tempNum = 0
tempS = ""
for k in range(n):
temp[k] =... | ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP LIST NUMBER VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR STRING FOR VAR FUN... |
The only difference between easy and hard versions is a number of elements in the array.
You are given an array $a$ consisting of $n$ integers. The value of the $i$-th element of the array is $a_i$.
You are also given a set of $m$ segments. The $j$-th segment is $[l_j; r_j]$, where $1 \le l_j \le r_j \le n$.
You can... | def __starting_point():
n, subset = map(int, input().split(" "))
a = list(map(int, input().split(" ")))
f = []
t = []
for i in range(subset):
x, y = map(int, input().split(" "))
f.append(x - 1)
t.append(y - 1)
diff = 0
answer = []
for ma in range(n):
for m... | FUNC_DEF ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR LIST ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING EXPR FUNC_CALL VAR BIN_OP VAR NUMBER EXPR FUNC_CALL... |
The only difference between easy and hard versions is a number of elements in the array.
You are given an array $a$ consisting of $n$ integers. The value of the $i$-th element of the array is $a_i$.
You are also given a set of $m$ segments. The $j$-th segment is $[l_j; r_j]$, where $1 \le l_j \le r_j \le n$.
You can... | import sys
mod = 10**9 + 7
INF = float("inf")
def inp():
return int(sys.stdin.readline())
def inpl():
return list(map(int, sys.stdin.readline().split()))
n, m = inpl()
a = inpl()
mx = max(a)
a = [(-(x - mx)) for x in a]
s = [inpl() for _ in range(m)]
res = 0
Q = []
for i in range(n):
for j in range(n... | IMPORT ASSIGN VAR BIN_OP BIN_OP NUMBER NUMBER NUMBER ASSIGN VAR FUNC_CALL VAR STRING FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP VAR VAR VAR VAR AS... |
The only difference between easy and hard versions is a number of elements in the array.
You are given an array $a$ consisting of $n$ integers. The value of the $i$-th element of the array is $a_i$.
You are also given a set of $m$ segments. The $j$-th segment is $[l_j; r_j]$, where $1 \le l_j \le r_j \le n$.
You can... | n, m = list(map(int, input().split()))
a = list(map(int, input().split()))
b = []
for i in range(m):
b.append(list(map(int, input().split())))
ans = -1000000000
for i in range(n):
ac = a.copy()
for j in range(m):
if i + 1 < b[j][0] or i + 1 > b[j][1]:
for k in range(b[j][0] - 1, b[j][1])... | ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL ... |
The only difference between easy and hard versions is a number of elements in the array.
You are given an array $a$ consisting of $n$ integers. The value of the $i$-th element of the array is $a_i$.
You are also given a set of $m$ segments. The $j$-th segment is $[l_j; r_j]$, where $1 \le l_j \le r_j \le n$.
You can... | n, m = map(int, input().split())
ls = list(map(int, input().split()))
segs = [None for _ in range(m)]
maxdiv = 0
maxsegs = set()
for i in range(m):
l, r = map(int, input().split())
segs[i] = l - 1, r - 1
for maxi in range(n):
currarr = [(0) for _ in range(n + 1)]
usegs = set()
for ind, seg in enumer... | ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NONE VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR BIN_OP VAR NUMBER... |
The only difference between easy and hard versions is a number of elements in the array.
You are given an array $a$ consisting of $n$ integers. The value of the $i$-th element of the array is $a_i$.
You are also given a set of $m$ segments. The $j$-th segment is $[l_j; r_j]$, where $1 \le l_j \le r_j \le n$.
You can... | n, m = map(int, input().split())
inputList = [0] + list(map(int, input().split())) + [0]
inputIntervals = []
for _ in range(m):
inputIntervals.append(tuple(map(int, input().split())))
def wynik(in1, in2):
intervals = [[] for _ in range(n + 1)]
for nr, (a, b) in enumerate(in2):
intervals[b] += [(a,... | ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP BIN_OP LIST NUMBER FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR LIST NUMBER ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF ASSIGN VAR LIST VAR FUNC_CALL VA... |
The only difference between easy and hard versions is a number of elements in the array.
You are given an array $a$ consisting of $n$ integers. The value of the $i$-th element of the array is $a_i$.
You are also given a set of $m$ segments. The $j$-th segment is $[l_j; r_j]$, where $1 \le l_j \le r_j \le n$.
You can... | n, m = list(map(int, input().split()))
A = list(map(int, input().split()))
if n > 300:
lst = []
for i in range(m):
a, b = list(map(int, input().split()))
lst.append([a, b])
answer = 0
answer_1 = []
m300 = [[-1, -(10**6)]]
for i in range(max(0, m - 1)):
m300.append([-1, -(... | ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF VAR NUMBER ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR LIST VAR VAR ASSIGN VAR NUMBER ASSIG... |
Two players are playing a game. They are given an array A_{1}, A_{2}, \ldots, A_{N} as well as an array B_{1}, B_{2}, \ldots, B_{M}.
The game consists of M rounds. Players are participating in rounds alternatively. During the i-th round (for i from 1 to M) the corresponding player (first player, if i is odd, and secon... | def ans(a, b, i):
if len(a) == 0:
return 0
x = [[], []]
for j in a:
if j % b[i] == 0:
x[0].append(j)
else:
x[1].append(j)
if i == len(b) - 1:
if i % 2 == 0:
return min(sum(x[0]), sum(x[1]))
else:
return max(sum(x[0])... | FUNC_DEF IF FUNC_CALL VAR VAR NUMBER RETURN NUMBER ASSIGN VAR LIST LIST LIST FOR VAR VAR IF BIN_OP VAR VAR VAR NUMBER EXPR FUNC_CALL VAR NUMBER VAR EXPR FUNC_CALL VAR NUMBER VAR IF VAR BIN_OP FUNC_CALL VAR VAR NUMBER IF BIN_OP VAR NUMBER NUMBER RETURN FUNC_CALL VAR FUNC_CALL VAR VAR NUMBER FUNC_CALL VAR VAR NUMBER RETU... |
In recent years John has very successfully settled at his new job at the office. But John doesn't like to idly sit around while his code is compiling, so he immediately found himself an interesting distraction. The point of his distraction was to maintain a water level in the water cooler used by other zebras.
Origina... | import sys
k, l, r, t, x, y = map(int, input().split())
if x == y:
if k + y <= r:
print("Yes")
elif k - x >= l:
print("Yes")
else:
print("No")
sys.exit()
if x > y:
if k + y <= r:
k += y
if k - x - (t - 1) * (x - y) >= l:
print("Yes")
else:
pri... | IMPORT ASSIGN VAR VAR VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF VAR VAR IF BIN_OP VAR VAR VAR EXPR FUNC_CALL VAR STRING IF BIN_OP VAR VAR VAR EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR IF VAR VAR IF BIN_OP VAR VAR VAR VAR VAR IF BIN_OP BIN_OP VAR VAR BIN_OP BIN_OP VAR NUMB... |
In recent years John has very successfully settled at his new job at the office. But John doesn't like to idly sit around while his code is compiling, so he immediately found himself an interesting distraction. The point of his distraction was to maintain a water level in the water cooler used by other zebras.
Origina... | import sys
k, l, r, t, x, y = map(int, input().split())
if k < l or k > r:
print("No")
sys.exit()
if y < x:
if k + y <= r:
k += y
k -= x
if k < l:
print("No")
sys.exit()
t -= 1
cur = (k - l) // (x - y)
print("Yes" if cur >= t else "No")
sys.exit()
else:
s... | IMPORT ASSIGN VAR VAR VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF VAR VAR VAR VAR EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR IF VAR VAR IF BIN_OP VAR VAR VAR VAR VAR VAR VAR IF VAR VAR EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR VAR BIN_OP VAR VAR EXPR FUNC_CA... |
In recent years John has very successfully settled at his new job at the office. But John doesn't like to idly sit around while his code is compiling, so he immediately found himself an interesting distraction. The point of his distraction was to maintain a water level in the water cooler used by other zebras.
Origina... | import sys
k, l, r, t, x, y = list(map(int, input().split()))
if y < x:
if k + y <= r:
k += y
k -= x
nb_days = int((k - l) / (x - y)) + 1
print("Yes" if nb_days >= t else "No")
elif x < y:
memo = {}
nb_days = 0
if (k - l) % x == k - l:
k += y
if k > r:
pr... | IMPORT ASSIGN VAR VAR VAR VAR VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF VAR VAR IF BIN_OP VAR VAR VAR VAR VAR VAR VAR ASSIGN VAR BIN_OP FUNC_CALL VAR BIN_OP BIN_OP VAR VAR BIN_OP VAR VAR NUMBER EXPR FUNC_CALL VAR VAR VAR STRING STRING IF VAR VAR ASSIGN VAR DICT ASSIGN VAR NUMBER IF BIN_OP BIN_O... |
In recent years John has very successfully settled at his new job at the office. But John doesn't like to idly sit around while his code is compiling, so he immediately found himself an interesting distraction. The point of his distraction was to maintain a water level in the water cooler used by other zebras.
Origina... | init, L, R, T, des, inc = list(map(int, input().split()))
if des > inc:
if init + inc > R:
T -= 1
init -= des
des_ = des - inc
if init - des_ * T < L:
print("No")
else:
print("Yes")
else:
used = set()
num = (init - L) // des
init -= des * num
T -= num
... | ASSIGN VAR VAR VAR VAR VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF VAR VAR IF BIN_OP VAR VAR VAR VAR NUMBER VAR VAR ASSIGN VAR BIN_OP VAR VAR IF BIN_OP VAR BIN_OP VAR VAR VAR EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR VAR BIN_... |
In recent years John has very successfully settled at his new job at the office. But John doesn't like to idly sit around while his code is compiling, so he immediately found himself an interesting distraction. The point of his distraction was to maintain a water level in the water cooler used by other zebras.
Origina... | INF = float("inf")
def solve(a, r, d, u):
if a + u <= r:
a += u
if d > u:
a -= d
return a // (d - u) + 1
elif d == u:
return 0 if a < d else INF
elif d < u:
if d <= r - u + 1:
return INF
ans = 0
visited = set()
while a % d <= ... | ASSIGN VAR FUNC_CALL VAR STRING FUNC_DEF IF BIN_OP VAR VAR VAR VAR VAR IF VAR VAR VAR VAR RETURN BIN_OP BIN_OP VAR BIN_OP VAR VAR NUMBER IF VAR VAR RETURN VAR VAR NUMBER VAR IF VAR VAR IF VAR BIN_OP BIN_OP VAR VAR NUMBER RETURN VAR ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR WHILE BIN_OP VAR VAR BIN_OP VAR VAR ASSIGN VA... |
In recent years John has very successfully settled at his new job at the office. But John doesn't like to idly sit around while his code is compiling, so he immediately found himself an interesting distraction. The point of his distraction was to maintain a water level in the water cooler used by other zebras.
Origina... | v, l, r, t, x, y = map(int, input().split())
if x == y:
if v - x < l and v + y > r:
print("No")
else:
print("Yes")
pass
elif x > y:
if v + y <= r:
v += y
v -= x
if v < l:
print("No")
else:
v -= (t - 1) * (x - y)
if v < l:
print("No"... | ASSIGN VAR VAR VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF VAR VAR IF BIN_OP VAR VAR VAR BIN_OP VAR VAR VAR EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR STRING IF VAR VAR IF BIN_OP VAR VAR VAR VAR VAR VAR VAR IF VAR VAR EXPR FUNC_CALL VAR STRING VAR BIN_OP BIN_OP VAR NUMBER BIN_OP VAR VAR IF VAR VAR EX... |
In recent years John has very successfully settled at his new job at the office. But John doesn't like to idly sit around while his code is compiling, so he immediately found himself an interesting distraction. The point of his distraction was to maintain a water level in the water cooler used by other zebras.
Origina... | def solve():
k, l, r, t, usage, added = map(int, input().split())
if added <= usage:
tot_added = added * t
if k + added > r:
tot_added -= added
tot_usage = usage * t
return "Yes" if k - tot_usage + tot_added >= l else "No"
else:
r_bound = r - l
if ... | FUNC_DEF ASSIGN VAR VAR VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF VAR VAR ASSIGN VAR BIN_OP VAR VAR IF BIN_OP VAR VAR VAR VAR VAR ASSIGN VAR BIN_OP VAR VAR RETURN BIN_OP BIN_OP VAR VAR VAR VAR STRING STRING ASSIGN VAR BIN_OP VAR VAR IF BIN_OP VAR NUMBER BIN_OP VAR VAR RETURN STRING ASSIGN VAR BIN_OP ... |
In recent years John has very successfully settled at his new job at the office. But John doesn't like to idly sit around while his code is compiling, so he immediately found himself an interesting distraction. The point of his distraction was to maintain a water level in the water cooler used by other zebras.
Origina... | import sys
k, l, r, t, x, y = [int(x) for x in input("").split()]
if x >= y:
if k + y > r:
k -= x
t -= 1
k -= t * (x - y)
if k < l:
print("NO")
sys.exit()
print("YES")
else:
if k + y > r:
k -= x
t -= 1
if k < l:
print("NO")
sys.exi... | IMPORT ASSIGN VAR VAR VAR VAR VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR STRING IF VAR VAR IF BIN_OP VAR VAR VAR VAR VAR VAR NUMBER VAR BIN_OP VAR BIN_OP VAR VAR IF VAR VAR EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR EXPR FUNC_CALL VAR STRING IF BIN_OP VAR VAR VAR VAR VAR VAR NUMBER IF VAR VAR EXPR FUNC_CAL... |
In recent years John has very successfully settled at his new job at the office. But John doesn't like to idly sit around while his code is compiling, so he immediately found himself an interesting distraction. The point of his distraction was to maintain a water level in the water cooler used by other zebras.
Origina... | k, l, r, t, x, y = map(int, input().split())
if x > y:
left = 0
right = 10**18 + 13
step = x - y
if k + y <= r:
k += y
while right - left > 1:
m = (right + left) // 2
if step * (m - 1) + x <= k - l:
left = m
else:
right = m
if left >= t:
... | ASSIGN VAR VAR VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF VAR VAR ASSIGN VAR NUMBER ASSIGN VAR BIN_OP BIN_OP NUMBER NUMBER NUMBER ASSIGN VAR BIN_OP VAR VAR IF BIN_OP VAR VAR VAR VAR VAR WHILE BIN_OP VAR VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR VAR NUMBER IF BIN_OP BIN_OP VAR BIN_OP VAR NUMBER VAR BIN_O... |
In recent years John has very successfully settled at his new job at the office. But John doesn't like to idly sit around while his code is compiling, so he immediately found himself an interesting distraction. The point of his distraction was to maintain a water level in the water cooler used by other zebras.
Origina... | def gcdExtended(a, b):
if a == 0:
return b, 0, 1
gcd, x1, y1 = gcdExtended(b % a, a)
x = y1 - b // a * x1
y = x1
return gcd, x, y
k, l, r, t, x, y = [int(a) for a in input().split()]
k -= l
r -= l
if y > r:
if k - x * t < 0:
print("No")
exit(0)
else:
print("... | FUNC_DEF IF VAR NUMBER RETURN VAR NUMBER NUMBER ASSIGN VAR VAR VAR FUNC_CALL VAR BIN_OP VAR VAR VAR ASSIGN VAR BIN_OP VAR BIN_OP BIN_OP VAR VAR VAR ASSIGN VAR VAR RETURN VAR VAR VAR ASSIGN VAR VAR VAR VAR VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR VAR VAR VAR VAR IF VAR VAR IF BIN_OP VAR BIN_OP VAR VAR NUMBE... |
In recent years John has very successfully settled at his new job at the office. But John doesn't like to idly sit around while his code is compiling, so he immediately found himself an interesting distraction. The point of his distraction was to maintain a water level in the water cooler used by other zebras.
Origina... | import sys
k, l, r, t, x, y = map(int, input().split())
if x > y:
until = max(0, (k - (r - y) + (x - 1)) // x)
t -= until
k -= until * x
if t <= 0 or k - t * (x - y) >= l:
print("Yes")
else:
print("No")
elif x == y:
if k + y <= r or k - x >= l:
print("Yes")
else:
... | IMPORT ASSIGN VAR VAR VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF VAR VAR ASSIGN VAR FUNC_CALL VAR NUMBER BIN_OP BIN_OP BIN_OP VAR BIN_OP VAR VAR BIN_OP VAR NUMBER VAR VAR VAR VAR BIN_OP VAR VAR IF VAR NUMBER BIN_OP VAR BIN_OP VAR BIN_OP VAR VAR VAR EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR STRING I... |
In recent years John has very successfully settled at his new job at the office. But John doesn't like to idly sit around while his code is compiling, so he immediately found himself an interesting distraction. The point of his distraction was to maintain a water level in the water cooler used by other zebras.
Origina... | vis = [0] * 1000010
k, l, r, t, x, y = [int(i) for i in input().split()]
if x > y:
if k < l or k > r:
print("No")
exit(0)
if k + y > r:
k -= x
t -= 1
if k < l:
print("No")
exit(0)
if (k - l) // (x - y) >= t:
print("Yes")
else:
... | ASSIGN VAR BIN_OP LIST NUMBER NUMBER ASSIGN VAR VAR VAR VAR VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR IF VAR VAR IF VAR VAR VAR VAR EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR NUMBER IF BIN_OP VAR VAR VAR VAR VAR VAR NUMBER IF VAR VAR EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR NUMBER IF BIN_OP BIN_OP VAR... |
In recent years John has very successfully settled at his new job at the office. But John doesn't like to idly sit around while his code is compiling, so he immediately found himself an interesting distraction. The point of his distraction was to maintain a water level in the water cooler used by other zebras.
Origina... | import sys
k, l, r, t, x, y = map(int, input().split())
def err(*args, **kwargs):
print(*args, **kwargs, file=sys.stderr)
def solve(k, l, r, t, x, y):
if y + x <= r - l + 1 and y >= x:
return True
if y >= x:
while t > 0:
k += (r - k) // y * y
cnt_x = (k - l) // x... | IMPORT ASSIGN VAR VAR VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF EXPR FUNC_CALL VAR VAR VAR VAR FUNC_DEF IF BIN_OP VAR VAR BIN_OP BIN_OP VAR VAR NUMBER VAR VAR RETURN NUMBER IF VAR VAR WHILE VAR NUMBER VAR BIN_OP BIN_OP BIN_OP VAR VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR IF VAR NUMBER RE... |
In recent years John has very successfully settled at his new job at the office. But John doesn't like to idly sit around while his code is compiling, so he immediately found himself an interesting distraction. The point of his distraction was to maintain a water level in the water cooler used by other zebras.
Origina... | k, l, r, t, x, y = map(int, input().split())
if x == y:
if k - x >= l or k + y <= r:
print("Yes")
else:
print("No")
elif x > y:
if k + y <= r:
k = k + y
k = k - (t - 1) * (x - y)
k = k - x
if k >= l:
print("Yes")
else:
print("No")
elif x + y <= r - l:
... | ASSIGN VAR VAR VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF VAR VAR IF BIN_OP VAR VAR VAR BIN_OP VAR VAR VAR EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR STRING IF VAR VAR IF BIN_OP VAR VAR VAR ASSIGN VAR BIN_OP VAR VAR ASSIGN VAR BIN_OP VAR BIN_OP BIN_OP VAR NUMBER BIN_OP VAR VAR ASSIGN VAR BIN_OP VAR ... |
In recent years John has very successfully settled at his new job at the office. But John doesn't like to idly sit around while his code is compiling, so he immediately found himself an interesting distraction. The point of his distraction was to maintain a water level in the water cooler used by other zebras.
Origina... | start, L, R, day, use, fill = map(int, input().split())
def init():
global start, R, fill, use, day
cnt = (start - (R - fill) + use - 1) // use
start -= cnt * use
day -= cnt
def ok():
print("Yes")
exit()
def no():
print("No")
exit()
if start - use * day >= L:
ok()
init()
if s... | ASSIGN VAR VAR VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF ASSIGN VAR BIN_OP BIN_OP BIN_OP BIN_OP VAR BIN_OP VAR VAR VAR NUMBER VAR VAR BIN_OP VAR VAR VAR VAR FUNC_DEF EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR FUNC_DEF EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR IF BIN_OP VAR BIN_OP VAR VAR V... |
In recent years John has very successfully settled at his new job at the office. But John doesn't like to idly sit around while his code is compiling, so he immediately found himself an interesting distraction. The point of his distraction was to maintain a water level in the water cooler used by other zebras.
Origina... | k, l, r, t, x, y = map(int, input().split(" "))
if x >= y:
if k + y > r:
bad = False
k -= x
if k < l:
bad = True
t -= 1
if k - t * (x - y) < l:
bad = True
if bad:
print("No")
else:
print("Yes")
elif k - t * (... | ASSIGN VAR VAR VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING IF VAR VAR IF BIN_OP VAR VAR VAR ASSIGN VAR NUMBER VAR VAR IF VAR VAR ASSIGN VAR NUMBER VAR NUMBER IF BIN_OP VAR BIN_OP VAR BIN_OP VAR VAR VAR ASSIGN VAR NUMBER IF VAR EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR STRING IF BIN_OP VAR BIN_OP... |
In recent years John has very successfully settled at his new job at the office. But John doesn't like to idly sit around while his code is compiling, so he immediately found himself an interesting distraction. The point of his distraction was to maintain a water level in the water cooler used by other zebras.
Origina... | import sys
input = sys.stdin.readline
def prog():
k, l, r, t, x, y = map(int, input().split())
if x >= y:
if k + y <= r:
k -= (x - y) * t
else:
k -= (x - y) * t + y
else:
adds = 0
t2 = 1
while adds <= x and t2 <= t:
subtract = (k... | IMPORT ASSIGN VAR VAR FUNC_DEF ASSIGN VAR VAR VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF VAR VAR IF BIN_OP VAR VAR VAR VAR BIN_OP BIN_OP VAR VAR VAR VAR BIN_OP BIN_OP BIN_OP VAR VAR VAR VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER WHILE VAR VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR VAR VAR VAR BIN_O... |
In recent years John has very successfully settled at his new job at the office. But John doesn't like to idly sit around while his code is compiling, so he immediately found himself an interesting distraction. The point of his distraction was to maintain a water level in the water cooler used by other zebras.
Origina... | import sys
input = sys.stdin.readline
out = lambda b: print(("No", "Yes")[b]) or quit()
k, l, r, t, x, y = map(int, input().split())
if y <= x:
t1 = max(0, -((r - k - y) // x))
if t1 >= t:
out(k - x * t >= l)
out(k + (y - x) * t - t1 * y >= l)
y1 = max(0, -((k - l - t * x) // y))
if y1 < 1:
out... | IMPORT ASSIGN VAR VAR ASSIGN VAR FUNC_CALL VAR STRING STRING VAR FUNC_CALL VAR ASSIGN VAR VAR VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF VAR VAR ASSIGN VAR FUNC_CALL VAR NUMBER BIN_OP BIN_OP BIN_OP VAR VAR VAR VAR IF VAR VAR EXPR FUNC_CALL VAR BIN_OP VAR BIN_OP VAR VAR VAR EXPR FUNC_CALL VAR BIN_OP BI... |
In recent years John has very successfully settled at his new job at the office. But John doesn't like to idly sit around while his code is compiling, so he immediately found himself an interesting distraction. The point of his distraction was to maintain a water level in the water cooler used by other zebras.
Origina... | def gcd(a, b):
if b == 0:
return a
return gcd(b, a % b)
k, l, r, days, drink, add = map(int, input().split())
if drink == add:
if k + add <= r or k - drink >= l:
print("Yes")
else:
print("No")
elif drink > add:
if k + add <= r:
k += add
d = drink - add
if k ... | FUNC_DEF IF VAR NUMBER RETURN VAR RETURN FUNC_CALL VAR VAR BIN_OP VAR VAR ASSIGN VAR VAR VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF VAR VAR IF BIN_OP VAR VAR VAR BIN_OP VAR VAR VAR EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR STRING IF VAR VAR IF BIN_OP VAR VAR VAR VAR VAR ASSIGN VAR BIN_OP VAR VAR IF... |
In recent years John has very successfully settled at his new job at the office. But John doesn't like to idly sit around while his code is compiling, so he immediately found himself an interesting distraction. The point of his distraction was to maintain a water level in the water cooler used by other zebras.
Origina... | k, l, r, t, x, y = map(int, input().strip().split())
def make():
global k, l, r, t, x, y
r -= l
k -= l
if x >= y:
if y + k > r:
k -= t * (x - y) + y
else:
k -= t * (x - y)
return k >= 0
p = [False] * x
i = 1
while i <= t:
if k + y <= ... | ASSIGN VAR VAR VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR FUNC_DEF VAR VAR VAR VAR IF VAR VAR IF BIN_OP VAR VAR VAR VAR BIN_OP BIN_OP VAR BIN_OP VAR VAR VAR VAR BIN_OP VAR BIN_OP VAR VAR RETURN VAR NUMBER ASSIGN VAR BIN_OP LIST NUMBER VAR ASSIGN VAR NUMBER WHILE VAR VAR IF BIN_OP VAR VAR VAR VA... |
In recent years John has very successfully settled at his new job at the office. But John doesn't like to idly sit around while his code is compiling, so he immediately found himself an interesting distraction. The point of his distraction was to maintain a water level in the water cooler used by other zebras.
Origina... | def egcd(a, b):
x0, x1 = 1, 0
y0, y1 = 0, 1
while b:
q, a, b = a // b, b, a % b
x0, x1 = x1, x0 - q * x1
y0, y1 = y1, y0 - q * y1
return a, x0, y0
def mdiv(a, b, m):
g, x, y = egcd(b, m)
if g == 1:
return x * a % m
elif a % g != 0:
raise ValueError("... | FUNC_DEF ASSIGN VAR VAR NUMBER NUMBER ASSIGN VAR VAR NUMBER NUMBER WHILE VAR ASSIGN VAR VAR VAR BIN_OP VAR VAR VAR BIN_OP VAR VAR ASSIGN VAR VAR VAR BIN_OP VAR BIN_OP VAR VAR ASSIGN VAR VAR VAR BIN_OP VAR BIN_OP VAR VAR RETURN VAR VAR VAR FUNC_DEF ASSIGN VAR VAR VAR FUNC_CALL VAR VAR VAR IF VAR NUMBER RETURN BIN_OP BIN... |
In recent years John has very successfully settled at his new job at the office. But John doesn't like to idly sit around while his code is compiling, so he immediately found himself an interesting distraction. The point of his distraction was to maintain a water level in the water cooler used by other zebras.
Origina... | import sys
def main():
def modst(a, s):
ret = 1
while s:
if s % 2:
ret = ret * a % mod
a = a * a % mod
s //= 2
return ret
def Cnk(n, k):
return (k <= n and n >= 0) * (
f[n] * modst(f[k] * f[n - k] % mod, mod - 2)... | IMPORT FUNC_DEF FUNC_DEF ASSIGN VAR NUMBER WHILE VAR IF BIN_OP VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR VAR NUMBER RETURN VAR FUNC_DEF RETURN BIN_OP VAR VAR VAR NUMBER BIN_OP BIN_OP VAR VAR FUNC_CALL VAR BIN_OP BIN_OP VAR VAR VAR BIN_OP VAR VAR VAR BIN_OP VAR NUMBER VAR ASSIG... |
In recent years John has very successfully settled at his new job at the office. But John doesn't like to idly sit around while his code is compiling, so he immediately found himself an interesting distraction. The point of his distraction was to maintain a water level in the water cooler used by other zebras.
Origina... | def solve(k, l, r, t, x, y):
k -= l
r -= l
if r >= x + y - 1:
if y < x:
if k + y > r:
k -= x
return t - 1 <= int(k // (x - y))
return t <= int(k // (x - y))
return True
if y < x:
if k + y > r:
if k - x < 0:
... | FUNC_DEF VAR VAR VAR VAR IF VAR BIN_OP BIN_OP VAR VAR NUMBER IF VAR VAR IF BIN_OP VAR VAR VAR VAR VAR RETURN BIN_OP VAR NUMBER FUNC_CALL VAR BIN_OP VAR BIN_OP VAR VAR RETURN VAR FUNC_CALL VAR BIN_OP VAR BIN_OP VAR VAR RETURN NUMBER IF VAR VAR IF BIN_OP VAR VAR VAR IF BIN_OP VAR VAR NUMBER RETURN NUMBER VAR VAR RETURN B... |
In recent years John has very successfully settled at his new job at the office. But John doesn't like to idly sit around while his code is compiling, so he immediately found himself an interesting distraction. The point of his distraction was to maintain a water level in the water cooler used by other zebras.
Origina... | import sys
input = sys.stdin.readline
k, l, r, t, x, y = map(int, input().split())
NOW = k
count = 0
if x > y and k - t * (x - y) < l:
print("No")
sys.exit()
while t > 0 and count <= 2 * 10**6:
if NOW + y > r:
xx = (NOW + y - r) // x
days = min(t, xx)
NOW -= x * days
t -= da... | IMPORT ASSIGN VAR VAR ASSIGN VAR VAR VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR ASSIGN VAR NUMBER IF VAR VAR BIN_OP VAR BIN_OP VAR BIN_OP VAR VAR VAR EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR WHILE VAR NUMBER VAR BIN_OP NUMBER BIN_OP NUMBER NUMBER IF BIN_OP VAR VAR VAR ASSIGN VAR BIN_OP... |
In recent years John has very successfully settled at his new job at the office. But John doesn't like to idly sit around while his code is compiling, so he immediately found himself an interesting distraction. The point of his distraction was to maintain a water level in the water cooler used by other zebras.
Origina... | s = input().split(" ")
k = int(s[0])
l = int(s[1])
r = int(s[2])
t = int(s[3])
x = int(s[4])
y = int(s[5])
def exgcd(a, b):
if b == 0:
return a, 1, 0
d, x, y = exgcd(b, a % b)
return d, y, x - a // b * y
if x >= y:
if k + y > r:
print("No" if k + y * (t - 1) - x * t < l else "Yes")
... | ASSIGN VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR NUMBER FUNC_DEF IF VAR NUMBER RETURN VAR NUMBER NUMBER ASSIGN VAR VAR... |
In recent years John has very successfully settled at his new job at the office. But John doesn't like to idly sit around while his code is compiling, so he immediately found himself an interesting distraction. The point of his distraction was to maintain a water level in the water cooler used by other zebras.
Origina... | k, l, r, t, x, y = map(int, input().split())
if x == y:
if k + x <= r or k - x >= l:
print("Yes")
else:
print("No")
exit(0)
if x > y:
tot = t * (x - y)
if k - tot < l:
print("No")
elif k + y <= r:
print("Yes")
elif k - tot - y < l:
print("No")
else... | ASSIGN VAR VAR VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF VAR VAR IF BIN_OP VAR VAR VAR BIN_OP VAR VAR VAR EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR NUMBER IF VAR VAR ASSIGN VAR BIN_OP VAR BIN_OP VAR VAR IF BIN_OP VAR VAR VAR EXPR FUNC_CALL VAR STRING IF BIN_OP VAR VAR VAR... |
In recent years John has very successfully settled at his new job at the office. But John doesn't like to idly sit around while his code is compiling, so he immediately found himself an interesting distraction. The point of his distraction was to maintain a water level in the water cooler used by other zebras.
Origina... | a = list(map(int, input().split()))
if a[5] + a[0] <= a[2]:
a[0] += a[5]
if a[0] - a[4] < a[1]:
print("No")
elif a[5] <= a[4]:
b = a[5] * (a[3] - 1) - a[4] * a[3] + a[0]
if b < a[1]:
print("No")
else:
print("Yes")
else:
a[0] -= a[1]
a[2] -= a[1]
a[1] = 0
b = a[0] // a... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF BIN_OP VAR NUMBER VAR NUMBER VAR NUMBER VAR NUMBER VAR NUMBER IF BIN_OP VAR NUMBER VAR NUMBER VAR NUMBER EXPR FUNC_CALL VAR STRING IF VAR NUMBER VAR NUMBER ASSIGN VAR BIN_OP BIN_OP BIN_OP VAR NUMBER BIN_OP VAR NUMBER NUMBER BIN_OP VAR NUMBER VAR NUMB... |
In recent years John has very successfully settled at his new job at the office. But John doesn't like to idly sit around while his code is compiling, so he immediately found himself an interesting distraction. The point of his distraction was to maintain a water level in the water cooler used by other zebras.
Origina... | k, l, r, t, x, y = map(int, input().split())
visited = set()
if k + y <= r:
k += y
while True:
left_cnt = (k - l) // x
if t <= left_cnt:
print("Yes")
break
else:
if left_cnt == 0:
print("No")
break
k = k - left_cnt * x
right_cnt = (r - k) /... | ASSIGN VAR VAR VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR IF BIN_OP VAR VAR VAR VAR VAR WHILE NUMBER ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR IF VAR VAR EXPR FUNC_CALL VAR STRING IF VAR NUMBER EXPR FUNC_CALL VAR STRING ASSIGN VAR BIN_OP VAR BIN_OP VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR... |
In recent years John has very successfully settled at his new job at the office. But John doesn't like to idly sit around while his code is compiling, so he immediately found himself an interesting distraction. The point of his distraction was to maintain a water level in the water cooler used by other zebras.
Origina... | import sys
sys.setrecursionlimit(10**5)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II():
return int(sys.stdin.buffer.readline())
def MI():
return map(int, sys.stdin.buffer.readline().split())
def LI():
return list(map(int, sys.stdin.buffer.readline().split()))
def LLI(rows_... | IMPORT EXPR FUNC_CALL VAR BIN_OP NUMBER NUMBER ASSIGN VAR BIN_OP FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR STRING FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF RETURN FUNC... |
In recent years John has very successfully settled at his new job at the office. But John doesn't like to idly sit around while his code is compiling, so he immediately found himself an interesting distraction. The point of his distraction was to maintain a water level in the water cooler used by other zebras.
Origina... | import sys
k, l, r, t, x, y = tuple(map(int, input().split()))
if x == y:
if k + y <= r or k - x >= l:
print("Yes")
else:
print("No")
elif y < x:
if k + y <= r:
k += y
if k - t * x + (t - 1) * y >= l:
print("Yes")
else:
print("No")
else:
k -= l
r -= l... | IMPORT ASSIGN VAR VAR VAR VAR VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF VAR VAR IF BIN_OP VAR VAR VAR BIN_OP VAR VAR VAR EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR STRING IF VAR VAR IF BIN_OP VAR VAR VAR VAR VAR IF BIN_OP BIN_OP VAR BIN_OP VAR VAR BIN_OP BIN_OP VAR NUMBER VAR VAR EXPR FUNC_CA... |
In recent years John has very successfully settled at his new job at the office. But John doesn't like to idly sit around while his code is compiling, so he immediately found himself an interesting distraction. The point of his distraction was to maintain a water level in the water cooler used by other zebras.
Origina... | k, l, r, t, x, y = map(int, input().split())
days = 0
if y <= x:
if k + y <= r:
days = (k - l) // (x - y) if y < x else 10**19
elif k - x >= l:
days = 1 + (k - x - l) // (x - y) if y < x else 10**19
else:
cycle = set([k])
while 1:
p = (k - l) // x
if p > 0:
da... | ASSIGN VAR VAR VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER IF VAR VAR IF BIN_OP VAR VAR VAR ASSIGN VAR VAR VAR BIN_OP BIN_OP VAR VAR BIN_OP VAR VAR BIN_OP NUMBER NUMBER IF BIN_OP VAR VAR VAR ASSIGN VAR VAR VAR BIN_OP NUMBER BIN_OP BIN_OP BIN_OP VAR VAR VAR BIN_OP VAR VAR BIN_OP NUMBER NU... |
In recent years John has very successfully settled at his new job at the office. But John doesn't like to idly sit around while his code is compiling, so he immediately found himself an interesting distraction. The point of his distraction was to maintain a water level in the water cooler used by other zebras.
Origina... | from sys import stdin
def water_level(k, l, r, t, x, y):
if k < l:
return "No"
seen = [False] * x
while t > 0:
d = (k - l) // x
t -= d
if t <= 0:
return "Yes"
m = (k - l) % x
if seen[m]:
return "Yes"
seen[m] = True
if ... | FUNC_DEF IF VAR VAR RETURN STRING ASSIGN VAR BIN_OP LIST NUMBER VAR WHILE VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR VAR VAR IF VAR NUMBER RETURN STRING ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR IF VAR VAR RETURN STRING ASSIGN VAR VAR NUMBER IF BIN_OP BIN_OP VAR VAR VAR VAR RETURN STRING ASSIGN VAR BIN_OP BIN_OP BIN_OP... |
In recent years John has very successfully settled at his new job at the office. But John doesn't like to idly sit around while his code is compiling, so he immediately found himself an interesting distraction. The point of his distraction was to maintain a water level in the water cooler used by other zebras.
Origina... | def solve():
k, l, r, t, x, y = map(int, input().split())
k -= l
r -= l
if y < x:
if k + y > r:
k -= x
t -= 1
k -= (x - y) * t
return k >= 0
if y + x - 1 <= r:
return True
if y > r:
k -= x * t
return k >= 0
t -= k // x
... | FUNC_DEF ASSIGN VAR VAR VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR VAR VAR VAR VAR IF VAR VAR IF BIN_OP VAR VAR VAR VAR VAR VAR NUMBER VAR BIN_OP BIN_OP VAR VAR VAR RETURN VAR NUMBER IF BIN_OP BIN_OP VAR VAR NUMBER VAR RETURN NUMBER IF VAR VAR VAR BIN_OP VAR VAR RETURN VAR NUMBER VAR BIN_OP VAR VAR VAR V... |
In recent years John has very successfully settled at his new job at the office. But John doesn't like to idly sit around while his code is compiling, so he immediately found himself an interesting distraction. The point of his distraction was to maintain a water level in the water cooler used by other zebras.
Origina... | def solve():
k, l, r, t, x, y = map(int, input().split())
k -= l
r -= l
if x > r:
print("No")
return
if k + y <= r:
k += y
if k < x:
print("No")
return
if x == y:
print("Yes")
return
if x > y:
if k - x - (x - y) * (t - 1) >=... | FUNC_DEF ASSIGN VAR VAR VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR VAR VAR VAR VAR IF VAR VAR EXPR FUNC_CALL VAR STRING RETURN IF BIN_OP VAR VAR VAR VAR VAR IF VAR VAR EXPR FUNC_CALL VAR STRING RETURN IF VAR VAR EXPR FUNC_CALL VAR STRING RETURN IF VAR VAR IF BIN_OP BIN_OP VAR VAR BIN_OP BIN_OP VAR VAR BI... |
In recent years John has very successfully settled at his new job at the office. But John doesn't like to idly sit around while his code is compiling, so he immediately found himself an interesting distraction. The point of his distraction was to maintain a water level in the water cooler used by other zebras.
Origina... | k, l, r, t, x, y = map(int, input().split())
k -= l
r -= l
l = 0
if k < x - y or k > r - y and k < x:
print("No")
exit()
if x > y:
if k + y > r:
k -= x
t -= 1
print("Yes" if t <= k // (x - y) else "No")
else:
if l + x + y - r <= 1:
print("Yes")
exit()
arr = [-1] *... | ASSIGN VAR VAR VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR VAR VAR VAR VAR ASSIGN VAR NUMBER IF VAR BIN_OP VAR VAR VAR BIN_OP VAR VAR VAR VAR EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR IF VAR VAR IF BIN_OP VAR VAR VAR VAR VAR VAR NUMBER EXPR FUNC_CALL VAR VAR BIN_OP VAR BIN_OP VAR VAR STRING STRING IF B... |
In recent years John has very successfully settled at his new job at the office. But John doesn't like to idly sit around while his code is compiling, so he immediately found himself an interesting distraction. The point of his distraction was to maintain a water level in the water cooler used by other zebras.
Origina... | mystr = input()
counter = 0
result = mystr.split(" ")
k = int(result[0])
l = int(result[1])
r = int(result[2])
t = int(result[3])
x = int(result[4])
y = int(result[5])
max_step_up = (l - r - 1) // y
max_step_down = (l - r - 1) // x
water_level = k
difference = y - x
days_last = (k - l) // x
max_level_can_add = r - y
if... | ASSIGN VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR BIN_OP BIN_OP BIN_... |
In recent years John has very successfully settled at his new job at the office. But John doesn't like to idly sit around while his code is compiling, so he immediately found himself an interesting distraction. The point of his distraction was to maintain a water level in the water cooler used by other zebras.
Origina... | v = list(map(int, input().split()))
v[0] -= v[1]
v[2] -= v[1]
v[1] -= v[1]
d = {}
if v[4] >= v[5]:
if v[0] + v[5] <= v[2]:
v[0] += (v[5] - v[4]) * v[3]
else:
v[0] -= v[4]
v[0] += (v[5] - v[4]) * (v[3] - 1)
if v[0] >= v[1] and v[0] <= v[2]:
print("Yes")
else:
print... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR VAR NUMBER VAR NUMBER VAR NUMBER VAR NUMBER VAR NUMBER VAR NUMBER ASSIGN VAR DICT IF VAR NUMBER VAR NUMBER IF BIN_OP VAR NUMBER VAR NUMBER VAR NUMBER VAR NUMBER BIN_OP BIN_OP VAR NUMBER VAR NUMBER VAR NUMBER VAR NUMBER VAR NUMBER VAR NUMBER BIN_OP BIN_O... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | for _ in range(int(input())):
s = input()
x = int(input())
ans = ["1"] * len(s)
c = []
for i in range(len(s)):
if s[i] == "0":
if i >= x:
ans[i - x] = "0"
if i < len(s) - x:
ans[i + x] = "0"
for i in range(len(ans)):
if i >=... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR BIN_OP LIST STRING FUNC_CALL VAR VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF VAR VAR STRING IF VAR VAR ASSIGN VAR BIN_OP VAR VAR STRING IF VAR BIN_OP FUNC_CALL VAR VAR VAR ASSI... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | import sys
input = sys.stdin.buffer.readline
inin = lambda: int(input())
inar = lambda: list(map(int, input().split()))
inst = lambda: input().decode().rstrip("\n\r")
_T_ = inin()
for _t_ in range(_T_):
s = inst()
x = inin()
n = len(s)
ns = ["1" for i in range(len(s))]
w = ["1" for i in range(len(s... | IMPORT ASSIGN VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | t = int(input())
for _ in range(t):
st = [int(x) for x in input()]
x = int(input())
arr = [(1) for _ in st]
n = len(st)
for i in range(len(st)):
if st[i] == 0:
if i - x >= 0:
arr[i - x] = 0
if i + x < len(st):
arr[i + x] = 0
st1 = [... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER VAR VAR ASSIGN VAR FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF VAR VAR NUMBER IF BIN_OP VAR VAR NUMBER ASSIGN VAR BIN_OP VAR VAR NUMBE... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
s = input()[:-1]
x = int(input())
n = len(s)
ans = [1] * n
for i, char in enumerate(s):
if char == "0":
if i - x >= 0:
ans[i - x] = 0
if i + x < n:
ans[i + x] = ... | IMPORT ASSIGN VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP LIST NUMBER VAR FOR VAR VAR FUNC_CALL VAR VAR IF VAR STRING IF BIN_OP VAR VAR NUMBER ASSIGN VAR BIN_OP VAR VAR NUMB... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | t = int(input())
def sxw(x, w):
s = ["1" for i in range(len(w))]
for i in range(len(s)):
if i - x >= 0 and w[i - x] == "1" or i + x < len(w) and w[i + x] == "1":
s[i] = "1"
else:
s[i] = "0"
return s
while t != 0:
t -= 1
s = list(input())
x = int(input(... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_DEF ASSIGN VAR STRING VAR FUNC_CALL VAR FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF BIN_OP VAR VAR NUMBER VAR BIN_OP VAR VAR STRING BIN_OP VAR VAR FUNC_CALL VAR VAR VAR BIN_OP VAR VAR STRING ASSIGN VAR VAR STRING ASSIGN VAR VAR STRING RETURN VAR WHILE VAR NUM... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | t = int(input())
while True:
if t == 0:
break
t -= 1
a = input()
n = len(a)
x = int(input())
w = ["1" for i in range(n + 1)]
s = ["1"]
for i in a:
s.append(i)
for i in range(1, n + 1):
if i > x and s[i] == "1":
if w[i - x] != "0":
w... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR WHILE NUMBER IF VAR NUMBER VAR NUMBER ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR STRING VAR FUNC_CALL VAR BIN_OP VAR NUMBER ASSIGN VAR LIST STRING FOR VAR VAR EXPR FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR NUMBER BIN_OP VA... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | t = int(input())
for tt in range(t):
s = input()
n = len(s)
x = int(input())
ans = [1] * n
f = int(1)
for i in range(n):
if ord(s[i]) == ord("0"):
if i + x <= n - 1:
ans[i + x] = 0
if i - x >= 0:
ans[i - x] = 0
for i in range(n)... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR BIN_OP LIST NUMBER VAR ASSIGN VAR FUNC_CALL VAR NUMBER FOR VAR FUNC_CALL VAR VAR IF FUNC_CALL VAR VAR VAR FUNC_CALL VAR STRING IF BIN_OP VAR VAR BIN_OP... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | t = int(input())
for _ in range(t):
s = input()
x = int(input())
n = len(s)
ans = ["1"] * n
for i in range(n):
if s[i] == "0":
if x + i < n:
ans[i + x] = "0"
if i >= x:
ans[i - x] = "0"
tmp = 0
for i in range(n):
if s[i]... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP LIST STRING VAR FOR VAR FUNC_CALL VAR VAR IF VAR VAR STRING IF BIN_OP VAR VAR VAR ASSIGN VAR BIN_OP VAR VAR STRING IF VAR VAR ASSIGN VAR BIN_OP ... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | t = int(input())
for _ in range(t):
ok = True
txt = input().strip()
n = int(input())
ans = ["1" for c in txt]
for i in range(len(txt)):
if txt[i] == "0":
if i - n >= 0:
ans[i - n] = "0"
if i + n < len(txt):
ans[i + n] = "0"
for i in... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR STRING VAR VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF VAR VAR STRING IF BIN_OP VAR VAR NUMBER ASSIGN VAR BIN_OP VAR VAR STRING IF BIN_OP VAR VAR FUN... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | t = int(input())
for h in range(t):
s = input()
x = int(input())
w = ["1"] * len(s)
for i in range(len(s)):
if s[i] == "0":
if i - x > -1:
w[i - x] = "0"
if i + x < len(s):
w[i + x] = "0"
for i in range(len(s)):
if s[i] == "1":
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR BIN_OP LIST STRING FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF VAR VAR STRING IF BIN_OP VAR VAR NUMBER ASSIGN VAR BIN_OP VAR VAR STRING IF BIN_OP VAR VAR FUNC_CALL... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | t = int(input())
for i in range(0, t):
str1 = input()
m = int(input())
l1 = []
y = len(str1)
for i in range(0, y):
l1.append(1)
for i in range(0, y):
if str1[i] == "0":
if i - m >= 0:
l1[i - m] = 0
if i + m < y:
l1[i + m] = ... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR NUMBER VAR EXPR FUNC_CALL VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER VAR IF VAR VAR STRING IF BIN_OP VAR VAR NUMBER ASSI... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | t = int(input())
for case in range(t):
s = input()
s = "2" + s
length = len(s)
x = int(input())
w = [1] * length
valid = True
for i in range(1, length):
if s[i] == "0":
if i > x:
w[i - x] = 0
if i < length - x:
w[i + x] = 0
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR BIN_OP STRING VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR BIN_OP LIST NUMBER VAR ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER VAR IF VAR VAR STRING IF VAR VAR ASSIGN VAR BIN_OP V... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | def main():
for _ in range(Iint()):
s = list(map(int, input()))
x = Iint()
n = len(s)
w = [(1) for i in s]
for i in range(n):
if s[i] == 0:
if i >= x:
w[i - x] = 0
if i + x < len(s):
w[i + x] ... | FUNC_DEF FOR VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER VAR VAR FOR VAR FUNC_CALL VAR VAR IF VAR VAR NUMBER IF VAR VAR ASSIGN VAR BIN_OP VAR VAR NUMBER IF BIN_OP VAR VAR FUNC_CALL VAR VAR ASSIGN VAR BIN... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | t = int(input(""))
for k in range(t):
s = input("")
x = int(input(""))
w = []
f = 0
ws = ""
for l in range(len(s)):
w.append("1")
for i in range(len(s)):
if i >= x and s[i] == "0":
w[i - x] = "0"
if i + x < len(s) and s[i] == "0":
w[i + x] = "0... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR STRING FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR STRING ASSIGN VAR LIST ASSIGN VAR NUMBER ASSIGN VAR STRING FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR STRING FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF VAR VAR V... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | import sys
test = int(input())
for i in range(test):
s = input()
x = int(input())
n = len(s)
w = [0] * n
for j in range(n):
if j - x < 0:
if j + x < n:
w[j] = int(s[j + x])
elif j + x >= n:
if j - x >= 0:
w[j] = int(s[j - x])
... | IMPORT ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP LIST NUMBER VAR FOR VAR FUNC_CALL VAR VAR IF BIN_OP VAR VAR NUMBER IF BIN_OP VAR VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR BIN_OP VAR VAR ... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | from sys import stdin, stdout
for _ in range(int(stdin.readline())):
s = input()
x = int(stdin.readline())
n = len(s)
ans = [" "] * n
f = 1
for i in range(n):
if s[i] == "0":
if i - x >= 0:
ans[i - x] = "0"
if i + x < n:
ans[i + x]... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP LIST STRING VAR ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR IF VAR VAR STRING IF BIN_OP VAR VAR NUMBER ASSIGN VAR BIN_OP VAR VAR STRING IF BIN_OP VAR VAR VAR A... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | def findEncoded(s, x):
enc = list(["0"] * len(s))
for i in range(len(s)):
if s[i] == "1":
if i - x >= 0:
enc[i - x] = "1"
if i + x < len(s):
enc[i + x] = "1"
return enc
def findOriginal(s, x):
orig = list(["1"] * len(s))
for i in rang... | FUNC_DEF ASSIGN VAR FUNC_CALL VAR BIN_OP LIST STRING FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF VAR VAR STRING IF BIN_OP VAR VAR NUMBER ASSIGN VAR BIN_OP VAR VAR STRING IF BIN_OP VAR VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP VAR VAR STRING RETURN VAR FUNC_DEF ASSIGN VAR FUNC_CALL VAR BIN_OP LIST STRING ... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | for t in range(int(input())):
s = input()
x = int(input())
n = len(s)
st = []
w = ["1"] * n
for i in s:
st.append(i)
for i in range(n):
if st[i] == "0":
if i - x >= 0:
w[i - x] = "0"
if i + x < n:
w[i + x] = "0"
flag... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR LIST ASSIGN VAR BIN_OP LIST STRING VAR FOR VAR VAR EXPR FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR VAR IF VAR VAR STRING IF BIN_OP VAR VAR NUMBER ASSIGN VAR BIN_OP VAR V... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | for _ in range(int(input())):
s = list(map(int, input()))
st = ""
g = ""
a = int(input())
p = [1] * len(s)
q = [0] * len(s)
for i in range(len(s)):
if s[i] == 0:
if i - a >= 0:
p[i - a] = 0
if i + a < len(s):
p[i + a] = 0
fo... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL VAR ASSIGN VAR STRING ASSIGN VAR STRING ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR BIN_OP LIST NUMBER FUNC_CALL VAR VAR ASSIGN VAR BIN_OP LIST NUMBER FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | T = int(input())
for _ in range(0, T):
s = input()
x = int(input())
L = ["1"] * len(s)
n = len(s)
for i in range(0, len(s)):
if s[i] == "0":
if i + x < n:
L[i + x] = "0"
if i - x >= 0:
L[i - x] = "0"
temp = "".join(L)
temp = str... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR BIN_OP LIST STRING FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR NUMBER FUNC_CALL VAR VAR IF VAR VAR STRING IF BIN_OP VAR VAR VAR ASSIGN VAR BIN_OP VA... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | for _ in range(int(input())):
s = input()
x = int(input())
n = len(s)
final = [(1) for _ in range(n)]
for i in range(n):
if s[i] == "0":
if i + x < n:
final[i + x] = 0
if i - x > -1:
final[i - x] = 0
done = 0
for i in range(n):
... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER VAR FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR VAR IF VAR VAR STRING IF BIN_OP VAR VAR VAR ASSIGN VAR BIN_OP VAR VAR NUMBER IF BIN_OP VAR VAR NUMBER ASSIGN VAR BI... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | t = int(input())
for i in range(t):
s = input()
x = int(input())
n = len(s)
dp = [None for i in range(len(s))]
for i in range(n):
ans = 1
if i - x >= 0:
ans &= int(s[i - x])
if i + x < n:
ans &= int(s[i + x])
dp[i] = ans
flag = 0
for i ... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR NONE VAR FUNC_CALL VAR FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER IF BIN_OP VAR VAR NUMBER VAR FUNC_CALL VAR VAR BIN_OP VAR VAR IF B... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | def controller(s, x):
n = len(s)
w = [True] * n
a = -x
b = x
for si in s:
if si == "0":
if a >= 0:
w[a] = False
if b < n:
w[b] = False
a += 1
b += 1
a = -x
b = x
for si in s:
if si == "1":
... | FUNC_DEF ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP LIST NUMBER VAR ASSIGN VAR VAR ASSIGN VAR VAR FOR VAR VAR IF VAR STRING IF VAR NUMBER ASSIGN VAR VAR NUMBER IF VAR VAR ASSIGN VAR VAR NUMBER VAR NUMBER VAR NUMBER ASSIGN VAR VAR ASSIGN VAR VAR FOR VAR VAR IF VAR STRING IF VAR NUMBER IF VAR VAR IF VAR VAR RETURN ST... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | t = int(input())
while t:
t -= 1
f = 0
s = input()
x = int(input())
w = ["1"] * len(s)
n = len(s)
for i in range(n):
if s[i] == "0":
if i - x >= 0:
w[i - x] = "0"
if i + x < n:
w[i + x] = "0"
for i in range(n):
if s[... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR WHILE VAR VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR BIN_OP LIST STRING FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR VAR IF VAR VAR STRING IF BIN_OP VAR VAR NUMBER ASSIGN VAR BIN_OP VAR VAR STRING... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | t = int(input())
for _ in range(t):
s = input()
x = int(input())
n = len(s)
ans = ""
flag = 1
for i in range(n):
if i < x and i < n - x:
if s[i + x] == "1":
ans += "1"
else:
ans += "0"
elif i >= n - x and i >= x:
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR STRING ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR IF VAR VAR VAR BIN_OP VAR VAR IF VAR BIN_OP VAR VAR STRING VAR STRING VAR STRING IF VAR BIN_OP VAR V... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | import sys
T = int(sys.stdin.readline().strip())
for t in range(0, T):
s = sys.stdin.readline().strip()
x = int(sys.stdin.readline().strip())
n = len(s)
A = [(1) for i in range(0, n)]
for i in range(0, n):
if i - x >= 0:
if s[i - x] == "0":
A[i] = 0
if i ... | IMPORT ASSIGN VAR FUNC_CALL VAR FUNC_CALL FUNC_CALL VAR FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER VAR FUNC_CALL VAR NUMBER VAR FOR VAR FUNC_CALL VAR NUMBER VAR IF BIN_OP VAR VAR NUMBER IF VAR BIN_OP... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | UNDEF = "?"
def forward(w, x):
s = ["?"] * len(w)
for i in range(len(w)):
if i - x >= 0 and w[i - x] == "1":
s[i] = "1"
elif i + x < len(w) and w[i + x] == "1":
s[i] = "1"
else:
s[i] = "0"
return "".join(s)
def solve(s, x):
n = len(s)
w... | ASSIGN VAR STRING FUNC_DEF ASSIGN VAR BIN_OP LIST STRING FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF BIN_OP VAR VAR NUMBER VAR BIN_OP VAR VAR STRING ASSIGN VAR VAR STRING IF BIN_OP VAR VAR FUNC_CALL VAR VAR VAR BIN_OP VAR VAR STRING ASSIGN VAR VAR STRING ASSIGN VAR VAR STRING RETURN FUNC_CALL STRING VA... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | def findBin(s, x):
n = len(s)
w = [-1] * n
for i in range(n):
if i >= x:
a = int(s[i - x])
else:
a = 1
if i + x < n:
b = int(s[i + x])
else:
b = 1
w[i] = str(a & b)
for i in range(n):
a, b = 0, 0
if i... | FUNC_DEF ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP LIST NUMBER VAR FOR VAR FUNC_CALL VAR VAR IF VAR VAR ASSIGN VAR FUNC_CALL VAR VAR BIN_OP VAR VAR ASSIGN VAR NUMBER IF BIN_OP VAR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR BIN_OP VAR VAR ASSIGN VAR NUMBER ASSIGN VAR VAR FUNC_CALL VAR BIN_OP VAR VAR FOR VAR FUNC_CALL VAR... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | for _ in range(int(input())):
s = input()
x = int(input())
n = len(s)
ans = ["1"] * n
for i in range(n):
if s[i] == "0":
if i - x > -1:
ans[i - x] = "0"
if i + x < n:
ans[i + x] = "0"
imp = 0
for i in range(n):
if s[i] =... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP LIST STRING VAR FOR VAR FUNC_CALL VAR VAR IF VAR VAR STRING IF BIN_OP VAR VAR NUMBER ASSIGN VAR BIN_OP VAR VAR STRING IF BIN_OP VAR VAR VAR ASSIGN VAR BIN_OP V... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | def valid(a1):
if a1 >= 0 and a1 < len(a):
return True
return False
for i in range(int(input())):
a = input()
b = int(input())
ans = [(-1) for j in a]
for j in range(len(a)):
if a[j] == "0":
if valid(j - b):
ans[j - b] = 0
if valid(j + b)... | FUNC_DEF IF VAR NUMBER VAR FUNC_CALL VAR VAR RETURN NUMBER RETURN NUMBER FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER VAR VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF VAR VAR STRING IF FUNC_CALL VAR BIN_OP VAR VAR ASSIGN VAR BIN_OP... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | def split(ini):
return [c for c in ini]
i = int(input())
for _ in range(i):
inlist = [int(j) for j in split(input())]
outlist = [(2) for _ in range(len(inlist))]
x = int(input())
totbreak = True
for k in range(len(inlist)):
bino = inlist[k]
if bino == 0:
if k - x >=... | FUNC_DEF RETURN VAR VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER VAR FUNC_CALL VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR ASSIGN VAR VAR ... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | import sys
def input():
return sys.stdin.readline().strip()
def list2d(a, b, c):
return [([c] * b) for i in range(a)]
def list3d(a, b, c, d):
return [[([d] * c) for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e):
return [[[([e] * d) for j in range(c)] for j in range(b)] for i in ran... | IMPORT FUNC_DEF RETURN FUNC_CALL FUNC_CALL VAR FUNC_DEF RETURN BIN_OP LIST VAR VAR VAR FUNC_CALL VAR VAR FUNC_DEF RETURN BIN_OP LIST VAR VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL VAR VAR FUNC_DEF RETURN BIN_OP LIST VAR VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL VAR VAR FUNC_DEF NUMBER RETURN FUNC_CALL ... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | for test in range(int(input())):
s = input()
x = int(input())
n = len(s)
w = [1] * n
for i in range(n):
if s[i] == "0":
j = i - x
if j >= 0:
w[j] = 0
j = i + x
if j < n:
w[j] = 0
check = True
for i in ran... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP LIST NUMBER VAR FOR VAR FUNC_CALL VAR VAR IF VAR VAR STRING ASSIGN VAR BIN_OP VAR VAR IF VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR BIN_OP VAR VAR IF VAR VAR ... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | def forward(w, x):
s = [(0) for i in w]
for i in range(len(w)):
if i - x >= 0 and w[i - x] == 1:
s[i] = 1
if i + x < len(w) and w[i + x] == 1:
s[i] = 1
return s
def backward(s, x):
w = [(1) for i in s]
for i in range(len(s)):
if s[i] == 0:
... | FUNC_DEF ASSIGN VAR NUMBER VAR VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF BIN_OP VAR VAR NUMBER VAR BIN_OP VAR VAR NUMBER ASSIGN VAR VAR NUMBER IF BIN_OP VAR VAR FUNC_CALL VAR VAR VAR BIN_OP VAR VAR NUMBER ASSIGN VAR VAR NUMBER RETURN VAR FUNC_DEF ASSIGN VAR NUMBER VAR VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | from sys import stdin
def iinput():
return int(stdin.readline())
def minput():
return map(int, stdin.readline().split())
def linput():
return list(map(int, stdin.readline().split()))
def f(s, x):
w = [None for _ in range(len(s))]
for i in range(len(s)):
if s[i] == "1":
if... | FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF ASSIGN VAR NONE VAR FUNC_CALL VAR FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF VAR VAR STRING IF BIN_OP VAR VAR NUMBER BI... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | def reconstruct(s, x):
w = "1" * len(s)
m = list(w)
l = []
for i in range(len(s)):
if s[i] == "0":
if i + 1 + x <= len(s):
m[i + x] = "0"
if i + 1 > x:
m[i - x] = "0"
for i in range(len(s)):
flag = 0
if s[i] == "1":
... | FUNC_DEF ASSIGN VAR BIN_OP STRING FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF VAR VAR STRING IF BIN_OP BIN_OP VAR NUMBER VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP VAR VAR STRING IF BIN_OP VAR NUMBER VAR ASSIGN VAR BIN_OP VAR VAR STRING FOR VAR FUNC_CALL VAR FU... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | def solve():
s = input()
x = int(input())
news = ["1"] * len(s)
for i in range(len(s)):
if s[i] == "0":
if i + x < len(s):
news[i + x] = "0"
if i - x >= 0:
news[i - x] = "0"
for i in range(len(s)):
if s[i] == "1":
fo... | FUNC_DEF ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR BIN_OP LIST STRING FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF VAR VAR STRING IF BIN_OP VAR VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP VAR VAR STRING IF BIN_OP VAR VAR NUMBER ASSIGN VAR BIN_OP VAR VAR STRING FOR VAR FUNC_C... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | for _ in range(int(input())):
s = list(input())
n = len(s)
x = int(input())
b = ["1"] * n
flag = True
cool = 0
for i in range(n):
if s[i] == "0":
if i + x <= n - 1:
b[i + x] = "0"
if i - x >= 0:
b[i - x] = "0"
for i in range... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR BIN_OP LIST STRING VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR IF VAR VAR STRING IF BIN_OP VAR VAR BIN_OP VAR NUMBER ASSIGN VAR BI... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | def f(a, b):
if a == b and a == 0:
return 0
if a == b:
return 1
if a + b == 0:
return 1
return 0
def g(a, b):
if a == 1 or b == 1:
return 1
return 0
for _ in range(int(input())):
s = input()
x = int(input())
n = len(s)
op = [-1] * (n + 2 * x)
... | FUNC_DEF IF VAR VAR VAR NUMBER RETURN NUMBER IF VAR VAR RETURN NUMBER IF BIN_OP VAR VAR NUMBER RETURN NUMBER RETURN NUMBER FUNC_DEF IF VAR NUMBER VAR NUMBER RETURN NUMBER RETURN NUMBER FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL ... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | for _ in range(int(input())):
w = input()
x = int(input())
m = len(w)
f = 0
s = set()
l = ["1"] * m
for i in range(len(w)):
if w[i] == "0":
if i + x < m and i + x > -1:
s.add(i + x)
if i - x > -1 and i - x < m:
s.add(i - x)
... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR ASSIGN VAR BIN_OP LIST STRING VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF VAR VAR STRING IF BIN_OP VAR VAR VAR BIN_OP VAR VAR NUMBE... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | for _ in range(int(input())):
s = input()
x = int(input())
w = ["1"] * len(s)
for i in range(1, len(s) + 1):
if s[i - 1] == "0":
if i + x < len(w) + 1:
w[i + x - 1] = "0"
if i > x and i - x > -1:
w[i - x - 1] = "0"
f = 0
for k in ra... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR BIN_OP LIST STRING FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR NUMBER BIN_OP FUNC_CALL VAR VAR NUMBER IF VAR BIN_OP VAR NUMBER STRING IF BIN_OP VAR VAR BIN_OP FUNC_CALL VAR VAR NUMBER ASSIGN VAR BIN_... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | t = int(input())
while t > 0:
t -= 1
s = input().strip()
x = int(input())
n = len(s)
w = ["1"] * n
for i in range(n):
if s[i] == "0":
if i - x >= 0:
w[i - x] = "0"
if i + x < n:
w[i + x] = "0"
ans = ""
for i in range(n):
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR WHILE VAR NUMBER VAR NUMBER ASSIGN VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP LIST STRING VAR FOR VAR FUNC_CALL VAR VAR IF VAR VAR STRING IF BIN_OP VAR VAR NUMBER ASSIGN VAR BIN_OP VAR VAR STRING IF BIN_OP VAR ... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | for _ in range(int(input())):
s = input()
n = len(s)
x = int(input())
ls = [(0) for i in range(x)]
out = [(0) for i in range(x)]
for i in s:
ls.append(int(i))
out.append(1)
for i in range(x):
ls.append(0)
out.append(0)
for i in range(x, x + n):
if ... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER VAR FUNC_CALL VAR VAR FOR VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR NUMBER FOR VAR FUNC_CALL VAR ... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | t = int(input())
for _ in range(t):
s = list(input())
n = len(s)
x = int(input())
ans = ["1"] * n
b = ["0"] * n
for i in range(n):
if s[i] == "0":
if i - x >= 0:
ans[i - x] = "0"
if i + x < n:
ans[i + x] = "0"
for i in range(n):... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR BIN_OP LIST STRING VAR ASSIGN VAR BIN_OP LIST STRING VAR FOR VAR FUNC_CALL VAR VAR IF VAR VAR STRING IF BIN_OP VAR VAR NUMBER ASSIGN VAR ... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | def tc():
s = input()
x = int(input())
n = len(s)
w = [1] * len(s)
for i, ch in enumerate(s):
if ch == "0":
if i - x >= 0:
w[i - x] = 0
if i + x < n:
w[i + x] = 0
for i, ch in enumerate(s):
if ch == "1":
l, r = F... | FUNC_DEF ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP LIST NUMBER FUNC_CALL VAR VAR FOR VAR VAR FUNC_CALL VAR VAR IF VAR STRING IF BIN_OP VAR VAR NUMBER ASSIGN VAR BIN_OP VAR VAR NUMBER IF BIN_OP VAR VAR VAR ASSIGN VAR BIN_OP VAR VAR NUMBER FOR VAR VAR F... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | def solve():
s = list(map(int, input()))
x = int(input())
n = len(s)
ans = [1] * n
for i, c in enumerate(s):
if c == 0:
if not i - x < 0:
ans[i - x] = 0
if not i + x >= n:
ans[i + x] = 0
t = [
int(not i - x < 0 and ans[i - x... | FUNC_DEF ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP LIST NUMBER VAR FOR VAR VAR FUNC_CALL VAR VAR IF VAR NUMBER IF BIN_OP VAR VAR NUMBER ASSIGN VAR BIN_OP VAR VAR NUMBER IF BIN_OP VAR VAR VAR ASSIGN VAR BIN_OP VAR VAR NU... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | for tt in range(int(input())):
s = input()
n = len(s)
x = int(input())
ans = [" " for i in range(n)]
for i in range(n):
if s[i] == "0":
for j in [i - x, i + x]:
if 0 <= j and j < n:
ans[j] = "0"
good = True
for i in range(n):
if... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR STRING VAR FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR VAR IF VAR VAR STRING FOR VAR LIST BIN_OP VAR VAR BIN_OP VAR VAR IF NUMBER VAR VAR VAR ASSIGN VAR VAR STRING ASSIGN... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | t = int(input())
for _ in range(t):
s = list(input())
x = int(input())
l = len(s)
news = ["-1"] * l
flag = 1
for i in range(l):
if s[i] == "1":
if i - x >= 0 and abs(int(news[i - x])) == 1:
news[i - x] = "1"
continue
elif i + x < l ... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP LIST STRING VAR ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR IF VAR VAR STRING IF BIN_OP VAR VAR NUMBER FUNC_CALL VAR FUNC_CALL VAR... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | def stringi(L):
r = ""
for l in L:
r += str(l)
return r
def construct(w, x):
n = len(w)
S = [0] * n
for i in range(n):
if i >= x:
if w[i - x] == "1":
S[i] = "1"
if i + x < n:
if w[i + x] == "1":
S[i] = "1"
S = ... | FUNC_DEF ASSIGN VAR STRING FOR VAR VAR VAR FUNC_CALL VAR VAR RETURN VAR FUNC_DEF ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP LIST NUMBER VAR FOR VAR FUNC_CALL VAR VAR IF VAR VAR IF VAR BIN_OP VAR VAR STRING ASSIGN VAR VAR STRING IF BIN_OP VAR VAR VAR IF VAR BIN_OP VAR VAR STRING ASSIGN VAR VAR STRING ASSIGN VAR FUNC... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | import sys
def input():
return sys.stdin.readline().strip()
def iinput():
return int(input())
def rinput():
return map(int, sys.stdin.readline().strip().split())
def get_list():
return list(map(int, sys.stdin.readline().strip().split()))
mod = int(1000000000.0) + 7
for _ in range(iinput()):
... | IMPORT FUNC_DEF RETURN FUNC_CALL FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP FUNC_CALL VAR NUMBER NUMBER FOR VAR FUNC_CALL VAR FUNC_CALL V... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | t = int(input())
for _ in range(t):
s = list(input())
x = int(input())
n = len(s)
bad = 0
ans = [(-1) for i in range(n)]
for i in range(n):
if i >= x and i + x < n:
if s[i - x] == s[i + x] == "1":
ans[i] = 1
elif s[i - x] == s[i + x] == "0":
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER VAR FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR VAR IF VAR VAR BIN_OP VAR VAR VAR IF VAR BIN_OP VAR VAR VAR BIN_OP V... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | import sys
sys.setrecursionlimit(10**5)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II():
return int(sys.stdin.readline())
def MI():
return map(int, sys.stdin.readline().split())
def LI():
return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number):
return [... | IMPORT EXPR FUNC_CALL VAR BIN_OP NUMBER NUMBER ASSIGN VAR BIN_OP FUNC_CALL VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR STRING FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF RETURN FUNC... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | def rn():
a = int(input())
return a
def rl():
a = list(map(int, input().split()))
return a
for _ in range(rn()):
s = list(input())
x = rn()
n = len(s)
a = ["2" for _ in range(n)]
dt = []
flag = 0
for i in range(x):
if i + x < n:
a[i + x] = s[i]
... | FUNC_DEF ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR RETURN VAR FUNC_DEF ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR RETURN VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR STRING VAR FUNC_CALL VAR VAR ASSIG... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | t = int(input())
for i in range(t):
s = input()
x = int(input())
w = ["a"] * len(s)
for j in range(len(s)):
if s[j] == "0":
if j >= x:
w[j - x] = "0"
if j + x < len(s):
w[j + x] = "0"
flag = 0
for j in range(len(s)):
flag = ... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR BIN_OP LIST STRING FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF VAR VAR STRING IF VAR VAR ASSIGN VAR BIN_OP VAR VAR STRING IF BIN_OP VAR VAR FUNC_CALL VAR VAR ASSIG... |
Consider the following process. You have a binary string (a string where each character is either 0 or 1) $w$ of length $n$ and an integer $x$. You build a new binary string $s$ consisting of $n$ characters. The $i$-th character of $s$ is chosen as follows:
if the character $w_{i-x}$ exists and is equal to 1, then $... | t = int(input())
for i in range(t):
s = input()
b = []
for j in s:
b.append(int(j))
n = len(b)
y = int(input())
c = [1] * n
j = 0
f = 0
while j < n:
if b[j] == 0:
if j - y >= 0:
c[j - y] = 0
if j + y < n:
c[j + y... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR BIN_OP LIST NUMBER VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER WHILE VAR VAR IF VAR VAR NU... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.