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 tags and a correct Python 3 solution for this coding contest problem.
Memory is now interested in the de-evolution of objects, specifically triangles. He starts with an equilateral triangle of side length x, and he wishes to perform operations to obtain an equilateral triangle of side length y.
In a single se... | instruction | 0 | 5,486 | 23 | 10,972 |
Tags: greedy, math
Correct Solution:
```
y, x = map(int, input().split())
def f(a):
a = sorted(a)
if a[0] == y:
return 0
a[0] = min(sum(a[1:]) - 1, y)
return 1 + f(a)
print(f([x, x, x]))
``` | output | 1 | 5,486 | 23 | 10,973 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Memory is now interested in the de-evolution of objects, specifically triangles. He starts with an equilateral triangle of side length x, and he wishes to perform operations to obtain an equilateral triangle of side length y.
In a single se... | instruction | 0 | 5,487 | 23 | 10,974 |
Tags: greedy, math
Correct Solution:
```
s=input().split()
tr=int(s[0])
gl=int(s[1])
list=list(range(3))
list[0]=gl
list[1]=gl
list[2]=gl
b=0
while list[0]!=tr or list[1]!=tr or list[2]!=tr:
if (list[1]+list[2]-1)>tr:
if list[0]!=tr:
list[0]=tr
b+=1
else:
if list[0]!=tr:
... | output | 1 | 5,487 | 23 | 10,975 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Memory is now interested in the de-evolution of objects, specifically triangles. He starts with an equilateral triangle of side length x, and he wishes to perform operations to obtain an equilateral triangle of side length y.
In a single se... | instruction | 0 | 5,488 | 23 | 10,976 |
Tags: greedy, math
Correct Solution:
```
x, y = map(int, input().split())
a = b = c = y
ans = 0
while min(a, b, c) != x:
arr = list(sorted([a, b, c]))
arr[0] = min(x, arr[1] + arr[2] - 1)
a, b, c = arr
ans += 1
print(ans)
``` | output | 1 | 5,488 | 23 | 10,977 |
Provide tags and a correct Python 3 solution for this coding contest problem.
Memory is now interested in the de-evolution of objects, specifically triangles. He starts with an equilateral triangle of side length x, and he wishes to perform operations to obtain an equilateral triangle of side length y.
In a single se... | instruction | 0 | 5,489 | 23 | 10,978 |
Tags: greedy, math
Correct Solution:
```
#!/usr/bin/env python
#-*-coding:utf-8 -*-
x,y=map(int,input().split())
N=3
L=N*[y]
y=i=0
while x>L[i]:
j=(1+i)%N
L[i]=L[(i-1)%N]-1+L[j]
i=j
y+=1
print(y)
``` | output | 1 | 5,489 | 23 | 10,979 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Memory is now interested in the de-evolution of objects, specifically triangles. He starts with an equilateral triangle of side length x, and he wishes to perform operations to obtain an equilat... | instruction | 0 | 5,490 | 23 | 10,980 |
Yes | output | 1 | 5,490 | 23 | 10,981 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Memory is now interested in the de-evolution of objects, specifically triangles. He starts with an equilateral triangle of side length x, and he wishes to perform operations to obtain an equilat... | instruction | 0 | 5,491 | 23 | 10,982 |
Yes | output | 1 | 5,491 | 23 | 10,983 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Memory is now interested in the de-evolution of objects, specifically triangles. He starts with an equilateral triangle of side length x, and he wishes to perform operations to obtain an equilat... | instruction | 0 | 5,492 | 23 | 10,984 |
Yes | output | 1 | 5,492 | 23 | 10,985 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Memory is now interested in the de-evolution of objects, specifically triangles. He starts with an equilateral triangle of side length x, and he wishes to perform operations to obtain an equilat... | instruction | 0 | 5,493 | 23 | 10,986 |
Yes | output | 1 | 5,493 | 23 | 10,987 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Memory is now interested in the de-evolution of objects, specifically triangles. He starts with an equilateral triangle of side length x, and he wishes to perform operations to obtain an equilat... | instruction | 0 | 5,494 | 23 | 10,988 |
No | output | 1 | 5,494 | 23 | 10,989 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Memory is now interested in the de-evolution of objects, specifically triangles. He starts with an equilateral triangle of side length x, and he wishes to perform operations to obtain an equilat... | instruction | 0 | 5,495 | 23 | 10,990 |
No | output | 1 | 5,495 | 23 | 10,991 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Memory is now interested in the de-evolution of objects, specifically triangles. He starts with an equilateral triangle of side length x, and he wishes to perform operations to obtain an equilat... | instruction | 0 | 5,496 | 23 | 10,992 |
No | output | 1 | 5,496 | 23 | 10,993 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
Memory is now interested in the de-evolution of objects, specifically triangles. He starts with an equilateral triangle of side length x, and he wishes to perform operations to obtain an equilat... | instruction | 0 | 5,497 | 23 | 10,994 |
No | output | 1 | 5,497 | 23 | 10,995 |
Provide a correct Python 3 solution for this coding contest problem.
Ordinary Jigsaw puzzles are solved with visual hints; players solve a puzzle with the picture which the puzzle shows on finish, and the diverse patterns of pieces. Such Jigsaw puzzles may be suitable for human players, because they require abilities ... | instruction | 0 | 5,746 | 23 | 11,492 |
"Correct Solution:
```
p_ch = [True] * 9
rot = ((0, 1, 2, 3), (1, 2, 3, 0), (2, 3, 0, 1), (3, 0, 1, 2))
adj = ['c'] * 13
# record indices of right and botoom adjacent edge label. 12 is invalid.
rec_adj = [[0, 2], [1, 3], [12, 4], [5, 7], [6, 8], [12, 9], [10, 12],
[11, 12], [12, 12]]
# refernce indices to ... | output | 1 | 5,746 | 23 | 11,493 |
Provide a correct Python 3 solution for this coding contest problem.
Problem statement
There are rectangles with vertical and horizontal lengths of h and w, and square squares with a side length of 1 are spread inside. If the upper left cell is (0,0) and the cell to the right of j below (0,0) is represented as (i, j)... | instruction | 0 | 5,778 | 23 | 11,556 |
"Correct Solution:
```
def gcd(a,b):
if a == 0:
return b
else:
return gcd(b%a,a)
t = int(input())
while t:
t -= 1
a,b = map(int, input().split())
c = gcd(a,b)
a = a//c
b = b//c
if a == b:
ans1 = 1
ans2 = 0
elif a % 2 == 0 or b % 2 == 0:
ans1 = ... | output | 1 | 5,778 | 23 | 11,557 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given two rectangles on a plane. The centers of both rectangles are located in the origin of coordinates (meaning the center of the rectangle's symmetry). The first rectangle's sides are parallel to the coordinate axes: the length of... | instruction | 0 | 6,095 | 23 | 12,190 |
Tags: geometry
Correct Solution:
```
#!/usr/bin/python3
from math import sin, cos, pi, atan2
w, h, a = tuple(map(int, input().split()))
if a in [0, 180]:
print(w * h)
elif a == 90:
print(min(w, h)**2)
else:
a *= pi / 180
w /= 2
h /= 2
base = [(w, h), (-w, h), (-w, -h), (w, -h)]
rot = [(x *... | output | 1 | 6,095 | 23 | 12,191 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given two rectangles on a plane. The centers of both rectangles are located in the origin of coordinates (meaning the center of the rectangle's symmetry). The first rectangle's sides are parallel to the coordinate axes: the length of... | instruction | 0 | 6,096 | 23 | 12,192 |
Tags: geometry
Correct Solution:
```
import os
import sys
from io import BytesIO, IOBase
import math
def main():
pass
BUFSIZE = 8192
class FastIO(IOBase):
newlines = 0
def __init__(self, file):
self._fd = file.fileno()
self.buffer = BytesIO()
self.writable = "x" in file.mode or "r... | output | 1 | 6,096 | 23 | 12,193 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given two rectangles on a plane. The centers of both rectangles are located in the origin of coordinates (meaning the center of the rectangle's symmetry). The first rectangle's sides are parallel to the coordinate axes: the length of... | instruction | 0 | 6,097 | 23 | 12,194 |
Tags: geometry
Correct Solution:
```
from math import sin, cos, tan, atan, pi
def main():
w, h, a = map(int, input().split())
a = min(a, 180 - a) * pi / 180
if h > w:
h, w = w, h
if h * (1 + cos(a)) < w * sin(a):
res = h * h / sin(a)
else:
res = h * w - ((w - h * tan(a / 2)... | output | 1 | 6,097 | 23 | 12,195 |
Provide tags and a correct Python 3 solution for this coding contest problem.
You are given two rectangles on a plane. The centers of both rectangles are located in the origin of coordinates (meaning the center of the rectangle's symmetry). The first rectangle's sides are parallel to the coordinate axes: the length of... | instruction | 0 | 6,098 | 23 | 12,196 |
Tags: geometry
Correct Solution:
```
import math
def rot_by_a(p, a):
return (p[0] * math.cos(a) - p[1] * math.sin(a),
p[0] * math.sin(a) + p[1] * math.cos(a))
h, w, alpha = map(int, input().split())
if h > w:
h, w = w, h
if alpha > 90:
alpha = 180 - alpha
ang = math.radians(alpha)
b = 2 ... | output | 1 | 6,098 | 23 | 12,197 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given two rectangles on a plane. The centers of both rectangles are located in the origin of coordinates (meaning the center of the rectangle's symmetry). The first rectangle's sides are... | instruction | 0 | 6,099 | 23 | 12,198 |
No | output | 1 | 6,099 | 23 | 12,199 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given two rectangles on a plane. The centers of both rectangles are located in the origin of coordinates (meaning the center of the rectangle's symmetry). The first rectangle's sides are... | instruction | 0 | 6,100 | 23 | 12,200 |
No | output | 1 | 6,100 | 23 | 12,201 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given two rectangles on a plane. The centers of both rectangles are located in the origin of coordinates (meaning the center of the rectangle's symmetry). The first rectangle's sides are... | instruction | 0 | 6,101 | 23 | 12,202 |
No | output | 1 | 6,101 | 23 | 12,203 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
You are given two rectangles on a plane. The centers of both rectangles are located in the origin of coordinates (meaning the center of the rectangle's symmetry). The first rectangle's sides are... | instruction | 0 | 6,102 | 23 | 12,204 |
No | output | 1 | 6,102 | 23 | 12,205 |
Provide a correct Python 3 solution for this coding contest problem.
There are N dots in a two-dimensional plane. The coordinates of the i-th dot are (x_i, y_i).
We will repeat the following operation as long as possible:
* Choose four integers a, b, c, d (a \neq c, b \neq d) such that there are dots at exactly thre... | instruction | 0 | 6,413 | 23 | 12,826 |
"Correct Solution:
```
import sys
from collections import defaultdict
import queue
n = int(sys.stdin.readline())
graph = defaultdict(list)
X, Y = [[] for i in range(n)], [[] for i in range(n)]
atX, atY = defaultdict(list), defaultdict(list)
for i in range(n):
a, b = map(int, sys.stdin.readline().split())
a -= 1; ... | output | 1 | 6,413 | 23 | 12,827 |
Provide a correct Python 3 solution for this coding contest problem.
There are N dots in a two-dimensional plane. The coordinates of the i-th dot are (x_i, y_i).
We will repeat the following operation as long as possible:
* Choose four integers a, b, c, d (a \neq c, b \neq d) such that there are dots at exactly thre... | instruction | 0 | 6,414 | 23 | 12,828 |
"Correct Solution:
```
from itertools import*
from math import*
from collections import*
from heapq import*
from bisect import bisect_left,bisect_right
from copy import deepcopy
inf = float("inf")
mod = 10**9+7
from functools import reduce
import sys
sys.setrecursionlimit(10**7)
class UnionFind():
def __init__(sel... | output | 1 | 6,414 | 23 | 12,829 |
Provide a correct Python 3 solution for this coding contest problem.
There are N dots in a two-dimensional plane. The coordinates of the i-th dot are (x_i, y_i).
We will repeat the following operation as long as possible:
* Choose four integers a, b, c, d (a \neq c, b \neq d) such that there are dots at exactly thre... | instruction | 0 | 6,415 | 23 | 12,830 |
"Correct Solution:
```
# 長方形の4点のうち3点が必要なので自明からほど遠い
# x,yを2部グラフ、格子を辺とみなす
# 連結成分ごとに張られる......
n = int(input())
xy = [list(map(int, input().split())) for _ in range(n)]
mx =0
my = 0
for i in range(n):
mx = max(mx,xy[i][0])
my = max(my,xy[i][1])
*p, = range(mx+my+1)
rank = [1]*(mx+my+1)
for i in range(n):
xy... | output | 1 | 6,415 | 23 | 12,831 |
Provide a correct Python 3 solution for this coding contest problem.
There are N dots in a two-dimensional plane. The coordinates of the i-th dot are (x_i, y_i).
We will repeat the following operation as long as possible:
* Choose four integers a, b, c, d (a \neq c, b \neq d) such that there are dots at exactly thre... | instruction | 0 | 6,416 | 23 | 12,832 |
"Correct Solution:
```
n = int(input())
xy = [list(map(int, input().split())) for _ in range(n)]
xtoy = {}
ytox = {}
for x, y in xy:
if x not in xtoy:
xtoy[x] = []
xtoy[x].append(y)
if y not in ytox:
ytox[y] = []
ytox[y].append(x)
ret = 0
while len(xtoy) > 0:
x = next(iter(xtoy))
... | output | 1 | 6,416 | 23 | 12,833 |
Provide a correct Python 3 solution for this coding contest problem.
There are N dots in a two-dimensional plane. The coordinates of the i-th dot are (x_i, y_i).
We will repeat the following operation as long as possible:
* Choose four integers a, b, c, d (a \neq c, b \neq d) such that there are dots at exactly thre... | instruction | 0 | 6,417 | 23 | 12,834 |
"Correct Solution:
```
import sys
input = sys.stdin.readline
max_n = 10**5
ans = 0
n = int(input())
class UnionFind:
def __init__(self, n):
self.par = [i for i in range(n)]
self.sizea = [1 if _ < n//2 else 0 for _ in range(n)]
self.sizeb = [0 if _ < n//2 else 1 for _ in range(n)]
se... | output | 1 | 6,417 | 23 | 12,835 |
Provide a correct Python 3 solution for this coding contest problem.
There are N dots in a two-dimensional plane. The coordinates of the i-th dot are (x_i, y_i).
We will repeat the following operation as long as possible:
* Choose four integers a, b, c, d (a \neq c, b \neq d) such that there are dots at exactly thre... | instruction | 0 | 6,418 | 23 | 12,836 |
"Correct Solution:
```
# https://drken1215.hatenablog.com/entry/2019/06/23/004700
# https://atcoder.jp/contests/abc131/submissions/7975278
# https://tjkendev.github.io/procon-library/python/union_find/union_find.html
def main():
from collections import Counter
import sys
input = sys.stdin.readline
MX ... | output | 1 | 6,418 | 23 | 12,837 |
Provide a correct Python 3 solution for this coding contest problem.
There are N dots in a two-dimensional plane. The coordinates of the i-th dot are (x_i, y_i).
We will repeat the following operation as long as possible:
* Choose four integers a, b, c, d (a \neq c, b \neq d) such that there are dots at exactly thre... | instruction | 0 | 6,419 | 23 | 12,838 |
"Correct Solution:
```
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda :sys.stdin.readline().rstrip()
def resolve():
V=100005
n=int(input())
E=[[] for _ in range(V*2)]
for _ in range(n):
x,y=map(int,input().split())
y+=V
E[x].append(y)
... | output | 1 | 6,419 | 23 | 12,839 |
Provide a correct Python 3 solution for this coding contest problem.
There are N dots in a two-dimensional plane. The coordinates of the i-th dot are (x_i, y_i).
We will repeat the following operation as long as possible:
* Choose four integers a, b, c, d (a \neq c, b \neq d) such that there are dots at exactly thre... | instruction | 0 | 6,420 | 23 | 12,840 |
"Correct Solution:
```
import sys
sys.setrecursionlimit(10 ** 7)
def dfs(G, F, crr, pre, ret, st):
F[crr] = False
if crr < 10**5:
ret[0] += 1
else:
ret[1] += 1
for nxt in G[crr]:
if nxt == pre:
continue
p, q = crr, nxt
if q < p:
p, q = q, ... | output | 1 | 6,420 | 23 | 12,841 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are N dots in a two-dimensional plane. The coordinates of the i-th dot are (x_i, y_i).
We will repeat the following operation as long as possible:
* Choose four integers a, b, c, d (a \n... | instruction | 0 | 6,421 | 23 | 12,842 |
Yes | output | 1 | 6,421 | 23 | 12,843 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are N dots in a two-dimensional plane. The coordinates of the i-th dot are (x_i, y_i).
We will repeat the following operation as long as possible:
* Choose four integers a, b, c, d (a \n... | instruction | 0 | 6,422 | 23 | 12,844 |
Yes | output | 1 | 6,422 | 23 | 12,845 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are N dots in a two-dimensional plane. The coordinates of the i-th dot are (x_i, y_i).
We will repeat the following operation as long as possible:
* Choose four integers a, b, c, d (a \n... | instruction | 0 | 6,423 | 23 | 12,846 |
Yes | output | 1 | 6,423 | 23 | 12,847 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are N dots in a two-dimensional plane. The coordinates of the i-th dot are (x_i, y_i).
We will repeat the following operation as long as possible:
* Choose four integers a, b, c, d (a \n... | instruction | 0 | 6,424 | 23 | 12,848 |
Yes | output | 1 | 6,424 | 23 | 12,849 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are N dots in a two-dimensional plane. The coordinates of the i-th dot are (x_i, y_i).
We will repeat the following operation as long as possible:
* Choose four integers a, b, c, d (a \n... | instruction | 0 | 6,425 | 23 | 12,850 |
No | output | 1 | 6,425 | 23 | 12,851 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are N dots in a two-dimensional plane. The coordinates of the i-th dot are (x_i, y_i).
We will repeat the following operation as long as possible:
* Choose four integers a, b, c, d (a \n... | instruction | 0 | 6,426 | 23 | 12,852 |
No | output | 1 | 6,426 | 23 | 12,853 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are N dots in a two-dimensional plane. The coordinates of the i-th dot are (x_i, y_i).
We will repeat the following operation as long as possible:
* Choose four integers a, b, c, d (a \n... | instruction | 0 | 6,427 | 23 | 12,854 |
No | output | 1 | 6,427 | 23 | 12,855 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are N dots in a two-dimensional plane. The coordinates of the i-th dot are (x_i, y_i).
We will repeat the following operation as long as possible:
* Choose four integers a, b, c, d (a \n... | instruction | 0 | 6,428 | 23 | 12,856 |
No | output | 1 | 6,428 | 23 | 12,857 |
Provide a correct Python 3 solution for this coding contest problem.
There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "YES" and if not... | instruction | 0 | 6,493 | 23 | 12,986 |
"Correct Solution:
```
EPS = 10**-10
n = int(input())
pos = []
for _ in range(n):
pos.append(list(map(float, input().split())))
for i in range(n):
vec_ax = pos[i][2]-pos[i][0]
vec_ay = pos[i][3]-pos[i][1]
vec_bx = pos[i][6]-pos[i][4]
vec_by = pos[i][7]-pos[i][5]
if abs(vec_bx*vec_ay - vec_by*vec_ax) < EPS... | output | 1 | 6,493 | 23 | 12,987 |
Provide a correct Python 3 solution for this coding contest problem.
There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "YES" and if not... | instruction | 0 | 6,494 | 23 | 12,988 |
"Correct Solution:
```
def cross_product(a,b):
return (a.conjugate()*b).imag
N = int(input().strip())
for _ in range(N):
P = list(map(float,input().strip().split()))
for i in range(len(P)):
P[i] = int(P[i]*1000000.0)
z = complex(P[0]-P[2],P[1]-P[3])
w = complex(P[4]-P[6],P[5]-P[7])
if ab... | output | 1 | 6,494 | 23 | 12,989 |
Provide a correct Python 3 solution for this coding contest problem.
There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "YES" and if not... | instruction | 0 | 6,495 | 23 | 12,990 |
"Correct Solution:
```
import math
import cmath
def cross_product(a,b):
return (a.conjugate()*b).imag
n = int(input())
for i in range(n):
L = list(map(float,input().split()))
a,b,c,d = [complex(L[j*2],L[j*2+1]) for j in range(4)]
vec_A = b-a
vec_B = d-c
if abs(cross_product(vec_A,vec_B)) < 1e-11... | output | 1 | 6,495 | 23 | 12,991 |
Provide a correct Python 3 solution for this coding contest problem.
There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "YES" and if not... | instruction | 0 | 6,496 | 23 | 12,992 |
"Correct Solution:
```
E = 10 ** -10
def check(lst):
x1, y1, x2, y2, x3, y3, x4, y4 = lst
vabx, vaby = x2 - x1, y2 - y1
vcdx, vcdy = x4 - x3, y4 - y3
if abs(vabx * vcdy - vcdx * vaby) < E:
return True
else:
return False
n = int(input())
for _ in range(n):
plst = list(map(float, input().split()))
... | output | 1 | 6,496 | 23 | 12,993 |
Provide a correct Python 3 solution for this coding contest problem.
There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "YES" and if not... | instruction | 0 | 6,497 | 23 | 12,994 |
"Correct Solution:
```
n = int(input())
for _ in range(n):
x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split())
abx = x2 - x1
aby = y2 - y1
cdx = x4 - x3
cdy = y4 - y3
if abs(aby * cdx) < 1e-10 and abs(cdy * abx) < 1e-10:
print(['NO', 'YES'][abs(abx - cdx) < 1e-10 or abs(aby - cd... | output | 1 | 6,497 | 23 | 12,995 |
Provide a correct Python 3 solution for this coding contest problem.
There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "YES" and if not... | instruction | 0 | 6,498 | 23 | 12,996 |
"Correct Solution:
```
import math
def equal(x, y):
return math.fabs(x - y) <= 10 ** (-10)
def spam(_x1, _y1, _x2, _y2):
if _x1 > _x2:
return _x1, _y1, _x2, _y2
else:
return _x2, _y2, _x1, _y1
for i in range(int(input())):
x1, y1, x2, y2, x3, y3, x4, y4 = list(map(float, input().sp... | output | 1 | 6,498 | 23 | 12,997 |
Provide a correct Python 3 solution for this coding contest problem.
There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "YES" and if not... | instruction | 0 | 6,499 | 23 | 12,998 |
"Correct Solution:
```
n = int(input())
for i in range(n):
x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split())
v1x = x1 - x2
v1y = y1 - y2
v2x = x3 - x4
v2y = y3 - y4
if abs(v1x * v2y - v2x * v1y) < 10 ** -10 :
print("YES")
else:
print("NO")
``` | output | 1 | 6,499 | 23 | 12,999 |
Provide a correct Python 3 solution for this coding contest problem.
There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "YES" and if not... | instruction | 0 | 6,500 | 23 | 13,000 |
"Correct Solution:
```
# AOJ 0021: Parallelism
# Python3 2018.6.15 bal4u
EPS = 1e-11
def dot(a, b):
return a.real*b.real + a.imag*b.imag
def cross(a, b):
return a.real*b.imag - a.imag*b.real
def norm(a):
return a.real**2 + a.imag**2
def project(line, p):
base = line[1]-line[0]
r = dot(p-line[0], base) / nor... | output | 1 | 6,500 | 23 | 13,001 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines a... | instruction | 0 | 6,501 | 23 | 13,002 |
Yes | output | 1 | 6,501 | 23 | 13,003 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines a... | instruction | 0 | 6,502 | 23 | 13,004 |
Yes | output | 1 | 6,502 | 23 | 13,005 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines a... | instruction | 0 | 6,503 | 23 | 13,006 |
Yes | output | 1 | 6,503 | 23 | 13,007 |
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response.
There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines a... | instruction | 0 | 6,504 | 23 | 13,008 |
Yes | output | 1 | 6,504 | 23 | 13,009 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.