Dataset Viewer
Auto-converted to Parquet Duplicate
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
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
276
23
552
Tags: binary search, combinatorics, two pointers Correct Solution: ``` from sys import * from math import * n,k=map(int,stdin.readline().split()) a=list(map(int,stdin.readline().split())) ans=0 for i in range(n-2): x=a[i]+k l=i+2 h=n-1 j=0 f=0 while l<=h: m=(l+h)//2 if a[m]>x: ...
output
1
276
23
553
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
279
23
558
Yes
output
1
279
23
559
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
280
23
560
Yes
output
1
280
23
561
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
281
23
562
Yes
output
1
281
23
563
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
282
23
564
No
output
1
282
23
565
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
283
23
566
No
output
1
283
23
567
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
284
23
568
No
output
1
284
23
569
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
285
23
570
No
output
1
285
23
571
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Alexandra has a paper strip with n numbers on it. Let's call them ai from left to right. Now Alexandra wants to split it into some pieces (possibly 1). For each piece of strip, it must satisfy:...
instruction
0
378
23
756
No
output
1
378
23
757
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Alexandra has a paper strip with n numbers on it. Let's call them ai from left to right. Now Alexandra wants to split it into some pieces (possibly 1). For each piece of strip, it must satisfy:...
instruction
0
379
23
758
No
output
1
379
23
759
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Snuke received a triangle as a birthday present. The coordinates of the three vertices were (x_1, y_1), (x_2, y_2), and (x_3, y_3). He wants to draw two circles with the same radius inside the ...
instruction
0
663
23
1,326
Yes
output
1
663
23
1,327
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Snuke received a triangle as a birthday present. The coordinates of the three vertices were (x_1, y_1), (x_2, y_2), and (x_3, y_3). He wants to draw two circles with the same radius inside the ...
instruction
0
664
23
1,328
Yes
output
1
664
23
1,329
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Snuke received a triangle as a birthday present. The coordinates of the three vertices were (x_1, y_1), (x_2, y_2), and (x_3, y_3). He wants to draw two circles with the same radius inside the ...
instruction
0
666
23
1,332
Yes
output
1
666
23
1,333
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Snuke received a triangle as a birthday present. The coordinates of the three vertices were (x_1, y_1), (x_2, y_2), and (x_3, y_3). He wants to draw two circles with the same radius inside the ...
instruction
0
667
23
1,334
No
output
1
667
23
1,335
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Snuke received a triangle as a birthday present. The coordinates of the three vertices were (x_1, y_1), (x_2, y_2), and (x_3, y_3). He wants to draw two circles with the same radius inside the ...
instruction
0
668
23
1,336
No
output
1
668
23
1,337
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Snuke received a triangle as a birthday present. The coordinates of the three vertices were (x_1, y_1), (x_2, y_2), and (x_3, y_3). He wants to draw two circles with the same radius inside the ...
instruction
0
669
23
1,338
No
output
1
669
23
1,339
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Snuke received a triangle as a birthday present. The coordinates of the three vertices were (x_1, y_1), (x_2, y_2), and (x_3, y_3). He wants to draw two circles with the same radius inside the ...
instruction
0
670
23
1,340
No
output
1
670
23
1,341
Provide tags and a correct Python 3 solution for this coding contest problem. You have a given integer n. Find the number of ways to fill all 3 × n tiles with the shape described in the picture below. Upon filling, no empty spaces are allowed. Shapes cannot overlap. <image> This picture describes when n = 4. The left...
instruction
0
885
23
1,770
Tags: dp, math Correct Solution: ``` n = int(input()) if n%2==0: if n%4==0: print(4**(n//4)) else: print((4**(n//4))*2) else: print(0) ```
output
1
885
23
1,771
Provide tags and a correct Python 3 solution for this coding contest problem. You have a given integer n. Find the number of ways to fill all 3 × n tiles with the shape described in the picture below. Upon filling, no empty spaces are allowed. Shapes cannot overlap. <image> This picture describes when n = 4. The left...
instruction
0
886
23
1,772
Tags: dp, math Correct Solution: ``` n = eval(input()) if n % 2 != 0: print(0) else: print(int(2**(n/2))) ```
output
1
886
23
1,773
Provide tags and a correct Python 3 solution for this coding contest problem. You have a given integer n. Find the number of ways to fill all 3 × n tiles with the shape described in the picture below. Upon filling, no empty spaces are allowed. Shapes cannot overlap. <image> This picture describes when n = 4. The left...
instruction
0
887
23
1,774
Tags: dp, math Correct Solution: ``` n = int(input()) print( ( 1 << ( n // 2 ) if n & 1 == 0 else 0 )) ```
output
1
887
23
1,775
Provide tags and a correct Python 3 solution for this coding contest problem. You have a given integer n. Find the number of ways to fill all 3 × n tiles with the shape described in the picture below. Upon filling, no empty spaces are allowed. Shapes cannot overlap. <image> This picture describes when n = 4. The left...
instruction
0
888
23
1,776
Tags: dp, math Correct Solution: ``` n = int(input()) if n % 2 == 1: print(0) else: print((int(2 ** (n/2)))) ```
output
1
888
23
1,777
Provide tags and a correct Python 3 solution for this coding contest problem. You have a given integer n. Find the number of ways to fill all 3 × n tiles with the shape described in the picture below. Upon filling, no empty spaces are allowed. Shapes cannot overlap. <image> This picture describes when n = 4. The left...
instruction
0
889
23
1,778
Tags: dp, math Correct Solution: ``` t = int(input()) if t%2==0: print(2**(t//2)) else: print(0) ```
output
1
889
23
1,779
Provide tags and a correct Python 3 solution for this coding contest problem. You have a given integer n. Find the number of ways to fill all 3 × n tiles with the shape described in the picture below. Upon filling, no empty spaces are allowed. Shapes cannot overlap. <image> This picture describes when n = 4. The left...
instruction
0
890
23
1,780
Tags: dp, math Correct Solution: ``` n=int(input()) if n&1==1: print(0) else: print(int(pow(2,n/2))) ```
output
1
890
23
1,781
Provide tags and a correct Python 3 solution for this coding contest problem. You have a given integer n. Find the number of ways to fill all 3 × n tiles with the shape described in the picture below. Upon filling, no empty spaces are allowed. Shapes cannot overlap. <image> This picture describes when n = 4. The left...
instruction
0
891
23
1,782
Tags: dp, math Correct Solution: ``` dim = int(input()) print(2 ** (dim // 2) if dim % 2 == 0 else 0) ```
output
1
891
23
1,783
Provide tags and a correct Python 3 solution for this coding contest problem. You have a given integer n. Find the number of ways to fill all 3 × n tiles with the shape described in the picture below. Upon filling, no empty spaces are allowed. Shapes cannot overlap. <image> This picture describes when n = 4. The left...
instruction
0
892
23
1,784
Tags: dp, math Correct Solution: ``` n = int(input()) if n % 2 == 0: print(round(2**(n / 2))) else: print(0) ```
output
1
892
23
1,785
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You have a given integer n. Find the number of ways to fill all 3 × n tiles with the shape described in the picture below. Upon filling, no empty spaces are allowed. Shapes cannot overlap. <ima...
instruction
0
893
23
1,786
Yes
output
1
893
23
1,787
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You have a given integer n. Find the number of ways to fill all 3 × n tiles with the shape described in the picture below. Upon filling, no empty spaces are allowed. Shapes cannot overlap. <ima...
instruction
0
894
23
1,788
Yes
output
1
894
23
1,789
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You have a given integer n. Find the number of ways to fill all 3 × n tiles with the shape described in the picture below. Upon filling, no empty spaces are allowed. Shapes cannot overlap. <ima...
instruction
0
895
23
1,790
Yes
output
1
895
23
1,791
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You have a given integer n. Find the number of ways to fill all 3 × n tiles with the shape described in the picture below. Upon filling, no empty spaces are allowed. Shapes cannot overlap. <ima...
instruction
0
896
23
1,792
Yes
output
1
896
23
1,793
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You have a given integer n. Find the number of ways to fill all 3 × n tiles with the shape described in the picture below. Upon filling, no empty spaces are allowed. Shapes cannot overlap. <ima...
instruction
0
897
23
1,794
No
output
1
897
23
1,795
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You have a given integer n. Find the number of ways to fill all 3 × n tiles with the shape described in the picture below. Upon filling, no empty spaces are allowed. Shapes cannot overlap. <ima...
instruction
0
898
23
1,796
No
output
1
898
23
1,797
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You have a given integer n. Find the number of ways to fill all 3 × n tiles with the shape described in the picture below. Upon filling, no empty spaces are allowed. Shapes cannot overlap. <ima...
instruction
0
899
23
1,798
No
output
1
899
23
1,799
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You have a given integer n. Find the number of ways to fill all 3 × n tiles with the shape described in the picture below. Upon filling, no empty spaces are allowed. Shapes cannot overlap. <ima...
instruction
0
900
23
1,800
No
output
1
900
23
1,801
Provide tags and a correct Python 3 solution for this coding contest problem. Bob has a rectangular chocolate bar of the size W × H. He introduced a cartesian coordinate system so that the point (0, 0) corresponds to the lower-left corner of the bar, and the point (W, H) corresponds to the upper-right corner. Bob deci...
instruction
0
1,157
23
2,314
Tags: dfs and similar, implementation Correct Solution: ``` w,h,n=list(map(int,input().split())) a=[[0 for i in range(2*w-1)] for j in range(2*h-1)] for i in range(1,2*h-1,2): for j in range(1,2*w-1,2): a[i][j]=' ' for i in range(n): x1,y1,x2,y2=list(map(int,input().split())) if x1==x2: if x...
output
1
1,157
23
2,315
Provide tags and a correct Python 3 solution for this coding contest problem. Bob has a rectangular chocolate bar of the size W × H. He introduced a cartesian coordinate system so that the point (0, 0) corresponds to the lower-left corner of the bar, and the point (W, H) corresponds to the upper-right corner. Bob deci...
instruction
0
1,158
23
2,316
Tags: dfs and similar, implementation Correct Solution: ``` w, h, n = map(int, input().split(' ')) hblock = [[False for i in range(w)] for i in range(h)] vblock = [[False for i in range(w)] for i in range(h)] for i in range(n): x1, y1, x2, y2 = map(int, input().split(' ')) if x1 == x2: for j in range(y...
output
1
1,158
23
2,317
Provide tags and a correct Python 3 solution for this coding contest problem. Bob has a rectangular chocolate bar of the size W × H. He introduced a cartesian coordinate system so that the point (0, 0) corresponds to the lower-left corner of the bar, and the point (W, H) corresponds to the upper-right corner. Bob deci...
instruction
0
1,159
23
2,318
Tags: dfs and similar, implementation Correct Solution: ``` import sys from array import array # noqa: F401 def input(): return sys.stdin.buffer.readline().decode('utf-8') w, h, n = map(int, input().split()) mat = [[0] * (2 * w) for _ in range(2 * h)] for x1, y1, x2, y2 in (map(int, input().split()) for _ in ...
output
1
1,159
23
2,319
Provide tags and a correct Python 3 solution for this coding contest problem. Bob has a rectangular chocolate bar of the size W × H. He introduced a cartesian coordinate system so that the point (0, 0) corresponds to the lower-left corner of the bar, and the point (W, H) corresponds to the upper-right corner. Bob deci...
instruction
0
1,160
23
2,320
Tags: dfs and similar, implementation Correct Solution: ``` WHn = [[0,0]] # WHn[0].extend(list(map(int, input().split(' ')))) WHn[0].extend([int(x) for x in input().split(' ')]) n = range(WHn[0][-1]) lines = [] lines_aux = [] for i in n: lines.append( [int(x) for x in input().split(' ')] ) lines_aux.append(Tr...
output
1
1,160
23
2,321
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Bob has a rectangular chocolate bar of the size W × H. He introduced a cartesian coordinate system so that the point (0, 0) corresponds to the lower-left corner of the bar, and the point (W, H) ...
instruction
0
1,161
23
2,322
No
output
1
1,161
23
2,323
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Bob has a rectangular chocolate bar of the size W × H. He introduced a cartesian coordinate system so that the point (0, 0) corresponds to the lower-left corner of the bar, and the point (W, H) ...
instruction
0
1,162
23
2,324
No
output
1
1,162
23
2,325
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Bob has a rectangular chocolate bar of the size W × H. He introduced a cartesian coordinate system so that the point (0, 0) corresponds to the lower-left corner of the bar, and the point (W, H) ...
instruction
0
1,163
23
2,326
No
output
1
1,163
23
2,327
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Roland loves growing flowers. He has recently grown a beautiful rose at point (0, 0) of the Cartesian coordinate system. The rose is so beautiful that Roland is afraid that the evil forces can t...
instruction
0
1,244
23
2,488
No
output
1
1,244
23
2,489
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Roland loves growing flowers. He has recently grown a beautiful rose at point (0, 0) of the Cartesian coordinate system. The rose is so beautiful that Roland is afraid that the evil forces can t...
instruction
0
1,245
23
2,490
No
output
1
1,245
23
2,491
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Roland loves growing flowers. He has recently grown a beautiful rose at point (0, 0) of the Cartesian coordinate system. The rose is so beautiful that Roland is afraid that the evil forces can t...
instruction
0
1,246
23
2,492
No
output
1
1,246
23
2,493
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Roland loves growing flowers. He has recently grown a beautiful rose at point (0, 0) of the Cartesian coordinate system. The rose is so beautiful that Roland is afraid that the evil forces can t...
instruction
0
1,247
23
2,494
No
output
1
1,247
23
2,495
Provide tags and a correct Python 3 solution for this coding contest problem. You are given n segments on a Cartesian plane. Each segment's endpoints have integer coordinates. Segments can intersect with each other. No two segments lie on the same line. Count the number of distinct points with integer coordinates, wh...
instruction
0
1,656
23
3,312
Tags: fft, geometry, number theory Correct Solution: ``` """ 1036E : Covered Points Borrows primarily from : https://stackoverflow.com/questions/563198/how-do-you-detect-where-two-line-segments-intersect """ def gcd(a, b): return a if b == 0 else gcd(b, a % b) def cross(x1, y1, x2, y2): return x1 * y2 - x2...
output
1
1,656
23
3,313
Provide tags and a correct Python 3 solution for this coding contest problem. You are given n segments on a Cartesian plane. Each segment's endpoints have integer coordinates. Segments can intersect with each other. No two segments lie on the same line. Count the number of distinct points with integer coordinates, wh...
instruction
0
1,657
23
3,314
Tags: fft, geometry, number theory Correct Solution: ``` import sys from array import array # noqa: F401 def input(): return sys.stdin.buffer.readline().decode('utf-8') class Point(object): COUNTER_CLOCKWISE = 1 CLOCKWISE = -1 ONLINE_BACK = 2 ONLINE_FRONT = -2 ON_SEGMENT = 0 def __init...
output
1
1,657
23
3,315
Provide tags and a correct Python 3 solution for this coding contest problem. You are given n segments on a Cartesian plane. Each segment's endpoints have integer coordinates. Segments can intersect with each other. No two segments lie on the same line. Count the number of distinct points with integer coordinates, wh...
instruction
0
1,658
23
3,316
Tags: fft, geometry, number theory Correct Solution: ``` import math def intersectSeg( pt1, pt2, ptA, ptB, interge=False): """ this returns the intersection of two segment (pt1,pt2) and (ptA,ptB) returns a tuple: (xi, yi, valid, r, s), where (xi, yi) is the intersection r is t...
output
1
1,658
23
3,317
Provide tags and a correct Python 3 solution for this coding contest problem. You are given n segments on a Cartesian plane. Each segment's endpoints have integer coordinates. Segments can intersect with each other. No two segments lie on the same line. Count the number of distinct points with integer coordinates, wh...
instruction
0
1,659
23
3,318
Tags: fft, geometry, number theory Correct Solution: ``` ''' Welcome to GDB Online. GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl, C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog. Code, Compile, Run and Debug online from anywh...
output
1
1,659
23
3,319
Provide tags and a correct Python 3 solution for this coding contest problem. You are given n segments on a Cartesian plane. Each segment's endpoints have integer coordinates. Segments can intersect with each other. No two segments lie on the same line. Count the number of distinct points with integer coordinates, wh...
instruction
0
1,660
23
3,320
Tags: fft, geometry, number theory Correct Solution: ``` # import sys def getIntList(): return list(map(int, input().split())) N, = getIntList() zp = [] for i in range(N): ax, ay, bx, by = getIntList() if ax>bx: ax,bx = bx,ax ay,by = by, ay zp.append( (ax,ay, bx,b...
output
1
1,660
23
3,321
Provide tags and a correct Python 3 solution for this coding contest problem. You are given n segments on a Cartesian plane. Each segment's endpoints have integer coordinates. Segments can intersect with each other. No two segments lie on the same line. Count the number of distinct points with integer coordinates, wh...
instruction
0
1,661
23
3,322
Tags: fft, geometry, number theory Correct Solution: ``` # -*- coding: utf-8 -*- """ Created on Tue Sep 18 10:09:57 2018 @author: a.teffal Chalenge : Covered Points """ from math import gcd def covered_points(xa, ya, xb, yb): ''' assumes all parameters are integers Returns the covered points by the se...
output
1
1,661
23
3,323
End of preview. Expand in Data Studio

Dataset Card for "python3-standardized_cluster_23_std"

More Information needed

Downloads last month
6