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. While playing with geometric figures Alex has accidentally invented a concept of a n-th order rhombus in a cell grid. A 1-st order rhombus is just a square 1 × 1 (i.e just a cell). A n-th orde...
instruction
0
98,686
23
197,372
Yes
output
1
98,686
23
197,373
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. While playing with geometric figures Alex has accidentally invented a concept of a n-th order rhombus in a cell grid. A 1-st order rhombus is just a square 1 × 1 (i.e just a cell). A n-th orde...
instruction
0
98,687
23
197,374
Yes
output
1
98,687
23
197,375
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. While playing with geometric figures Alex has accidentally invented a concept of a n-th order rhombus in a cell grid. A 1-st order rhombus is just a square 1 × 1 (i.e just a cell). A n-th orde...
instruction
0
98,688
23
197,376
Yes
output
1
98,688
23
197,377
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. While playing with geometric figures Alex has accidentally invented a concept of a n-th order rhombus in a cell grid. A 1-st order rhombus is just a square 1 × 1 (i.e just a cell). A n-th orde...
instruction
0
98,689
23
197,378
No
output
1
98,689
23
197,379
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. While playing with geometric figures Alex has accidentally invented a concept of a n-th order rhombus in a cell grid. A 1-st order rhombus is just a square 1 × 1 (i.e just a cell). A n-th orde...
instruction
0
98,690
23
197,380
No
output
1
98,690
23
197,381
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. While playing with geometric figures Alex has accidentally invented a concept of a n-th order rhombus in a cell grid. A 1-st order rhombus is just a square 1 × 1 (i.e just a cell). A n-th orde...
instruction
0
98,691
23
197,382
No
output
1
98,691
23
197,383
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. While playing with geometric figures Alex has accidentally invented a concept of a n-th order rhombus in a cell grid. A 1-st order rhombus is just a square 1 × 1 (i.e just a cell). A n-th orde...
instruction
0
98,692
23
197,384
No
output
1
98,692
23
197,385
Provide tags and a correct Python 3 solution for this coding contest problem. Several months later Alex finally got his brother Bob's creation by post. And now, in his turn, Alex wants to boast about something to his brother. He thought for a while, and came to the conclusion that he has no ready creations, and decide...
instruction
0
98,848
23
197,696
Tags: brute force, constructive algorithms, geometry, implementation, math Correct Solution: ``` from collections import Counter puntos = Counter() segmentos = Counter() for _ in range(4): px, py, qx, qy = list(map(int, input().split())) p = (px, py) q = (qx, qy) puntos[p] += 1 puntos[q] += 1 i...
output
1
98,848
23
197,697
Provide tags and a correct Python 3 solution for this coding contest problem. Several months later Alex finally got his brother Bob's creation by post. And now, in his turn, Alex wants to boast about something to his brother. He thought for a while, and came to the conclusion that he has no ready creations, and decide...
instruction
0
98,849
23
197,698
Tags: brute force, constructive algorithms, geometry, implementation, math Correct Solution: ``` def main(): line_1 = input().strip().split() line_1 = list(map(int, line_1)) line_2 = input().strip().split() line_2 = list(map(int, line_2)) line_3 = input().strip().split() line_3 = list(map(int, line_3)) ...
output
1
98,849
23
197,699
Provide tags and a correct Python 3 solution for this coding contest problem. Several months later Alex finally got his brother Bob's creation by post. And now, in his turn, Alex wants to boast about something to his brother. He thought for a while, and came to the conclusion that he has no ready creations, and decide...
instruction
0
98,850
23
197,700
Tags: brute force, constructive algorithms, geometry, implementation, math Correct Solution: ``` def main(): line_1 = input().strip().split() line_1 = list(map(int, line_1)) line_2 = input().strip().split() line_2 = list(map(int, line_2)) line_3 = input().strip().split() line_3 = list(map(int, line_3)) ...
output
1
98,850
23
197,701
Provide tags and a correct Python 3 solution for this coding contest problem. Several months later Alex finally got his brother Bob's creation by post. And now, in his turn, Alex wants to boast about something to his brother. He thought for a while, and came to the conclusion that he has no ready creations, and decide...
instruction
0
98,851
23
197,702
Tags: brute force, constructive algorithms, geometry, implementation, math Correct Solution: ``` # Try to do in 30 minutes # 4 segments are given def read_points(): hSegs = [] vSegs = [] for i in range(4): rawline = input().split() line = {"p1":[int(rawline[0]),int(rawline[1])],"p2":[int(r...
output
1
98,851
23
197,703
Provide tags and a correct Python 3 solution for this coding contest problem. Several months later Alex finally got his brother Bob's creation by post. And now, in his turn, Alex wants to boast about something to his brother. He thought for a while, and came to the conclusion that he has no ready creations, and decide...
instruction
0
98,852
23
197,704
Tags: brute force, constructive algorithms, geometry, implementation, math Correct Solution: ``` def is_rect(es): v = set([]) for e in es: if not ((e[0] == e[2]) or (e[1] == e[3])): return False v.add((e[0], e[1])) v.add((e[2], e[3])) if len(v) != 4: return Fal...
output
1
98,852
23
197,705
Provide tags and a correct Python 3 solution for this coding contest problem. Several months later Alex finally got his brother Bob's creation by post. And now, in his turn, Alex wants to boast about something to his brother. He thought for a while, and came to the conclusion that he has no ready creations, and decide...
instruction
0
98,853
23
197,706
Tags: brute force, constructive algorithms, geometry, implementation, math Correct Solution: ``` def is_rect(): def seg(): [x0, y0, x1, y1] = input().split(' ') return int(x0), int(y0), int(x1), int(y1) def parallel(x0, x1, y0, y1, x2, x3, y2, y3): return y0 == y1 and y2 == y3 and y0 !...
output
1
98,853
23
197,707
Provide tags and a correct Python 3 solution for this coding contest problem. Several months later Alex finally got his brother Bob's creation by post. And now, in his turn, Alex wants to boast about something to his brother. He thought for a while, and came to the conclusion that he has no ready creations, and decide...
instruction
0
98,854
23
197,708
Tags: brute force, constructive algorithms, geometry, implementation, math Correct Solution: ``` accepted = True lines = [] dic = {} for i in range(4): line = list(map(int,input().split(" "))) if line[0] == line[2] and line[1] == line[3]: accepted = False lines.append(((line[0], line[1]),(line[2],line[3]))) if not ...
output
1
98,854
23
197,709
Provide tags and a correct Python 3 solution for this coding contest problem. Several months later Alex finally got his brother Bob's creation by post. And now, in his turn, Alex wants to boast about something to his brother. He thought for a while, and came to the conclusion that he has no ready creations, and decide...
instruction
0
98,855
23
197,710
Tags: brute force, constructive algorithms, geometry, implementation, math Correct Solution: ``` liste=[] i=0 i2=0 distance=[] answer='YES' for _ in range(4): x1,y1,x2,y2=map(int,input().split(" ")) liste.append([(x1,y1),(x2,y2)]) def perpendiculaire(vect1,vect2): return vect1[0]*vect2[0]+vect1[1]*vect2[...
output
1
98,855
23
197,711
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Several months later Alex finally got his brother Bob's creation by post. And now, in his turn, Alex wants to boast about something to his brother. He thought for a while, and came to the conclu...
instruction
0
98,856
23
197,712
Yes
output
1
98,856
23
197,713
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Several months later Alex finally got his brother Bob's creation by post. And now, in his turn, Alex wants to boast about something to his brother. He thought for a while, and came to the conclu...
instruction
0
98,857
23
197,714
Yes
output
1
98,857
23
197,715
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Several months later Alex finally got his brother Bob's creation by post. And now, in his turn, Alex wants to boast about something to his brother. He thought for a while, and came to the conclu...
instruction
0
98,858
23
197,716
Yes
output
1
98,858
23
197,717
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Several months later Alex finally got his brother Bob's creation by post. And now, in his turn, Alex wants to boast about something to his brother. He thought for a while, and came to the conclu...
instruction
0
98,859
23
197,718
Yes
output
1
98,859
23
197,719
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Several months later Alex finally got his brother Bob's creation by post. And now, in his turn, Alex wants to boast about something to his brother. He thought for a while, and came to the conclu...
instruction
0
98,860
23
197,720
No
output
1
98,860
23
197,721
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Several months later Alex finally got his brother Bob's creation by post. And now, in his turn, Alex wants to boast about something to his brother. He thought for a while, and came to the conclu...
instruction
0
98,861
23
197,722
No
output
1
98,861
23
197,723
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Several months later Alex finally got his brother Bob's creation by post. And now, in his turn, Alex wants to boast about something to his brother. He thought for a while, and came to the conclu...
instruction
0
98,862
23
197,724
No
output
1
98,862
23
197,725
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Several months later Alex finally got his brother Bob's creation by post. And now, in his turn, Alex wants to boast about something to his brother. He thought for a while, and came to the conclu...
instruction
0
98,863
23
197,726
No
output
1
98,863
23
197,727
Provide tags and a correct Python 3 solution for this coding contest problem. Input The first line contains a single integer n (1 ≤ n ≤ 1000) — the number of points on a plane. Each of the next n lines contains two real coordinates xi and yi of the <image> point, specified with exactly 2 fractional digits. All coo...
instruction
0
98,990
23
197,980
Tags: *special, geometry Correct Solution: ``` a = int(input()) s = 0 for i in range(a): s += float(input().split()[1]) d = round(s / a, 3) + 5 l = len(str(d).split(".")[1]) if l < 3: print(str(d) + "0" * (3 - l)) else: print(d) ```
output
1
98,990
23
197,981
Provide tags and a correct Python 3 solution for this coding contest problem. Input The first line contains a single integer n (1 ≤ n ≤ 1000) — the number of points on a plane. Each of the next n lines contains two real coordinates xi and yi of the <image> point, specified with exactly 2 fractional digits. All coo...
instruction
0
98,991
23
197,982
Tags: *special, geometry Correct Solution: ``` n = int(input()) P = [[float(x) for x in input().split()] for _ in range(n)] print(5 + sum(b for a,b in P)/n) ```
output
1
98,991
23
197,983
Provide tags and a correct Python 3 solution for this coding contest problem. Input The first line contains a single integer n (1 ≤ n ≤ 1000) — the number of points on a plane. Each of the next n lines contains two real coordinates xi and yi of the <image> point, specified with exactly 2 fractional digits. All coo...
instruction
0
98,992
23
197,984
Tags: *special, geometry Correct Solution: ``` import sys def solve(): n = int(input()) avg = sum([list(map(float, input().split()))[1] for _ in range(n)])/n return avg + 5 if sys.hexversion == 50594544 : sys.stdin = open("test.txt") print(solve()) ```
output
1
98,992
23
197,985
Provide tags and a correct Python 3 solution for this coding contest problem. Input The first line contains a single integer n (1 ≤ n ≤ 1000) — the number of points on a plane. Each of the next n lines contains two real coordinates xi and yi of the <image> point, specified with exactly 2 fractional digits. All coo...
instruction
0
98,993
23
197,986
Tags: *special, geometry Correct Solution: ``` n = int(input()) sum = 0 for _ in range(n): sum += [float(i) for i in input().split(" ")][1] print(5 + sum/n) ```
output
1
98,993
23
197,987
Provide tags and a correct Python 3 solution for this coding contest problem. Input The first line contains a single integer n (1 ≤ n ≤ 1000) — the number of points on a plane. Each of the next n lines contains two real coordinates xi and yi of the <image> point, specified with exactly 2 fractional digits. All coo...
instruction
0
98,994
23
197,988
Tags: *special, geometry Correct Solution: ``` n=int(input()) sum=0.00 for i in range(1,n+1): s=input().split() sum+=float(s[1]) print(sum/n+5) ```
output
1
98,994
23
197,989
Provide tags and a correct Python 3 solution for this coding contest problem. Input The first line contains a single integer n (1 ≤ n ≤ 1000) — the number of points on a plane. Each of the next n lines contains two real coordinates xi and yi of the <image> point, specified with exactly 2 fractional digits. All coo...
instruction
0
98,995
23
197,990
Tags: *special, geometry Correct Solution: ``` n = int(input()) s = 0.0 for i in range(0, n): data = input().split() x, y = float(data[0]), float(data[1]) s += y print("%.3f" % (5 + s/n)) ```
output
1
98,995
23
197,991
Provide tags and a correct Python 3 solution for this coding contest problem. Input The first line contains a single integer n (1 ≤ n ≤ 1000) — the number of points on a plane. Each of the next n lines contains two real coordinates xi and yi of the <image> point, specified with exactly 2 fractional digits. All coo...
instruction
0
98,996
23
197,992
Tags: *special, geometry Correct Solution: ``` a=int(input());print(sum([float(input().split(' ')[1]) for i in range(a)])/a+5) ```
output
1
98,996
23
197,993
Provide tags and a correct Python 3 solution for this coding contest problem. Input The first line contains a single integer n (1 ≤ n ≤ 1000) — the number of points on a plane. Each of the next n lines contains two real coordinates xi and yi of the <image> point, specified with exactly 2 fractional digits. All coo...
instruction
0
98,997
23
197,994
Tags: *special, geometry Correct Solution: ``` n = int(input()) theta = 5.0 for i in range(n): theta += list(map(float, input().split()))[1] / n print('%.3f' % theta) ```
output
1
98,997
23
197,995
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Input The first line contains a single integer n (1 ≤ n ≤ 1000) — the number of points on a plane. Each of the next n lines contains two real coordinates xi and yi of the <image> point, spec...
instruction
0
98,998
23
197,996
Yes
output
1
98,998
23
197,997
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Input The first line contains a single integer n (1 ≤ n ≤ 1000) — the number of points on a plane. Each of the next n lines contains two real coordinates xi and yi of the <image> point, spec...
instruction
0
98,999
23
197,998
Yes
output
1
98,999
23
197,999
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Input The first line contains a single integer n (1 ≤ n ≤ 1000) — the number of points on a plane. Each of the next n lines contains two real coordinates xi and yi of the <image> point, spec...
instruction
0
99,000
23
198,000
Yes
output
1
99,000
23
198,001
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Input The first line contains a single integer n (1 ≤ n ≤ 1000) — the number of points on a plane. Each of the next n lines contains two real coordinates xi and yi of the <image> point, spec...
instruction
0
99,001
23
198,002
Yes
output
1
99,001
23
198,003
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Input The first line contains a single integer n (1 ≤ n ≤ 1000) — the number of points on a plane. Each of the next n lines contains two real coordinates xi and yi of the <image> point, spec...
instruction
0
99,002
23
198,004
No
output
1
99,002
23
198,005
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Input The first line contains a single integer n (1 ≤ n ≤ 1000) — the number of points on a plane. Each of the next n lines contains two real coordinates xi and yi of the <image> point, spec...
instruction
0
99,003
23
198,006
No
output
1
99,003
23
198,007
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Input The first line contains a single integer n (1 ≤ n ≤ 1000) — the number of points on a plane. Each of the next n lines contains two real coordinates xi and yi of the <image> point, spec...
instruction
0
99,004
23
198,008
No
output
1
99,004
23
198,009
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Input The first line contains a single integer n (1 ≤ n ≤ 1000) — the number of points on a plane. Each of the next n lines contains two real coordinates xi and yi of the <image> point, spec...
instruction
0
99,005
23
198,010
No
output
1
99,005
23
198,011
Provide tags and a correct Python 3 solution for this coding contest problem. You are given a n × m field consisting only of periods ('.') and asterisks ('*'). Your task is to count all right triangles with two sides parallel to the square sides, whose vertices are in the centers of '*'-cells. A right triangle is a tr...
instruction
0
99,038
23
198,076
Tags: combinatorics Correct Solution: ``` u=input n,m=map(int,u().split()) l=[list(u()) for _ in range(n)] R=[p.count('*') for p in l] C=[p.count('*') for p in zip(*l)] t=0 for i in range(n): for j in range(m): if(l[i][j]=='*'): t+=(R[i]-1)*(C[j]-1) print(t) ```
output
1
99,038
23
198,077
Provide tags and a correct Python 3 solution for this coding contest problem. You are given a n × m field consisting only of periods ('.') and asterisks ('*'). Your task is to count all right triangles with two sides parallel to the square sides, whose vertices are in the centers of '*'-cells. A right triangle is a tr...
instruction
0
99,039
23
198,078
Tags: combinatorics Correct Solution: ``` n,m = map(int,input().split()) ma = [] for i in range(n): ma.append(input()) x = [0] * n y = [0] * m for i in range(n): for j in range(m): if ma[i][j] == "*": x[i] += 1 y[j] += 1 ans = 0 for i in range(n): for j in range(m): ...
output
1
99,039
23
198,079
Provide tags and a correct Python 3 solution for this coding contest problem. You are given a n × m field consisting only of periods ('.') and asterisks ('*'). Your task is to count all right triangles with two sides parallel to the square sides, whose vertices are in the centers of '*'-cells. A right triangle is a tr...
instruction
0
99,040
23
198,080
Tags: combinatorics Correct Solution: ``` n,m=map(int,input().split()) a,r,c=[""]*n,[0]*n,[0]*m for i in range(n): a[i]=input() for i in range(n): for j in range(m): if a[i][j]=="*": r[i]+=1 c[j]+=1 ans=0 for i in range(n): for j in range(m): if a[i][j]=="*": ...
output
1
99,040
23
198,081
Provide tags and a correct Python 3 solution for this coding contest problem. You are given a n × m field consisting only of periods ('.') and asterisks ('*'). Your task is to count all right triangles with two sides parallel to the square sides, whose vertices are in the centers of '*'-cells. A right triangle is a tr...
instruction
0
99,041
23
198,082
Tags: combinatorics Correct Solution: ``` n, m = [int(x) for x in input().split()] a = [] for _ in range(n): a.append(input()) cnt_rows = [0] * n cnt_cols = [0] * m for i in range(n): for j in range(m): if a[i][j] == '*': cnt_rows[i] +=1 cnt_cols[j] += 1 res = 0 for i in range(...
output
1
99,041
23
198,083
Provide tags and a correct Python 3 solution for this coding contest problem. You are given a n × m field consisting only of periods ('.') and asterisks ('*'). Your task is to count all right triangles with two sides parallel to the square sides, whose vertices are in the centers of '*'-cells. A right triangle is a tr...
instruction
0
99,042
23
198,084
Tags: combinatorics Correct Solution: ``` u=input n,m=map(int,u().split()) l=[list(u()) for _ in range(n)] R=[p.count('*') for p in l] C=[p.count('*') for p in zip(*l)] t=0 for i in range(n): for j in range(m): if(l[i][j]=='*'): t+=(R[i]-1)*(C[j]-1) print(t) # Made By Mostafa_Khaled ```
output
1
99,042
23
198,085
Provide tags and a correct Python 3 solution for this coding contest problem. You are given a n × m field consisting only of periods ('.') and asterisks ('*'). Your task is to count all right triangles with two sides parallel to the square sides, whose vertices are in the centers of '*'-cells. A right triangle is a tr...
instruction
0
99,043
23
198,086
Tags: combinatorics Correct Solution: ``` n, m = map(int, input().split()) a = [] for i in range(n): a.append(input()) r = [0] * n c = [0] * m for i in range(n): for j in range(m): if a[i][j] == '*': r[i] += 1 c[j] += 1 s = 0 for i in range(n): for j in range(m): if a...
output
1
99,043
23
198,087
Provide tags and a correct Python 3 solution for this coding contest problem. You are given a n × m field consisting only of periods ('.') and asterisks ('*'). Your task is to count all right triangles with two sides parallel to the square sides, whose vertices are in the centers of '*'-cells. A right triangle is a tr...
instruction
0
99,044
23
198,088
Tags: combinatorics Correct Solution: ``` n,m=list(map(int,input().split())) a=[input() for i in range(n)] b=[-1]*n c=[-1]*m for i in range(n): for j in range(m): if a[i][j]=='*': b[i]+=1 c[j]+=1 d=0 for i in range(n): for j in range(m): if a[i][j]=='*': d+=b[...
output
1
99,044
23
198,089
Provide tags and a correct Python 3 solution for this coding contest problem. You are given a n × m field consisting only of periods ('.') and asterisks ('*'). Your task is to count all right triangles with two sides parallel to the square sides, whose vertices are in the centers of '*'-cells. A right triangle is a tr...
instruction
0
99,045
23
198,090
Tags: combinatorics Correct Solution: ``` import sys from array import array # noqa: F401 def input(): return sys.stdin.buffer.readline().decode('utf-8') n, m = map(int, input().split()) a = ([[0] * (m + 2)] + [[0] + list(1 if c == '*' else 0 for c in input().rstrip()) + [0] for _ in range(n)] + [[0]...
output
1
99,045
23
198,091
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given a n × m field consisting only of periods ('.') and asterisks ('*'). Your task is to count all right triangles with two sides parallel to the square sides, whose vertices are in the...
instruction
0
99,046
23
198,092
Yes
output
1
99,046
23
198,093
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given a n × m field consisting only of periods ('.') and asterisks ('*'). Your task is to count all right triangles with two sides parallel to the square sides, whose vertices are in the...
instruction
0
99,047
23
198,094
Yes
output
1
99,047
23
198,095
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given a n × m field consisting only of periods ('.') and asterisks ('*'). Your task is to count all right triangles with two sides parallel to the square sides, whose vertices are in the...
instruction
0
99,048
23
198,096
Yes
output
1
99,048
23
198,097