description stringlengths 171 4k | code stringlengths 94 3.98k | normalized_code stringlengths 57 4.99k |
|---|---|---|
Gerald is very particular to eight point sets. He thinks that any decent eight point set must consist of all pairwise intersections of three distinct integer vertical straight lines and three distinct integer horizontal straight lines, except for the average of these nine points. In other words, there must be three int... | a = [0] * 8
b = [0] * 8
c = [0] * 8
d = [0] * 8
flag = 0
for i in range(8):
x, y = map(int, input().split())
a[i] = x
b[i] = y
c[i] = x
d[i] = y
n = 8
a.sort(reverse=False)
b.sort(reverse=False)
x1 = a[0]
x2 = a[3]
x3 = a[7]
y1 = b[0]
y2 = b[3]
y3 = b[7]
flag = 0
if x1 == x2 or x1 == x3 or x2 == x3 ... | ASSIGN VAR BIN_OP LIST NUMBER NUMBER ASSIGN VAR BIN_OP LIST NUMBER NUMBER ASSIGN VAR BIN_OP LIST NUMBER NUMBER ASSIGN VAR BIN_OP LIST NUMBER NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR VAR ASSIGN VAR VAR VAR ASSIGN VAR VAR VAR ASSIGN VAR ... |
Gerald is very particular to eight point sets. He thinks that any decent eight point set must consist of all pairwise intersections of three distinct integer vertical straight lines and three distinct integer horizontal straight lines, except for the average of these nine points. In other words, there must be three int... | x = []
y = []
def unique(a):
res = []
res.append(a[0])
for i in range(1, len(a)):
if a[i] != a[i - 1]:
res.append(a[i])
return res
def process(x, y, a, b, n):
if len(x) != 3 or len(y) != 3:
return "ugly"
check1 = False
check2 = False
for i in range(3):
... | ASSIGN VAR LIST ASSIGN VAR LIST FUNC_DEF ASSIGN VAR LIST EXPR FUNC_CALL VAR VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER FUNC_CALL VAR VAR IF VAR VAR VAR BIN_OP VAR NUMBER EXPR FUNC_CALL VAR VAR VAR RETURN VAR FUNC_DEF IF FUNC_CALL VAR VAR NUMBER FUNC_CALL VAR VAR NUMBER RETURN STRING ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR... |
Gerald is very particular to eight point sets. He thinks that any decent eight point set must consist of all pairwise intersections of three distinct integer vertical straight lines and three distinct integer horizontal straight lines, except for the average of these nine points. In other words, there must be three int... | x = [0] * 8
y = [0] * 8
z = []
for i in range(8):
x[i], y[i] = map(int, input().split())
if (x[i], y[i]) not in z:
z.append((x[i], y[i]))
sx = set(x)
sy = set(y)
if len(sx) != 3 or len(sy) != 3 or len(z) != 8:
print("ugly")
else:
xx = sorted(list(sx))
yy = sorted(list(sy))
if (xx[1], yy[... | ASSIGN VAR BIN_OP LIST NUMBER NUMBER ASSIGN VAR BIN_OP LIST NUMBER NUMBER ASSIGN VAR LIST FOR VAR FUNC_CALL VAR NUMBER ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF VAR VAR VAR VAR VAR EXPR FUNC_CALL VAR VAR VAR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR IF FUNC_CALL VAR VAR... |
Gerald is very particular to eight point sets. He thinks that any decent eight point set must consist of all pairwise intersections of three distinct integer vertical straight lines and three distinct integer horizontal straight lines, except for the average of these nine points. In other words, there must be three int... | sets = []
for i in range(8):
x, y = map(int, input().split())
sets.append((x, y))
a1 = sorted(sets, key=lambda point: point[0])
pointx = []
for i in range(len(a1)):
if len(pointx) == 0:
pointx.append(a1[i][0])
elif pointx[-1] != a1[i][0]:
pointx.append(a1[i][0])
if len(pointx) > 3:
... | ASSIGN VAR LIST FOR VAR FUNC_CALL VAR NUMBER ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR VAR NUMBER ASSIGN VAR LIST FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF FUNC_CALL VAR VAR NUMBER EXPR FUNC_CALL VAR VAR VAR NUMBER IF VAR NUMBER VAR VAR NUMBER EXPR... |
Gerald is very particular to eight point sets. He thinks that any decent eight point set must consist of all pairwise intersections of three distinct integer vertical straight lines and three distinct integer horizontal straight lines, except for the average of these nine points. In other words, there must be three int... | x, y = [], []
xx, yy = {}, {}
for i in range(8):
a, b = map(int, input().split())
x.append(a)
y.append(b)
if a not in xx:
xx[a] = [b]
else:
xx[a].append(b)
if b not in yy:
yy[b] = [a]
else:
yy[b].append(a)
if len(set(x)) != 3 or len(set(y)) != 3:
print("ug... | ASSIGN VAR VAR LIST LIST ASSIGN VAR VAR DICT DICT FOR VAR FUNC_CALL VAR NUMBER ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR VAR IF VAR VAR ASSIGN VAR VAR LIST VAR EXPR FUNC_CALL VAR VAR VAR IF VAR VAR ASSIGN VAR VAR LIST VAR EXPR FUNC_CALL VAR VAR VAR IF FUNC_CALL V... |
Gerald is very particular to eight point sets. He thinks that any decent eight point set must consist of all pairwise intersections of three distinct integer vertical straight lines and three distinct integer horizontal straight lines, except for the average of these nine points. In other words, there must be three int... | class coor:
def __init__(self, x, y):
self.x = x
self.y = y
def __lt__(self, other):
if self.x < other.x:
return True
elif self.x > other.x:
return False
elif self.y < other.y:
return True
else:
return False
def ... | CLASS_DEF FUNC_DEF ASSIGN VAR VAR ASSIGN VAR VAR FUNC_DEF IF VAR VAR RETURN NUMBER IF VAR VAR RETURN NUMBER IF VAR VAR RETURN NUMBER RETURN NUMBER FUNC_DEF ASSIGN VAR LIST FOR VAR FUNC_CALL VAR NUMBER ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR NUMBER FUNC... |
Gerald is very particular to eight point sets. He thinks that any decent eight point set must consist of all pairwise intersections of three distinct integer vertical straight lines and three distinct integer horizontal straight lines, except for the average of these nine points. In other words, there must be three int... | def main(temp):
nums = []
for item in temp:
if item not in nums:
nums.append(item)
else:
return "ugly"
Xs = [item[0] for item in nums]
Ys = [item[1] for item in nums]
Xset = list(set(Xs))
Yset = list(set(Ys))
if len(Xset) != 3 or len(Yset) != 3:
... | FUNC_DEF ASSIGN VAR LIST FOR VAR VAR IF VAR VAR EXPR FUNC_CALL VAR VAR RETURN STRING ASSIGN VAR VAR NUMBER VAR VAR ASSIGN VAR VAR NUMBER VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF FUNC_CALL VAR VAR NUMBER FUNC_CALL VAR VAR NUMBER RETURN STRING EXPR FUNC_CALL VAR EXP... |
Gerald is very particular to eight point sets. He thinks that any decent eight point set must consist of all pairwise intersections of three distinct integer vertical straight lines and three distinct integer horizontal straight lines, except for the average of these nine points. In other words, there must be three int... | class Point:
def __init__(self, x_p, y_p):
self.x = x_p
self.y = y_p
points = []
sub_x = []
sub_y = []
key = False
for i in range(8):
x, y = map(int, input().split())
if [x, y] in points:
key = True
if x not in sub_x:
sub_x.append(x)
if y not in sub_y:
sub_... | CLASS_DEF FUNC_DEF ASSIGN VAR VAR ASSIGN VAR VAR ASSIGN VAR LIST ASSIGN VAR LIST ASSIGN VAR LIST ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF LIST VAR VAR VAR ASSIGN VAR NUMBER IF VAR VAR EXPR FUNC_CALL VAR VAR IF VAR VAR EXPR FUNC_CALL VAR VAR EXPR FUNC_CAL... |
Gerald is very particular to eight point sets. He thinks that any decent eight point set must consist of all pairwise intersections of three distinct integer vertical straight lines and three distinct integer horizontal straight lines, except for the average of these nine points. In other words, there must be three int... | def check_condition(axis):
for i in range(1, 3):
if points[i - 1][axis] != points[i][axis]:
return False
if points[2][axis] == points[3][axis]:
return False
if points[3][axis] != points[4][axis] or points[4][axis] == points[5][axis]:
return False
for i in range(6, 8):... | FUNC_DEF FOR VAR FUNC_CALL VAR NUMBER NUMBER IF VAR BIN_OP VAR NUMBER VAR VAR VAR VAR RETURN NUMBER IF VAR NUMBER VAR VAR NUMBER VAR RETURN NUMBER IF VAR NUMBER VAR VAR NUMBER VAR VAR NUMBER VAR VAR NUMBER VAR RETURN NUMBER FOR VAR FUNC_CALL VAR NUMBER NUMBER IF VAR BIN_OP VAR NUMBER VAR VAR VAR VAR RETURN NUMBER RETUR... |
Gerald is very particular to eight point sets. He thinks that any decent eight point set must consist of all pairwise intersections of three distinct integer vertical straight lines and three distinct integer horizontal straight lines, except for the average of these nine points. In other words, there must be three int... | l = [[int(c) for c in input().split()] for i in range(8)]
xs = sorted(set([p[0] for p in l]))
ys = sorted(set([p[1] for p in l]))
if len(xs) != 3 or len(ys) != 3:
print("ugly")
else:
done = False
for x in range(3):
for y in range(3):
if x == y == 1:
continue
i... | ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR VAR FUNC_CALL VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR NUMBER VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR NUMBER VAR VAR IF FUNC_CALL VAR VAR NUMBER FUNC_CALL VAR VAR NUMBER EXPR FUNC_CALL VAR STRING ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUM... |
Gerald is very particular to eight point sets. He thinks that any decent eight point set must consist of all pairwise intersections of three distinct integer vertical straight lines and three distinct integer horizontal straight lines, except for the average of these nine points. In other words, there must be three int... | i = 0
ab = []
while i != 8:
m, n = map(int, input().split())
ab.append((m, n))
i += 1
ab = sorted(ab, key=lambda tup: tup[0])
ab1 = sorted(ab[:3], key=lambda tup: tup[1])
ab2 = sorted(ab[3:5], key=lambda tup: tup[1])
ab3 = sorted(ab[5:8], key=lambda tup: tup[1])
ab = ab1 + ab2 + ab3
if (
ab[0][0] == ab[... | ASSIGN VAR NUMBER ASSIGN VAR LIST WHILE VAR NUMBER ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR VAR VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR NUMBER VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR NUMBER NUMBER VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR NUMB... |
Gerald is very particular to eight point sets. He thinks that any decent eight point set must consist of all pairwise intersections of three distinct integer vertical straight lines and three distinct integer horizontal straight lines, except for the average of these nine points. In other words, there must be three int... | class Solution:
def eightPointSets(self, listPairs):
listX = list(pair[0] for pair in listPairs)
listY = list(pair[1] for pair in listPairs)
listX.sort()
listY.sort()
setX = list(set(listX))
setY = list(set(listY))
if len(setX) != 3 or len(setY) != 3:
... | CLASS_DEF FUNC_DEF ASSIGN VAR FUNC_CALL VAR VAR NUMBER VAR VAR ASSIGN VAR FUNC_CALL VAR VAR NUMBER VAR VAR EXPR FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF FUNC_CALL VAR VAR NUMBER FUNC_CALL VAR VAR NUMBER RETURN NUMBER IF LIST VAR NUMBER VAR... |
Gerald is very particular to eight point sets. He thinks that any decent eight point set must consist of all pairwise intersections of three distinct integer vertical straight lines and three distinct integer horizontal straight lines, except for the average of these nine points. In other words, there must be three int... | x_set = set()
y_set = set()
points = []
for i in range(8):
x, y = [int(k) for k in input().split()]
x_set.add(x)
y_set.add(y)
points.append((x, y))
cnt = 0
if len(x_set) != 3 or len(y_set) != 3:
print("ugly")
else:
x_set = sorted(x_set)
y_set = sorted(y_set)
for i in range(3):
fo... | ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR NUMBER ASSIGN VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR VAR VAR ASSIGN VAR NUMBER IF FUNC_CALL VAR VAR NUMBER FUNC_CALL VAR VAR NUMBER EXPR FUNC_CALL VAR S... |
Gerald is very particular to eight point sets. He thinks that any decent eight point set must consist of all pairwise intersections of three distinct integer vertical straight lines and three distinct integer horizontal straight lines, except for the average of these nine points. In other words, there must be three int... | lines = []
for i in range(0, 8):
lines.append(list(map(int, input().split())))
lines = sorted(lines)
countA = [lines[0][0]]
countB = [lines[0][1]]
for i in range(1, len(lines)):
if lines[i][0] != lines[i - 1][0]:
countA.append(lines[i][0])
if lines[i][1] not in countB:
countB.append(lines[i]... | ASSIGN VAR LIST FOR VAR FUNC_CALL VAR NUMBER NUMBER EXPR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR LIST VAR NUMBER NUMBER ASSIGN VAR LIST VAR NUMBER NUMBER FOR VAR FUNC_CALL VAR NUMBER FUNC_CALL VAR VAR IF VAR VAR NUMBER VAR BIN_OP VAR NUMBER NUMBER EX... |
Gerald is very particular to eight point sets. He thinks that any decent eight point set must consist of all pairwise intersections of three distinct integer vertical straight lines and three distinct integer horizontal straight lines, except for the average of these nine points. In other words, there must be three int... | def check():
l = []
for i in range(8):
x, y = list(map(int, input().split()))
l += [[x, y]]
xSet = set()
ySet = set()
for x, y in l:
xSet.add(x)
ySet.add(y)
if len(xSet) != 3 or len(ySet) != 3:
return False
xList = sorted(list(xSet))
yList = sorted... | FUNC_DEF ASSIGN VAR LIST FOR VAR FUNC_CALL VAR NUMBER ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR VAR LIST LIST VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FOR VAR VAR VAR EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR VAR IF FUNC_CALL VAR VAR NUMBER FUNC_CALL VAR VAR NUMBER RETURN N... |
Gerald is very particular to eight point sets. He thinks that any decent eight point set must consist of all pairwise intersections of three distinct integer vertical straight lines and three distinct integer horizontal straight lines, except for the average of these nine points. In other words, there must be three int... | def solve():
x = [0] * 8
y = [0] * 8
xy = [None] * 8
for i in range(0, 8):
line = input()
if line == "":
line = input()
x[i], y[i] = map(int, line.split())
xy[i] = x[i], y[i]
a = sorted(x)
b = sorted(y)
x1 = a[0]
x2 = a[3]
x3 = a[7]
y1 ... | FUNC_DEF ASSIGN VAR BIN_OP LIST NUMBER NUMBER ASSIGN VAR BIN_OP LIST NUMBER NUMBER ASSIGN VAR BIN_OP LIST NONE NUMBER FOR VAR FUNC_CALL VAR NUMBER NUMBER ASSIGN VAR FUNC_CALL VAR IF VAR STRING ASSIGN VAR FUNC_CALL VAR ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL VAR ASSIGN VAR VAR VAR VAR VAR VAR ASSIGN VAR FUNC_... |
Gerald is very particular to eight point sets. He thinks that any decent eight point set must consist of all pairwise intersections of three distinct integer vertical straight lines and three distinct integer horizontal straight lines, except for the average of these nine points. In other words, there must be three int... | x, y = [0] * 8, [0] * 8
for i in range(8):
x[i], y[i] = map(int, input().split())
for i in range(8):
for j in range(i):
if x[i] == x[j] and y[i] == y[j]:
print("ugly")
break
else:
continue
break
else:
x.sort()
y.sort()
if (
x[0] == x[1] == x[2]... | ASSIGN VAR VAR BIN_OP LIST NUMBER NUMBER BIN_OP LIST NUMBER NUMBER FOR VAR FUNC_CALL VAR NUMBER ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FOR VAR FUNC_CALL VAR NUMBER FOR VAR FUNC_CALL VAR VAR IF VAR VAR VAR VAR VAR VAR VAR VAR EXPR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR EXPR FUNC_CALL VAR IF VA... |
Gerald is very particular to eight point sets. He thinks that any decent eight point set must consist of all pairwise intersections of three distinct integer vertical straight lines and three distinct integer horizontal straight lines, except for the average of these nine points. In other words, there must be three int... | class coor:
def __init__(self, x, y):
self.x = x
self.y = y
def __lt__(self, other):
if self.x < other.x:
return True
elif self.x > other.x:
return False
elif self.y < other.y:
return True
else:
return False
a = ... | CLASS_DEF FUNC_DEF ASSIGN VAR VAR ASSIGN VAR VAR FUNC_DEF IF VAR VAR RETURN NUMBER IF VAR VAR RETURN NUMBER IF VAR VAR RETURN NUMBER RETURN NUMBER ASSIGN VAR LIST ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR NUMBER NUMBER ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL... |
Gerald is very particular to eight point sets. He thinks that any decent eight point set must consist of all pairwise intersections of three distinct integer vertical straight lines and three distinct integer horizontal straight lines, except for the average of these nine points. In other words, there must be three int... | class CodeforcesTask334BSolution:
def __init__(self):
self.result = ""
self.points = []
def read_input(self):
for x in range(8):
self.points.append([int(x) for x in input().split(" ")])
def process_task(self):
xs = [x[0] for x in self.points]
xs.sort()
... | CLASS_DEF FUNC_DEF ASSIGN VAR STRING ASSIGN VAR LIST FUNC_DEF FOR VAR FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR STRING FUNC_DEF ASSIGN VAR VAR NUMBER VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR VAR NUMBER VAR VAR EXPR FUNC_CALL VAR IF VAR NUMBER VAR NUMBER VAR NUMBER VAR NUMBER VAR... |
Gerald is very particular to eight point sets. He thinks that any decent eight point set must consist of all pairwise intersections of three distinct integer vertical straight lines and three distinct integer horizontal straight lines, except for the average of these nine points. In other words, there must be three int... | a = []
b = [0] * (10**6 + 1)
c = [0] * (10**6 + 1)
for i in range(8):
x, y = map(int, input().split())
a.append((x, y))
a = sorted(a)
p = 0
x = []
y = []
for i in range(8):
if b[a[i][0]] == 0:
x.append(a[i][0])
b[a[i][0]] = 1
if c[a[i][1]] == 0:
y.append(a[i][1])
c[a[i][1... | ASSIGN VAR LIST ASSIGN VAR BIN_OP LIST NUMBER BIN_OP BIN_OP NUMBER NUMBER NUMBER ASSIGN VAR BIN_OP LIST NUMBER BIN_OP BIN_OP NUMBER NUMBER NUMBER FOR VAR FUNC_CALL VAR NUMBER ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER ASSIGN VAR LIS... |
One popular blog site edits the uploaded photos like this. It cuts a rectangular area out of them so that the ratio of height to width (i.e. the height / width quotient) can vary from 0.8 to 1.25 inclusively. Besides, at least one side of the cut area should have a size, equal to some power of number 2 (2x for some int... | c = 1
lis = [0] * 35
for i in range(33):
lis[i] = c
c *= 2
h, w = map(int, input().split())
ans = []
for i in range(32, -1, -1):
if lis[i] <= h:
l = 1
r = w
while l <= r:
mid = l + (r - l) // 2
if mid / lis[i] < 1.25:
l = mid + 1
el... | ASSIGN VAR NUMBER ASSIGN VAR BIN_OP LIST NUMBER NUMBER FOR VAR FUNC_CALL VAR NUMBER ASSIGN VAR VAR VAR VAR NUMBER ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR NUMBER NUMBER NUMBER IF VAR VAR VAR ASSIGN VAR NUMBER ASSIGN VAR VAR WHILE VAR VAR ASSIGN VAR BIN_OP VAR BIN_OP... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | w = []
col = ["Carrots", "Kiwis", "Grapes"]
n, m, k, t = map(int, input().split())
for _ in range(k):
w.append(list(map(int, input().split())))
for _ in range(t):
c = list(map(int, input().split()))
if c in w:
print("Waste")
else:
s = 0
for i in w:
if i < c:
... | ASSIGN VAR LIST ASSIGN VAR LIST STRING STRING STRING ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF VAR V... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | n, m, k, t = map(int, input().split())
crops = ["Carrots", "Kiwis", "Grapes"]
waste = list()
answers = list()
for i in range(k):
a, b = map(int, input().split())
a = a - 1
b = b - 1
waste.append(a * m + b)
waste.sort()
for i in range(t):
j, k = map(int, input().split())
q = (j - 1) * m + k - 1
... | ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST STRING STRING STRING ASSIGN VAR FUNC_CALL VAR 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 BIN_OP VAR NUMBER ASSIGN VAR BIN_OP VAR NUMBER EXPR FUNC_CALL VAR BIN_OP B... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | n, m, k, t = list(map(int, input().split()))
karr = [list(map(int, input().split())) for _ in range(k)]
tarr = [list(map(int, input().split())) for _ in range(t)]
karr = [(m * (x - 1) + y) for x, y in karr]
tarr = [(m * (x - 1) + y) for x, y in tarr]
karr.sort()
mx = karr[-1]
a = ["Carrots", "Kiwis", "Grapes"]
for q in... | ASSIGN VAR VAR 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 VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR BIN_OP VAR NUMBER VAR VAR VAR VAR ... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | def single_integer():
return int(input())
def multi_integer():
return map(int, input().split())
def string():
return input()
def multi_string():
return input().split()
n, m, k, t = multi_integer()
wastes = list()
fruits = ["Carrots", "Kiwis", "Grapes"]
for i in range(k):
wastes.append(tuple(... | 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_DEF RETURN FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR VAR VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR LIST STRING STRING STRING FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FUNC... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | n, m, k, t = list(map(int, input().split(" ")))
wastes = set()
for _ in range(k):
wastes.add(tuple(map(int, input().split(" "))))
mapping = {(0): "Carrots", (1): "Kiwis", (2): "Grapes"}
for _ in range(t):
x, y = list(map(int, input().split(" ")))
if (x, y) in wastes:
print("Waste")
continue
... | ASSIGN VAR VAR VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR DICT NUMBER NUMBER NUMBER STRING STRING STRING FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FU... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | from sys import stdin
n, m, k, t = map(int, stdin.readline().split())
empty = []
for i in range(k):
empty.append(list(map(int, stdin.readline().split())))
for i in range(t):
a, b = map(int, stdin.readline().split())
flag = 0
for j in empty:
if a == j[0] and b == j[1]:
flag = 1
... | ASSIGN VAR VAR VAR 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 FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER FOR VAR VAR IF VAR VAR NUMBER VAR VAR... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | n, m, k, t = [int(i) for i in input().split()]
waste_map = {}
for i in range(n):
waste_map[i] = []
for q in range(k):
i, j = [(int(i) - 1) for i in input().split()]
waste_map[i].append(j)
fruit_map = {(-1): "Waste", (0): "Carrots", (1): "Kiwis", (2): "Grapes"}
starts = [0] * n
num = 0
for i in range(n):
... | ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR DICT FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR BIN_OP FUNC_CALL VAR VAR NUMBER VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR VAR VAR ASSIGN VAR DICT NUMBER NUMBER NUMBER NUMBER STRING STRING STR... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | def one_line_input():
return list(map(int, input().split()))
n, m, k, t = one_line_input()
list_of_waste = []
for i in range(k):
a, b = one_line_input()
tup = [a, b]
list_of_waste.append(tup)
list_of_waste = sorted(list_of_waste)
for i in range(t):
count = 0
a, b = one_line_input()
tup = [... | FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR VAR VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR ASSIGN VAR LIST VAR VAR EXPR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER ASSIGN VAR VAR FUNC_... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | n, m, k, t = map(int, input().split())
dp = []
for i in range(k):
a, b = map(int, input().split())
idx = (a - 1) * m + (b - 1)
dp.append(idx)
dp.sort()
for i in range(t):
x, y = map(int, input().split())
idx_ = (x - 1) * m + (y - 1)
if idx_ in dp:
print("Waste")
else:
j = 0
... | ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP VAR NUMBER VAR BIN_OP VAR NUMBER EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CAL... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | line = [int(x) for x in input().split()]
rows = line[0]
cols = line[1]
k = line[2]
t = line[3]
waste = []
res = ["Carrots", "Kiwis", "Grapes"]
for case in range(k):
waste.append([int(x) for x in input().split()])
for q in range(t):
query = [int(x) for x in input().split()]
foundWaste = False
pre = 0
... | ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR LIST ASSIGN VAR LIST STRING STRING STRING FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIG... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | n, m, k, t = map(int, input().split())
waste = []
for _ in range(k):
i, j = map(int, input().split())
waste += [(i - 1) * m + (j - 1)]
waste.sort()
put = ["Carrots", "Kiwis", "Grapes"]
for _ in range(t):
i, j = map(int, input().split())
numc = (i - 1) * m + (j - 1)
c = 0
for x in waste:
... | ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR VAR LIST BIN_OP BIN_OP BIN_OP VAR NUMBER VAR BIN_OP VAR NUMBER EXPR FUNC_CALL VAR ASSIGN VAR LIST STRING STRING STRING FOR VAR FUNC_CALL VAR VAR ASSIGN VAR ... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | inp = [int(x) for x in input().split()]
n = inp[0]
m = inp[1]
k = inp[2]
t = inp[3]
waste = []
for i in range(k):
temp = [int(x) for x in input().split()]
waste.append(temp)
query = []
for i in range(t):
temp = [int(x) for x in input().split()]
query.append(temp)
loc = 0
b = 0
for i in range(t):
loc... | ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR ... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | n, m, k, t = map(int, input().split())
answers = ["Carrots", "Kiwis", "Grapes"]
d = []
for i in range(k):
k = [int(k) for k in input().split()]
d.append(k)
for i in range(t):
a = [int(a) for a in input().split()]
if a in d:
print("Waste")
else:
cnt = (a[0] - 1) * m + a[1]
all... | ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST STRING STRING STRING ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR IF VAR VAR EX... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | n, m, k, t = map(int, input().split())
waste = []
for i in range(k):
a, b = map(int, input().split())
waste.append((a - 1) * m + b - 1)
waste.sort()
plant = ["Carrots", "Kiwis", "Grapes"]
for _ in range(t):
cnt = 0
crop = True
i, j = map(int, input().split())
c = (i - 1) * m + j - 1
for x in... | ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP BIN_OP VAR NUMBER VAR VAR NUMBER EXPR FUNC_CALL VAR ASSIGN VAR LIST STRING STRING STRING FOR VAR FUNC_CALL VAR VAR A... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | n, m, k, t = map(int, input().split())
a = []
for i in range(k):
b, c = map(int, input().split())
a.append([b, c])
a.sort()
for i in range(t):
d, e = map(int, input().split())
if [d, e] in a:
print("Waste")
else:
g = (d - 1) * m + (e - 1)
h = 0
for i in range(k):
... | ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR LIST VAR VAR EXPR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF LIST VAR VAR VAR EX... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | n, m, k, t = map(int, input().split())
arr = []
for i in range(k):
g, h = map(int, input().split())
arr.append([g, h])
arr.sort()
for i in range(t):
g, h = map(int, input().split())
re = 0
bl = True
for i in arr:
if i[0] == g and i[1] == h:
bl = False
break
... | ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR LIST VAR VAR EXPR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER ASSI... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | class Query:
def __init__(self, rank, cell):
self.rank = rank
self.cell = cell
n, m, num_wasted, num_queries = map(int, input().split())
wasted = [None for i in range(num_wasted)]
for i in range(num_wasted):
a, b = map(lambda s: int(s) - 1, input().split())
wasted[i] = a * m + b
queries =... | CLASS_DEF FUNC_DEF ASSIGN VAR VAR ASSIGN VAR VAR ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NONE VAR FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR BIN_OP FUNC_CALL VAR VAR NUMBER FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR BIN_OP BIN_OP VAR VAR VAR ASSIGN VAR NONE ... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | row, line, waste, ask = map(int, input().split())
waste_array = []
for i in range(waste):
row_data, line_data = map(int, input().split())
waste_array.append((row_data - 1) * line + line_data)
waste_array = sorted(waste_array)
def binarySearchCount(arr, n, value):
left = 0
right = n - 1
count = 0
... | ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP VAR NUMBER VAR VAR ASSIGN VAR FUNC_CALL VAR VAR FUNC_DEF ASSIGN VAR NUMBER ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR N... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | n, m, k, t = map(int, input().split())
kk = k
waste = []
a = ["Carrots", "Kiwis", "Grapes"]
while k:
i, j = map(int, input().split())
waste.append([i - 1, j - 1])
k -= 1
while t:
i, j = map(int, input().split())
if [i - 1, j - 1] in waste:
print("Waste")
else:
count = (i - 1) * m... | ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR ASSIGN VAR LIST ASSIGN VAR LIST STRING STRING STRING WHILE VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR LIST BIN_OP VAR NUMBER BIN_OP VAR NUMBER VAR NUMBER WHILE VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_C... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | l1 = [int(num) for num in input().split()]
n = l1[0]
m = l1[1]
k = l1[2]
t = l1[3]
wastes = []
for i in range(k):
l2 = [int(x) for x in input().split()]
wastes.append(l2)
for i in range(t):
l3 = [int(y) for y in input().split()]
if l3 in wastes:
print("Waste")
else:
k = 0
for... | ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VA... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | def main():
n, m, k, t = map(int, input().split())
waste = []
ans = {(1): "Carrots", (2): "Kiwis", (0): "Grapes"}
for i in range(k):
a, b = map(int, input().split())
waste.append((a - 1) * m + b)
waste.sort()
for i in range(t):
a, b = map(int, input().split())
cel... | FUNC_DEF ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR DICT NUMBER NUMBER NUMBER STRING STRING STRING FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP VAR NUMBER VAR VAR EXPR FUNC_CALL VAR FOR VAR FUN... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | n, m, k, t = map(int, input().split())
waste = []
for _ in range(k):
tmp = list(map(int, input().split()))
waste.append(tmp)
tree = {(1): "Carrots", (2): "Kiwis", (0): "Grapes"}
waste.sort()
for _ in range(t):
ls = list(map(int, input().split()))
i = 0
found = False
for plot in waste:
if... | ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR VAR ASSIGN VAR DICT NUMBER NUMBER NUMBER STRING STRING STRING EXPR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | rows, columns, waste_count, q_count = [int(i) for i in input().split(" ")]
waste_list = []
for _ in range(waste_count):
waste_list.append([int(i) for i in input().split(" ")])
query_list = []
for _ in range(q_count):
query_list.append([int(i) for i in input().split(" ")])
waste_row = []
waste_row_count = []
for... | ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR LIST ... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | n, m, k, t = map(int, input().split())
a = []
for i in range(k):
i, j = map(int, input().split())
a.append([i, j])
for i in range(t):
i, j = map(int, input().split())
c = j + (i - 1) * m
w = 0
f = 0
for z in range(k):
if a[z][0] < i:
w += 1
elif a[z][0] == i:
... | ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR LIST VAR VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP VAR BIN_OP BIN_OP VAR N... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | n, m, k, t = map(int, input().split())
def mToA(i, j):
return i * m + j - m - 1
waste = [mToA(*map(int, input().split())) for _ in range(k)]
waste.sort()
plants = ["Carrots", "Kiwis", "Grapes"]
for _ in range(t):
i, j = map(int, input().split())
a = mToA(i, j)
if a in waste:
print("Waste")
... | ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF RETURN BIN_OP BIN_OP BIN_OP BIN_OP VAR VAR VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR LIST STRING STRING STRING FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FU... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | n, m, k, t = map(int, input().split())
cnt = {(-1, m - 1): 0}
waste_fields = []
for _ in range(k):
a, b = map(int, input().split())
a -= 1
b -= 1
waste_fields.append([a, b])
fruit = ["Carrots", "Kiwis", "Grapes"]
for _ in range(t):
a, b = map(int, input().split())
a -= 1
b -= 1
if [a, b]... | ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR DICT NUMBER BIN_OP VAR NUMBER NUMBER ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR VAR NUMBER VAR NUMBER EXPR FUNC_CALL VAR LIST VAR VAR ASSIGN VAR LIST STRING STRING STRING FOR VAR FUNC_CALL... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | def get_waste_amount(waste, t):
for i in range(len(waste)):
if waste[i] > t:
return len(waste[:i])
if i == len(waste) - 1:
return len(waste)
def process_query(m, t, waste):
if t in waste:
print("Waste")
else:
f = ["Carrots", "Kiwis", "Grapes"]
... | FUNC_DEF FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF VAR VAR VAR RETURN FUNC_CALL VAR VAR VAR IF VAR BIN_OP FUNC_CALL VAR VAR NUMBER RETURN FUNC_CALL VAR VAR FUNC_DEF IF VAR VAR EXPR FUNC_CALL VAR STRING ASSIGN VAR LIST STRING STRING STRING ASSIGN VAR FUNC_CALL VAR VAR VAR EXPR FUNC_CALL VAR VAR BIN_OP BIN_OP BIN_OP BIN... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | n, m, k, t = map(int, input().split())
waste = []
val = ["Carrots", "Kiwis", "Grapes"]
for i in range(k):
a = list(map(int, input().split()))
waste.append(a)
for i in range(t):
q = list(map(int, input().split()))
if q in waste:
print("Waste")
else:
s = 0
for i in waste:
... | ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR LIST STRING STRING STRING FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CA... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | n, m, k, t = map(int, input().split())
fruits = ["Carrots", "Kiwis", "Grapes"]
results = []
waste = []
for i in range(k):
waste.append(list(map(int, input().split())))
for i in range(t):
inp = list(map(int, input().split()))
total = 0
for w in waste:
if inp == w:
total = "Waste"
... | ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST STRING STRING STRING ASSIGN VAR LIST 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 FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_C... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | n, m, k, t = list(map(int, input().split(" ")))
arr = []
ans = []
def binarySearch(val, arr):
lo = 0
hi = len(arr)
while lo < hi:
mid = (lo + hi) // 2
if arr[mid] < val:
lo = mid + 1
else:
hi = mid
return lo
for _ in range(k):
i, j = list(map(int, ... | ASSIGN VAR VAR VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR LIST ASSIGN VAR LIST FUNC_DEF ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR WHILE VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR NUMBER IF VAR VAR VAR ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR VAR RETURN VAR FOR VAR FUNC_CALL VAR ... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | n, m, k, r = map(int, input().split())
dic = {}
li = ["Carrots", "Kiwis", "Grapes"]
li1 = []
for i in range(k):
a, b = map(int, input().split())
li1.append((a, b))
li1.sort()
for d in range(r):
t = 0
cnt = 0
v, w = map(int, input().split())
for j in li1:
if int(j[0]) == v and int(j[1]) =... | ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR DICT ASSIGN VAR LIST STRING STRING STRING ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR VAR VAR EXPR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER ASSIGN VAR NU... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | a = list(map(int, input().split()))
n = a[0]
m = a[1]
k = a[2]
t = a[3]
l = []
for i in range(k):
s = list(map(int, input().split()))
d = (s[0] - 1) * m + s[1]
l.append(d)
kt = []
for i in range(t):
s = list(map(int, input().split()))
d = (s[0] - 1) * m + s[1]
kt.append(d)
l.sort()
for ele in kt... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP VAR NUMBER NUMBER VAR VA... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | from sys import stdin, stdout
def input():
a = stdin.readline()
if a[-1] == "\n":
a = a[:-1]
return a
def print(*argv, end="\n", sep=" "):
n = len(argv)
for i in range(n):
if i == n - 1:
stdout.write(str(argv[i]))
else:
stdout.write(str(argv[i]) + ... | FUNC_DEF ASSIGN VAR FUNC_CALL VAR IF VAR NUMBER STRING ASSIGN VAR VAR NUMBER RETURN VAR FUNC_DEF STRING STRING ASSIGN VAR FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR VAR IF VAR BIN_OP VAR NUMBER EXPR FUNC_CALL VAR FUNC_CALL VAR VAR VAR EXPR FUNC_CALL VAR BIN_OP FUNC_CALL VAR VAR VAR VAR EXPR FUNC_CALL VAR VAR ASSIGN VAR BI... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | n, m, k, t = map(int, input().split())
l = []
for i in range(k):
a, b = map(int, input().split())
pos = b - 1 + m * (a - 1)
l.append(pos)
for i in range(t):
a, b = map(int, input().split())
pos = b - 1 + m * (a - 1)
j = 0
k = 0
for i in sorted(l):
if i < pos:
k += 1
... | ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP BIN_OP VAR NUMBER BIN_OP VAR BIN_OP VAR NUMBER EXPR FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | class Coordenada:
def __init__(self, linha, coluna):
self.linha = linha
self.coluna = coluna
def __eq__(self, other):
return self.linha == other.linha and self.coluna == other.coluna
def __repr__(self):
return "({}, {})".format(self.linha, self.coluna)
def __lt__(self... | CLASS_DEF FUNC_DEF ASSIGN VAR VAR ASSIGN VAR VAR FUNC_DEF RETURN VAR VAR VAR VAR FUNC_DEF RETURN FUNC_CALL STRING VAR VAR FUNC_DEF IF VAR VAR RETURN VAR VAR RETURN VAR VAR FUNC_DEF NUMBER NONE IF VAR NONE ASSIGN VAR BIN_OP FUNC_CALL VAR VAR NUMBER IF VAR VAR RETURN NUMBER ASSIGN VAR BIN_OP BIN_OP VAR VAR NUMBER IF VAR ... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | n, m, k, t = [int(x) for x in input().split()]
mapp = {(0): "Carrots", (1): "Kiwis", (2): "Grapes"}
iamdistruption = []
for i in range(k):
x, y = [int(x) for x in input().split()]
iamdistruption.append((x, y))
for i in range(t):
x, y = [int(x) for x in input().split()]
orig = m * (x - 1) + y - 1
dis... | ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR DICT NUMBER NUMBER NUMBER STRING STRING STRING ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR VAR VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR VAR ... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | v = ["Carrots", "Kiwis", "Grapes"]
n, m, k, t = map(int, input().split())
w = []
for i in range(k):
a, b = map(int, input().split())
w.append((a - 1) * m + b - 1)
w.append(n * m)
w.sort()
for i in range(t):
a, b = map(int, input().split())
c, wi = (a - 1) * m + b - 1, 0
while w[wi] < c:
wi +... | ASSIGN VAR LIST STRING STRING STRING ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP BIN_OP VAR NUMBER VAR VAR NUMBER EXPR FUNC_CALL VAR BIN_OP VAR VAR EXPR FUNC_CA... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | n, m, k, t = [int(i) for i in input().split()]
waste = []
for j in range(k):
a = [int(z) for z in input().split()]
waste.append(a)
waste.sort()
for y in range(t):
b = [int(y) for y in input().split()]
if True:
count = 0
f = 0
for q in range(k):
if waste[q][0] < b[0]:
... | ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR IF NUMBER ASSIGN VAR NUMBER... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | n, m, k, t = map(int, input().split())
waste = [n * m + 1]
for i in range(k):
a, b = map(int, input().split())
waste.append((a - 1) * m + b)
waste.sort()
for i in range(t):
i, j = map(int, input().split())
ind = (i - 1) * m + j
for index, x in enumerate(waste):
if x == ind:
print... | ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST BIN_OP BIN_OP VAR VAR NUMBER FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP VAR NUMBER VAR VAR EXPR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CAL... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | z = list(map(int, input().split()))
hold = [0] * z[0]
lst = []
for i in range(z[2]):
a, b = map(int, input().split())
lst.append((a, b))
hold[a - 1] += 1
lst.sort()
for k in range(1, len(hold)):
hold[k] += hold[k - 1]
for j in range(z[3]):
v, b = map(int, input().split())
if (v, b) in lst:
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP LIST NUMBER VAR NUMBER ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR VAR VAR VAR BIN_OP VAR NUMBER NUMBER EXPR FUNC_CALL VAR FOR VAR FUNC_CALL VAR NUMBER FU... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | n, m, k, t = map(int, input().split())
m, l = m % 3, (m + 1) % 3
p = [[] for i in range(n + 1)]
for i in range(k):
x, y = map(int, input().split())
p[x].append(y)
r = [len(i) for i in p]
for i in range(1, n + 1):
r[i] += r[i - 1]
r, q = [0] + r, [0] * t
for i in range(t):
x, y = map(int, input().split()... | ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR BIN_OP VAR NUMBER BIN_OP BIN_OP VAR NUMBER NUMBER ASSIGN VAR LIST VAR FUNC_CALL VAR BIN_OP VAR NUMBER FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | def read():
return map(int, input().split())
plants = ["Carrots", "Kiwis", "Grapes", "Waste"]
n, m, k, t = read()
waste_pos = set()
for _ in range(k):
x, y = read()
pos = (x - 1) * m + (y - 1)
waste_pos.add(pos)
for _ in range(t):
x, y = read()
res = (x - 1) * m + (y - 1)
sub = 0
if re... | FUNC_DEF RETURN FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST STRING STRING STRING STRING ASSIGN VAR VAR VAR VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP VAR NUMBER VAR BIN_OP VAR NUMBER EXPR FUNC_CALL VAR VAR FOR VAR FUNC_... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | n, m, k, t = map(int, input().split())
waste = []
queries = []
plants = {(0): "Carrots", (1): "Kiwis", (2): "Grapes"}
waste_cells = 0
for _ in range(k):
waste.append(list(map(int, input().split())))
for _ in range(t):
query = list(map(int, input().split()))
if query in waste:
print("Waste")
else... | ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR LIST ASSIGN VAR DICT NUMBER NUMBER NUMBER STRING STRING STRING ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | n, m, k, t = map(int, input().strip().split())
w = []
for i in range(k):
a, b = map(int, input().strip().split())
c = []
c.append(a)
c.append(b)
w.append(c)
w.sort()
d = ["Carrots", "Kiwis", "Grapes"]
for i in range(t):
a, b = map(int, input().strip().split())
if [a, b] in w:
print("... | ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR LIST STRING STRING ST... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | n, m, k, t = [int(i) for i in input().split()]
waste = []
for i in range(k):
a, b = [int(i) for i in input().split()]
waste.append((a - 1) * m + b)
crop = ["Carrots", "Kiwis", "Grapes"]
waste.sort()
nn = len(waste)
for i in range(t):
a, b = [int(i) for i in input().split()]
c = (a - 1) * m + b
i = 0... | ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP VAR NUMBER VAR VAR ASSIGN VAR LIST STRING STRING STRING EXPR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR FOR ... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | n, m, w, q = [int(i) for i in input().split()]
waste = []
for i in range(w):
waste.append(tuple(map(int, input().split())))
waste.sort(key=lambda s: (s[0], s[1]))
def wl(nw, w, x):
d = 0
f = nw - 1
m = (d + f) // 2
while f >= d:
m = (d + f) // 2
if w[m][0] >= x[0]:
f = ... | ASSIGN VAR VAR VAR VAR FUNC_CALL VAR 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 EXPR FUNC_CALL VAR VAR NUMBER VAR NUMBER FUNC_DEF ASSIGN VAR NUMBER ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP BIN_OP VAR VAR NUMB... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | def get_crop(n, m, waste, i, j):
curr = m * i + j
if curr in waste:
return "Waste"
new = curr
i = 0
while i < len(waste) and waste[i] < curr:
new -= 1
i += 1
if new % 3 == 0:
return "Carrots"
elif new % 3 == 1:
return "Kiwis"
else:
return "... | FUNC_DEF ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR IF VAR VAR RETURN STRING ASSIGN VAR VAR ASSIGN VAR NUMBER WHILE VAR FUNC_CALL VAR VAR VAR VAR VAR VAR NUMBER VAR NUMBER IF BIN_OP VAR NUMBER NUMBER RETURN STRING IF BIN_OP VAR NUMBER NUMBER RETURN STRING RETURN STRING ASSIGN VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR VAR VA... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | [n, m, k, t] = list(map(int, input().split()))
black = []
Plants = ["Carrots", "Kiwis", "Grapes"]
for i in range(k):
black.append(tuple(map(int, input().split())))
black.sort()
queries = []
for i in range(t):
queries.append(tuple(map(int, input().split())))
for q in queries:
if q in black:
print("Wa... | ASSIGN LIST VAR VAR VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR LIST STRING STRING STRING FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FU... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | food = ["Carrots", "Kiwis", "Grapes"]
n, m, k, t = [int(x) for x in input().split(" ")]
wasts = []
for _k in range(k):
_x, _y = [(int(x) - 1) for x in input().split(" ")]
wasts.append((_x, _y))
wasts = sorted(wasts, key=lambda x: x)
queries = []
for _t in range(t):
query = [(int(x) - 1) for x in input().spl... | ASSIGN VAR LIST STRING STRING STRING ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR BIN_OP FUNC_CALL VAR VAR NUMBER VAR FUNC_CALL FUNC_CALL VAR STRING EXPR FUNC_CALL VAR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR VAR ASSIGN VAR LIST FOR VAR... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | n, m, k, t = list(map(int, input().split()))
waste_cell = set()
for i in range(k):
row, col = list(map(int, input().split()))
which_cell = m * (row - 1) + col
waste_cell.add(which_cell)
crop = {(1): "Carrots", (2): "Kiwis", (0): "Grapes"}
def waste_cell_before(total_cell):
count = 0
for cell in so... | ASSIGN VAR VAR VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR BIN_OP BIN_OP VAR BIN_OP VAR NUMBER VAR EXPR FUNC_CALL VAR VAR ASSIGN VAR DICT NUMBER NUMBER NUMBER STRING S... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | n, m, k, t = map(int, input().split(" "))
posMat = []
for i in range(k):
x, y = map(int, input().split(" "))
posMat.append((x - 1) * m + y)
posMat = sorted(posMat)
for j in range(t):
x, y = map(int, input().split(" "))
pos = (x - 1) * m + y
if pos in posMat:
print("Waste")
else:
... | ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING 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 BIN_OP BIN_OP VAR NUMBER VAR VAR ASSIGN VAR FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | n, m, k, t = map(int, input().split())
k = [list(map(int, input().split())) for i in range(k)]
for i in range(t):
x = list(map(int, input().split()))
print(
"Waste"
if x in k
else ["Grapes", "Carrots", "Kiwis"][
(x[0] * m - m + x[1] - sum(map(lambda i: i < x, k))) % 3
... | ASSIGN VAR VAR 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 VAR FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR VAR VAR STRING LIST STRING STRING STRING BIN_OP BIN_OP... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | n, m, k, t = map(int, input().split())
waste = []
for i in range(k):
waste.append(tuple(map(int, input().split())))
hashmap = dict()
for a in waste:
hashmap[a] = 1
ans = {(1): "Carrots", (2): "Kiwis", (0): "Grapes"}
for _ in range(t):
a, b = map(int, input().split())
if (a, b) in hashmap:
print(... | ASSIGN VAR VAR VAR 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 FUNC_CALL VAR FOR VAR VAR ASSIGN VAR VAR NUMBER ASSIGN VAR DICT NUMBER NUMBER NUMBER STRING STRING STRING FOR VAR FUNC_CALL VAR... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | n, m, k, t = map(int, input().split())
waste = [tuple(map(int, input().split())) for _ in range(k)]
def getCount2(waste, q1, q2):
count = 0
for index, val in enumerate(waste):
if val[0] < q1 and val[1] <= m:
count = count + 1
elif val[0] == q1 and val[1] < q2:
count = c... | ASSIGN VAR VAR 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 VAR FUNC_CALL VAR VAR FUNC_DEF ASSIGN VAR NUMBER FOR VAR VAR FUNC_CALL VAR VAR IF VAR NUMBER VAR VAR NUMBER VAR ASSIGN VAR BIN_OP VAR NUMBER IF VAR NUMBER VAR VAR NUMBER VAR ASSIGN VAR BIN... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | n, m, k, t = list(map(int, input().split()))
w = []
crops = ["Carrots", "Kiwis", "Grapes"]
def getNumWaste(pos):
ans = 0
for i in w:
if i < pos:
ans += 1
elif i == pos:
return -1
return ans
for i in range(k):
a, b = list(map(int, input().split()))
a -= 1
... | ASSIGN VAR VAR VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR LIST STRING STRING STRING FUNC_DEF ASSIGN VAR NUMBER FOR VAR VAR IF VAR VAR VAR NUMBER IF VAR VAR RETURN NUMBER RETURN VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CAL... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | import sys
def ints_input():
return [int(i) for i in sys.stdin.readline().strip("\n").split(" ")]
def print_list(arr):
sys.stdout.writelines(str(x) + " " for x in arr)
sys.stdout.write("\n")
def fast_input(type=str):
return type(sys.stdin.readline().strip("\n"))
n, m, k, t = ints_input()
wastes ... | IMPORT FUNC_DEF RETURN FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR STRING STRING FUNC_DEF EXPR FUNC_CALL VAR BIN_OP FUNC_CALL VAR VAR STRING VAR VAR EXPR FUNC_CALL VAR STRING FUNC_DEF VAR RETURN FUNC_CALL VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR VAR VAR VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CA... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | def mi():
return map(int, input().split())
n, m, k, t = mi()
wasterowscount = [0] * (n + 1)
d = {(0): "Carrots", (1): "Kiwis", (2): "Grapes"}
waste = [[]] * (n + 1)
def fun(x, y):
global waste
if y in waste[x]:
print("Waste")
return 0
cur = (x - 1) * m - wasterowscount[x - 1]
cur... | FUNC_DEF RETURN FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR VAR VAR FUNC_CALL VAR ASSIGN VAR BIN_OP LIST NUMBER BIN_OP VAR NUMBER ASSIGN VAR DICT NUMBER NUMBER NUMBER STRING STRING STRING ASSIGN VAR BIN_OP LIST LIST BIN_OP VAR NUMBER FUNC_DEF IF VAR VAR VAR EXPR FUNC_CALL VAR STRING RETURN NUMBER ASSIGN VA... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | def main():
n, m, k, t = map(int, input().split())
uf = []
for _ in range(k):
a, b = map(int, input().split())
uf.append([a, b])
crd = []
for _ in range(t):
i, j = map(int, input().split())
crd.append([i, j])
for p1 in crd:
total = (p1[0] - 1) * m + p1[1] ... | FUNC_DEF ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR LIST VAR VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL V... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | n, m, k, t = map(int, input().split())
p = []
fruit = ["Carrots", "Kiwis", "Grapes"]
for i in range(k):
a, b = map(int, input().split())
p.append([a, b])
p.sort()
for q in range(t):
a, b = map(int, input().split())
if [a, b] in p:
print("Waste")
else:
I = (a - 1) * m + b - 1
... | ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR LIST STRING STRING STRING FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR LIST VAR VAR EXPR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | f = []
n, m, k, t = map(int, input().split())
for i in range(k):
f.append(list(map(int, input().split())))
f.sort()
for j in range(t):
a, b = map(int, input().split())
if [a, b] not in f:
c = b + (a - 1) * m
u = 0
for s in f:
if s[1] + (s[0] - 1) * m < c:
... | ASSIGN VAR LIST ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR IF LIST VAR VAR VAR ASSIGN VAR BIN_O... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | rows, cols, waste, t = map(int, input().split())
w = []
for i in range(waste):
i, j = map(int, input().split())
w.append([i, j])
w.sort()
fruits = ["Carrots", "Kiwis", "Grapes"]
for i in range(t):
i, j = map(int, input().split())
if [i, j] in w:
print("Waste")
else:
J = (i - 1) * col... | ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR LIST VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR LIST STRING STRING STRING FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | n, m, k, t = map(int, input().split())
def index(l, r):
return l * m + r
k_list = []
d = {(0): "Carrots", (1): "Kiwis", (2): "Grapes"}
for i in range(k):
l, r = map(int, input().split())
k_list.append((l - 1, r - 1))
k_list.sort()
for i in range(t):
cnt = 0
l, r = map(int, input().split())
l... | ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF RETURN BIN_OP BIN_OP VAR VAR VAR ASSIGN VAR LIST ASSIGN VAR DICT NUMBER NUMBER NUMBER STRING STRING STRING FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR BIN_OP VAR NUMBER BIN_OP VAR NUMBER E... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | n, m, k, t = input().strip().split(" ")
n = int(n)
m = int(m)
k = int(k)
t = int(t)
ar = []
for i in range(k):
inp = input().strip().split(" ")
ar.append((int(inp[0]) - 1) * m + int(inp[1]) - 1)
ar.sort()
for i in range(t):
inp = input().strip().split(" ")
inp[0] = int(inp[0]) - 1
inp[1] = int(inp[1... | ASSIGN VAR VAR VAR VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR STRING EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP BIN_OP... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | inp = str(input()).split(" ")
n = int(inp[0])
m = int(inp[1])
k = int(inp[2])
t = int(inp[3])
wasteSpace = []
for _ in range(k):
inp = str(input()).split(" ")
while inp == [""]:
inp = str(input()).split(" ")
x = int(inp[0]) - 1
y = int(inp[1]) - 1
wasteSpace.append((x, y))
wasteSpace.sort()
... | ASSIGN VAR FUNC_CALL FUNC_CALL 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 LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL FUNC_CALL VAR FUNC_CALL VAR STRING WHILE VAR LIST STRING ... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | n, m, k, t = map(int, input().split())
arr = []
for i in range(k):
a, b = map(int, input().split())
arr.append((a - 1) * m + b)
arr.sort()
for i in range(t):
x, y = map(int, input().split())
c = 0
s = (x - 1) * m + y
p = 0
for j in arr:
if j == s:
p = 1
print(... | ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP VAR NUMBER VAR VAR EXPR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | n, m, num_wasted, num_queries = map(int, input().split())
wasted = [None for i in range(num_wasted)]
for i in range(num_wasted):
a, b = map(lambda s: int(s) - 1, input().split())
wasted[i] = a * m + b
wasted_set = set(wasted)
wasted.sort()
crops = ["Carrots", "Kiwis", "Grapes"]
for i in range(num_queries):
... | ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NONE VAR FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR BIN_OP FUNC_CALL VAR VAR NUMBER FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR BIN_OP BIN_OP VAR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR ASSIGN VAR LIST S... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | A = list(map(int, input().split()))
n = A[0]
m = A[1]
k = A[2]
q = A[3]
wastepos = []
for i in range(k):
a, b = list(map(int, input().split()))
wastepos += [[a - 1, b - 1]]
Items = ["Carrots", "Kiwis", "Grapes"]
for _ in range(q):
a, b = list(map(int, input().split()))
res = (a - 1) * m + b
if [a - ... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR 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 VAR LIST LIST BIN_OP VAR NUMBER BIN_OP VAR NUMBER AS... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | n, m, k, t = map(int, input().split(" "))
field = []
for _ in range(k):
a, b = map(int, input().split(" "))
field.append((a - 1) * m + (b - 1))
field.sort()
dic = {(0): "Carrots", (1): "Kiwis", (2): "Grapes"}
for _ in range(t):
flag = 0
x, y = map(int, input().split(" "))
value = (x - 1) * m + (y - ... | ASSIGN VAR VAR VAR VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING 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 BIN_OP BIN_OP VAR NUMBER VAR BIN_OP VAR NUMBER EXPR FUNC_CALL VAR ASSIGN VAR DICT NUMBER NUMBER NUMBER STRING STRING... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | from sys import stdin
def get_ints():
return list(map(int, stdin.readline().strip().split()))
n, m, k, t = get_ints()
seq = ["Carrots", "Kiwis", "Grapes"]
wastes = []
dic = {}
for _ in range(k):
a, b = get_ints()
wastes.append((a - 1) * m + b - 1)
dic[(a - 1) * m + b - 1] = 1
wastes = sorted(wastes)... | FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR ASSIGN VAR VAR VAR VAR FUNC_CALL VAR ASSIGN VAR LIST STRING STRING STRING ASSIGN VAR LIST ASSIGN VAR DICT FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP BIN_OP VAR NUMBER VAR VAR NUMBER ASSI... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | def inp():
return map(int, input().split())
def print_arr(arr):
print(*arr, sep="\n")
def get_col(arr, i):
return [row[i] for row in arr]
n, m, k, t = inp()
waste, quary, plant = [], [], ["Grapes", "Carrots", "Kiwis"]
for i in range(k):
a, b = inp()
waste.append((a - 1) * m + b)
for i in range... | FUNC_DEF RETURN FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF EXPR FUNC_CALL VAR VAR STRING FUNC_DEF RETURN VAR VAR VAR VAR ASSIGN VAR VAR VAR VAR FUNC_CALL VAR ASSIGN VAR VAR VAR LIST LIST LIST STRING STRING STRING FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR FUNC_CALL VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP VAR ... |
Fox Ciel saw a large field while she was on a bus. The field was a n × m rectangle divided into 1 × 1 cells. Some cells were wasteland, and other each cell contained crop plants: either carrots or kiwis or grapes.
After seeing the field carefully, Ciel found that the crop plants of each cell were planted in following... | btngan = 0
a = [int(x) for x in input().split(" ")]
wastec = 0
xi = a[0]
xj = a[1]
waste = [[(0) for x in range(2)] for y in range(a[2])]
for i in range(0, a[2]):
w = [int(x) for x in input().split(" ")]
waste[i] = w
for i in range(0, a[3]):
count = 0
p = [int(x) for x in input().split(" ")]
ii = p[... | ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR NUMBER VAR FUNC_CALL VAR NUMBER VAR FUNC_CALL VAR VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR STRING ... |
There is a forest that we model as a plane and live $n$ rare animals. Animal number $i$ has its lair in the point $(x_{i}, y_{i})$. In order to protect them, a decision to build a nature reserve has been made.
The reserve must have a form of a circle containing all lairs. There is also a straight river flowing through... | l, r = -100000000, 1000000000
def check(mid):
mx = 0
for i in range(n):
x, y = x1[i], y1[i]
mx = max(mx, (x1[i] - mid) ** 2 / (2 * y1[i]) + y1[i] / 2)
return mx
n = int(input())
count1 = 0
count2 = 0
x1 = []
y1 = []
for i in range(n):
a, b = list(map(int, input().split()))
if b >... | ASSIGN VAR VAR NUMBER NUMBER FUNC_DEF ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR VAR VAR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR BIN_OP BIN_OP BIN_OP BIN_OP VAR VAR VAR NUMBER BIN_OP NUMBER VAR VAR BIN_OP VAR VAR NUMBER RETURN VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER A... |
There is a forest that we model as a plane and live $n$ rare animals. Animal number $i$ has its lair in the point $(x_{i}, y_{i})$. In order to protect them, a decision to build a nature reserve has been made.
The reserve must have a form of a circle containing all lairs. There is also a straight river flowing through... | import sys
input = sys.stdin.readline
class Point:
def __init__(self, x, y):
self.x = x
self.y = y
def get(x0, a, n):
r = 0
for i in range(n):
p = (x0 - a[i].x) * (x0 - a[i].x) + 1.0 * a[i].y * a[i].y
p = p / 2.0 / a[i].y
if p < 0:
p = -p
r =... | IMPORT ASSIGN VAR VAR CLASS_DEF FUNC_DEF ASSIGN VAR VAR ASSIGN VAR VAR FUNC_DEF ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP VAR VAR VAR BIN_OP VAR VAR VAR BIN_OP BIN_OP NUMBER VAR VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR NUMBER VAR VAR IF VAR NUMBER ASSIGN VAR VAR ASSIGN VAR FUNC_CALL VA... |
There is a forest that we model as a plane and live $n$ rare animals. Animal number $i$ has its lair in the point $(x_{i}, y_{i})$. In order to protect them, a decision to build a nature reserve has been made.
The reserve must have a form of a circle containing all lairs. There is also a straight river flowing through... | def bs(x, y, n, p):
r = 0
for i in range(n):
z = (p - x[i]) * (p - x[i]) + 1.0 * y[i] * y[i]
z = z / 2.0
z = z / y[i]
z = abs(z)
r = max(z, r)
return r
n = int(input())
y = []
x = []
k = z = 0
for i in range(n):
a, b = [int(i) for i in input().split()]
if b ... | FUNC_DEF ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP BIN_OP BIN_OP VAR VAR VAR BIN_OP VAR VAR VAR BIN_OP BIN_OP NUMBER VAR VAR VAR VAR ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP VAR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR VAR RETURN VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL ... |
There is a forest that we model as a plane and live $n$ rare animals. Animal number $i$ has its lair in the point $(x_{i}, y_{i})$. In order to protect them, a decision to build a nature reserve has been made.
The reserve must have a form of a circle containing all lairs. There is also a straight river flowing through... | n, l, r = 0, -100000000, 1000000000
x, y = [], []
def cal(mid):
mx = 0
for i in range(n):
mx = max(mx, (x[i] - mid) ** 2 / (2 * y[i]) + y[i] / 2)
return mx
n = int(input())
for i in range(n):
a, b = map(int, input().split())
x.append(a), y.append(b)
for i in range(1, n):
if y[i] * y[... | ASSIGN VAR VAR VAR NUMBER NUMBER NUMBER ASSIGN VAR VAR LIST LIST FUNC_DEF ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR BIN_OP BIN_OP BIN_OP BIN_OP VAR VAR VAR NUMBER BIN_OP NUMBER VAR VAR BIN_OP VAR VAR NUMBER RETURN VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN... |
The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, $n$ is always even, and in C2, $n$ is always odd.
You are given a regular polygon with $2 \cdot n$ vertices (it's convex and has equal sides and equal angles) and all its sides have length $1$. Let's n... | res = [
"1.9318516577",
"3.1962266127",
"4.4657021374",
"5.7368566318",
"7.0087710109",
"8.2810937889",
"9.5536612999",
"10.8263870658",
"12.0992210840",
"13.3721323881",
"14.6451008008",
"15.9181125992",
"17.1911581674",
"18.4642304645",
"19.7373243730",
... | ASSIGN VAR LIST STRING STRING STRING STRING STRING STRING STRING STRING STRING STRING STRING STRING STRING STRING STRING STRING STRING STRING STRING STRING STRING STRING STRING STRING STRING STRING STRING STRING STRING STRING STRING STRING STRING STRING STRING STRING STRING STRING STRING STRING STRING STRING STRING STR... |
Let's write all the positive integer numbers one after another from $1$ without any delimiters (i.e. as a single string). It will be the infinite sequence starting with 123456789101112131415161718192021222324252627282930313233343536...
Your task is to print the $k$-th digit of this sequence.
-----Input-----
The fir... | k = int(input(""))
a = [9]
i = 1
if k < 10:
print(k)
else:
while k > a[-1]:
a.append((10 ** (i + 1) - 10**i) * (i + 1) + a[i - 1])
i += 1
cat = len(a)
diff = k - a[-2]
step = int(diff / cat)
rem = diff % cat
if rem == 0:
number = 10 ** (cat - 1) - 1 + step
pri... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR STRING ASSIGN VAR LIST NUMBER ASSIGN VAR NUMBER IF VAR NUMBER EXPR FUNC_CALL VAR VAR WHILE VAR VAR NUMBER EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP BIN_OP NUMBER BIN_OP VAR NUMBER BIN_OP NUMBER VAR BIN_OP VAR NUMBER VAR BIN_OP VAR NUMBER VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR ASSIG... |
Let's write all the positive integer numbers one after another from $1$ without any delimiters (i.e. as a single string). It will be the infinite sequence starting with 123456789101112131415161718192021222324252627282930313233343536...
Your task is to print the $k$-th digit of this sequence.
-----Input-----
The fir... | digit = 1
x = int(input())
start_range = 1
end_range = 9
nine = 9
total = 0
while x > end_range:
start_range = end_range + 1
digit += 1
end_range += digit * nine * pow(10, digit - 1)
total = total + start_range
start = pow(10, digit - 1)
number = int((x - start_range) / digit)
index = int((x - start_ran... | ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER WHILE VAR VAR ASSIGN VAR BIN_OP VAR NUMBER VAR NUMBER VAR BIN_OP BIN_OP VAR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER ASSIGN VAR BIN_OP VAR VAR ASSIGN VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUM... |
Let's write all the positive integer numbers one after another from $1$ without any delimiters (i.e. as a single string). It will be the infinite sequence starting with 123456789101112131415161718192021222324252627282930313233343536...
Your task is to print the $k$-th digit of this sequence.
-----Input-----
The fir... | idx = {}
idx[0] = 0
s = 0
num = 9
for digit in range(1, 12):
s += num * digit
idx[digit] = s
num = num * 10
N = int(input())
nubmer = 0
r = 0
d = 0
for digit in range(1, 12):
if N <= idx[digit] and N > idx[digit - 1]:
number = (N - idx[digit - 1]) // digit
r = (N - idx[digit - 1]) % digi... | ASSIGN VAR DICT ASSIGN VAR NUMBER NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER NUMBER VAR BIN_OP VAR VAR ASSIGN VAR VAR VAR ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER NUMBER IF VAR VAR ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.