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 reads a rectangle and a circle, and determines whether the circle is arranged inside the rectangle. As shown in the following figures, the upper right coordinate $(W, H)$ o... | instruction | 0 | 63,979 | 23 | 127,958 |
No | output | 1 | 63,979 | 23 | 127,959 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Write a program which reads a rectangle and a circle, and determines whether the circle is arranged inside the rectangle. As shown in the following figures, the upper right coordinate $(W, H)$ o... | instruction | 0 | 63,980 | 23 | 127,960 |
No | output | 1 | 63,980 | 23 | 127,961 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There is given an integer k and a grid 2^k Γ 2^k with some numbers written in its cells, cell (i, j) initially contains number a_{ij}. Grid is considered to be a torus, that is, the cell to the ... | instruction | 0 | 64,099 | 23 | 128,198 |
No | output | 1 | 64,099 | 23 | 128,199 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are three points marked on the coordinate plane. The goal is to make a simple polyline, without self-intersections and self-touches, such that it passes through all these points. Also, the polyline must consist of only segments paralle... | instruction | 0 | 64,430 | 23 | 128,860 |
Tags: constructive algorithms, implementation
Correct Solution:
```
from sys import stdin
a, b, c, d, e, f = map(int, stdin.read().split())
res = [3]
for _ in 0, 1:
if a == c == e:
res.append(1)
for _ in range(3):
if a == c and not (b < f < d or b > f > d):
res.append(2)
a, ... | output | 1 | 64,430 | 23 | 128,861 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are three points marked on the coordinate plane. The goal is to make a simple polyline, without self-intersections and self-touches, such that it passes through all these points. Also, the polyline must consist of only segments paralle... | instruction | 0 | 64,431 | 23 | 128,862 |
Tags: constructive algorithms, implementation
Correct Solution:
```
def f(a,b,c):
if a>min(b,c) and a<max(c,b):
return True
x1,y1=map(int,input().split())
x2,y2=map(int,input().split())
x3,y3=map(int,input().split())
if (x1==x2 and x2==x3) or (y1==y2 and y2==y3):
print(1)
elif (x1==x2 or x2==x3 or x1=... | output | 1 | 64,431 | 23 | 128,863 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are three points marked on the coordinate plane. The goal is to make a simple polyline, without self-intersections and self-touches, such that it passes through all these points. Also, the polyline must consist of only segments paralle... | instruction | 0 | 64,432 | 23 | 128,864 |
Tags: constructive algorithms, implementation
Correct Solution:
```
#!/usr/bin/python3
(x1, y1) = tuple(map(int, input().split()))
(x2, y2) = tuple(map(int, input().split()))
(x3, y3) = tuple(map(int, input().split()))
if (x1 == x2 and x2 == x3) or (y1 == y2 and y2 == y3):
print("1")
elif (x1 == x2 and y3 >= max(y1,... | output | 1 | 64,432 | 23 | 128,865 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are three points marked on the coordinate plane. The goal is to make a simple polyline, without self-intersections and self-touches, such that it passes through all these points. Also, the polyline must consist of only segments paralle... | instruction | 0 | 64,433 | 23 | 128,866 |
Tags: constructive algorithms, implementation
Correct Solution:
```
def min_polyline(p1, p2, p3):
if p1[0] != p2[0] and p1[1] != p2[1]:
if p1[0] == p3[0] or p1[1] == p3[1]:
p2, p3 = p3, p2
elif p2[0] == p3[0] or p2[1] == p3[1]:
p1, p3 = p3, p1
else:
return... | output | 1 | 64,433 | 23 | 128,867 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are three points marked on the coordinate plane. The goal is to make a simple polyline, without self-intersections and self-touches, such that it passes through all these points. Also, the polyline must consist of only segments paralle... | instruction | 0 | 64,434 | 23 | 128,868 |
Tags: constructive algorithms, implementation
Correct Solution:
```
p = [tuple(map(int, input().split())) for i in range(3)]
if p[0][0] == p[1][0] and p[1][0] == p[2][0] or p[0][1] == p[1][1] and p[1][1] == p[2][1]:
print(1)
exit()
p.sort()
if p[0][0] == p[1][0]:
print(3 if p[2][1] in range(min(p[0][1], ... | output | 1 | 64,434 | 23 | 128,869 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are three points marked on the coordinate plane. The goal is to make a simple polyline, without self-intersections and self-touches, such that it passes through all these points. Also, the polyline must consist of only segments paralle... | instruction | 0 | 64,435 | 23 | 128,870 |
Tags: constructive algorithms, implementation
Correct Solution:
```
x1, y1 = map(int, input().split())
x2, y2 = map(int, input().split())
x3, y3 = map(int, input().split())
v1 = len(set([x1, x2, x3]))
v2 = len(set([y1, y2, y3]))
if(v1>v2):
v1, v2=v2, v1
# print(v1, v2)
if(v1==1):
if(v2==1):
print(0)
... | output | 1 | 64,435 | 23 | 128,871 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are three points marked on the coordinate plane. The goal is to make a simple polyline, without self-intersections and self-touches, such that it passes through all these points. Also, the polyline must consist of only segments paralle... | instruction | 0 | 64,436 | 23 | 128,872 |
Tags: constructive algorithms, implementation
Correct Solution:
```
x, y = zip(*[map(int, input().split(' ')) for i in range(3)])
def getCnt(a):
if a[0] == a[1] == a[2]:
return 3
if a[0] == a[1] or a[0] == a[2] or a[1]==a[2] :
return 2
return 1
similar = max(getCnt(x), getCnt(y))
if similar... | output | 1 | 64,436 | 23 | 128,873 |
Provide tags and a correct Python 3 solution for this coding contest problem.
There are three points marked on the coordinate plane. The goal is to make a simple polyline, without self-intersections and self-touches, such that it passes through all these points. Also, the polyline must consist of only segments paralle... | instruction | 0 | 64,437 | 23 | 128,874 |
Tags: constructive algorithms, implementation
Correct Solution:
```
read = lambda: map(int, input().split())
bet = lambda a, b, c: a <= c <= b or b <= c <= a
f = lambda A, B, C: (C[0] == A[0] or C[0] == B[0]) and bet(A[1], B[1], C[1]) or (C[1] == A[1] or C[1] == B[1]) and bet(A[0], B[0], C[0])
A, B, C = tuple(read()), ... | output | 1 | 64,437 | 23 | 128,875 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are three points marked on the coordinate plane. The goal is to make a simple polyline, without self-intersections and self-touches, such that it passes through all these points. Also, the... | instruction | 0 | 64,438 | 23 | 128,876 |
Yes | output | 1 | 64,438 | 23 | 128,877 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are three points marked on the coordinate plane. The goal is to make a simple polyline, without self-intersections and self-touches, such that it passes through all these points. Also, the... | instruction | 0 | 64,439 | 23 | 128,878 |
Yes | output | 1 | 64,439 | 23 | 128,879 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are three points marked on the coordinate plane. The goal is to make a simple polyline, without self-intersections and self-touches, such that it passes through all these points. Also, the... | instruction | 0 | 64,440 | 23 | 128,880 |
Yes | output | 1 | 64,440 | 23 | 128,881 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are three points marked on the coordinate plane. The goal is to make a simple polyline, without self-intersections and self-touches, such that it passes through all these points. Also, the... | instruction | 0 | 64,441 | 23 | 128,882 |
Yes | output | 1 | 64,441 | 23 | 128,883 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are three points marked on the coordinate plane. The goal is to make a simple polyline, without self-intersections and self-touches, such that it passes through all these points. Also, the... | instruction | 0 | 64,442 | 23 | 128,884 |
No | output | 1 | 64,442 | 23 | 128,885 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are three points marked on the coordinate plane. The goal is to make a simple polyline, without self-intersections and self-touches, such that it passes through all these points. Also, the... | instruction | 0 | 64,443 | 23 | 128,886 |
No | output | 1 | 64,443 | 23 | 128,887 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are three points marked on the coordinate plane. The goal is to make a simple polyline, without self-intersections and self-touches, such that it passes through all these points. Also, the... | instruction | 0 | 64,444 | 23 | 128,888 |
No | output | 1 | 64,444 | 23 | 128,889 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are three points marked on the coordinate plane. The goal is to make a simple polyline, without self-intersections and self-touches, such that it passes through all these points. Also, the... | instruction | 0 | 64,445 | 23 | 128,890 |
No | output | 1 | 64,445 | 23 | 128,891 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Alice and Bob play 5-in-a-row game. They have a playing field of size 10 Γ 10. In turns they put either crosses or noughts, one at a time. Alice puts crosses and Bob puts noughts.
In current ma... | instruction | 0 | 64,513 | 23 | 129,026 |
Yes | output | 1 | 64,513 | 23 | 129,027 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Alice and Bob play 5-in-a-row game. They have a playing field of size 10 Γ 10. In turns they put either crosses or noughts, one at a time. Alice puts crosses and Bob puts noughts.
In current ma... | instruction | 0 | 64,518 | 23 | 129,036 |
No | output | 1 | 64,518 | 23 | 129,037 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Alice and Bob play 5-in-a-row game. They have a playing field of size 10 Γ 10. In turns they put either crosses or noughts, one at a time. Alice puts crosses and Bob puts noughts.
In current ma... | instruction | 0 | 64,519 | 23 | 129,038 |
No | output | 1 | 64,519 | 23 | 129,039 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given two squares, one with sides parallel to the coordinate axes, and another one with sides at 45 degrees to the coordinate axes. Find whether the two squares intersect.
The interior of the square is considered to be part of the s... | instruction | 0 | 64,568 | 23 | 129,136 |
Tags: geometry, implementation
Correct Solution:
```
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
quadrate1 = list(map(int, input().split()))
quadrate2 = list(map(int, input().split()))
def sq2_treug(x1,y1, x2,y2, x3,y3) -> int:
''' doubled square of triangle with sign. '''
return (x3-x1)*(y2-y1) - (y3-y1)*(... | output | 1 | 64,568 | 23 | 129,137 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given two squares, one with sides parallel to the coordinate axes, and another one with sides at 45 degrees to the coordinate axes. Find whether the two squares intersect.
The interior of the square is considered to be part of the s... | instruction | 0 | 64,569 | 23 | 129,138 |
Tags: geometry, implementation
Correct Solution:
```
a = list(map(int, input().split()))
b = list(map(int, input().split()))
x1 = min(a[0], a[2], a[4], a[6])
x2 = max(a[0], a[2], a[4], a[6])
y1 = min(a[1], a[3], a[5], a[7])
y2 = max(a[1], a[3], a[5], a[7])
d1 = min(b[0] - b[1], b[2] - b[3], b[4] - b[5], b[6] - b[7])
d2... | output | 1 | 64,569 | 23 | 129,139 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given two squares, one with sides parallel to the coordinate axes, and another one with sides at 45 degrees to the coordinate axes. Find whether the two squares intersect.
The interior of the square is considered to be part of the s... | instruction | 0 | 64,570 | 23 | 129,140 |
Tags: geometry, implementation
Correct Solution:
```
s = list(map(int, input().split()))
s = [s[i:i+2] for i in range(0,8,2)]
s.sort()
t = list(map(int, input().split()))
t = [t[i:i+2] for i in range(0,8,2)]
t.sort()
for i in t:
if s[0][0] <= i[0] <= s[3][0] and s[0][1] <= i[1] <= s[3][1]:
print('YES'); exi... | output | 1 | 64,570 | 23 | 129,141 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given two squares, one with sides parallel to the coordinate axes, and another one with sides at 45 degrees to the coordinate axes. Find whether the two squares intersect.
The interior of the square is considered to be part of the s... | instruction | 0 | 64,571 | 23 | 129,142 |
Tags: geometry, implementation
Correct Solution:
```
a = list(map(int, input().split()))
b = list(map(int, input().split()))
xa = a[0::2]
ya = a[1::2]
xb = b[0::2]
yb = b[1::2]
miny = min(yb)
maxy = max(yb)
for i in range(miny, (miny + maxy) // 2 + 1):
for j in range(xb[yb.index(miny)] - (abs(i - miny)), xb[yb.in... | output | 1 | 64,571 | 23 | 129,143 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given two squares, one with sides parallel to the coordinate axes, and another one with sides at 45 degrees to the coordinate axes. Find whether the two squares intersect.
The interior of the square is considered to be part of the s... | instruction | 0 | 64,572 | 23 | 129,144 |
Tags: geometry, implementation
Correct Solution:
```
def cp(a, b):
return a[0]*b[1] - a[1]*b[0]
def sub(b, a):
return (b[0]-a[0], b[1]-a[1])
def ccw(a, b, c):
r = cp(sub(b,a), sub(c,a))
if r == 0: return 0
elif r > 0: return 1
else: return -1
def sortpts(pts):
return pts if ccw(pts[0], pts[1], pts[2]) > 0 else l... | output | 1 | 64,572 | 23 | 129,145 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given two squares, one with sides parallel to the coordinate axes, and another one with sides at 45 degrees to the coordinate axes. Find whether the two squares intersect.
The interior of the square is considered to be part of the s... | instruction | 0 | 64,573 | 23 | 129,146 |
Tags: geometry, implementation
Correct Solution:
```
def check1(point):
return sq1[0][0] <= point[0] <= sq1[3][0] and sq1[0][1] <= point[1] <= sq1[3][1]
def check2(point):
return point[0] + sq2[0][1] - sq2[0][0] >= point[1] and point[0] + sq2[3][1] - sq2[3][0] <= point[1] and -point[0] + sq2[3][1] + sq2[3][0] ... | output | 1 | 64,573 | 23 | 129,147 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given two squares, one with sides parallel to the coordinate axes, and another one with sides at 45 degrees to the coordinate axes. Find whether the two squares intersect.
The interior of the square is considered to be part of the s... | instruction | 0 | 64,574 | 23 | 129,148 |
Tags: geometry, implementation
Correct Solution:
```
from sys import exit
n = 4
a = list(map(int, input().split()))
am0 = min(a[0], a[2], a[4], a[6])
am1 = max(a[0], a[2], a[4], a[6])
aM0 = min(a[1], a[3], a[5], a[7])
aM1 = max(a[1], a[3], a[5], a[7])
b = list(map(int, input().split()))
bm0 = min(b[0], b[2], b[4], b... | output | 1 | 64,574 | 23 | 129,149 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given two squares, one with sides parallel to the coordinate axes, and another one with sides at 45 degrees to the coordinate axes. Find whether the two squares intersect.
The interior of the square is considered to be part of the s... | instruction | 0 | 64,575 | 23 | 129,150 |
Tags: geometry, implementation
Correct Solution:
```
from collections import defaultdict
x1,y1,x2,y2,x3,y3,x4,y4 = map(int,input().split())
a1,b1,a2,b2,a3,b3,a4,b4 = map(int,input().split())
first = [(x1,y1),(x2,y2),(x3,y3),(x4,y4)]
sec = [(a1,b1),(a2,b2),(a3,b3),(a4,b4)]
sec.sort()
D = defaultdict(bool)
y = sec[1][1... | output | 1 | 64,575 | 23 | 129,151 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given two squares, one with sides parallel to the coordinate axes, and another one with sides at 45 degrees to the coordinate axes. Find whether the two squares intersect.
The interior ... | instruction | 0 | 64,576 | 23 | 129,152 |
Yes | output | 1 | 64,576 | 23 | 129,153 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given two squares, one with sides parallel to the coordinate axes, and another one with sides at 45 degrees to the coordinate axes. Find whether the two squares intersect.
The interior ... | instruction | 0 | 64,577 | 23 | 129,154 |
Yes | output | 1 | 64,577 | 23 | 129,155 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given two squares, one with sides parallel to the coordinate axes, and another one with sides at 45 degrees to the coordinate axes. Find whether the two squares intersect.
The interior ... | instruction | 0 | 64,578 | 23 | 129,156 |
Yes | output | 1 | 64,578 | 23 | 129,157 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given two squares, one with sides parallel to the coordinate axes, and another one with sides at 45 degrees to the coordinate axes. Find whether the two squares intersect.
The interior ... | instruction | 0 | 64,579 | 23 | 129,158 |
Yes | output | 1 | 64,579 | 23 | 129,159 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given two squares, one with sides parallel to the coordinate axes, and another one with sides at 45 degrees to the coordinate axes. Find whether the two squares intersect.
The interior ... | instruction | 0 | 64,580 | 23 | 129,160 |
No | output | 1 | 64,580 | 23 | 129,161 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given two squares, one with sides parallel to the coordinate axes, and another one with sides at 45 degrees to the coordinate axes. Find whether the two squares intersect.
The interior ... | instruction | 0 | 64,581 | 23 | 129,162 |
No | output | 1 | 64,581 | 23 | 129,163 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given two squares, one with sides parallel to the coordinate axes, and another one with sides at 45 degrees to the coordinate axes. Find whether the two squares intersect.
The interior ... | instruction | 0 | 64,582 | 23 | 129,164 |
No | output | 1 | 64,582 | 23 | 129,165 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given two squares, one with sides parallel to the coordinate axes, and another one with sides at 45 degrees to the coordinate axes. Find whether the two squares intersect.
The interior ... | instruction | 0 | 64,583 | 23 | 129,166 |
No | output | 1 | 64,583 | 23 | 129,167 |
Provide a correct Python 3 solution for this coding contest problem.
Karnaugh is a poor farmer who has a very small field. He wants to reclaim wasteland in the kingdom to get a new field. But the king who loves regular shape made a rule that a settler can only get a rectangular land as his field. Thus, Karnaugh should... | instruction | 0 | 64,759 | 23 | 129,518 |
"Correct Solution:
```
# AOJ 1114: Get a Rectangular Field
# Python3 2018.7.8 bal4u
s = [[0 for c in range(6)] for r in range(6)]
for k in range(int(input())):
if k > 0: input()
for r in range(5):
a = list(map(int, input().split()))
for c in range(5): s[r+1][c+1] = s[r+1][c]+a[c]
ans = 0;
for r in range(1, 6):... | output | 1 | 64,759 | 23 | 129,519 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Karnaugh is a poor farmer who has a very small field. He wants to reclaim wasteland in the kingdom to get a new field. But the king who loves regular shape made a rule that a settler can only ge... | instruction | 0 | 64,760 | 23 | 129,520 |
No | output | 1 | 64,760 | 23 | 129,521 |
Provide a correct Python 3 solution for this coding contest problem.
Problem Statement
One day, you found an old scroll with strange texts on it.
You revealed that the text was actually an expression denoting the position of treasure. The expression consists of following three operations:
* From two points, yield a... | instruction | 0 | 64,787 | 23 | 129,574 |
"Correct Solution:
```
digits = "-0123456789"
def cross_point(P, Q):
x0, y0, x1, y1 = P
x2, y2, x3, y3 = Q
dx0 = x1 - x0; dy0 = y1 - y0
dx1 = x3 - x2; dy1 = y3 - y2
s = (y0-y2)*dx1 - (x0-x2)*dy1
sm = dx0*dy1 - dy0*dx1
if s < 0:
s = -s
sm = -sm
if s == 0:
x = x0
... | output | 1 | 64,787 | 23 | 129,575 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Sereja has an n Γ m rectangular table a, each cell of the table contains a zero or a number one. Sereja wants his table to meet the following requirement: each connected component of the same values forms a rectangle with sides parallel to t... | instruction | 0 | 65,173 | 23 | 130,346 |
Tags: bitmasks, greedy
Correct Solution:
```
from functools import *
read_line = lambda: [int(i) for i in input().split()]
n, m, k = read_line()
a = [read_line() for i in range(n)]
if n < m:
n, m, a = m, n, zip(*a)
xs = [reduce(lambda x, b: 2 * x + b, y) for y in a]
minm = lambda a: min(a, m - a)
work = lambda y... | output | 1 | 65,173 | 23 | 130,347 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Sereja has an n Γ m rectangular table a, each cell of the table contains a zero or a number one. Sereja wants his table to meet the following requirement: each connected component of the same values forms a rectangle with sides parallel to t... | instruction | 0 | 65,174 | 23 | 130,348 |
Tags: bitmasks, greedy
Correct Solution:
```
from functools import *
read_line = lambda: [int(i) for i in input().split()]
n, m, k = read_line()
a = [read_line() for i in range(n)]
if n < m:
n, m, a = m, n, zip(*a)
xs = [reduce(lambda x, b: 2 * x + b, y) for y in a]
minm = lambda a: min(a, m - a)
work = lambda y... | output | 1 | 65,174 | 23 | 130,349 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Sereja has an n Γ m rectangular table a, each cell of the table contains a zero or a number one. Sereja wants his table to meet the following requirement: each connected component of the same values forms a rectangle with sides parallel to t... | instruction | 0 | 65,175 | 23 | 130,350 |
Tags: bitmasks, greedy
Correct Solution:
```
read_line = lambda: [int(i) for i in input().split()]
n, m, k = read_line()
a = [read_line() for i in range(n)]
if n < m:
n, m, a = m, n, zip(*a)
xs = []
for y in a:
x = 0
for b in y:
x = 2 * x + b
xs.append(x)
def work(y):
tot = 0
for x in... | output | 1 | 65,175 | 23 | 130,351 |
Provide tags and a correct Python 3 solution for this coding contest problem.
On a certain meeting of a ruling party "A" minister Pavel suggested to improve the sewer system and to create a new pipe in the city.
The city is an n Γ m rectangular squared field. Each square of the field is either empty (then the pipe ca... | instruction | 0 | 65,189 | 23 | 130,378 |
Tags: binary search, brute force, combinatorics, dp, implementation
Correct Solution:
```
n, m = [int(x) for x in input().split()]
a = [[int(c == '.') for c in input()] for i in range(n)]
def rotate(a):
n = len(a)
m = len(a[0])
b = [[0] * n for i in range(m)]
for i in range(n):
for j in range(m... | output | 1 | 65,189 | 23 | 130,379 |
Provide tags and a correct Python 3 solution for this coding contest problem.
On one quiet day all of sudden Mister B decided to draw angle a on his field. Aliens have already visited his field and left many different geometric figures on it. One of the figures is regular convex n-gon (regular convex polygon with n si... | instruction | 0 | 65,341 | 23 | 130,682 |
Tags: constructive algorithms, geometry, math
Correct Solution:
```
n,a=map(int,input().split())
s=180*(n-2)
c=s/n
k=(180-c)/2
ugl=[]
for i in range(1,n-1):
ugl.append(k*i)
mi=abs(ugl[0]-a)
v=3
for i in range(len(ugl)):
if abs(ugl[i]-a)<mi:
mi=abs(ugl[i]-a)
v=i+3
print('2 1',v)
``` | output | 1 | 65,341 | 23 | 130,683 |
Provide tags and a correct Python 3 solution for this coding contest problem.
On one quiet day all of sudden Mister B decided to draw angle a on his field. Aliens have already visited his field and left many different geometric figures on it. One of the figures is regular convex n-gon (regular convex polygon with n si... | instruction | 0 | 65,342 | 23 | 130,684 |
Tags: constructive algorithms, geometry, math
Correct Solution:
```
n, a = input().split()
n = int(n)
a = int(a)
u = -1
m = 10000
for i in range(1, n-1):
if abs(180/n*i-a) < m:
m=abs(180/n*i-a)
u = i
print(1+u, u+2, 1)
``` | output | 1 | 65,342 | 23 | 130,685 |
Provide tags and a correct Python 3 solution for this coding contest problem.
On one quiet day all of sudden Mister B decided to draw angle a on his field. Aliens have already visited his field and left many different geometric figures on it. One of the figures is regular convex n-gon (regular convex polygon with n si... | instruction | 0 | 65,343 | 23 | 130,686 |
Tags: constructive algorithms, geometry, math
Correct Solution:
```
#!/usr/bin/env python3
import sys
def main():
n, a = map(int, sys.stdin.readline().split())
sum_angles = 180 * (n - 2)
if a >= sum_angles / n:
print("2 1 {}".format(n))
return
div = (n - 2) * n
lo = 1
hi = n - 1... | output | 1 | 65,343 | 23 | 130,687 |
Provide tags and a correct Python 3 solution for this coding contest problem.
On one quiet day all of sudden Mister B decided to draw angle a on his field. Aliens have already visited his field and left many different geometric figures on it. One of the figures is regular convex n-gon (regular convex polygon with n si... | instruction | 0 | 65,344 | 23 | 130,688 |
Tags: constructive algorithms, geometry, math
Correct Solution:
```
s,a=map(int,input().split())
print(2,1,min(2+max(1,(a*s+90)//180),s))
# Made By Mostafa_Khaled
``` | output | 1 | 65,344 | 23 | 130,689 |
Provide tags and a correct Python 3 solution for this coding contest problem.
On one quiet day all of sudden Mister B decided to draw angle a on his field. Aliens have already visited his field and left many different geometric figures on it. One of the figures is regular convex n-gon (regular convex polygon with n si... | instruction | 0 | 65,345 | 23 | 130,690 |
Tags: constructive algorithms, geometry, math
Correct Solution:
```
# _
#####################################################################################################################
def main():
return bestAngle_sVertices(*map(int, input().split()))
def bestAngle_sVertices(nVertices, angle):
angle *= ... | output | 1 | 65,345 | 23 | 130,691 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.