message
stringlengths
2
44.5k
message_type
stringclasses
2 values
message_id
int64
0
1
conversation_id
int64
276
109k
cluster
float64
23
23
__index_level_0__
int64
552
217k
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. A binary matrix is called good if every even length square sub-matrix has an odd number of ones. Given a binary matrix a consisting of n rows and m columns, determine the minimum number of cel...
instruction
0
83,588
23
167,176
No
output
1
83,588
23
167,177
Provide tags and a correct Python 3 solution for this coding contest problem. Little Petya likes points a lot. Recently his mom has presented him n points lying on the line OX. Now Petya is wondering in how many ways he can choose three distinct points so that the distance between the two farthest of them doesn't exce...
instruction
0
83,692
23
167,384
Tags: binary search, combinatorics, two pointers Correct Solution: ``` from sys import stdin from bisect import * from math import factorial def nCr(n, r): f, m = factorial, 1 for i in range(n, n - r, -1): m *= i return int(m // f(r)) def arr_inp(n): if n == 1: return [int(x) for x i...
output
1
83,692
23
167,385
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Little Petya likes points a lot. Recently his mom has presented him n points lying on the line OX. Now Petya is wondering in how many ways he can choose three distinct points so that the distanc...
instruction
0
83,700
23
167,400
Yes
output
1
83,700
23
167,401
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Little Petya likes points a lot. Recently his mom has presented him n points lying on the line OX. Now Petya is wondering in how many ways he can choose three distinct points so that the distanc...
instruction
0
83,701
23
167,402
Yes
output
1
83,701
23
167,403
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Little Petya likes points a lot. Recently his mom has presented him n points lying on the line OX. Now Petya is wondering in how many ways he can choose three distinct points so that the distanc...
instruction
0
83,702
23
167,404
Yes
output
1
83,702
23
167,405
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Little Petya likes points a lot. Recently his mom has presented him n points lying on the line OX. Now Petya is wondering in how many ways he can choose three distinct points so that the distanc...
instruction
0
83,703
23
167,406
Yes
output
1
83,703
23
167,407
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Little Petya likes points a lot. Recently his mom has presented him n points lying on the line OX. Now Petya is wondering in how many ways he can choose three distinct points so that the distanc...
instruction
0
83,704
23
167,408
No
output
1
83,704
23
167,409
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Little Petya likes points a lot. Recently his mom has presented him n points lying on the line OX. Now Petya is wondering in how many ways he can choose three distinct points so that the distanc...
instruction
0
83,705
23
167,410
No
output
1
83,705
23
167,411
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Little Petya likes points a lot. Recently his mom has presented him n points lying on the line OX. Now Petya is wondering in how many ways he can choose three distinct points so that the distanc...
instruction
0
83,706
23
167,412
No
output
1
83,706
23
167,413
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Little Petya likes points a lot. Recently his mom has presented him n points lying on the line OX. Now Petya is wondering in how many ways he can choose three distinct points so that the distanc...
instruction
0
83,707
23
167,414
No
output
1
83,707
23
167,415
Provide tags and a correct Python 3 solution for this coding contest problem. You are given n rectangles. The corners of rectangles have integer coordinates and their edges are parallel to the Ox and Oy axes. The rectangles may touch each other, but they do not overlap (that is, there are no points that belong to the ...
instruction
0
83,724
23
167,448
Tags: implementation Correct Solution: ``` n = int(input()) area = 0 minx = miny = 999999 maxx = maxy = 0 for _ in range(n): x1, y1, x2, y2 = list(map(int, input().split())) minx = min(minx, min(x1, x2)) miny = min(miny, min(y1, y2)) maxx = max(maxx, max(x1, x2)) maxy = max(maxy, max(y1, y2)) a ...
output
1
83,724
23
167,449
Provide tags and a correct Python 3 solution for this coding contest problem. You are given n rectangles. The corners of rectangles have integer coordinates and their edges are parallel to the Ox and Oy axes. The rectangles may touch each other, but they do not overlap (that is, there are no points that belong to the ...
instruction
0
83,725
23
167,450
Tags: implementation Correct Solution: ``` xmin, ymin, xmax, ymax, a = 31400, 31400, 0, 0, 0 for i in range(int(input())): x1, y1, x2, y2 = map(int, input().split()) xmin = min(xmin, x1) ymin = min(ymin, y1) xmax = max(xmax, x2) ymax = max(ymax, y2) a += (x2 - x1) * (y2 - y1) print('YES' if xmax...
output
1
83,725
23
167,451
Provide tags and a correct Python 3 solution for this coding contest problem. You are given n rectangles. The corners of rectangles have integer coordinates and their edges are parallel to the Ox and Oy axes. The rectangles may touch each other, but they do not overlap (that is, there are no points that belong to the ...
instruction
0
83,726
23
167,452
Tags: implementation Correct Solution: ``` n = int(input()) x1 = [] x2 = [] y1 = [] y2 = [] S = 0 for i in range(n): a, b, c, d = list(map(int, input().split())) x1.append(a) y1.append(b) x2.append(c) y2.append(d) S += (c - a) * (d - b) if (max(x2) - min(x1)) * (max(y2) - min(y1)) == S and max...
output
1
83,726
23
167,453
Provide tags and a correct Python 3 solution for this coding contest problem. You are given n rectangles. The corners of rectangles have integer coordinates and their edges are parallel to the Ox and Oy axes. The rectangles may touch each other, but they do not overlap (that is, there are no points that belong to the ...
instruction
0
83,727
23
167,454
Tags: implementation Correct Solution: ``` n = eval(input()) area = 0 p1, p2 = [], [] for i in range(n): in_ = input().split() p1.append(tuple(map(int, in_[0:2]))) p2.append(tuple(map(int, in_[2:4]))) area += (p2[i][0] - p1[i][0]) * (p2[i][1] - p1[i][1]) pl = min(p1) pu = max(p2) ok = True for p in p1 ...
output
1
83,727
23
167,455
Provide tags and a correct Python 3 solution for this coding contest problem. You are given n rectangles. The corners of rectangles have integer coordinates and their edges are parallel to the Ox and Oy axes. The rectangles may touch each other, but they do not overlap (that is, there are no points that belong to the ...
instruction
0
83,728
23
167,456
Tags: implementation Correct Solution: ``` def f(l, i): return min(l) if i < 2 else max(l) class CodeforcesTask325ASolution: def __init__(self): self.result = '' self.n = 0 self.rectangles = [] def read_input(self): self.n = int(input()) for _ in range(self.n): ...
output
1
83,728
23
167,457
Provide tags and a correct Python 3 solution for this coding contest problem. You are given n rectangles. The corners of rectangles have integer coordinates and their edges are parallel to the Ox and Oy axes. The rectangles may touch each other, but they do not overlap (that is, there are no points that belong to the ...
instruction
0
83,729
23
167,458
Tags: implementation Correct Solution: ``` n = int(input()) a1, b1, a2, b2 = map(int, input().split()) s = (a2 - a1) * (b2 - b1) for i in range(n - 1): x1, y1, x2, y2 = map(int, input().split()) a1, b1, a2, b2 = min(a1, x1), min(b1, y1), max(a2, x2), max(b2, y2) s += (x2 - x1) * (y2 - y1) print('YES' if a2 ...
output
1
83,729
23
167,459
Provide tags and a correct Python 3 solution for this coding contest problem. You are given n rectangles. The corners of rectangles have integer coordinates and their edges are parallel to the Ox and Oy axes. The rectangles may touch each other, but they do not overlap (that is, there are no points that belong to the ...
instruction
0
83,730
23
167,460
Tags: implementation Correct Solution: ``` n = int(input()) #print(n) l = [[int(x) for x in input().split()] for i in range(n)] #print(l) dx = (max([r[2] for r in l])-min([r[0] for r in l])) dy = (max([r[3] for r in l])-min([r[1] for r in l])) size = dx*dy #print(size) if dx == dy and sum([(r[2]-r[0])*(r[3]-r[1]) f...
output
1
83,730
23
167,461
Provide tags and a correct Python 3 solution for this coding contest problem. You are given n rectangles. The corners of rectangles have integer coordinates and their edges are parallel to the Ox and Oy axes. The rectangles may touch each other, but they do not overlap (that is, there are no points that belong to the ...
instruction
0
83,731
23
167,462
Tags: implementation Correct Solution: ``` x0=[]; x1=[]; y0=[]; y1=[] n=int(input()) s=0 # Variable to add rects. areas together for i in range(n): l=list(map(int,input().split())) x0.extend([l[0]]) x1.extend([l[2]]) y0.extend([l[1]]) y1.extend([l[3]]) s+=(l[3]-l[1])*(l[2]-l[0]) lx=max(x1)-min(...
output
1
83,731
23
167,463
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given n rectangles. The corners of rectangles have integer coordinates and their edges are parallel to the Ox and Oy axes. The rectangles may touch each other, but they do not overlap (t...
instruction
0
83,732
23
167,464
Yes
output
1
83,732
23
167,465
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given n rectangles. The corners of rectangles have integer coordinates and their edges are parallel to the Ox and Oy axes. The rectangles may touch each other, but they do not overlap (t...
instruction
0
83,733
23
167,466
Yes
output
1
83,733
23
167,467
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given n rectangles. The corners of rectangles have integer coordinates and their edges are parallel to the Ox and Oy axes. The rectangles may touch each other, but they do not overlap (t...
instruction
0
83,734
23
167,468
Yes
output
1
83,734
23
167,469
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given n rectangles. The corners of rectangles have integer coordinates and their edges are parallel to the Ox and Oy axes. The rectangles may touch each other, but they do not overlap (t...
instruction
0
83,735
23
167,470
Yes
output
1
83,735
23
167,471
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given n rectangles. The corners of rectangles have integer coordinates and their edges are parallel to the Ox and Oy axes. The rectangles may touch each other, but they do not overlap (t...
instruction
0
83,736
23
167,472
No
output
1
83,736
23
167,473
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given n rectangles. The corners of rectangles have integer coordinates and their edges are parallel to the Ox and Oy axes. The rectangles may touch each other, but they do not overlap (t...
instruction
0
83,737
23
167,474
No
output
1
83,737
23
167,475
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given n rectangles. The corners of rectangles have integer coordinates and their edges are parallel to the Ox and Oy axes. The rectangles may touch each other, but they do not overlap (t...
instruction
0
83,738
23
167,476
No
output
1
83,738
23
167,477
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given n rectangles. The corners of rectangles have integer coordinates and their edges are parallel to the Ox and Oy axes. The rectangles may touch each other, but they do not overlap (t...
instruction
0
83,739
23
167,478
No
output
1
83,739
23
167,479
Provide a correct Python 3 solution for this coding contest problem. A mobile phone company ACMICPC (Advanced Cellular, Mobile, and Internet-Connected Phone Corporation) is planning to set up a collection of antennas for mobile phones in a city called Maxnorm. The company ACMICPC has several collections for locations ...
instruction
0
84,151
23
168,302
"Correct Solution: ``` import sys def is_contained(a, area): rx1, ry1, rx2, ry2 = a for r in area: x1, y1, x2, y2 = r if x1 <= rx1 <= x2 and x1 <= rx2 <= x2 and \ y1 <= ry1 <= y2 and y1 <= ry2 <= y2: return True return False def add_area(a, area): if is_contained...
output
1
84,151
23
168,303
Provide a correct Python 3 solution for this coding contest problem. A mobile phone company ACMICPC (Advanced Cellular, Mobile, and Internet-Connected Phone Corporation) is planning to set up a collection of antennas for mobile phones in a city called Maxnorm. The company ACMICPC has several collections for locations ...
instruction
0
84,152
23
168,304
"Correct Solution: ``` # AOJ 1202: Mobile Phone Coverage # Python3 2018.7.28 from bisect import bisect_left cno = 0 while True: n = int(input()) if n == 0: break tbl, xx, yy = [], set(), set() for i in range(n): x, y, r = map(float, input().split()) x, y, r = int(100*x), int(100*y), int(100*r) x1, y1, x2, y2...
output
1
84,152
23
168,305
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. A mobile phone company ACMICPC (Advanced Cellular, Mobile, and Internet-Connected Phone Corporation) is planning to set up a collection of antennas for mobile phones in a city called Maxnorm. Th...
instruction
0
84,153
23
168,306
No
output
1
84,153
23
168,307
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. A mobile phone company ACMICPC (Advanced Cellular, Mobile, and Internet-Connected Phone Corporation) is planning to set up a collection of antennas for mobile phones in a city called Maxnorm. Th...
instruction
0
84,154
23
168,308
No
output
1
84,154
23
168,309
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. A mobile phone company ACMICPC (Advanced Cellular, Mobile, and Internet-Connected Phone Corporation) is planning to set up a collection of antennas for mobile phones in a city called Maxnorm. Th...
instruction
0
84,155
23
168,310
No
output
1
84,155
23
168,311
Provide a correct Python 3 solution for this coding contest problem. You are given N non-overlapping circles in xy-plane. The radius of each circle varies, but the radius of the largest circle is not double longer than that of the smallest. <image> Figure 1: The Sample Input The distance between two circles C1 and ...
instruction
0
84,169
23
168,338
"Correct Solution: ``` def _get_distance(c1, c2): return ((c1[1] - c2[1]) ** 2 + (c1[2] - c2[2]) ** 2) ** 0.5 - c1[0] - c2[0] from itertools import combinations def _get_min_distance(circles): min_d = float("inf") for c1, c2 in combinations(circles, 2): min_d = min(min_d, _get_distance(c1, c2)) ...
output
1
84,169
23
168,339
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given N non-overlapping circles in xy-plane. The radius of each circle varies, but the radius of the largest circle is not double longer than that of the smallest. <image> Figure 1: Th...
instruction
0
84,170
23
168,340
No
output
1
84,170
23
168,341
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given N non-overlapping circles in xy-plane. The radius of each circle varies, but the radius of the largest circle is not double longer than that of the smallest. <image> Figure 1: Th...
instruction
0
84,171
23
168,342
No
output
1
84,171
23
168,343
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given N non-overlapping circles in xy-plane. The radius of each circle varies, but the radius of the largest circle is not double longer than that of the smallest. <image> Figure 1: Th...
instruction
0
84,172
23
168,344
No
output
1
84,172
23
168,345
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given N non-overlapping circles in xy-plane. The radius of each circle varies, but the radius of the largest circle is not double longer than that of the smallest. <image> Figure 1: Th...
instruction
0
84,173
23
168,346
No
output
1
84,173
23
168,347
Provide tags and a correct Python 3 solution for this coding contest problem. You are given two segments [l_1; r_1] and [l_2; r_2] on the x-axis. It is guaranteed that l_1 < r_1 and l_2 < r_2. Segments may intersect, overlap or even coincide with each other. <image> The example of two segments on the x-axis. Your pr...
instruction
0
84,269
23
168,538
Tags: implementation Correct Solution: ``` n = int(input()) for _ in range(n): a, b, c, d = map(int, input().split()) first_answer = a second_answer = c while second_answer == first_answer and c <= second_answer <= d: second_answer += 1 print ('{} {}'.format(first_answer,second_answer)) ```
output
1
84,269
23
168,539
Provide tags and a correct Python 3 solution for this coding contest problem. You are given two segments [l_1; r_1] and [l_2; r_2] on the x-axis. It is guaranteed that l_1 < r_1 and l_2 < r_2. Segments may intersect, overlap or even coincide with each other. <image> The example of two segments on the x-axis. Your pr...
instruction
0
84,270
23
168,540
Tags: implementation Correct Solution: ``` import math q=eval(input()) i=1 while i<=q: x=str(input()) l1,r1,l2,r2=x.split() a=math.ceil(float(l1)) b=math.floor(float(r2)) if a==b: a=math.floor(float(r1)) print (a,b) i+=1 ```
output
1
84,270
23
168,541
Provide tags and a correct Python 3 solution for this coding contest problem. You are given two segments [l_1; r_1] and [l_2; r_2] on the x-axis. It is guaranteed that l_1 < r_1 and l_2 < r_2. Segments may intersect, overlap or even coincide with each other. <image> The example of two segments on the x-axis. Your pr...
instruction
0
84,271
23
168,542
Tags: implementation Correct Solution: ``` def inpl(): return [int(i) for i in input().split()] for _ in range(int(input())): a, _, c, d = inpl() if a != d: print(*(a, d)) else: print(*(a, c)) ```
output
1
84,271
23
168,543
Provide tags and a correct Python 3 solution for this coding contest problem. You are given two segments [l_1; r_1] and [l_2; r_2] on the x-axis. It is guaranteed that l_1 < r_1 and l_2 < r_2. Segments may intersect, overlap or even coincide with each other. <image> The example of two segments on the x-axis. Your pr...
instruction
0
84,272
23
168,544
Tags: implementation Correct Solution: ``` q = int(input()) for l in range(q): l1, r1, l2, r2 = [int(i) for i in input().split()] if l1 == l2: if l1 < r1: print(r1, ' ', l2) else: print(l1, ' ', r2) else: print(l1, ' ', l2) if __name__ == "__main__": pass ...
output
1
84,272
23
168,545
Provide tags and a correct Python 3 solution for this coding contest problem. You are given two segments [l_1; r_1] and [l_2; r_2] on the x-axis. It is guaranteed that l_1 < r_1 and l_2 < r_2. Segments may intersect, overlap or even coincide with each other. <image> The example of two segments on the x-axis. Your pr...
instruction
0
84,273
23
168,546
Tags: implementation Correct Solution: ``` q = int(input()) for _ in range(q): a, b, c, d = map(int, input().split()) if a != c: print(a, c) elif b != d: print(b, d) else: print(a, d) ```
output
1
84,273
23
168,547
Provide tags and a correct Python 3 solution for this coding contest problem. You are given two segments [l_1; r_1] and [l_2; r_2] on the x-axis. It is guaranteed that l_1 < r_1 and l_2 < r_2. Segments may intersect, overlap or even coincide with each other. <image> The example of two segments on the x-axis. Your pr...
instruction
0
84,274
23
168,548
Tags: implementation Correct Solution: ``` import random n=int(input()) for i in range(0,n): a=list(map(int,str(input()).split())) p=random.randint(a[0],a[1]) q=random.randint(a[2],a[3]) while(p==q and a[0]!=a[1] and a[3]!=a[2]): q=random.randint(a[2],a[3]) print(p,q) ```
output
1
84,274
23
168,549
Provide tags and a correct Python 3 solution for this coding contest problem. You are given two segments [l_1; r_1] and [l_2; r_2] on the x-axis. It is guaranteed that l_1 < r_1 and l_2 < r_2. Segments may intersect, overlap or even coincide with each other. <image> The example of two segments on the x-axis. Your pr...
instruction
0
84,275
23
168,550
Tags: implementation Correct Solution: ``` q=lambda:map(int,input().split()) qi=lambda:int(input()) qs=lambda:input().split() for _ in [0]*qi(): l1,r1,l2,r2=q() print(*(l1,l2) if l1!=l2 else (l1,l2+1)) ```
output
1
84,275
23
168,551
Provide tags and a correct Python 3 solution for this coding contest problem. You are given two segments [l_1; r_1] and [l_2; r_2] on the x-axis. It is guaranteed that l_1 < r_1 and l_2 < r_2. Segments may intersect, overlap or even coincide with each other. <image> The example of two segments on the x-axis. Your pr...
instruction
0
84,276
23
168,552
Tags: implementation Correct Solution: ``` q = int(input()) for _ in range(q): l1,r1,l2,r2 = map(int, input().split()) if l1 != l2: print(l1, l2) else: print(r1, l2) ```
output
1
84,276
23
168,553
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given two segments [l_1; r_1] and [l_2; r_2] on the x-axis. It is guaranteed that l_1 < r_1 and l_2 < r_2. Segments may intersect, overlap or even coincide with each other. <image> The ...
instruction
0
84,277
23
168,554
Yes
output
1
84,277
23
168,555
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given two segments [l_1; r_1] and [l_2; r_2] on the x-axis. It is guaranteed that l_1 < r_1 and l_2 < r_2. Segments may intersect, overlap or even coincide with each other. <image> The ...
instruction
0
84,278
23
168,556
Yes
output
1
84,278
23
168,557
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given two segments [l_1; r_1] and [l_2; r_2] on the x-axis. It is guaranteed that l_1 < r_1 and l_2 < r_2. Segments may intersect, overlap or even coincide with each other. <image> The ...
instruction
0
84,279
23
168,558
Yes
output
1
84,279
23
168,559
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given two segments [l_1; r_1] and [l_2; r_2] on the x-axis. It is guaranteed that l_1 < r_1 and l_2 < r_2. Segments may intersect, overlap or even coincide with each other. <image> The ...
instruction
0
84,280
23
168,560
Yes
output
1
84,280
23
168,561
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given two segments [l_1; r_1] and [l_2; r_2] on the x-axis. It is guaranteed that l_1 < r_1 and l_2 < r_2. Segments may intersect, overlap or even coincide with each other. <image> The ...
instruction
0
84,281
23
168,562
No
output
1
84,281
23
168,563
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given two segments [l_1; r_1] and [l_2; r_2] on the x-axis. It is guaranteed that l_1 < r_1 and l_2 < r_2. Segments may intersect, overlap or even coincide with each other. <image> The ...
instruction
0
84,282
23
168,564
No
output
1
84,282
23
168,565