message stringlengths 2 44.5k | message_type stringclasses 2
values | message_id int64 0 1 | conversation_id int64 276 109k | cluster float64 23 23 | __index_level_0__ int64 552 217k |
|---|---|---|---|---|---|
Provide a correct Python 3 solution for this coding contest problem.
4 different points on the plane Read the coordinates of $ A (x_a, y_a) $, $ B (x_b, y_b) $, $ C (x_c, y_c) $, $ D (x_d, y_d) $ and read those 4 points Create a program that outputs YES if there is no dent in the quadrangle $ ABCD $ with the coordinat... | instruction | 0 | 86,455 | 23 | 172,910 |
"Correct Solution:
```
#凸包を求める
def quickhull(l,r,s,k):
if not s:
return
su = []
sd = []
a = (r[0]-l[0],r[1]-l[1])
for x,y in s:
b = (x-l[0],y-l[1])
cro = cross(a,b)
if cro > 0:
su.append((x,y)) #上半分
elif cro < 0:
sd.append((x,y)) #下半分
... | output | 1 | 86,455 | 23 | 172,911 |
Provide a correct Python 3 solution for this coding contest problem.
4 different points on the plane Read the coordinates of $ A (x_a, y_a) $, $ B (x_b, y_b) $, $ C (x_c, y_c) $, $ D (x_d, y_d) $ and read those 4 points Create a program that outputs YES if there is no dent in the quadrangle $ ABCD $ with the coordinat... | instruction | 0 | 86,456 | 23 | 172,912 |
"Correct Solution:
```
from decimal import Decimal
import sys
for l in sys.stdin:
xa,ya,xb,yb,xc,yc,xd,yd=list(map(Decimal,l.split(",")))
a=xd-xb
b=yd-yb
c=xa-xb
d=ya-yb
e=xc-xb
f=yc-yb
try:
s=(a*f-b*e)/(c*f-d*e)
t=(-a*d+b*c)/(c*f-d*e)
except:
print("NO")
if s>=0 and t>=0 and s+t>=1:
... | output | 1 | 86,456 | 23 | 172,913 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
4 different points on the plane Read the coordinates of $ A (x_a, y_a) $, $ B (x_b, y_b) $, $ C (x_c, y_c) $, $ D (x_d, y_d) $ and read those 4 points Create a program that outputs YES if there ... | instruction | 0 | 86,457 | 23 | 172,914 |
Yes | output | 1 | 86,457 | 23 | 172,915 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
4 different points on the plane Read the coordinates of $ A (x_a, y_a) $, $ B (x_b, y_b) $, $ C (x_c, y_c) $, $ D (x_d, y_d) $ and read those 4 points Create a program that outputs YES if there ... | instruction | 0 | 86,458 | 23 | 172,916 |
Yes | output | 1 | 86,458 | 23 | 172,917 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
4 different points on the plane Read the coordinates of $ A (x_a, y_a) $, $ B (x_b, y_b) $, $ C (x_c, y_c) $, $ D (x_d, y_d) $ and read those 4 points Create a program that outputs YES if there ... | instruction | 0 | 86,459 | 23 | 172,918 |
Yes | output | 1 | 86,459 | 23 | 172,919 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
4 different points on the plane Read the coordinates of $ A (x_a, y_a) $, $ B (x_b, y_b) $, $ C (x_c, y_c) $, $ D (x_d, y_d) $ and read those 4 points Create a program that outputs YES if there ... | instruction | 0 | 86,460 | 23 | 172,920 |
Yes | output | 1 | 86,460 | 23 | 172,921 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
4 different points on the plane Read the coordinates of $ A (x_a, y_a) $, $ B (x_b, y_b) $, $ C (x_c, y_c) $, $ D (x_d, y_d) $ and read those 4 points Create a program that outputs YES if there ... | instruction | 0 | 86,461 | 23 | 172,922 |
No | output | 1 | 86,461 | 23 | 172,923 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
4 different points on the plane Read the coordinates of $ A (x_a, y_a) $, $ B (x_b, y_b) $, $ C (x_c, y_c) $, $ D (x_d, y_d) $ and read those 4 points Create a program that outputs YES if there ... | instruction | 0 | 86,462 | 23 | 172,924 |
No | output | 1 | 86,462 | 23 | 172,925 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
4 different points on the plane Read the coordinates of $ A (x_a, y_a) $, $ B (x_b, y_b) $, $ C (x_c, y_c) $, $ D (x_d, y_d) $ and read those 4 points Create a program that outputs YES if there ... | instruction | 0 | 86,463 | 23 | 172,926 |
No | output | 1 | 86,463 | 23 | 172,927 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
4 different points on the plane Read the coordinates of $ A (x_a, y_a) $, $ B (x_b, y_b) $, $ C (x_c, y_c) $, $ D (x_d, y_d) $ and read those 4 points Create a program that outputs YES if there ... | instruction | 0 | 86,464 | 23 | 172,928 |
No | output | 1 | 86,464 | 23 | 172,929 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a chessboard of size n × n. It is filled with numbers from 1 to n^2 in the following way: the first ⌈ (n^2)/(2) ⌉ numbers from 1 to ⌈ (n^2)/(2) ⌉ are written in the cells with even... | instruction | 0 | 86,601 | 23 | 173,202 |
Yes | output | 1 | 86,601 | 23 | 173,203 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a chessboard of size n × n. It is filled with numbers from 1 to n^2 in the following way: the first ⌈ (n^2)/(2) ⌉ numbers from 1 to ⌈ (n^2)/(2) ⌉ are written in the cells with even... | instruction | 0 | 86,602 | 23 | 173,204 |
Yes | output | 1 | 86,602 | 23 | 173,205 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a chessboard of size n × n. It is filled with numbers from 1 to n^2 in the following way: the first ⌈ (n^2)/(2) ⌉ numbers from 1 to ⌈ (n^2)/(2) ⌉ are written in the cells with even... | instruction | 0 | 86,603 | 23 | 173,206 |
Yes | output | 1 | 86,603 | 23 | 173,207 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a chessboard of size n × n. It is filled with numbers from 1 to n^2 in the following way: the first ⌈ (n^2)/(2) ⌉ numbers from 1 to ⌈ (n^2)/(2) ⌉ are written in the cells with even... | instruction | 0 | 86,604 | 23 | 173,208 |
Yes | output | 1 | 86,604 | 23 | 173,209 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a chessboard of size n × n. It is filled with numbers from 1 to n^2 in the following way: the first ⌈ (n^2)/(2) ⌉ numbers from 1 to ⌈ (n^2)/(2) ⌉ are written in the cells with even... | instruction | 0 | 86,605 | 23 | 173,210 |
No | output | 1 | 86,605 | 23 | 173,211 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a chessboard of size n × n. It is filled with numbers from 1 to n^2 in the following way: the first ⌈ (n^2)/(2) ⌉ numbers from 1 to ⌈ (n^2)/(2) ⌉ are written in the cells with even... | instruction | 0 | 86,606 | 23 | 173,212 |
No | output | 1 | 86,606 | 23 | 173,213 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a chessboard of size n × n. It is filled with numbers from 1 to n^2 in the following way: the first ⌈ (n^2)/(2) ⌉ numbers from 1 to ⌈ (n^2)/(2) ⌉ are written in the cells with even... | instruction | 0 | 86,607 | 23 | 173,214 |
No | output | 1 | 86,607 | 23 | 173,215 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given a chessboard of size n × n. It is filled with numbers from 1 to n^2 in the following way: the first ⌈ (n^2)/(2) ⌉ numbers from 1 to ⌈ (n^2)/(2) ⌉ are written in the cells with even... | instruction | 0 | 86,608 | 23 | 173,216 |
No | output | 1 | 86,608 | 23 | 173,217 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You have a long stick, consisting of m segments enumerated from 1 to m. Each segment is 1 centimeter long. Sadly, some segments are broken and need to be repaired.
You have an infinitely long r... | instruction | 0 | 86,641 | 23 | 173,282 |
Yes | output | 1 | 86,641 | 23 | 173,283 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You have a long stick, consisting of m segments enumerated from 1 to m. Each segment is 1 centimeter long. Sadly, some segments are broken and need to be repaired.
You have an infinitely long r... | instruction | 0 | 86,642 | 23 | 173,284 |
Yes | output | 1 | 86,642 | 23 | 173,285 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You have a long stick, consisting of m segments enumerated from 1 to m. Each segment is 1 centimeter long. Sadly, some segments are broken and need to be repaired.
You have an infinitely long r... | instruction | 0 | 86,643 | 23 | 173,286 |
Yes | output | 1 | 86,643 | 23 | 173,287 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You have a long stick, consisting of m segments enumerated from 1 to m. Each segment is 1 centimeter long. Sadly, some segments are broken and need to be repaired.
You have an infinitely long r... | instruction | 0 | 86,644 | 23 | 173,288 |
Yes | output | 1 | 86,644 | 23 | 173,289 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You have a long stick, consisting of m segments enumerated from 1 to m. Each segment is 1 centimeter long. Sadly, some segments are broken and need to be repaired.
You have an infinitely long r... | instruction | 0 | 86,645 | 23 | 173,290 |
No | output | 1 | 86,645 | 23 | 173,291 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You have a long stick, consisting of m segments enumerated from 1 to m. Each segment is 1 centimeter long. Sadly, some segments are broken and need to be repaired.
You have an infinitely long r... | instruction | 0 | 86,646 | 23 | 173,292 |
No | output | 1 | 86,646 | 23 | 173,293 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You have a long stick, consisting of m segments enumerated from 1 to m. Each segment is 1 centimeter long. Sadly, some segments are broken and need to be repaired.
You have an infinitely long r... | instruction | 0 | 86,647 | 23 | 173,294 |
No | output | 1 | 86,647 | 23 | 173,295 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You have a long stick, consisting of m segments enumerated from 1 to m. Each segment is 1 centimeter long. Sadly, some segments are broken and need to be repaired.
You have an infinitely long r... | instruction | 0 | 86,648 | 23 | 173,296 |
No | output | 1 | 86,648 | 23 | 173,297 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Guy-Manuel and Thomas are going to build a polygon spaceship.
You're given a strictly convex (i. e. no three points are collinear) polygon P which is defined by coordinates of its vertices. Define P(x,y) as a polygon obtained by translating... | instruction | 0 | 86,737 | 23 | 173,474 |
Tags: geometry
Correct Solution:
```
n = int(input())
pts = set([tuple(map(int, input().split())) for i in range(n)])
centre = (sum([a for a,b in pts])/n, sum([b for a,b in pts])/n)
ok = True
for x,y in pts:
if (int(x+(centre[0]-x)*2), int(y+(centre[1]-y)*2)) not in pts:
ok = False
break
if ok:
print("YES")
e... | output | 1 | 86,737 | 23 | 173,475 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Guy-Manuel and Thomas are going to build a polygon spaceship.
You're given a strictly convex (i. e. no three points are collinear) polygon P which is defined by coordinates of its vertices. Define P(x,y) as a polygon obtained by translating... | instruction | 0 | 86,738 | 23 | 173,476 |
Tags: geometry
Correct Solution:
```
from sys import stdin, stdout
def deg(p1, p2):
if p1[0] == p2[0]:
return 1e20
return (p1[1] - p2[1]) / (p1[0] - p2[0])
def dist2(p1, p2):
return (p1[0] - p2[0]) * (p1[0] - p2[0]) + (p1[1] - p2[1]) * (p1[1] - p2[1])
n = int(input())
a = []
for i in range(n):... | output | 1 | 86,738 | 23 | 173,477 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Guy-Manuel and Thomas are going to build a polygon spaceship.
You're given a strictly convex (i. e. no three points are collinear) polygon P which is defined by coordinates of its vertices. Define P(x,y) as a polygon obtained by translating... | instruction | 0 | 86,739 | 23 | 173,478 |
Tags: geometry
Correct Solution:
```
"""
Author: guiferviz
Time: 2020-02-09 15:05:02
"""
def normalize_pol(P):
x_min, y_min, x_max, y_max = P[0][0], P[0][1], P[0][0], P[0][1]
for x, y in P:
x_min = min(x_min, x)
x_max = max(x_max, x)
y_min = min(y_min, y)
y_max = max(y_max, y)
... | output | 1 | 86,739 | 23 | 173,479 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Guy-Manuel and Thomas are going to build a polygon spaceship.
You're given a strictly convex (i. e. no three points are collinear) polygon P which is defined by coordinates of its vertices. Define P(x,y) as a polygon obtained by translating... | instruction | 0 | 86,740 | 23 | 173,480 |
Tags: geometry
Correct Solution:
```
import os,io
import sys
input=io.BytesIO(os.read(0,os.fstat(0).st_size)).readline
n=int(input())
shape=[]
for _ in range(n):
x,y=map(int,input().split())
shape.append([x,y])
if n%2==1:
print('NO')
sys.exit()
for i in range(n):
if shape[i][0]-shape[i-1][0]!=shape[... | output | 1 | 86,740 | 23 | 173,481 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Guy-Manuel and Thomas are going to build a polygon spaceship.
You're given a strictly convex (i. e. no three points are collinear) polygon P which is defined by coordinates of its vertices. Define P(x,y) as a polygon obtained by translating... | instruction | 0 | 86,741 | 23 | 173,482 |
Tags: geometry
Correct Solution:
```
n = int(input())
p = []
for i in range(n):
p.append(list(map(int,input().split())))
if n%2==1:
print("NO")
else:
ok = True
for i in range(n//2):
if p[0][0]+p[n//2][0]!=p[i][0]+p[i+n//2][0] or p[0][1]+p[n//2][1]!=p[i][1]+p[i+n//2][1]:
ok = False
... | output | 1 | 86,741 | 23 | 173,483 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Guy-Manuel and Thomas are going to build a polygon spaceship.
You're given a strictly convex (i. e. no three points are collinear) polygon P which is defined by coordinates of its vertices. Define P(x,y) as a polygon obtained by translating... | instruction | 0 | 86,742 | 23 | 173,484 |
Tags: geometry
Correct Solution:
```
import sys
input = lambda: sys.stdin.readline().rstrip()
n = int(input())
xy = []
for _ in range(n):
x, y = map(int, input().split())
xy.append((x, y))
if n%2:
print('NO')
exit(0)
for i in range(n//2):
xy0 = xy[i]
xy1 = xy[i+1]
xy2 = xy[n//2+i]
xy3 = ... | output | 1 | 86,742 | 23 | 173,485 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Guy-Manuel and Thomas are going to build a polygon spaceship.
You're given a strictly convex (i. e. no three points are collinear) polygon P which is defined by coordinates of its vertices. Define P(x,y) as a polygon obtained by translating... | instruction | 0 | 86,743 | 23 | 173,486 |
Tags: geometry
Correct Solution:
```
import sys
def main():
n = int(sys.stdin.readline().split()[0])
a = [list(map(int, sys.stdin.readline().split())) for _ in range(n)]
if n&1 == 1:
print("NO")
return
m = n//2
for i in range(-1, m-1):
if a[i+1][0]-a[i][0] != -a[i+1+m][0]+a[... | output | 1 | 86,743 | 23 | 173,487 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Guy-Manuel and Thomas are going to build a polygon spaceship.
You're given a strictly convex (i. e. no three points are collinear) polygon P which is defined by coordinates of its vertices. Define P(x,y) as a polygon obtained by translating... | instruction | 0 | 86,744 | 23 | 173,488 |
Tags: geometry
Correct Solution:
```
n = int(input())
P = [list(map(int, input().split())) for i in range(n)]
if n % 2 == 1:
print('NO')
else:
dx, dy = P[0][0]-P[1][0], P[0][1]-P[1][1]
for i in range(2, n):
dx2, dy2 = P[i][0]-P[(i+1)%n][0], P[i][1]-P[(i+1)%n][1]
if dx2 == -dx and dy2 == -... | output | 1 | 86,744 | 23 | 173,489 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Guy-Manuel and Thomas are going to build a polygon spaceship.
You're given a strictly convex (i. e. no three points are collinear) polygon P which is defined by coordinates of its vertices. Def... | instruction | 0 | 86,745 | 23 | 173,490 |
Yes | output | 1 | 86,745 | 23 | 173,491 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Guy-Manuel and Thomas are going to build a polygon spaceship.
You're given a strictly convex (i. e. no three points are collinear) polygon P which is defined by coordinates of its vertices. Def... | instruction | 0 | 86,746 | 23 | 173,492 |
Yes | output | 1 | 86,746 | 23 | 173,493 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Guy-Manuel and Thomas are going to build a polygon spaceship.
You're given a strictly convex (i. e. no three points are collinear) polygon P which is defined by coordinates of its vertices. Def... | instruction | 0 | 86,747 | 23 | 173,494 |
Yes | output | 1 | 86,747 | 23 | 173,495 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Guy-Manuel and Thomas are going to build a polygon spaceship.
You're given a strictly convex (i. e. no three points are collinear) polygon P which is defined by coordinates of its vertices. Def... | instruction | 0 | 86,748 | 23 | 173,496 |
Yes | output | 1 | 86,748 | 23 | 173,497 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Guy-Manuel and Thomas are going to build a polygon spaceship.
You're given a strictly convex (i. e. no three points are collinear) polygon P which is defined by coordinates of its vertices. Def... | instruction | 0 | 86,749 | 23 | 173,498 |
No | output | 1 | 86,749 | 23 | 173,499 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Guy-Manuel and Thomas are going to build a polygon spaceship.
You're given a strictly convex (i. e. no three points are collinear) polygon P which is defined by coordinates of its vertices. Def... | instruction | 0 | 86,750 | 23 | 173,500 |
No | output | 1 | 86,750 | 23 | 173,501 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Guy-Manuel and Thomas are going to build a polygon spaceship.
You're given a strictly convex (i. e. no three points are collinear) polygon P which is defined by coordinates of its vertices. Def... | instruction | 0 | 86,751 | 23 | 173,502 |
No | output | 1 | 86,751 | 23 | 173,503 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Guy-Manuel and Thomas are going to build a polygon spaceship.
You're given a strictly convex (i. e. no three points are collinear) polygon P which is defined by coordinates of its vertices. Def... | instruction | 0 | 86,752 | 23 | 173,504 |
No | output | 1 | 86,752 | 23 | 173,505 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Three companies decided to order a billboard with pictures of their logos. A billboard is a big square board. A logo of each company is a rectangle of a non-zero area.
Advertisers will put up the ad only if it is possible to place all thre... | instruction | 0 | 87,067 | 23 | 174,134 |
Tags: bitmasks, brute force, constructive algorithms, geometry, implementation, math
Correct Solution:
```
__author__ = 'User'
def f(arr, value, deep, vis):
global flag
if flag == True:
return
fl = False
#print("Num")
pos = (0, 0)
for i in range(n):
for j in range(n):
... | output | 1 | 87,067 | 23 | 174,135 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Three companies decided to order a billboard with pictures of their logos. A billboard is a big square board. A logo of each company is a rectangle of a non-zero area.
Advertisers will put up the ad only if it is possible to place all thre... | instruction | 0 | 87,068 | 23 | 174,136 |
Tags: bitmasks, brute force, constructive algorithms, geometry, implementation, math
Correct Solution:
```
v=list(map(int,input().split()))
def funk(a):
if ((a[0]==a[2]+a[4])and(a[1]+a[3]==a[0])and(a[3]==a[5])):
print(a[0])
for i in range(a[1]):
print('A'*a[0])
for i in range(a[3]):
print('B'*a[2]+'C'*a[4]... | output | 1 | 87,068 | 23 | 174,137 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Three companies decided to order a billboard with pictures of their logos. A billboard is a big square board. A logo of each company is a rectangle of a non-zero area.
Advertisers will put up the ad only if it is possible to place all thre... | instruction | 0 | 87,069 | 23 | 174,138 |
Tags: bitmasks, brute force, constructive algorithms, geometry, implementation, math
Correct Solution:
```
x1, y1, x2, y2, x3, y3 = map(int, input().split())
x1, y1 = max(x1, y1), min(x1, y1)
x2, y2 = max(x2, y2), min(x2, y2)
x3, y3 = max(x3, y3), min(x3, y3)
x1c, y1c, x2c, y2c, x3c, y3c = x1, y1, x2, y2, x3, y3
if x2 ... | output | 1 | 87,069 | 23 | 174,139 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Three companies decided to order a billboard with pictures of their logos. A billboard is a big square board. A logo of each company is a rectangle of a non-zero area.
Advertisers will put up the ad only if it is possible to place all thre... | instruction | 0 | 87,070 | 23 | 174,140 |
Tags: bitmasks, brute force, constructive algorithms, geometry, implementation, math
Correct Solution:
```
from sys import *
inp = lambda : stdin.readline()
def main():
x1,y1,x2,y2,x3,y3 = map(int,inp().split())
m = max(x1,x2,x3,y1,y2,y3)
l = [(x1,y1),(x2,y2),(x3,y3)]
ans = [ ['C' for i in range(m)] fo... | output | 1 | 87,070 | 23 | 174,141 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Three companies decided to order a billboard with pictures of their logos. A billboard is a big square board. A logo of each company is a rectangle of a non-zero area.
Advertisers will put up the ad only if it is possible to place all thre... | instruction | 0 | 87,071 | 23 | 174,142 |
Tags: bitmasks, brute force, constructive algorithms, geometry, implementation, math
Correct Solution:
```
#!/usr/bin/python3
from itertools import permutations
def isqrt(x):
l, r = 0, 10**100
while l < r - 1:
mid = (l + r) // 2
if mid ** 2 > x:
r = mid
else:
l... | output | 1 | 87,071 | 23 | 174,143 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Three companies decided to order a billboard with pictures of their logos. A billboard is a big square board. A logo of each company is a rectangle of a non-zero area.
Advertisers will put up the ad only if it is possible to place all thre... | instruction | 0 | 87,072 | 23 | 174,144 |
Tags: bitmasks, brute force, constructive algorithms, geometry, implementation, math
Correct Solution:
```
inp = input().split()
a = [int(inp[0]),int(inp[1])]
b = [int(inp[2]),int(inp[3])]
c = [int(inp[4]),int(inp[5])]
a.sort()
a.reverse()
a.append("A")
b.sort()
b.reverse()
b.append("B")
c.sort()
c.reverse()
c.append("... | output | 1 | 87,072 | 23 | 174,145 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Three companies decided to order a billboard with pictures of their logos. A billboard is a big square board. A logo of each company is a rectangle of a non-zero area.
Advertisers will put up the ad only if it is possible to place all thre... | instruction | 0 | 87,073 | 23 | 174,146 |
Tags: bitmasks, brute force, constructive algorithms, geometry, implementation, math
Correct Solution:
```
import sys
def get_sol(a, b, c, n, reverse):
#1
if reverse[0]:
a = (a[1], a[0], a[2])
if reverse[1]:
b = (b[1], b[0], b[2])
if reverse[2]:
c = (c[1], c[0], c[2])
ans = []
if a[0] == b[0] == c[0] ==... | output | 1 | 87,073 | 23 | 174,147 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Three companies decided to order a billboard with pictures of their logos. A billboard is a big square board. A logo of each company is a rectangle of a non-zero area.
Advertisers will put up the ad only if it is possible to place all thre... | instruction | 0 | 87,074 | 23 | 174,148 |
Tags: bitmasks, brute force, constructive algorithms, geometry, implementation, math
Correct Solution:
```
a,b,c,d,e,f=map(int,input().split())
m=sorted([(max(a,b),min(a,b),"A"),(max(c,d),min(c,d),"B"),(max(e,f),min(e,f),"C")])
ma=m[-1][0]
ma2=ma-m[-1][1]
ans=[["A"]*ma for i in range(ma)]
if a*b+c*d+e*f!=ma*ma: print(-... | output | 1 | 87,074 | 23 | 174,149 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.