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.
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,100 | 23 | 92,200 |
Yes | output | 1 | 46,100 | 23 | 92,201 |
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,101 | 23 | 92,202 |
No | output | 1 | 46,101 | 23 | 92,203 |
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,102 | 23 | 92,204 |
No | output | 1 | 46,102 | 23 | 92,205 |
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,103 | 23 | 92,206 |
No | output | 1 | 46,103 | 23 | 92,207 |
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,104 | 23 | 92,208 |
No | output | 1 | 46,104 | 23 | 92,209 |
Provide a correct Python 3 solution for this coding contest problem.
ACM University holds its sports day in every July. The "Roll-A-Big-Ball" is the highlight of the day. In the game, players roll a ball on a straight course drawn on the ground. There are rectangular parallelepiped blocks on the ground as obstacles, w... | instruction | 0 | 46,121 | 23 | 92,242 |
"Correct Solution:
```
#!/usr/bin/env python3
from math import sqrt
# ??????
def cross(P0, P1, P2):
x0, y0 = P0; x1, y1 = P1; x2, y2 = P2
x1 -= x0; x2 -= x0
y1 -= y0; y2 -= y0
return x1*y2 - x2*y1
# ??????
def dot(P0, P1, P2):
x0, y0 = P0; x1, y1 = P1; x2, y2 = P2
x1 -= x0; x2 -= x0
y1 -= y0... | output | 1 | 46,121 | 23 | 92,243 |
Provide a correct Python 3 solution for this coding contest problem.
ACM University holds its sports day in every July. The "Roll-A-Big-Ball" is the highlight of the day. In the game, players roll a ball on a straight course drawn on the ground. There are rectangular parallelepiped blocks on the ground as obstacles, w... | instruction | 0 | 46,122 | 23 | 92,244 |
"Correct Solution:
```
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**13
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]
def LI(): return [int... | output | 1 | 46,122 | 23 | 92,245 |
Provide a correct Python 3 solution for this coding contest problem.
ACM University holds its sports day in every July. The "Roll-A-Big-Ball" is the highlight of the day. In the game, players roll a ball on a straight course drawn on the ground. There are rectangular parallelepiped blocks on the ground as obstacles, w... | instruction | 0 | 46,123 | 23 | 92,246 |
"Correct Solution:
```
def cross(c1, c2):
return c1.real * c2.imag - c1.imag * c2.real
def dot(c1, c2):
return c1.real * c2.real + c1.imag * c2.imag
def ccw(p0, p1, p2):
a = p1 - p0
b = p2 - p0
cross_ab = cross(a, b)
if cross_ab > 0:
return 1
elif cross_ab < 0:
return -1
... | output | 1 | 46,123 | 23 | 92,247 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Petya is preparing for IQ test and he has noticed that there many problems like: you are given a sequence, find the next number. Now Petya can solve only problems with arithmetic or geometric pr... | instruction | 0 | 46,587 | 23 | 93,174 |
Yes | output | 1 | 46,587 | 23 | 93,175 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Petya is preparing for IQ test and he has noticed that there many problems like: you are given a sequence, find the next number. Now Petya can solve only problems with arithmetic or geometric pr... | instruction | 0 | 46,588 | 23 | 93,176 |
No | output | 1 | 46,588 | 23 | 93,177 |
Provide a correct Python 3 solution for this coding contest problem.
There are N points in a D-dimensional space.
The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}).
The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 ... | instruction | 0 | 46,876 | 23 | 93,752 |
"Correct Solution:
```
N,D=map(int,input().split())
L=[list(map(int,input().split())) for i in range(N)]
n=0
for i in range(N):
for j in range(i):
DD=0
for k in range(D):
DD+=(L[i][k]-L[j][k])**2
if any(n**2==DD for n in range(1,128)):
n+=1
print(n)
``` | output | 1 | 46,876 | 23 | 93,753 |
Provide a correct Python 3 solution for this coding contest problem.
There are N points in a D-dimensional space.
The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}).
The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 ... | instruction | 0 | 46,877 | 23 | 93,754 |
"Correct Solution:
```
import math
n,d=map(int,input().split())
x=[list(map(float,input().split())) for _ in range(n)]
ans=0
for i in range(n-1):
for j in range(i+1,n):
tmp=0
for k in range(d):
tmp+=(x[i][k]-x[j][k])**2
if math.sqrt(tmp).is_integer():
ans+=1
print(ans)
``` | output | 1 | 46,877 | 23 | 93,755 |
Provide a correct Python 3 solution for this coding contest problem.
There are N points in a D-dimensional space.
The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}).
The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 ... | instruction | 0 | 46,878 | 23 | 93,756 |
"Correct Solution:
```
N, D=map(int, input().split())
x=[list(map(int, input().split())) for i in range(N)]
cnt=0
d=0
for i in range(N-1):
for j in range(i+1, N):
for k in range(D):
d+=(x[i][k]-x[j][k])**2
if (d**(1/2))%1==0:
cnt+=1
d=0
print(cnt)
``` | output | 1 | 46,878 | 23 | 93,757 |
Provide a correct Python 3 solution for this coding contest problem.
There are N points in a D-dimensional space.
The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}).
The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 ... | instruction | 0 | 46,879 | 23 | 93,758 |
"Correct Solution:
```
n,d=map(int,input().split())
X=[list(map(int,input().split())) for _ in range(n)]
c=0
for i in range(n-1):
for j in range(i+1,n):
for k in range(d):
diff = sum([(s-t)**2 for s,t in zip(X[i],X[j])])
if (diff**.5).is_integer():c += 1
print(c)
``` | output | 1 | 46,879 | 23 | 93,759 |
Provide a correct Python 3 solution for this coding contest problem.
There are N points in a D-dimensional space.
The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}).
The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 ... | instruction | 0 | 46,880 | 23 | 93,760 |
"Correct Solution:
```
import math
n,d=map(int,input().split())
a=[list(map(int,input().split())) for i in range(n)]
p=0
for i in range(0,n-1):
for j in range(i+1,n):
q=0
for k in range(0,d):
q+=(a[i][k]-a[j][k])**2
if int(math.sqrt(q))==math.sqrt(q):
p+=1
print(p)
``` | output | 1 | 46,880 | 23 | 93,761 |
Provide a correct Python 3 solution for this coding contest problem.
There are N points in a D-dimensional space.
The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}).
The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 ... | instruction | 0 | 46,881 | 23 | 93,762 |
"Correct Solution:
```
N, D = map(int, input().split())
X = [list(map(int, input().split())) for _ in range(N)]
S = {i**2 for i in range(1000)}
ans = sum(
a != b and sum((x - y)**2 for x, y in zip(a, b)) in S
for a in X
for b in X
) // 2
print(ans)
``` | output | 1 | 46,881 | 23 | 93,763 |
Provide a correct Python 3 solution for this coding contest problem.
There are N points in a D-dimensional space.
The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}).
The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 ... | instruction | 0 | 46,882 | 23 | 93,764 |
"Correct Solution:
```
n,d=map(int,input().split())
A=[list(map(int,input().split())) for i in range(n)]
ans=0
for i in range(n):
for j in range(i):
dis=sum([(A[i][k]-A[j][k])**2 for k in range(d)])
if dis**(1/2)==int(dis**(1/2)):
ans+=1
print(ans)
``` | output | 1 | 46,882 | 23 | 93,765 |
Provide a correct Python 3 solution for this coding contest problem.
There are N points in a D-dimensional space.
The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}).
The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1, z_2, ..., z_D) is \sqrt{(y_1 - z_1)^2 + (y_2 - z_2)^2 ... | instruction | 0 | 46,883 | 23 | 93,766 |
"Correct Solution:
```
n,d=map(int,input().split())
ans=0
X=[list(map(int,input().split())) for _ in range(n)]
for i ,j in enumerate(X):
for k in X[i+1:] :
res=0
for l in range(d):
res+=(j[l]-k[l])**2
if res**0.5-int(res**0.5)<10e-10:
ans+=1
print(ans)
``` | output | 1 | 46,883 | 23 | 93,767 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are N points in a D-dimensional space.
The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}).
The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1... | instruction | 0 | 46,884 | 23 | 93,768 |
Yes | output | 1 | 46,884 | 23 | 93,769 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are N points in a D-dimensional space.
The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}).
The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1... | instruction | 0 | 46,885 | 23 | 93,770 |
Yes | output | 1 | 46,885 | 23 | 93,771 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are N points in a D-dimensional space.
The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}).
The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1... | instruction | 0 | 46,886 | 23 | 93,772 |
Yes | output | 1 | 46,886 | 23 | 93,773 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are N points in a D-dimensional space.
The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}).
The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1... | instruction | 0 | 46,887 | 23 | 93,774 |
Yes | output | 1 | 46,887 | 23 | 93,775 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are N points in a D-dimensional space.
The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}).
The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1... | instruction | 0 | 46,888 | 23 | 93,776 |
No | output | 1 | 46,888 | 23 | 93,777 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are N points in a D-dimensional space.
The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}).
The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1... | instruction | 0 | 46,889 | 23 | 93,778 |
No | output | 1 | 46,889 | 23 | 93,779 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are N points in a D-dimensional space.
The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}).
The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1... | instruction | 0 | 46,890 | 23 | 93,780 |
No | output | 1 | 46,890 | 23 | 93,781 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are N points in a D-dimensional space.
The coordinates of the i-th point are (X_{i1}, X_{i2}, ..., X_{iD}).
The distance between two points with coordinates (y_1, y_2, ..., y_D) and (z_1... | instruction | 0 | 46,891 | 23 | 93,782 |
No | output | 1 | 46,891 | 23 | 93,783 |
Provide a correct Python 3 solution for this coding contest problem.
There is a square in the xy-plane. The coordinates of its four vertices are (x_1,y_1),(x_2,y_2),(x_3,y_3) and (x_4,y_4) in counter-clockwise order. (Assume that the positive x-axis points right, and the positive y-axis points up.)
Takahashi remember... | instruction | 0 | 46,892 | 23 | 93,784 |
"Correct Solution:
```
x1,y1,x2,y2=map(int,input().split())
v=(-y2+y1,x2-x1)
print(x2-y2+y1,y2+x2-x1,x1-y2+y1,y1+x2-x1)
``` | output | 1 | 46,892 | 23 | 93,785 |
Provide a correct Python 3 solution for this coding contest problem.
There is a square in the xy-plane. The coordinates of its four vertices are (x_1,y_1),(x_2,y_2),(x_3,y_3) and (x_4,y_4) in counter-clockwise order. (Assume that the positive x-axis points right, and the positive y-axis points up.)
Takahashi remember... | instruction | 0 | 46,893 | 23 | 93,786 |
"Correct Solution:
```
x1,y1,x2,y2=map(int,input().split())
X=x1-x2
Y=y1-y2
x3,y3=x2+Y,y2-X
x4,y4=x3+X,y3+Y
print(x3,y3,x4,y4)
``` | output | 1 | 46,893 | 23 | 93,787 |
Provide a correct Python 3 solution for this coding contest problem.
There is a square in the xy-plane. The coordinates of its four vertices are (x_1,y_1),(x_2,y_2),(x_3,y_3) and (x_4,y_4) in counter-clockwise order. (Assume that the positive x-axis points right, and the positive y-axis points up.)
Takahashi remember... | instruction | 0 | 46,894 | 23 | 93,788 |
"Correct Solution:
```
x1,y1,x2,y2=map(int,input().split())
dy = y2-y1
dx = x2-x1
print(x2-dy, y2+dx, x1-dy, y1+dx)
``` | output | 1 | 46,894 | 23 | 93,789 |
Provide a correct Python 3 solution for this coding contest problem.
There is a square in the xy-plane. The coordinates of its four vertices are (x_1,y_1),(x_2,y_2),(x_3,y_3) and (x_4,y_4) in counter-clockwise order. (Assume that the positive x-axis points right, and the positive y-axis points up.)
Takahashi remember... | instruction | 0 | 46,895 | 23 | 93,790 |
"Correct Solution:
```
a,b,c,d=map(int,input().split())
print(b+c-d,-a+c+d,a+b-d,-a+b+c)
``` | output | 1 | 46,895 | 23 | 93,791 |
Provide a correct Python 3 solution for this coding contest problem.
There is a square in the xy-plane. The coordinates of its four vertices are (x_1,y_1),(x_2,y_2),(x_3,y_3) and (x_4,y_4) in counter-clockwise order. (Assume that the positive x-axis points right, and the positive y-axis points up.)
Takahashi remember... | instruction | 0 | 46,896 | 23 | 93,792 |
"Correct Solution:
```
x1, y1, x2, y2 = map(int, input().split())
i = x2 - x1
j = y2 - y1
print(x2-j, y2+i, x1-j, y1+i)
``` | output | 1 | 46,896 | 23 | 93,793 |
Provide a correct Python 3 solution for this coding contest problem.
There is a square in the xy-plane. The coordinates of its four vertices are (x_1,y_1),(x_2,y_2),(x_3,y_3) and (x_4,y_4) in counter-clockwise order. (Assume that the positive x-axis points right, and the positive y-axis points up.)
Takahashi remember... | instruction | 0 | 46,897 | 23 | 93,794 |
"Correct Solution:
```
a,b,c,d = map(int,input().split())
print(b+c-d,c+d-a,b-d+a,c+b-a)
``` | output | 1 | 46,897 | 23 | 93,795 |
Provide a correct Python 3 solution for this coding contest problem.
There is a square in the xy-plane. The coordinates of its four vertices are (x_1,y_1),(x_2,y_2),(x_3,y_3) and (x_4,y_4) in counter-clockwise order. (Assume that the positive x-axis points right, and the positive y-axis points up.)
Takahashi remember... | instruction | 0 | 46,898 | 23 | 93,796 |
"Correct Solution:
```
x1,y1,x2,y2 = list(map(int,input().split()))
dx,dy = x2-x1,y2-y1
print(x2-dy,y2+dx,x1-dy,y1+dx)
``` | output | 1 | 46,898 | 23 | 93,797 |
Provide a correct Python 3 solution for this coding contest problem.
There is a square in the xy-plane. The coordinates of its four vertices are (x_1,y_1),(x_2,y_2),(x_3,y_3) and (x_4,y_4) in counter-clockwise order. (Assume that the positive x-axis points right, and the positive y-axis points up.)
Takahashi remember... | instruction | 0 | 46,899 | 23 | 93,798 |
"Correct Solution:
```
a,b,c,d=map(int,input().split())
x,y=c-a,d-b
h,i,j,k=c-y,d+x,a-y,b+x
print(h,i,j,k)
``` | output | 1 | 46,899 | 23 | 93,799 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There is a square in the xy-plane. The coordinates of its four vertices are (x_1,y_1),(x_2,y_2),(x_3,y_3) and (x_4,y_4) in counter-clockwise order. (Assume that the positive x-axis points right,... | instruction | 0 | 46,900 | 23 | 93,800 |
Yes | output | 1 | 46,900 | 23 | 93,801 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There is a square in the xy-plane. The coordinates of its four vertices are (x_1,y_1),(x_2,y_2),(x_3,y_3) and (x_4,y_4) in counter-clockwise order. (Assume that the positive x-axis points right,... | instruction | 0 | 46,901 | 23 | 93,802 |
Yes | output | 1 | 46,901 | 23 | 93,803 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There is a square in the xy-plane. The coordinates of its four vertices are (x_1,y_1),(x_2,y_2),(x_3,y_3) and (x_4,y_4) in counter-clockwise order. (Assume that the positive x-axis points right,... | instruction | 0 | 46,902 | 23 | 93,804 |
Yes | output | 1 | 46,902 | 23 | 93,805 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There is a square in the xy-plane. The coordinates of its four vertices are (x_1,y_1),(x_2,y_2),(x_3,y_3) and (x_4,y_4) in counter-clockwise order. (Assume that the positive x-axis points right,... | instruction | 0 | 46,903 | 23 | 93,806 |
Yes | output | 1 | 46,903 | 23 | 93,807 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There is a square in the xy-plane. The coordinates of its four vertices are (x_1,y_1),(x_2,y_2),(x_3,y_3) and (x_4,y_4) in counter-clockwise order. (Assume that the positive x-axis points right,... | instruction | 0 | 46,904 | 23 | 93,808 |
No | output | 1 | 46,904 | 23 | 93,809 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There is a square in the xy-plane. The coordinates of its four vertices are (x_1,y_1),(x_2,y_2),(x_3,y_3) and (x_4,y_4) in counter-clockwise order. (Assume that the positive x-axis points right,... | instruction | 0 | 46,905 | 23 | 93,810 |
No | output | 1 | 46,905 | 23 | 93,811 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There is a square in the xy-plane. The coordinates of its four vertices are (x_1,y_1),(x_2,y_2),(x_3,y_3) and (x_4,y_4) in counter-clockwise order. (Assume that the positive x-axis points right,... | instruction | 0 | 46,906 | 23 | 93,812 |
No | output | 1 | 46,906 | 23 | 93,813 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There is a square in the xy-plane. The coordinates of its four vertices are (x_1,y_1),(x_2,y_2),(x_3,y_3) and (x_4,y_4) in counter-clockwise order. (Assume that the positive x-axis points right,... | instruction | 0 | 46,907 | 23 | 93,814 |
No | output | 1 | 46,907 | 23 | 93,815 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A star is a figure of the following type: an asterisk character '*' in the center of the figure and four rays (to the left, right, top, bottom) of the same positive length. The size of a star is the length of its rays. The size of a star mus... | instruction | 0 | 47,020 | 23 | 94,040 |
Tags: brute force, dp, greedy
Correct Solution:
```
from copy import *
r,c=map(int,input().split())
arr1=[]
arr2=[]
for i in range(r):
s=str(input())
arrx=[]
for j in range(c):
arrx.append(s[j])
arr1.append(copy(arrx))
arr2.append(copy(arrx))
ansarr=[]
for i in range(r):
for j in range(c... | output | 1 | 47,020 | 23 | 94,041 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A star is a figure of the following type: an asterisk character '*' in the center of the figure and four rays (to the left, right, top, bottom) of the same positive length. The size of a star is the length of its rays. The size of a star mus... | instruction | 0 | 47,021 | 23 | 94,042 |
Tags: brute force, dp, greedy
Correct Solution:
```
# ---------------------------iye ha aam zindegi---------------------------------------------
import math
import heapq, bisect
import sys
from collections import deque, defaultdict
from fractions import Fraction
import sys
mod = 10 ** 9 + 7
mod1 = 998244353
sys.setrecu... | output | 1 | 47,021 | 23 | 94,043 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A star is a figure of the following type: an asterisk character '*' in the center of the figure and four rays (to the left, right, top, bottom) of the same positive length. The size of a star is the length of its rays. The size of a star mus... | instruction | 0 | 47,022 | 23 | 94,044 |
Tags: brute force, dp, greedy
Correct Solution:
```
def go():
n, m = [int(i) for i in input().split(' ')]
grid = []
count = 0
for _ in range(n):
l = [i for i in input()]
count += l.count('*')
grid.append(l)
visited = set()
stars = set()
def x(i, j):
low = i ... | output | 1 | 47,022 | 23 | 94,045 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A star is a figure of the following type: an asterisk character '*' in the center of the figure and four rays (to the left, right, top, bottom) of the same positive length. The size of a star is the length of its rays. The size of a star mus... | instruction | 0 | 47,023 | 23 | 94,046 |
Tags: brute force, dp, greedy
Correct Solution:
```
import sys
from math import *
def minp():
return sys.stdin.readline().strip()
def mint():
return int(minp())
def mints():
return map(int, minp().split())
def main():
n, m = mints()
res = []
a = [None]*n
l = [None]*n
r = [None]*n
s = [0]*n
for i in range(... | output | 1 | 47,023 | 23 | 94,047 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A star is a figure of the following type: an asterisk character '*' in the center of the figure and four rays (to the left, right, top, bottom) of the same positive length. The size of a star is the length of its rays. The size of a star mus... | instruction | 0 | 47,024 | 23 | 94,048 |
Tags: brute force, dp, greedy
Correct Solution:
```
n, m = map(int, input().split())
pole = []
metka = []
for i in range(n):
pole.append([])
metka.append([])
s = input()
for j in range(m):
pole[i].append(s[j])
if s[j] == '.':
metka[i].append(0)
else:
metka... | output | 1 | 47,024 | 23 | 94,049 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A star is a figure of the following type: an asterisk character '*' in the center of the figure and four rays (to the left, right, top, bottom) of the same positive length. The size of a star is the length of its rays. The size of a star mus... | instruction | 0 | 47,025 | 23 | 94,050 |
Tags: brute force, dp, greedy
Correct Solution:
```
import sys
input=sys.stdin.readline
def read():return list(map(int,input().split()))
n,m=read()
g=[input() for i in range(n)]
mrk=[[0 for j in range(m)] for i in range(n)]
ans=[]
for i in range(n):
for j in range(m):
if g[i][j] == '*':
cnt=[0,0... | output | 1 | 47,025 | 23 | 94,051 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A star is a figure of the following type: an asterisk character '*' in the center of the figure and four rays (to the left, right, top, bottom) of the same positive length. The size of a star is the length of its rays. The size of a star mus... | instruction | 0 | 47,026 | 23 | 94,052 |
Tags: brute force, dp, greedy
Correct Solution:
```
def main():
inp = []
n, m = map(int, input().split())
remaining = 0
for _ in range(n):
cur_inp = input()
inp.append(cur_inp)
remaining += cur_inp.count("*")
remaining2 = [[True]*m for _ in range(n)]
res = []
for x in range(1, n-1):
for y in range(1, m-1... | output | 1 | 47,026 | 23 | 94,053 |
Provide tags and a correct Python 3 solution for this coding contest problem.
A star is a figure of the following type: an asterisk character '*' in the center of the figure and four rays (to the left, right, top, bottom) of the same positive length. The size of a star is the length of its rays. The size of a star mus... | instruction | 0 | 47,027 | 23 | 94,054 |
Tags: brute force, dp, greedy
Correct Solution:
```
# ---------------------------iye ha aam zindegi---------------------------------------------
import math
import heapq, bisect
import sys
from collections import deque, defaultdict
from fractions import Fraction
import sys
mod = 10 ** 9 + 7
mod1 = 998244353
#sys.setrec... | output | 1 | 47,027 | 23 | 94,055 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.