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. Write a program which prints the central coordinate $(p_x, p_y)$ and the radius $r$ of a circumscribed circle of a triangle which is constructed by three points $(x_1, y_1)$, $(x_2, y_2)$ and $(...
instruction
0
45,296
23
90,592
No
output
1
45,296
23
90,593
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Write a program which prints the central coordinate $(p_x, p_y)$ and the radius $r$ of a circumscribed circle of a triangle which is constructed by three points $(x_1, y_1)$, $(x_2, y_2)$ and $(...
instruction
0
45,297
23
90,594
No
output
1
45,297
23
90,595
Provide a correct Python 3 solution for this coding contest problem. Example Input 4 4 1 2 3 1 3 3 2 3 3 2 4 3 Output 1 3
instruction
0
45,333
23
90,666
"Correct Solution: ``` N, M = map(int, input().split()) E0 = [] for i in range(M): S, D, C = map(int, input().split()) E0.append((C, S-1, D-1)) E0.sort() *parent, = range(N) def root(x): if x == parent[x]: return x y = parent[x] = root(parent[x]) return y def unite(x, y): px = root(x); ...
output
1
45,333
23
90,667
Provide a correct Python 3 solution for this coding contest problem. For given two sides of a triangle a and b and the angle C between them, calculate the following properties: * S: Area of the triangle * L: The length of the circumference of the triangle * h: The height of the triangle with side a as a bottom edge ...
instruction
0
45,362
23
90,724
"Correct Solution: ``` import math a, b, C = map(float, input().split()) S = a*b*math.sin(math.radians(C))/2 L = a + b + math.sqrt(a*a + b*b - 2*a*b*math.cos(math.radians(C))) h = 2 * S / a print(f"{S} {L} {h}") ```
output
1
45,362
23
90,725
Provide a correct Python 3 solution for this coding contest problem. For given two sides of a triangle a and b and the angle C between them, calculate the following properties: * S: Area of the triangle * L: The length of the circumference of the triangle * h: The height of the triangle with side a as a bottom edge ...
instruction
0
45,363
23
90,726
"Correct Solution: ``` import math a, b, c = map(int, input().split()) S = 0.5*math.sin(math.radians(c))*a*b L = (a**2+b**2-2*a*b*math.cos(math.radians(c)))**0.5 + a + b h = 2*S/a print(S,L,h) ```
output
1
45,363
23
90,727
Provide a correct Python 3 solution for this coding contest problem. For given two sides of a triangle a and b and the angle C between them, calculate the following properties: * S: Area of the triangle * L: The length of the circumference of the triangle * h: The height of the triangle with side a as a bottom edge ...
instruction
0
45,364
23
90,728
"Correct Solution: ``` import math a,b,c=map(int,input().split()) rad=math.radians(c) s=a*b*math.sin(rad)/2 print(s) edge=math.sqrt(a**2 + b**2 - 2*a*b*math.cos(rad)) print(a+b+edge) print(s*2/a) ```
output
1
45,364
23
90,729
Provide a correct Python 3 solution for this coding contest problem. For given two sides of a triangle a and b and the angle C between them, calculate the following properties: * S: Area of the triangle * L: The length of the circumference of the triangle * h: The height of the triangle with side a as a bottom edge ...
instruction
0
45,365
23
90,730
"Correct Solution: ``` import math as mp a,b,C = map(int,input().split()) C = mp.radians(C) print(0.5*a*b*mp.sin(C)) print(a+b+mp.sqrt(a**2+b**2-2*a*b*mp.cos(C))) print(b*mp.sin(C)) ```
output
1
45,365
23
90,731
Provide a correct Python 3 solution for this coding contest problem. For given two sides of a triangle a and b and the angle C between them, calculate the following properties: * S: Area of the triangle * L: The length of the circumference of the triangle * h: The height of the triangle with side a as a bottom edge ...
instruction
0
45,366
23
90,732
"Correct Solution: ``` import math a, b, c = map(float, input().split()) c = c*math.pi/180 S = 0.5*a*b*math.sin(c) d = (a**2 + b**2 - 2*b*a*math.cos(c))**0.5 L = a + b + d h = b*math.sin(c) print (S, L, h, end="\n") ```
output
1
45,366
23
90,733
Provide a correct Python 3 solution for this coding contest problem. For given two sides of a triangle a and b and the angle C between them, calculate the following properties: * S: Area of the triangle * L: The length of the circumference of the triangle * h: The height of the triangle with side a as a bottom edge ...
instruction
0
45,367
23
90,734
"Correct Solution: ``` import math a, b, C = map(int, input().split()) S = a*b*math.sin(C*math.pi/180)/2 L = a+b+(a**2+b**2-2*a*b*math.cos(C*math.pi/180))**0.5 h = 2*S/a print(S) print(L) print(h) ```
output
1
45,367
23
90,735
Provide a correct Python 3 solution for this coding contest problem. For given two sides of a triangle a and b and the angle C between them, calculate the following properties: * S: Area of the triangle * L: The length of the circumference of the triangle * h: The height of the triangle with side a as a bottom edge ...
instruction
0
45,368
23
90,736
"Correct Solution: ``` import math A, B, R = map(int, input().split()) rad = math.radians(R) S = A * B * math.sin(rad) / 2 C = math.sqrt(A**2 + B**2 - 2*A*B*math.cos(rad)) h = S / (0.5 *A) print(S) print(A+B+C) print(h) ```
output
1
45,368
23
90,737
Provide a correct Python 3 solution for this coding contest problem. For given two sides of a triangle a and b and the angle C between them, calculate the following properties: * S: Area of the triangle * L: The length of the circumference of the triangle * h: The height of the triangle with side a as a bottom edge ...
instruction
0
45,369
23
90,738
"Correct Solution: ``` import math a,b, A = map(float, input().split()) h = b*math.sin(math.radians(A)) S = a*h*0.5 L = a + b + math.sqrt(pow(a, 2) + pow(b, 2) - 2*a*b*math.cos(math.radians(A))) print(S) print(L) print(h) ```
output
1
45,369
23
90,739
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. For given two sides of a triangle a and b and the angle C between them, calculate the following properties: * S: Area of the triangle * L: The length of the circumference of the triangle * h: T...
instruction
0
45,370
23
90,740
Yes
output
1
45,370
23
90,741
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. For given two sides of a triangle a and b and the angle C between them, calculate the following properties: * S: Area of the triangle * L: The length of the circumference of the triangle * h: T...
instruction
0
45,371
23
90,742
Yes
output
1
45,371
23
90,743
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. For given two sides of a triangle a and b and the angle C between them, calculate the following properties: * S: Area of the triangle * L: The length of the circumference of the triangle * h: T...
instruction
0
45,372
23
90,744
Yes
output
1
45,372
23
90,745
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. For given two sides of a triangle a and b and the angle C between them, calculate the following properties: * S: Area of the triangle * L: The length of the circumference of the triangle * h: T...
instruction
0
45,373
23
90,746
Yes
output
1
45,373
23
90,747
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. For given two sides of a triangle a and b and the angle C between them, calculate the following properties: * S: Area of the triangle * L: The length of the circumference of the triangle * h: T...
instruction
0
45,374
23
90,748
No
output
1
45,374
23
90,749
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. For given two sides of a triangle a and b and the angle C between them, calculate the following properties: * S: Area of the triangle * L: The length of the circumference of the triangle * h: T...
instruction
0
45,375
23
90,750
No
output
1
45,375
23
90,751
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. For given two sides of a triangle a and b and the angle C between them, calculate the following properties: * S: Area of the triangle * L: The length of the circumference of the triangle * h: T...
instruction
0
45,376
23
90,752
No
output
1
45,376
23
90,753
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. For given two sides of a triangle a and b and the angle C between them, calculate the following properties: * S: Area of the triangle * L: The length of the circumference of the triangle * h: T...
instruction
0
45,377
23
90,754
No
output
1
45,377
23
90,755
Provide tags and a correct Python 3 solution for this coding contest problem. You are given n segments on a coordinate line; each endpoint of every segment has integer coordinates. Some segments can degenerate to points. Segments can intersect with each other, be nested in each other or even coincide. Your task is th...
instruction
0
45,378
23
90,756
Tags: data structures, implementation, sortings Correct Solution: ``` n=int(input()) l=[0 for i in range(n+1)] lo=[] lc=[] for i in range(n): x,y=map(int,input().strip().split()) lo.append(x) lc.append(y) lo.sort() lc.sort() i=1 j=0 count=1 st=lo[0] ref=0 while(i<n and j<n): if (lo[i]<=lc[j]): if ref==0: l[cou...
output
1
45,378
23
90,757
Provide tags and a correct Python 3 solution for this coding contest problem. You are given n segments on a coordinate line; each endpoint of every segment has integer coordinates. Some segments can degenerate to points. Segments can intersect with each other, be nested in each other or even coincide. Your task is th...
instruction
0
45,379
23
90,758
Tags: data structures, implementation, sortings Correct Solution: ``` n = int(input()) pos = {} for _ in range(n): l, r = [int(x) for x in input().split()] if l in pos: pos[l] += 1 else:pos[l] = 1 if r+1 in pos: pos[r+1] -= 1 else:pos[r+1] = -1 #pos[r+1] = pos.get(r+1, -1) - 1 a = sorted(pos.ite...
output
1
45,379
23
90,759
Provide tags and a correct Python 3 solution for this coding contest problem. You are given n segments on a coordinate line; each endpoint of every segment has integer coordinates. Some segments can degenerate to points. Segments can intersect with each other, be nested in each other or even coincide. Your task is th...
instruction
0
45,380
23
90,760
Tags: data structures, implementation, sortings Correct Solution: ``` def ii(): return int(input()) def mi(): return map(int, input().split()) def li(): return list(mi()) from collections import Counter n = ii() a1 = [tuple(mi()) for i in range(n)] a = [] for l, r in a1: a.append((l, 0)) a.append((...
output
1
45,380
23
90,761
Provide tags and a correct Python 3 solution for this coding contest problem. You are given n segments on a coordinate line; each endpoint of every segment has integer coordinates. Some segments can degenerate to points. Segments can intersect with each other, be nested in each other or even coincide. Your task is th...
instruction
0
45,381
23
90,762
Tags: data structures, implementation, sortings Correct Solution: ``` import sys class main: def __init__(self): self.n=int(sys.stdin.readline()) self.line=dict() for i in range(self.n): a,b=(int(s) for s in sys.stdin.readline().rstrip().split(' ')) self.line[a]=s...
output
1
45,381
23
90,763
Provide tags and a correct Python 3 solution for this coding contest problem. You are given n segments on a coordinate line; each endpoint of every segment has integer coordinates. Some segments can degenerate to points. Segments can intersect with each other, be nested in each other or even coincide. Your task is th...
instruction
0
45,382
23
90,764
Tags: data structures, implementation, sortings Correct Solution: ``` N = int(input()) points = [] for i in range(N): a, b = map(int, input().split()) points.append((a, 1)) points.append((b + 1, -1)) points = sorted(points, key = lambda x:x[0]) count = [0 for i in range(N + 1)] overlapp = 0 prev =...
output
1
45,382
23
90,765
Provide tags and a correct Python 3 solution for this coding contest problem. You are given n segments on a coordinate line; each endpoint of every segment has integer coordinates. Some segments can degenerate to points. Segments can intersect with each other, be nested in each other or even coincide. Your task is th...
instruction
0
45,383
23
90,766
Tags: data structures, implementation, sortings Correct Solution: ``` l = int(input()) points = [] for i in range(l): a, b = map(int, input().split()) points.append((a, 1)) points.append((b + 1, -1)) points = sorted(points, key = lambda x:x[0]) count = [0 for i in range(l + 1)] overlap = 0 prev = ...
output
1
45,383
23
90,767
Provide tags and a correct Python 3 solution for this coding contest problem. You are given n segments on a coordinate line; each endpoint of every segment has integer coordinates. Some segments can degenerate to points. Segments can intersect with each other, be nested in each other or even coincide. Your task is th...
instruction
0
45,384
23
90,768
Tags: data structures, implementation, sortings Correct Solution: ``` import sys input = sys.stdin.readline from collections import defaultdict n = int(input()) l = [] for _ in range(n): li, ri = map(int, input().split()) l.append((1, li)) l.append((-1, ri+1)) l.sort(key=lambda k: k[1]) ans = defaultdict...
output
1
45,384
23
90,769
Provide tags and a correct Python 3 solution for this coding contest problem. You are given n segments on a coordinate line; each endpoint of every segment has integer coordinates. Some segments can degenerate to points. Segments can intersect with each other, be nested in each other or even coincide. Your task is th...
instruction
0
45,385
23
90,770
Tags: data structures, implementation, sortings Correct Solution: ``` from collections import* n=int(input()) d=defaultdict(int) for _ in [0]*n: l,r=map(int,input().split());d[l]+=1;d[r+1]-=1 s=p=0 f=[0]*(n+1) for k in sorted(d): f[s]+=k-p;s+=d[k];p=k print(*f[1:]) r = 77 ```
output
1
45,385
23
90,771
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given n segments on a coordinate line; each endpoint of every segment has integer coordinates. Some segments can degenerate to points. Segments can intersect with each other, be nested i...
instruction
0
45,386
23
90,772
Yes
output
1
45,386
23
90,773
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given n segments on a coordinate line; each endpoint of every segment has integer coordinates. Some segments can degenerate to points. Segments can intersect with each other, be nested i...
instruction
0
45,387
23
90,774
Yes
output
1
45,387
23
90,775
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given n segments on a coordinate line; each endpoint of every segment has integer coordinates. Some segments can degenerate to points. Segments can intersect with each other, be nested i...
instruction
0
45,388
23
90,776
Yes
output
1
45,388
23
90,777
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given n segments on a coordinate line; each endpoint of every segment has integer coordinates. Some segments can degenerate to points. Segments can intersect with each other, be nested i...
instruction
0
45,389
23
90,778
Yes
output
1
45,389
23
90,779
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given n segments on a coordinate line; each endpoint of every segment has integer coordinates. Some segments can degenerate to points. Segments can intersect with each other, be nested i...
instruction
0
45,390
23
90,780
No
output
1
45,390
23
90,781
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given n segments on a coordinate line; each endpoint of every segment has integer coordinates. Some segments can degenerate to points. Segments can intersect with each other, be nested i...
instruction
0
45,391
23
90,782
No
output
1
45,391
23
90,783
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given n segments on a coordinate line; each endpoint of every segment has integer coordinates. Some segments can degenerate to points. Segments can intersect with each other, be nested i...
instruction
0
45,392
23
90,784
No
output
1
45,392
23
90,785
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given n segments on a coordinate line; each endpoint of every segment has integer coordinates. Some segments can degenerate to points. Segments can intersect with each other, be nested i...
instruction
0
45,393
23
90,786
No
output
1
45,393
23
90,787
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. A set of points on a plane is called good, if for any two points at least one of the three conditions is true: * those two points lie on same horizontal line; * those two points lie on sam...
instruction
0
45,909
23
91,818
No
output
1
45,909
23
91,819
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. A set of points on a plane is called good, if for any two points at least one of the three conditions is true: * those two points lie on same horizontal line; * those two points lie on sam...
instruction
0
45,910
23
91,820
No
output
1
45,910
23
91,821
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. A set of points on a plane is called good, if for any two points at least one of the three conditions is true: * those two points lie on same horizontal line; * those two points lie on sam...
instruction
0
45,911
23
91,822
No
output
1
45,911
23
91,823
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. A set of points on a plane is called good, if for any two points at least one of the three conditions is true: * those two points lie on same horizontal line; * those two points lie on sam...
instruction
0
45,912
23
91,824
No
output
1
45,912
23
91,825
Provide a correct Python 3 solution for this coding contest problem. There are a total of n x n squares, n rows vertically and n columns horizontally. Some squares are marked. Create a program that reads the marked state of each square and displays the length of the side of the largest square consisting of only the un...
instruction
0
46,089
23
92,178
"Correct Solution: ``` import sys while True: N = int(sys.stdin.readline().rstrip()) if N == 0: break; max_value = 0 prev_row = [0] * (N+1) for i in range(N): row = sys.stdin.readline().rstrip() curr_row = [0] * (N+1) for x,d in enumerate(row,1): if d == ...
output
1
46,089
23
92,179
Provide a correct Python 3 solution for this coding contest problem. There are a total of n x n squares, n rows vertically and n columns horizontally. Some squares are marked. Create a program that reads the marked state of each square and displays the length of the side of the largest square consisting of only the un...
instruction
0
46,090
23
92,180
"Correct Solution: ``` while True: n = int(input()) if n == 0: break inp = [] for i in range(n): inp.append(list(input())) sq_max = [[0 for i in range(n + 1)] for j in range(n + 1)] for y in range(n): for x in range(n): if inp[y][x] == ".": ...
output
1
46,090
23
92,181
Provide a correct Python 3 solution for this coding contest problem. There are a total of n x n squares, n rows vertically and n columns horizontally. Some squares are marked. Create a program that reads the marked state of each square and displays the length of the side of the largest square consisting of only the un...
instruction
0
46,091
23
92,182
"Correct Solution: ``` # -*- coding: utf-8 -*- """ http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0092 """ import sys def find_square0(data): max_size = 0 lmap = [] # dp??¨???2?¬?????????? # '.'????????????0??????'*'????????????1???????????? for row in data: temp = [] for c i...
output
1
46,091
23
92,183
Provide a correct Python 3 solution for this coding contest problem. There are a total of n x n squares, n rows vertically and n columns horizontally. Some squares are marked. Create a program that reads the marked state of each square and displays the length of the side of the largest square consisting of only the un...
instruction
0
46,092
23
92,184
"Correct Solution: ``` while True: Sei = [] m_si = 0 n = int(input()) if n == 0: break for i in range(n): sen = input() Sei.append(list(sen)) DP = [[0] * n for i in range(n)] for j in range(n): if Sei[0][j] == ".": DP[0][j] = 1 els...
output
1
46,092
23
92,185
Provide a correct Python 3 solution for this coding contest problem. There are a total of n x n squares, n rows vertically and n columns horizontally. Some squares are marked. Create a program that reads the marked state of each square and displays the length of the side of the largest square consisting of only the un...
instruction
0
46,093
23
92,186
"Correct Solution: ``` # don't know good 参考:http://judge.u-aizu.ac.jp/onlinejudge/review.jsp?rid=2954794#1 table = [''] * 1002 dp = [[0] * 1002 for i in range(1002)] while 1: n = int(input()) if n == 0: break for r in range(n): table[r] = input() ans = 0 for r in range(n): for c in range(n): if table[r][c...
output
1
46,093
23
92,187
Provide a correct Python 3 solution for this coding contest problem. There are a total of n x n squares, n rows vertically and n columns horizontally. Some squares are marked. Create a program that reads the marked state of each square and displays the length of the side of the largest square consisting of only the un...
instruction
0
46,094
23
92,188
"Correct Solution: ``` # -*- coding: utf-8 -*- """ http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0092 """ import sys def find_square(data): max_size = 0 lmap = [] for row in data: temp = [] for c in row: if c == '.': temp.append(1) else: ...
output
1
46,094
23
92,189
Provide a correct Python 3 solution for this coding contest problem. There are a total of n x n squares, n rows vertically and n columns horizontally. Some squares are marked. Create a program that reads the marked state of each square and displays the length of the side of the largest square consisting of only the un...
instruction
0
46,095
23
92,190
"Correct Solution: ``` # AOJ 0092 Square Searching # Python3 2018.6.21 bal4u cin = [[''] for r in range(1002)] dp = [[0 for c in range(1002)] for r in range(1002)] while 1: n = int(input()) if n == 0: break for r in range(n): cin[r] = input() ans = 0 for r in range(n): for c in range(n): if cin[r][c] == '*'...
output
1
46,095
23
92,191
Provide a correct Python 3 solution for this coding contest problem. There are a total of n x n squares, n rows vertically and n columns horizontally. Some squares are marked. Create a program that reads the marked state of each square and displays the length of the side of the largest square consisting of only the un...
instruction
0
46,096
23
92,192
"Correct Solution: ``` # AOJ 0092 Square Searching # Python3 2018.6.21 bal4u cin = [['' for c in range(1002)] for r in range(1002)] dp = [[0 for c in range(1002)] for r in range(1002)] while 1: n = int(input()) if n == 0: break for r in range(n): cin[r] = list(input()) ans = 0 for r in range(n): for c in ran...
output
1
46,096
23
92,193
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are a total of n x n squares, n rows vertically and n columns horizontally. Some squares are marked. Create a program that reads the marked state of each square and displays the length of ...
instruction
0
46,097
23
92,194
Yes
output
1
46,097
23
92,195
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are a total of n x n squares, n rows vertically and n columns horizontally. Some squares are marked. Create a program that reads the marked state of each square and displays the length of ...
instruction
0
46,098
23
92,196
Yes
output
1
46,098
23
92,197
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are a total of n x n squares, n rows vertically and n columns horizontally. Some squares are marked. Create a program that reads the marked state of each square and displays the length of ...
instruction
0
46,099
23
92,198
Yes
output
1
46,099
23
92,199