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. <image> For given three points p0, p1, p2, print COUNTER_CLOCKWISE if p0, p1, p2 make a counterclockwise turn (1), CLOCKWISE if p0, p1, p2 make a clockwise turn (2), ONLINE_BACK if p2 is on a line p2, p0, p1 in this order (3), ONLINE_F...
instruction
0
85,693
23
171,386
"Correct Solution: ``` # -*- coding: utf-8 -*- import sys sys.setrecursionlimit(10 ** 9) def input(): return sys.stdin.readline().strip() def INT(): return int(input()) def MAP(): return map(int, input().split()) def LIST(): return list(map(int, input().split())) INF=float('inf') class Geometry: EPS = 10 ** -9 ...
output
1
85,693
23
171,387
Provide a correct Python 3 solution for this coding contest problem. <image> For given three points p0, p1, p2, print COUNTER_CLOCKWISE if p0, p1, p2 make a counterclockwise turn (1), CLOCKWISE if p0, p1, p2 make a clockwise turn (2), ONLINE_BACK if p2 is on a line p2, p0, p1 in this order (3), ONLINE_F...
instruction
0
85,694
23
171,388
"Correct Solution: ``` import math class Vector: def __init__(self,x,y): self.x = x self.y = y def __add__(self,other): return Vector(self.x+other.x,self.y+other.y) def __sub__(self,other): return Vector(self.x-other.x,self.y-other.y) def __mul__(self,...
output
1
85,694
23
171,389
Provide a correct Python 3 solution for this coding contest problem. <image> For given three points p0, p1, p2, print COUNTER_CLOCKWISE if p0, p1, p2 make a counterclockwise turn (1), CLOCKWISE if p0, p1, p2 make a clockwise turn (2), ONLINE_BACK if p2 is on a line p2, p0, p1 in this order (3), ONLINE_F...
instruction
0
85,695
23
171,390
"Correct Solution: ``` import cmath import os import sys if os.getenv("LOCAL"): sys.stdin = open("_in.txt", "r") sys.setrecursionlimit(10 ** 9) INF = float("inf") IINF = 10 ** 18 MOD = 10 ** 9 + 7 # MOD = 998244353 INF = float("inf") PI = cmath.pi TAU = cmath.pi * 2 EPS = 1e-10 class Point: """ 2次元空間上の...
output
1
85,695
23
171,391
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. <image> For given three points p0, p1, p2, print COUNTER_CLOCKWISE if p0, p1, p2 make a counterclockwise turn (1), CLOCKWISE if p0, p1, p2 make a clockwise turn (2), ONLINE_BACK if ...
instruction
0
85,696
23
171,392
Yes
output
1
85,696
23
171,393
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. <image> For given three points p0, p1, p2, print COUNTER_CLOCKWISE if p0, p1, p2 make a counterclockwise turn (1), CLOCKWISE if p0, p1, p2 make a clockwise turn (2), ONLINE_BACK if ...
instruction
0
85,697
23
171,394
Yes
output
1
85,697
23
171,395
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. <image> For given three points p0, p1, p2, print COUNTER_CLOCKWISE if p0, p1, p2 make a counterclockwise turn (1), CLOCKWISE if p0, p1, p2 make a clockwise turn (2), ONLINE_BACK if ...
instruction
0
85,698
23
171,396
Yes
output
1
85,698
23
171,397
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. <image> For given three points p0, p1, p2, print COUNTER_CLOCKWISE if p0, p1, p2 make a counterclockwise turn (1), CLOCKWISE if p0, p1, p2 make a clockwise turn (2), ONLINE_BACK if ...
instruction
0
85,699
23
171,398
Yes
output
1
85,699
23
171,399
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. <image> For given three points p0, p1, p2, print COUNTER_CLOCKWISE if p0, p1, p2 make a counterclockwise turn (1), CLOCKWISE if p0, p1, p2 make a clockwise turn (2), ONLINE_BACK if ...
instruction
0
85,700
23
171,400
No
output
1
85,700
23
171,401
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. <image> For given three points p0, p1, p2, print COUNTER_CLOCKWISE if p0, p1, p2 make a counterclockwise turn (1), CLOCKWISE if p0, p1, p2 make a clockwise turn (2), ONLINE_BACK if ...
instruction
0
85,701
23
171,402
No
output
1
85,701
23
171,403
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. <image> For given three points p0, p1, p2, print COUNTER_CLOCKWISE if p0, p1, p2 make a counterclockwise turn (1), CLOCKWISE if p0, p1, p2 make a clockwise turn (2), ONLINE_BACK if ...
instruction
0
85,702
23
171,404
No
output
1
85,702
23
171,405
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. <image> For given three points p0, p1, p2, print COUNTER_CLOCKWISE if p0, p1, p2 make a counterclockwise turn (1), CLOCKWISE if p0, p1, p2 make a clockwise turn (2), ONLINE_BACK if ...
instruction
0
85,703
23
171,406
No
output
1
85,703
23
171,407
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given an array a_1, a_2, ... , a_n, which is sorted in non-decreasing order (a_i ≤ a_{i + 1}). Find three indices i, j, k such that 1 ≤ i < j < k ≤ n and it is impossible to construct ...
instruction
0
85,879
23
171,758
Yes
output
1
85,879
23
171,759
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given an array a_1, a_2, ... , a_n, which is sorted in non-decreasing order (a_i ≤ a_{i + 1}). Find three indices i, j, k such that 1 ≤ i < j < k ≤ n and it is impossible to construct ...
instruction
0
85,880
23
171,760
Yes
output
1
85,880
23
171,761
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given an array a_1, a_2, ... , a_n, which is sorted in non-decreasing order (a_i ≤ a_{i + 1}). Find three indices i, j, k such that 1 ≤ i < j < k ≤ n and it is impossible to construct ...
instruction
0
85,881
23
171,762
Yes
output
1
85,881
23
171,763
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given an array a_1, a_2, ... , a_n, which is sorted in non-decreasing order (a_i ≤ a_{i + 1}). Find three indices i, j, k such that 1 ≤ i < j < k ≤ n and it is impossible to construct ...
instruction
0
85,882
23
171,764
Yes
output
1
85,882
23
171,765
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given an array a_1, a_2, ... , a_n, which is sorted in non-decreasing order (a_i ≤ a_{i + 1}). Find three indices i, j, k such that 1 ≤ i < j < k ≤ n and it is impossible to construct ...
instruction
0
85,883
23
171,766
No
output
1
85,883
23
171,767
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given an array a_1, a_2, ... , a_n, which is sorted in non-decreasing order (a_i ≤ a_{i + 1}). Find three indices i, j, k such that 1 ≤ i < j < k ≤ n and it is impossible to construct ...
instruction
0
85,884
23
171,768
No
output
1
85,884
23
171,769
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given an array a_1, a_2, ... , a_n, which is sorted in non-decreasing order (a_i ≤ a_{i + 1}). Find three indices i, j, k such that 1 ≤ i < j < k ≤ n and it is impossible to construct ...
instruction
0
85,885
23
171,770
No
output
1
85,885
23
171,771
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You are given an array a_1, a_2, ... , a_n, which is sorted in non-decreasing order (a_i ≤ a_{i + 1}). Find three indices i, j, k such that 1 ≤ i < j < k ≤ n and it is impossible to construct ...
instruction
0
85,886
23
171,772
No
output
1
85,886
23
171,773
Provide tags and a correct Python 3 solution for this coding contest problem. You may know that Euclid was a mathematician. Well, as it turns out, Morpheus knew it too. So when he wanted to play a mean trick on Euclid, he sent him an appropriate nightmare. In his bad dream Euclid has a set S of n m-dimensional vecto...
instruction
0
85,919
23
171,838
Tags: bitmasks, dfs and similar, dsu, graphs, greedy, math, sortings Correct Solution: ``` from collections import defaultdict import sys input = sys.stdin.readline class UF: def __init__(self, N): self.par = list(range(N)) self.sz = [1] * N def find(self, x): if self.par[x] != x: ...
output
1
85,919
23
171,839
Provide tags and a correct Python 3 solution for this coding contest problem. You may know that Euclid was a mathematician. Well, as it turns out, Morpheus knew it too. So when he wanted to play a mean trick on Euclid, he sent him an appropriate nightmare. In his bad dream Euclid has a set S of n m-dimensional vecto...
instruction
0
85,920
23
171,840
Tags: bitmasks, dfs and similar, dsu, graphs, greedy, math, sortings Correct Solution: ``` import sys input = iter(sys.stdin.read().splitlines()).__next__ class UnionFind: # based on submission 102831279 def __init__(self, n): """ elements are 0, 1, 2, ..., n-1 """ self.parent = list(range(n)) ...
output
1
85,920
23
171,841
Provide tags and a correct Python 3 solution for this coding contest problem. You may know that Euclid was a mathematician. Well, as it turns out, Morpheus knew it too. So when he wanted to play a mean trick on Euclid, he sent him an appropriate nightmare. In his bad dream Euclid has a set S of n m-dimensional vecto...
instruction
0
85,921
23
171,842
Tags: bitmasks, dfs and similar, dsu, graphs, greedy, math, sortings Correct Solution: ``` import sys input=sys.stdin.buffer.readline #FOR READING PURE INTEGER INPUTS (space separation ok) class UnionFind: def __init__(self, n): self.parent = list(range(n)) def find(self, a): #return parent of a. a and ...
output
1
85,921
23
171,843
Provide tags and a correct Python 3 solution for this coding contest problem. You may know that Euclid was a mathematician. Well, as it turns out, Morpheus knew it too. So when he wanted to play a mean trick on Euclid, he sent him an appropriate nightmare. In his bad dream Euclid has a set S of n m-dimensional vecto...
instruction
0
85,922
23
171,844
Tags: bitmasks, dfs and similar, dsu, graphs, greedy, math, sortings Correct Solution: ``` import sys readline = sys.stdin.readline class UF(): def __init__(self, num): self.par = [-1]*num self.color = [0]*num def find(self, x): if self.par[x] < 0: return x else: ...
output
1
85,922
23
171,845
Provide tags and a correct Python 3 solution for this coding contest problem. You may know that Euclid was a mathematician. Well, as it turns out, Morpheus knew it too. So when he wanted to play a mean trick on Euclid, he sent him an appropriate nightmare. In his bad dream Euclid has a set S of n m-dimensional vecto...
instruction
0
85,923
23
171,846
Tags: bitmasks, dfs and similar, dsu, graphs, greedy, math, sortings Correct Solution: ``` import sys input = sys.stdin.readline mod=1000000007 n,m=map(int,input().split()) ans=[] groupi=[-1]*(m+1) groups=[2]*m for i in range(m): groups[i]=[] cur=1 for i in range(n): x=list(map(int,input().split())) k=x.pop...
output
1
85,923
23
171,847
Provide tags and a correct Python 3 solution for this coding contest problem. You may know that Euclid was a mathematician. Well, as it turns out, Morpheus knew it too. So when he wanted to play a mean trick on Euclid, he sent him an appropriate nightmare. In his bad dream Euclid has a set S of n m-dimensional vecto...
instruction
0
85,924
23
171,848
Tags: bitmasks, dfs and similar, dsu, graphs, greedy, math, sortings Correct Solution: ``` import os import sys from io import BytesIO, IOBase # region fastio BUFSIZE = 8192 class FastIO(IOBase): def __init__(self, file): self.newlines = 0 self._fd = file.fileno() self.buffer = BytesIO() ...
output
1
85,924
23
171,849
Provide tags and a correct Python 3 solution for this coding contest problem. You may know that Euclid was a mathematician. Well, as it turns out, Morpheus knew it too. So when he wanted to play a mean trick on Euclid, he sent him an appropriate nightmare. In his bad dream Euclid has a set S of n m-dimensional vecto...
instruction
0
85,925
23
171,850
Tags: bitmasks, dfs and similar, dsu, graphs, greedy, math, sortings Correct Solution: ``` class UnionFindVerSize(): def __init__(self, N): self._parent = [n for n in range(0, N)] self._size = [1] * N self.source = [False] * N self.group = N def find_root(self, x): if se...
output
1
85,925
23
171,851
Provide tags and a correct Python 3 solution for this coding contest problem. You may know that Euclid was a mathematician. Well, as it turns out, Morpheus knew it too. So when he wanted to play a mean trick on Euclid, he sent him an appropriate nightmare. In his bad dream Euclid has a set S of n m-dimensional vecto...
instruction
0
85,926
23
171,852
Tags: bitmasks, dfs and similar, dsu, graphs, greedy, math, sortings Correct Solution: ``` """ Author - Satwik Tiwari . 19th Jan , 2021 - Tuesday """ #=============================================================================================== #importing some useful libraries. from __future__ import divis...
output
1
85,926
23
171,853
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You may know that Euclid was a mathematician. Well, as it turns out, Morpheus knew it too. So when he wanted to play a mean trick on Euclid, he sent him an appropriate nightmare. In his bad dr...
instruction
0
85,927
23
171,854
Yes
output
1
85,927
23
171,855
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You may know that Euclid was a mathematician. Well, as it turns out, Morpheus knew it too. So when he wanted to play a mean trick on Euclid, he sent him an appropriate nightmare. In his bad dr...
instruction
0
85,928
23
171,856
Yes
output
1
85,928
23
171,857
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You may know that Euclid was a mathematician. Well, as it turns out, Morpheus knew it too. So when he wanted to play a mean trick on Euclid, he sent him an appropriate nightmare. In his bad dr...
instruction
0
85,929
23
171,858
Yes
output
1
85,929
23
171,859
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You may know that Euclid was a mathematician. Well, as it turns out, Morpheus knew it too. So when he wanted to play a mean trick on Euclid, he sent him an appropriate nightmare. In his bad dr...
instruction
0
85,930
23
171,860
Yes
output
1
85,930
23
171,861
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You may know that Euclid was a mathematician. Well, as it turns out, Morpheus knew it too. So when he wanted to play a mean trick on Euclid, he sent him an appropriate nightmare. In his bad dr...
instruction
0
85,931
23
171,862
No
output
1
85,931
23
171,863
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You may know that Euclid was a mathematician. Well, as it turns out, Morpheus knew it too. So when he wanted to play a mean trick on Euclid, he sent him an appropriate nightmare. In his bad dr...
instruction
0
85,932
23
171,864
No
output
1
85,932
23
171,865
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You may know that Euclid was a mathematician. Well, as it turns out, Morpheus knew it too. So when he wanted to play a mean trick on Euclid, he sent him an appropriate nightmare. In his bad dr...
instruction
0
85,933
23
171,866
No
output
1
85,933
23
171,867
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You may know that Euclid was a mathematician. Well, as it turns out, Morpheus knew it too. So when he wanted to play a mean trick on Euclid, he sent him an appropriate nightmare. In his bad dr...
instruction
0
85,934
23
171,868
No
output
1
85,934
23
171,869
Provide tags and a correct Python 3 solution for this coding contest problem. Every day Ruslan tried to count sheep to fall asleep, but this didn't help. Now he has found a more interesting thing to do. First, he thinks of some set of circles on a plane, and then tries to choose a beautiful set of points, such that th...
instruction
0
86,122
23
172,244
Tags: constructive algorithms, math Correct Solution: ``` def f(x): if x == n: return "0" if x == 0: return "(" + str(X[0]) + "+" + f(1) + ")" ss = "(abs((t-" + str(x-1) + "))-abs((t-" + str(x) + ")))" tmp = (X[x] - X[x - 1]) // 2 re = (X[x...
output
1
86,122
23
172,245
Provide tags and a correct Python 3 solution for this coding contest problem. Every day Ruslan tried to count sheep to fall asleep, but this didn't help. Now he has found a more interesting thing to do. First, he thinks of some set of circles on a plane, and then tries to choose a beautiful set of points, such that th...
instruction
0
86,123
23
172,246
Tags: constructive algorithms, math Correct Solution: ``` def f(x): if x == n: return "0" if x == 0: return "(" + str(X[0]) + "+" + f(1) + ")" ss = "(abs((t-" + str(x-1) + "))-abs((t-" + str(x) + ")))" tmp = (X[x] - X[x - 1]) // 2 re = (X[x] - X[x...
output
1
86,123
23
172,247
Provide tags and a correct Python 3 solution for this coding contest problem. Every day Ruslan tried to count sheep to fall asleep, but this didn't help. Now he has found a more interesting thing to do. First, he thinks of some set of circles on a plane, and then tries to choose a beautiful set of points, such that th...
instruction
0
86,124
23
172,248
Tags: constructive algorithms, math Correct Solution: ``` n = int(input()) x = [0] * n y = [0] * n for i in range(n): x[i], y[i], r = map(int, input().split()) def sum(s1, s2): return '(' + s1 + '+' + s2 + ')' def minus(s1, s2): return '(' + s1 + '-' + s2 + ')' def mult(s1, s2): return '(' + s1 + ...
output
1
86,124
23
172,249
Provide tags and a correct Python 3 solution for this coding contest problem. Every day Ruslan tried to count sheep to fall asleep, but this didn't help. Now he has found a more interesting thing to do. First, he thinks of some set of circles on a plane, and then tries to choose a beautiful set of points, such that th...
instruction
0
86,125
23
172,250
Tags: constructive algorithms, math Correct Solution: ``` def canonise(t): if t < 0: return "(0-" + canonise(-t) + ")" ans = "" while t > 50: ans += "(50+" t -= 50 return ans + str(t) + ")" * (len(ans)//4) n = int(input()) cxes = [] cyes = [] for i in range(n): x, y, r = map(int, input().split()) for dx i...
output
1
86,125
23
172,251
Provide tags and a correct Python 3 solution for this coding contest problem. Every day Ruslan tried to count sheep to fall asleep, but this didn't help. Now he has found a more interesting thing to do. First, he thinks of some set of circles on a plane, and then tries to choose a beautiful set of points, such that th...
instruction
0
86,126
23
172,252
Tags: constructive algorithms, math Correct Solution: ``` def ex(values): e = None for i, v in enumerate(values): e_ = f'({v//2}*((1-abs((t-{i})))+abs((1-abs((t-{i}))))))' if e is None: e = e_ else: e = f'({e}+{e_})' return e def solve(circles): xs = [c[...
output
1
86,126
23
172,253
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Every day Ruslan tried to count sheep to fall asleep, but this didn't help. Now he has found a more interesting thing to do. First, he thinks of some set of circles on a plane, and then tries to...
instruction
0
86,127
23
172,254
No
output
1
86,127
23
172,255
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Every day Ruslan tried to count sheep to fall asleep, but this didn't help. Now he has found a more interesting thing to do. First, he thinks of some set of circles on a plane, and then tries to...
instruction
0
86,128
23
172,256
No
output
1
86,128
23
172,257
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Every day Ruslan tried to count sheep to fall asleep, but this didn't help. Now he has found a more interesting thing to do. First, he thinks of some set of circles on a plane, and then tries to...
instruction
0
86,129
23
172,258
No
output
1
86,129
23
172,259
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Every day Ruslan tried to count sheep to fall asleep, but this didn't help. Now he has found a more interesting thing to do. First, he thinks of some set of circles on a plane, and then tries to...
instruction
0
86,130
23
172,260
No
output
1
86,130
23
172,261
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,449
23
172,898
"Correct Solution: ``` import sys for e in sys.stdin: e=list(map(float,e.split(','))) print(['YES','NO'][sum((e[i]-e[(2+i)%8])*(e[(5+i)%8]-e[(3+i)%8])-(e[1+i]-e[(3+i)%8])*(e[(4+i)%8]-e[(2+i)%8])>0 for i in range(0,8,2))%4>0]) ```
output
1
86,449
23
172,899
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,450
23
172,900
"Correct Solution: ``` import sys readlines = sys.stdin.readlines write = sys.stdout.write def cross3(a, b, c): return (b[0]-a[0])*(c[1]-a[1]) - (b[1]-a[1])*(c[0]-a[0]) def solve(): for line in readlines(): xa, ya, xb, yb, xc, yc, xd, yd = map(float, line.split(",")) P = [(xa, ya), (xb, yb), (xc...
output
1
86,450
23
172,901
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,451
23
172,902
"Correct Solution: ``` import sys def solve(): for line in sys.stdin: xa,ya,xb,yb,xc,yc,xd,yd = map(float, line.split(',')) def fac(x, y): if xa == xc: return x - xa else: return ((ya-yc)/(xa-xc))*(x-xa) - y + ya def ...
output
1
86,451
23
172,903
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,452
23
172,904
"Correct Solution: ``` def judge(p1,p2,p3,p4): t1 = (p3[0] - p4[0]) * (p1[1] - p3[1]) + (p3[1] - p4[1]) * (p3[0] - p1[0]) t2 = (p3[0] - p4[0]) * (p2[1] - p3[1]) + (p3[1] - p4[1]) * (p3[0] - p2[0]) t3 = (p1[0] - p2[0]) * (p3[1] - p1[1]) + (p1[1] - p2[1]) * (p1[0] - p3[0]) t4 = (p1[0] - p2[0]) * (p4[1] - ...
output
1
86,452
23
172,905
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,453
23
172,906
"Correct Solution: ``` # -*- coding: utf-8 -*- import sys import os import math def cross(v1, v2): return v1[0] * v2[1] - v1[1] * v2[0] def sign(v): if v >= 0: return 1 else: return -1 for s in sys.stdin: ax, ay, bx, by, cx, cy, dx, dy = map(float, s.split(',')) AB = (bx - ax, ...
output
1
86,453
23
172,907
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,454
23
172,908
"Correct Solution: ``` import math def eq(x, y): return abs(x - y) <= 10e-10 def get_r(_a, _b, _c): return math.acos((-_a ** 2 + _b ** 2 + _c ** 2) / (2 * _b * _c)) def _len(_ax, _ay, _bx, _by): return math.sqrt((_ax - _bx) ** 2 + (_ay - _by) ** 2) try: while 1: xa,ya,xb,yb,xc,yc,xd,yd =...
output
1
86,454
23
172,909