submission_id
string
problem_id
string
status
string
code
string
input
string
output
string
problem_description
string
s259599657
p00021
Wrong Answer
for _ in xrange(input()): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, raw_input().split()) if x1 == x2 and x3 == x4: print 'YES' elif x1 == x2 or x3 == x4: print 'NO' else: print 'YES' if (y2-y1)/(x2-x1) == (y4-y3)/(x4-x3) else 'NO'
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s993877460
p00021
Wrong Answer
for i in range(int(input())): l = list(map(float,input().split())) a,b,c,d = l[2]-l[0],l[3]-l[1],l[6]-l[4],l[7]-l[5] if b==0 or d==0: continue if a/b==c/d: print('YES') else: print('NO')
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s196109417
p00021
Wrong Answer
for i in range(int(input())): l = list(map(float,input().split())) a,b,c,d = l[2]-l[0],l[3]-l[1],l[6]-l[4],l[7]-l[5] if a*d==c*b: print('YES') else: print('NO')
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s894300374
p00021
Wrong Answer
n = int(input()) for i in range(n): Date = list(map(float,input().split())) if Date[2] != Date[0] and Date[6] != Date[4]: if (Date[3] - Date[1])/(Date[2] - Date[0]) == (Date[7] - Date[5])/(Date[6] - Date[4]): print("YES") else: print("NO") elif Date[2] != Date[0] and Date[6] != Date[4]: print("YES")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s646096475
p00021
Wrong Answer
n = int(input()) for i in range(n): Date = list(map(float,input().split())) if Date[2] != Date[0] and Date[6] != Date[4]: if (Date[3] - Date[1]) * (Date[6] - Date[4]) == (Date[7] - Date[5]) * (Date[2] - Date[0]): print("YES") else: print("NO") elif Date[2] != Date[0] and Date[6] != Date[4]: print("YES")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s420550624
p00021
Wrong Answer
n = int(input()) for i in range(n): Date = list(map(float,input().split())) if (Date[3] - Date[1]) * (Date[6] - Date[4]) == (Date[7] - Date[5]) * (Date[2] - Date[0]): print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s919398742
p00021
Wrong Answer
n = int(input()) for i in range(n): Date = list(map(float,input().split())) if Date[2] != Date[0] or Date[6] != Date[4]: if (Date[3] - Date[1]) * (Date[6] - Date[4]) == (Date[7] - Date[5]) * (Date[2] - Date[0]): print("YES") continue else: print("NO") continue elif Date[2] != Date[0] and Date[6] != Date[4]: print("YES")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s139639910
p00021
Wrong Answer
n = int(input()) for i in range(n): Date = list(map(float,input().split())) if Date[2] != Date[0] and Date[6] != Date[4]: if (Date[3] - Date[1]) * (Date[6] - Date[4]) == (Date[7] - Date[5]) * (Date[2] - Date[0]): print("YES") continue else: print("NO") continue elif Date[2] != Date[0] and Date[6] != Date[4]: print("YES")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s549191660
p00021
Wrong Answer
n = int(input()) for i in range(n): Date = list(map(float,input().split())) if Date[2] != Date[0] and Date[6] != Date[4]: if (Date[3] - Date[1]) * (Date[6] - Date[4]) == (Date[7] - Date[5]) * (Date[2] - Date[0]): print("YES") continue else: print("NO") continue elif Date[2] == Date[0] and Date[6] == Date[4]: print("YES")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s534822216
p00021
Wrong Answer
n = int(input()) for i in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = list(map(float, input().split())) s = [x2-x1, y2-y1] t = [x4-x3, y4-y3] if not (s[0] and t[0]): if not (s[0] or t[0]): print("YES") else: print("NO") continue if s[1]/s[0] == t[1]/t[0]: print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s531599972
p00021
Wrong Answer
n = int(raw_input()) for i in range(n): x0, y0, x1, y1, x2, y2, x3, y3 = map(float, raw_input().split(' ')) if x0==x1 or x2==x3: if x0==x1 and x2==x3: print 'YES' else: print 'NO' elif float(y1-y0)/(x1-x0) == float(y3-y2)/(x3-x2): print 'YES' else: print 'NO'
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s296483500
p00021
Wrong Answer
n = int(raw_input()) for i in range(n): x0, y0, x1, y1, x2, y2, x3, y3 = map(float, raw_input().split(' ')) if x0==x1 or x2==x3: if x0==x1 and x2==x3: print 'YES' else: print 'NO' elif float(y1-y0)/(x1-x0) == float(y3-y2)/(x3-x2): print 'YES' else: print 'NO'
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s448367867
p00021
Wrong Answer
n=int(input()) for i in range(n): a=[float(i) for i in input().split()] dx1=a[2]-a[0] dy1=a[3]-a[1] dx2=a[6]-a[4] dy2=a[7]-a[5] if dx1==0 or dx2==0: if dx1==0 and dx2==0: print("YES") else: print("NO") elif dy1/dx1==dy2/dx2: print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s351244921
p00021
Wrong Answer
n=int(input()) for i in range(n): a=[float(i) for i in input().split()] dx1=a[2]-a[0] dy1=a[3]-a[1] dx2=a[6]-a[4] dy2=a[7]-a[5] if dx1==0 or dx2==0: if dx1==0 and dx2==0: print("YES") else: print("NO") elif (dy1/dx1-dy2/dx2)<1e-10: print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s161012262
p00021
Wrong Answer
def check_para(x1,y1,x2,y2,x3,y3,x4,y4): if (x1 - x2) * (y3 - y4) != (x3 - x4) * (y1 - y2): print("NO") return else: print("YES") return n = int(input()) for i in range(n): x1,y1,x2,y2,x3,y3,x4,y4 = map(float,input().split()) check_para(x1,y1,x2,y2,x3,y3,x4,y4)
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s796419518
p00021
Wrong Answer
def check_para(x1,y1,x2,y2,x3,y3,x4,y4): if (x1 - x2) * (y3 - y4) - (x3 - x4) * (y1 - y2) > 1e-10: print("NO") return else: print("YES") return n = int(input()) for i in range(n): x1,y1,x2,y2,x3,y3,x4,y4 = map(float,input().split()) check_para(x1,y1,x2,y2,x3,y3,x4,y4)
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s668796923
p00021
Wrong Answer
for _ in range(int(input())): ax, ay, bx, by, cx, cy, dx, dy = map(float, input().split()) print(['NO','YES'][(ay-by)*(dx-cx)-(ax-bx)*(dy-cy)<1e-10])
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s970956486
p00021
Wrong Answer
for i in range(int(input())): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split()) if x1 == x2: ans = x3 == x4 elif x3 == x4: ans = False else: ans = (y2-y1)/(x2-x1) == (y4-y3)/(x4-x3) print("YES") if ans else print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s140466524
p00021
Wrong Answer
for i in range(int(input())): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split()) if x1 == x2: ans = x3 == x4 elif x3 == x4: ans = False else: ans = ((y2-y1)/(x2-x1) - (y4-y3)/(x4-x3)) < 1e-5 print("YES") if ans else print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s628613807
p00021
Wrong Answer
for i in range(int(input())): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split()) det = (y1-y2) * (x3-x4) - (x1-x2) * (y3-y4) if det<1e-12 : print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s476311825
p00021
Wrong Answer
n = int(input()) for i in range(n): line = list(map(float,input().split())) if round(line[2] - line[0], 2) == 0: if round(line[6] - line[4], 2) == 0: print("YES") else: print("NO") elif round(line[6] - line[4], 2) == 0: pass else: AB = (line[3] - line[1]) / (line[2] - line[0]) CD = (line[7] - line[5]) / (line[6] - line[4]) if round(AB - CD, 8) == 0: print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s460694212
p00021
Wrong Answer
n = int(input()) for i in range(n): line = list(map(float,input().split())) if round(line[2] - line[0], 5) == 0: if round(line[6] - line[4], 5) == 0: print("YES") else: print("NO") elif round(line[6] - line[4], 5) == 0: pass else: AB = (line[3] - line[1]) / (line[2] - line[0]) CD = (line[7] - line[5]) / (line[6] - line[4]) if round(AB - CD, 11) == 0: print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s299655381
p00021
Wrong Answer
n = int(input()) for i in range(n): line = list(map(float,input().split())) if round(line[2] - line[0], 7) == 0: if round(line[6] - line[4], 7) == 0: print("YES") else: print("NO") elif round(line[6] - line[4], 7) == 0: pass else: AB = (line[3] - line[1]) / (line[2] - line[0]) CD = (line[7] - line[5]) / (line[6] - line[4]) if round(AB - CD, 11) == 0: print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s453664978
p00021
Wrong Answer
n = int(input()) for i in range(n): line = list(map(float,input().split())) if round(line[2] - line[0], 7) == 0: if round(line[6] - line[4], 7) == 0: print("YES") else: print("NO") elif round(line[6] - line[4], 7) == 0: pass else: AB = (line[3] - line[1]) / (line[2] - line[0]) CD = (line[7] - line[5]) / (line[6] - line[4]) if round(AB - CD, 8) == 0: print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s772507309
p00021
Wrong Answer
n = int(input()) for i in range(n): line = list(map(float,input().split())) if round(line[2] - line[0], 6) == 0: if round(line[6] - line[4], 6) == 0: if round(line[6] - line[0],6) == 0: print("NO") else: print("YES") else: print("NO") elif round(line[6] - line[4], 6) == 0: print("NO") else: AB = (line[3] - line[1]) / (line[2] - line[0]) CD = (line[7] - line[5]) / (line[6] - line[4]) if round(line[4] - line[2], 6) == 0: BC = 10000000000 else: BC = (line[5] - line[3]) / (line[4] - line[2]) if round(AB - CD, 8) == 0 and round(AB - BC,8) != 0: print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s663626308
p00021
Wrong Answer
from fractions import Fraction def sroap(x1,y1,x2,y2): if x2 - x1 == 0: return float("inf") else: return Fraction(y2 - y1,x2 - x1) N = int(input()) for n in range(N): Ax,Ay,Bx,By,Cx,Cy,Dx,Dy = map(lambda x: round(x * 10 ** 5),(map(float,input().split()))) if sroap(Ax,Ay,Bx,By) == sroap(Cx,Cy,Dx,Dy): if sroap(Ax,Ay,Bx,By) == sroap(Bx,By,Cx,Cy): print("NO") else: print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s631777397
p00021
Wrong Answer
from fractions import Fraction ''' def judgeX0(Ax,Ay,Bx,By,Cx,Cy,Dx,Dy): ABx = Bx - Ax CDx = Dx - Cx if ABx == 0: if CDx == 0: if Cx == Bx: return 0 else: return 2 else: return 0 elif CDx == 0: return 0 else: return 1 ''' def sroap(x1,y1,x2,y2): if x2 - x1 == 0: return float("inf") else: return Fraction(y2 - y1,x2 - x1) N = int(input()) for n in range(N): Ax,Ay,Bx,By,Cx,Cy,Dx,Dy = map(lambda x: round(x * 10 ** 6),(map(float,input().split()))) if sroap(Ax,Ay,Bx,By) == sroap(Cx,Cy,Dx,Dy): if sroap(Ax,Ay,Bx,By) == sroap(Bx,By,Cx,Cy): print("NO") else: print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s506346615
p00021
Wrong Answer
n=input() for i in range(n): a,b,c,d,e,f,g,h=map(float,raw_input().split()) if a==c and g==e:print "YES" if a==c and g!=e:print "NO" if a!=c and g==e:print "NO" if a!=c and g!=e: if (d-b)/(c-a)==(h-f)/(g-e):print "YES" else:print "NO"
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s275251361
p00021
Wrong Answer
n=input() for i in range(n): a,b,c,d,e,f,g,h=map(float,raw_input().split()) # if a==c and g==e:print "YES" # if a==c and g!=e:print "NO" # if a!=c and g==e:print "NO" # if a!=c and g!=e: # if (d-b)/(c-a)==(h-f)/(g-e):print "YES" # else:print "NO" if (d-b)*(g-e)-(c-a)*(h-f)==0: print "YES" else: print "NO"
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s335538161
p00021
Wrong Answer
n=input() for i in range(n): a,b,c,d,e,f,g,h=map(float,raw_input().split()) # if a==c and g==e:print "YES" # if a==c and g!=e:print "NO" # if a!=c and g==e:print "NO" # if a!=c and g!=e: # if (d-b)/(c-a)==(h-f)/(g-e):print "YES" # else:print "NO" if (d-b)*(g-e)-(c-a)*(h-f)<1e-8: print "YES" else: print "NO"
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s872670053
p00021
Wrong Answer
n=input() for i in range(n): a,b,c,d,e,f,g,h=map(float,raw_input().split()) if (d-b)*(g-e)-(c-a)*(h-f)<1e-8: print "YES" else: print "NO"
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s498609749
p00021
Wrong Answer
n=input() for i in range(n): a,b,c,d,e,f,g,h=map(float,raw_input().split()) # if a==c and g==e:print "YES" # if a==c and g!=e:print "NO" # if a!=c and g==e:print "NO" # if a!=c and g!=e: # if (d-b)/(c-a)==(h-f)/(g-e):print "YES" # else:print "NO" if (d-b)*(g-e)-(c-a)*(h-f)<1e-10: print "YES" else: print "NO"
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s861786248
p00021
Wrong Answer
for i in range(input()): a,b,c,d,e,f,g,h=map(float,raw_input().split()) print "YES" if abs((d-b)*(g-e)-(c-a)*(h-f))<1e-9 else "NO"
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s733249093
p00021
Wrong Answer
def points2vec(points): return [points[0][i]-points[1][i] for i in range(2)] def determinant(v1, v2): return v1[0] * v2[1] - v1[1] * v2[0] n = int(input()) for _ in range(n): it = map(float, input().split()) points = list(zip(it, it)) v1 = points2vec(points[:2]) v2 = points2vec(points[2:]) print("YES" if determinant(v1, v2) == 0.0 else "NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s948306272
p00021
Wrong Answer
# -*- coding: utf-8 -*- import sys import os N = int(input()) for i in range(N): ax, ay, bx, by, cx, cy, dx, dy = list(map(float, input().split())) AB = (bx - ax, by - ay) CD = (dx - cx, dy - cy) cross = AB[0] * CD[1] - AB[1] * CD[0] if cross == 0: print('YES') else: print('NO')
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s848246089
p00021
Wrong Answer
import math num = int(input()) for i in range(num): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split(' ')) aaa = (y1 - y2) * (x3 - x4) bbb = (y3 - y4) * (x1 - x2) if abs(aaa - bbb) <= 0: print('YES') else: print('NO')
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s444499542
p00021
Wrong Answer
n = int(input()) ans = [] for _ in range(n): ax, ay, bx, by, cx, cy, dx, dy = map(float, input().split()) if (ax - bx) != 0: a1 = (ay - by) / (ax - bx) else: a1 = float("inf") if (cx - dx) != 0: a2 = (cy - dy) / (cx - dx) else: a2 = float("inf") if a1 == a2: ans.append("YES") else: ans.append("NO") print(*ans, sep="\n")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s370487819
p00021
Wrong Answer
n = int(input()) ans = [] for _ in range(n): ax, ay, bx, by, cx, cy, dx, dy = map(float, input().split()) a1 = (ay - by) / (ax - bx) if (ax - bx) != 0 else float("inf") a2 = (cy - dy) / (cx - dx) if (cx - dx) != 0 else float("inf") if a1 == a2: ans.append("YES") else: ans.append("NO") print(*ans, sep="\n")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s002042340
p00021
Wrong Answer
def parallelism(x1, y1, x2, y2, x3, y3, x4, y4): a1 = (y2-y1)/(x2-x1) if (x2-x1) != 0 else float("inf") a2 = (y4-y3)/(x4-x3) if (x4-x3) != 0 else float("inf") if a1 == a2: return "YES" else: return "NO" if __name__ == "__main__": assert parallelism(0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 2.0, 1.0) == "YES", "sample1" assert parallelism(3.0, 2.0, 9.0, 6.0, 13.0, 5.0, 7.0, 9.0) == "NO", "sample2" assert parallelism(3.0, 2.0, 9.0, 2.0, 13.0, 5.0, 7.0, 5.0) == "YES", "horizontal line" assert parallelism(3.0, 2.0, 3.0, 6.0, 13.0, 5.0, 13.0, 9.0) == "YES", "vertical line" n = int(input()) for _ in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split()) print(parallelism(x1, y1, x2, y2, x3, y3, x4, y4))
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s879836373
p00021
Wrong Answer
def parallelism(x1, y1, x2, y2, x3, y3, x4, y4): from fractions import Fraction x1, y1, x2, y2, x3, y3, x4, y4 = map(Fraction,(x1, y1, x2, y2, x3, y3, x4, y4)) a1 = Fraction((y2-y1), (x2-x1)) if (x2-x1) != 0 else float("inf") a2 = Fraction((y4-y3), (x4-x3)) if (x4-x3) != 0 else float("inf") if a1 == a2: return "YES" else: return "NO" if __name__ == "__main__": assert parallelism(0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 2.0, 1.0) == "YES", "sample1" assert parallelism(3.0, 2.0, 9.0, 6.0, 13.0, 5.0, 7.0, 9.0) == "NO", "sample2" assert parallelism(3.0, 2.0, 9.0, 2.0, 13.0, 5.0, 7.0, 5.0) == "YES", "horizontal line" assert parallelism(3.0, 2.0, 3.0, 6.0, 13.0, 5.0, 13.0, 9.0) == "YES", "vertical line" n = int(input()) for _ in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split()) print(parallelism(x1, y1, x2, y2, x3, y3, x4, y4))
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s796482401
p00021
Wrong Answer
n = int(input()) for i in range(n): a,e,b,f,c,g,d,h=list(map(float,input().split())) print("YES" if abs((b-a)*(d-c)-(h-g)*(f-e)) < 1e-10 else "NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s338660807
p00021
Wrong Answer
ABs=[] CDs=[] n = int(input()) for i in range(n): x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4, = map(float, input().split()) AB = [x_2 - x_1, y_2 - y_1] CD = [x_4 - x_3, y_4 - y_3] ABs.append(AB) CDs.append(CD) for i in range(n): if ABs[i][0]*CDs[i][1]==ABs[i][1]*CDs[i][0]: print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s870066684
p00021
Wrong Answer
n=int(input()) for loop in range(n): x1,y1,x2,y2,x3,y3,x4,y4=[float(i) for i in input().split(" ")] AB=[x2-x1,y2-y1] CD=[x4-x3,y4-y3] if AB[0]*CD[1]==AB[1]*CD[0]: print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s027294971
p00021
Wrong Answer
n=int(input()) for loop in range(n): x1,y1,x2,y2,x3,y3,x4,y4=[float(i) for i in input().split(" ")] AB=[x2-x1,y2-y1] CD=[x4-x3,y4-y3] if abs(AB[0]*CD[1]-AB[1]*CD[0])<10**(-5): print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s917785722
p00021
Wrong Answer
n = int(input()) for _ in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split()) if (x2 - x1) * (y4 - y3) - (x4 - x3) * (y2 - y1) == 0: print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s219158704
p00021
Wrong Answer
n = int(input()) for _ in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split()) if (x2 - x1) * (y4 - y3) - (x4 - x3) * (y2 - y1) == 0.0: print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s747287736
p00021
Wrong Answer
n = int(input()) for _ in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split()) if abs((x2 - x1) * (y4 - y3) - (x4 - x3) * (y2 - y1)) < 1e-8: print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s075694709
p00021
Wrong Answer
n = int(input()) for _ in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split()) if abs((x2 - x1) * (y4 - y3) - (x4 - x3) * (y2 - y1)) < 1e-5: print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s525956978
p00021
Wrong Answer
n = int(input()) for i in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split()) if y1 == y3 and y2 == y4: print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s537132106
p00021
Wrong Answer
# Aizu Problem 0021: Parallelism # import sys, math, os # read input: PYDEV = os.environ.get('PYDEV') if PYDEV=="True": sys.stdin = open("sample-input.txt", "rt") N = int(input()) for n in range(N): x1, y1, x2, y2, x3, y3, x4, y4 = [float(_) for _ in input().split()] det = (x2 - x1) * (y4 - y3) - (y2 - y1) * (x4 - x3) print("YES" if det == 0 else "NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s991713133
p00021
Wrong Answer
# Aizu Problem 0021: Parallelism # import sys, math, os # read input: PYDEV = os.environ.get('PYDEV') if PYDEV=="True": sys.stdin = open("sample-input.txt", "rt") N = int(input()) for n in range(N): x1, y1, x2, y2, x3, y3, x4, y4 = [float(_) for _ in input().split()] det = (x2 - x1) * (y4 - y3) - (y2 - y1) * (x4 - x3) print("YES" if abs(det) < 1e-5 else "NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s151185796
p00021
Wrong Answer
# Aizu Problem 0021: Parallelism # import sys, math, os # read input: PYDEV = os.environ.get('PYDEV') if PYDEV=="True": sys.stdin = open("sample-input.txt", "rt") N = int(input()) for n in range(N): x1, y1, x2, y2, x3, y3, x4, y4 = [float(_) for _ in input().split()] det = (x2 - x1) * (y4 - y3) - (y2 - y1) * (x4 - x3) print("YES" if abs(det) < 1e-6 else "NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s020838471
p00021
Wrong Answer
# -*- coding: utf-8 -*- """ http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0021&lang=jp """ import sys from sys import stdin input = stdin.readline class Point(object): epsilon = 1e-10 def __init__(self, x=0.0, y=0.0): if isinstance(x, tuple): self.x = x[0] self.y = x[1] else: self.x = x self.y = y # ???????????? def __add__(self, other): return Point(self.x + other.x, self.y + other.y) def __sub__(self, other): return Point(self.x - other.x, self.y - other.y) def __mul__(self, other): return Point(other * self.x, other * self.y) def __truediv__(self, other): return Point(self.x / other, self.y / other) def __lt__(self, other): if self.x == other.x: return self.y < other.y else: return self.x < other.x def __eq__(self, other): from math import fabs if fabs(self.x - other.x) < Point.epsilon and fabs(self.y - other.y) < Point.epsilon: return True else: return False def norm(self): return self.x * self.x + self.y * self.y def __abs__(self): return sqrt(self.norm()) def ccw(self, p0, p1): # ??????2???(p0, p1)?????????????????????????????????????????¢???????????? a = Vector(p1 - p0) b = Vector(self - p0) if Vector.cross(a, b) > Point.epsilon: return 1 # 'COUNTER_CLOCKWISE' elif Vector.cross(a, b) < -Point.epsilon: return -1 # 'CLOCKWISE' elif Vector.dot(a, b) < -Point.epsilon: return 2 # 'ONLINE_BACK' elif a.norm() < b.norm(): return -2 # 'ONLINE_FRONT' else: return 0 # 'ON_SEGMENT' def project(self, s): # ??????(Point)????????????s??????????????????????????????????????§?¨?(?°???±)????±??????? base = Vector(s.p2 - s.p1) a = Vector(self - s.p1) r = Vector.dot(a, base) r /= base.norm() return s.p1 + base * r def reflect(self, s): # ??????s???????§°?????¨?????????????????¨???????§°??????????????§?¨?(????°?)????±??????? proj = self.project(s) return self + (proj - self)*2 def distance(self, s): # ????????¨??????s????????¢????¨?????????? if Vector.dot(s.p2-s.p1, self-s.p1) < 0.0: return abs(self - s.p1) if Vector.dot(s.p1-s.p2, self-s.p2) < 0.0: return abs(self - s.p2) return abs(Vector.cross(s.p2-s.p1, self-s.p1) / abs(s.p2-s.p1)) class Vector(Point): def __init__(self, x=0.0, y=0.0): if isinstance(x, tuple): self.x = x[0] self.y = x[1] elif isinstance(x, Point): self.x = x.x self.y = x.y else: 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, other): return Vector(other * self.x, other * self.y) def __truediv__(self, other): return Vector(self.x / other, self.y / other) @classmethod def dot(cls, a, b): return a.x * b.x + a.y * b.y @classmethod def cross(cls, a, b): return a.x * b.y - a.y * b.x @classmethod def is_orthogonal(cls, a, b): return Vector.dot(a, b) == 0.0 @classmethod def is_parallel(cls, a, b): return Vector.cross(a, b) == 0.0 class Segment(object): def __init__(self, p1=Point(), p2=Point()): if isinstance(p1, Point): self.p1 = p1 self.p2 = p2 elif isinstance(p1, tuple): self.p1 = Point(p1[0], p1[1]) self.p2 = Point(p2[0], p2[1]) def intersect(self, s): # ????????¨?????????????????????????????????????????????????????? ans1 = s.p1.ccw(self.p1, self.p2) * s.p2.ccw(self.p1, self.p2) ans2 = self.p1.ccw(s.p1, s.p2) * self.p2.ccw(s.p1, s.p2) return ans1 <= 0 and ans2 <= 0 def cross_point(self, s): # ????????¨??????????????????????????????????????§?¨?????±??????? base = s.p2 - s.p1 d1 = abs(Vector.cross(base, self.p1-s.p1)) d2 = abs(Vector.cross(base, self.p2-s.p1)) t = d1 / (d1 + d2) return self.p1 + (self.p2 - self.p1) * t def distance(self, s): # ????????¨?????????????????????????????¢????±??????? if self.intersect(s): return 0.0 d1 = s.p1.distance(self) d2 = s.p2.distance(self) d3 = self.p1.distance(s) d4 = self.p2.distance(s) return min(d1, d2, d3, d4) @classmethod def is_orthogonal(cls, s1, s2): a = Vector(s1.p2 - s1.p1) b = Vector(s2.p2 - s2.p1) return Vector.is_orthogonal(a, b) @classmethod def is_parallel(cls, s1, s2): a = Vector(s1.p2 - s1.p1) b = Vector(s2.p2 - s2.p1) return Vector.is_parallel(a, b) class Line(Segment): pass class Cirle(object): def __init__(self, x, y=Point(), r=1.0): if isinstance(x, Point): self.c = x self.r = y elif isinstance(x, tuple): self.c = Point(x[0], x[1]) self.r = r def cross_points(self, s): if isinstance(s, Segment): pr = self.c.project(s) e = (s.p2 - s.p1) / abs(s.p2 - s.p1) base = sqrt(self.r * self.r - (pr - self.c).norm()) return pr + e * base, pr - e * base elif isinstance(s, Cirle): c2 = s d = abs(self.c - c2.c) a = acos((self.r * self.r + d * d - c2.r * c2.r) / (2 * self.r * d)) t = atan2(c2.c.y - self.c.y, c2.c.x - self.c.x) temp1 = Point(cos(t+a)*self.r, sin(t+a)*self.r) temp2 = Point(cos(t-a)*self.r, sin(t-a)*self.r) return self.c + temp1, self.c + temp2 def contains(polygon, p): n = len(polygon) x = False for i in range(n): a = polygon[i] - p b = polygon[(i+1)%n] - p if abs(Vector.cross(a, b)) < Point.epsilon and Vector.dot(a, b) < Point.epsilon: return 1 if a.y > b.y: temp = a a = b b = temp if a.y < Point.epsilon and Point.epsilon < b.y and Vector.cross(a, b) > Point.epsilon: x = not x return 2 if x else 0 def main(args): n = int(input()) for _ in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split()) a = Point(x1, y1) b = Point(x2, y2) c = Point(x3, y3) d = Point(x4, y4) AB = Segment(a, b) CD = Segment(c, d) result = Segment.is_parallel(AB, CD) if result: print('YES') else: print('NO') if __name__ == '__main__': main(sys.argv[1:])
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s457323161
p00021
Wrong Answer
n = int(input()) for i in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split()) if x1 == x2 and x3 == x4: print("YES") elif x1 == x2 or x3 == x4: print("NO") elif (y2 - y1) / (x2 - x1) == (y4 - y3) / (x4 - x3): print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s031955672
p00021
Wrong Answer
n = int(input()) for i in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split()) if x1 == x2 and x3 == x4: print("YES") elif x1 == x2 or x3 == x4: print("NO") elif (y2 - y1) / (x2 - x1) - (y4 - y3) / (x4 - x3) < 1e-10: print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s423958388
p00021
Wrong Answer
if __name__ == '__main__': n = int(input()) for _ in range(n): x1,y1,x2,y2,x3,y3,x4,y4 = map(float,input().split()) if x1 == x2 and x3 == x4: print("YES") elif x1 == x2: print("NO") elif x3 == x4: print("NO") else: if (y2-y1)/(x2-x1) == (y4-y3)/(x4-x3): print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s354055884
p00021
Wrong Answer
import math if __name__ == '__main__': n = int(input()) for _ in range(n): x1,y1,x2,y2,x3,y3,x4,y4 = map(float,input().split()) if math.fabs(x1 - x2) <= 0.00001 and math.fabs( x3 - x4) <= 0.00001: print("YES") elif math.fabs(x1 - x2) <= 0.00001: print("NO") elif math.fabs(x3 - x4) <= 0.00001: print("NO") else: if math.fabs((y2-y1)/(x2-x1) - (y4-y3)/(x4-x3)) <= 0.00001: print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s536443448
p00021
Wrong Answer
import math if __name__ == '__main__': n = int(input()) for _ in range(n): x1,y1,x2,y2,x3,y3,x4,y4 = map(float,input().split()) #print((y2-y1)/(x2-x1) - (y4-y3)/(x4-x3)) '''if math.fabs(x1 - x2) <= 0.00001 and math.fabs( x3 - x4) <= 0.00001: print("YES") elif math.fabs(x1 - x2) <= 0.00001: print("NO") elif math.fabs(x3 - x4) <= 0.00001: print("NO") else: ''' if math.fabs((x2-x1) * (y4-y3)-(x4-x3)*(y2-y1)) <= 0.00001: print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s628579713
p00021
Wrong Answer
import math if __name__ == '__main__': n = int(input()) for _ in range(n): x1,y1,x2,y2,x3,y3,x4,y4 = map(float,input().split()) #print((y2-y1)/(x2-x1) - (y4-y3)/(x4-x3)) '''if math.fabs(x1 - x2) <= 0.00001 and math.fabs( x3 - x4) <= 0.00001: print("YES") elif math.fabs(x1 - x2) <= 0.00001: print("NO") elif math.fabs(x3 - x4) <= 0.00001: print("NO") else: ''' if abs((x2-x1) * (y4-y3)-(x4-x3)*(y2-y1)) <= 0.00001: print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s720640315
p00021
Wrong Answer
import math if __name__ == '__main__': n = int(input()) for _ in range(n): x1,y1,x2,y2,x3,y3,x4,y4 = map(float,input().split()) #print((y2-y1)/(x2-x1) - (y4-y3)/(x4-x3)) '''if math.fabs(x1 - x2) <= 0.00001 and math.fabs( x3 - x4) <= 0.00001: print("YES") elif math.fabs(x1 - x2) <= 0.00001: print("NO") elif math.fabs(x3 - x4) <= 0.00001: print("NO") else: ''' if abs((x2-x1) * (y4-y3)-(x4-x3)*(y2-y1)) <= 0.000001: print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s038361804
p00021
Wrong Answer
a = int(input()) for i in range(a): x1,y1,x2,y2,x3,y3,x4,y4=list((map(float,raw_input().split()))) if ((x2-x1)*(y4-y3)-(y2-y1)*(x4-x3)) < 1e-10: print "YES" else: print "NO"
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s230156947
p00021
Wrong Answer
a = int(input()) for i in range(0,a): x1,y1,x2,y2,x3,y3,x4,y4=list((map(float,raw_input().split()))) if ((x2-x1)*(y4-y3)-(y2-y1)*(x4-x3)) < 1e-6: print "YES" else: print "NO"
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s417160553
p00021
Wrong Answer
n = int(input()) for i in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, raw_input().split()) if abs(((y2-y1)*(x4-x3) - (x2-x1)*(y4-y3))) < 1e-10: print "YES" else: "NO"
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s475426443
p00021
Wrong Answer
n = int(input()) for i in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = list(map(float, raw_input().split())) if abs(((y2-y1)*(x4-x3) - (x2-x1)*(y4-y3))) < 1e-10: print "YES" else: "NO"
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s723323264
p00021
Wrong Answer
# coding=utf-8 n = int(input()) for i in range(n): points_list = list(map(float, input().split())) abx = points_list[2] - points_list[0] aby = points_list[3] - points_list[1] cdx = points_list[6] - points_list[4] cdy = points_list[7] - points_list[5] if abx == cdx and aby == cdy: print('YES') else: print('NO')
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s027805303
p00021
Wrong Answer
# coding=utf-8 n = int(input()) for i in range(n): points_list = list(map(float, input().split())) abx = points_list[2] - points_list[0] aby = points_list[3] - points_list[1] cdx = points_list[6] - points_list[4] cdy = points_list[7] - points_list[5] if abx == cdx and aby == cdy: print('YES') else: print('NO') # 2 # 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 # 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s093184107
p00021
Wrong Answer
# coding=utf-8 n = int(input()) for i in range(n): points_list = list(map(float, input().split())) abx = points_list[2] - points_list[0] aby = points_list[3] - points_list[1] cdx = points_list[6] - points_list[4] cdy = points_list[7] - points_list[5] if cdx == 0 or cdy == 0: if cdx == 0 and cdy == 0: print('YES') else: print('NO') elif abx / cdx == aby / cdy: print('YES') else: print('NO')
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s639558543
p00021
Wrong Answer
# coding=utf-8 n = int(input()) for i in range(n): points_list = list(map(float, input().split())) abx = points_list[2] - points_list[0] aby = points_list[3] - points_list[1] cdx = points_list[6] - points_list[4] cdy = points_list[7] - points_list[5] if aby == 0 or cdy == 0: if aby == 0 and cdy == 0: print('YES') else: print('NO') elif abx / aby == cdx / cdy: print('YES') else: print('NO')
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s189749885
p00021
Wrong Answer
# coding=utf-8 n = int(input()) for i in range(n): points_list = list(map(float, input().split())) abx = points_list[2] - points_list[0] aby = points_list[3] - points_list[1] cdx = points_list[6] - points_list[4] cdy = points_list[7] - points_list[5] if abx == 0 or cdx == 0: if abx == 0 and cdx == 0: print('YES') else: print('NO') elif aby / abx == cdy / cdx: print('YES') else: print('NO')
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s415243431
p00021
Wrong Answer
try: n=int(raw_input()) for i in range(0,n): a,b,c,d,e,f,g,h=map(float,raw_input().split(" ")) t=(d-b)/(c-a) y=(h-f)/(g-e) if y==t or y==-t: print "YES" else: print "NO", except: print "error"
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s069136695
p00021
Wrong Answer
try: n=int(raw_input()) for i in range(n): a,b,c,d,e,f,g,h=map(float,raw_input().split(" ")) t=(d-b)/(c-a) y=(h-f)/(g-e) if y==t or y==-t: print "YES" else: print "NO", except: print "error"
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s095028763
p00021
Wrong Answer
try: n=int(raw_input()) for i in range(n): a,b,c,d,e,f,g,h=map(float,raw_input().split()) t=(d-b)/(c-a) y=(h-f)/(g-e) if y==t or y==-t: print "YES" else: print "NO", except: print "error"
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s079672182
p00021
Wrong Answer
# -*- coding:utf-8 -*- try: n=int(raw_input()) for i in range(n): a,b,c,d,e,f,g,h=map(float,raw_input().split()) t=(d-b)/(c-a) y=(h-f)/(g-e) if y==t or y==-t: print "YES" else: print "NO", except: print "error"
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s915618440
p00021
Wrong Answer
count = int(input()) for i in range(count): x = list(map(float ,input().split())) x1=x[2]-x[0] y1=x[3]-x[1] x2=x[6]-x[4] y2=x[7]-x[5] if x1==0: if x2==0: print("YES") else: print("NO") elif y1==0: if y2==0: print("YES") else: print("NO") else: if y1/x1==y2/x2: print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s817248110
p00021
Wrong Answer
count = int(input()) for i in range(count): x = list(map(float ,input().split())) x1=x[2]-x[0] y1=x[3]-x[1] x2=x[6]-x[4] y2=x[7]-x[5] if x1==0.00000: if x2==0.00000: print("YES") else: print("NO") elif y1==0.00000: if y2==0.00000: print("YES") else: print("NO") else: if format(y1/x1,'.5f')==format(y2/x2,'.5f'): print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s341369900
p00021
Wrong Answer
count = int(input()) for i in range(count): x = list(map(float ,input().split())) x1=x[2]-x[0] y1=x[3]-x[1] x2=x[6]-x[4] y2=x[7]-x[5] if abs(x1)<=0.00001: if abs(x2)<=0.00001: print("YES") else: print("NO") elif abs(y1)<=0.00001: if abs(y2)<=0.00001: print("YES") else: print("NO") else: if format(y1/x1,'.5f')==format(y2/x2,'.5f'): print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s482111092
p00021
Wrong Answer
count = int(input()) for i in range(count): x = list(map(float ,input().split())) x1=x[2]-x[0] y1=x[3]-x[1] x2=x[6]-x[4] y2=x[7]-x[5] if abs(x1*y2-x2*y1)<=0.00001: print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s670657405
p00021
Wrong Answer
n = int(input()) for i in range(n): try: x1, y1, x2, y2, x3, y3, x4, y4 = [float(j) for j in input().split()] if x2 - x1 == 0.0: if x4 - x3 == 0.0: print("YES") else: print("NO") elif x4 - x3 == 0.0: print("NO") print("YES" if (y2 - y1) / (x2 - x1) == (y4 - y3) / (x4 - x3) else "NO") except: break
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s915586727
p00021
Wrong Answer
n = int(input()) for i in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = [float(j) for j in input().split()] if x2 - x1 == 0.0: if x4 - x3 == 0.0: print("YES") else: print("NO") elif x4 - x3 == 0.0: print("NO") else: print("YES" if (y2 - y1) / (x2 - x1) == (y4 - y3) / (x4 - x3) else "NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s449563740
p00021
Wrong Answer
n = int(input()) for i in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = [float(j) for j in input().split()] if x2 == x1: if x4 == x3: print("YES") else: print("NO") elif x4 == x3: print("NO") else: print("YES" if (y2 - y1) / (x2 - x1) == (y4 - y3) / (x4 - x3) else "NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s037352520
p00021
Wrong Answer
n = int(input()) for i in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = [float(j) * 10**5 for j in input().split()] if x2 == x1: if x4 == x3: print("YES") else: print("NO") elif x4 == x3: print("NO") else: print("YES" if (y2 - y1) / (x2 - x1) == (y4 - y3) / (x4 - x3) else "NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s124709684
p00021
Wrong Answer
n = int(input()) for i in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = [float(j) for j in input().split()] if x2 == x1: if x4 == x3: print("YES") else: print("NO") elif x4 == x3: print("NO") else: print("YES" if (y2 - y1) / (x2 - x1) - (y4 - y3) / (x4 - x3) < 1e-10 else "NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s403052916
p00021
Wrong Answer
n = int(input()) for i in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = [float(j) for j in input().split()] if x2 == x1: if x4 == x3: print("YES") else: print("NO") elif x4 == x3: print("NO") else: print("YES" if (y2 - y1) / (x2 - x1) - (y4 - y3) / (x4 - x3) < 1e-5 else "NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s631571693
p00021
Wrong Answer
def main(): n = int(input()) x1,y1,x2,y2,x3,y3,x4,y4 = map(float,input().split()) if (y2-y1)/(x2-x1) == (y4 - y3)/(x4 -x3): print("YES") else: print("NO") if __name__ == '__main__': main()
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s675287138
p00021
Wrong Answer
def main(): n = int(input()) for i in range(n): x1,y1,x2,y2,x3,y3,x4,y4 = map(float,input().split()) if x1 == x2 and x3 == x4 : print("YES") elif x1 == x2 or x3 == x4 : print("NO") elif (y2-y1)/(x2-x1) == (y4 - y3)/(x4 -x3): print("YES") else: print("NO") if __name__ == '__main__': main()
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s253513714
p00021
Wrong Answer
n = int(input()) for i in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split()) if (x2-x1)*(y4-y3) - (y2-y1)*(x4-x3) == 0: print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s080542489
p00021
Wrong Answer
n = int(input()) for i in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split()) if (x2-x1)*(y4-y3) - (y2-y1)*(x4-x3) + 0 == 0.0: print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s231950830
p00021
Wrong Answer
for i in range(int(input())): a,b,c,d,e,f,g,h = map(float,input().split()) if a == c: print("YES" if e == g else "NO") continue if e == g: print("NO") continue print("YES" if (b-d)/(a-c) == (f-h)/(e-g) else "NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s285759907
p00021
Wrong Answer
for i in range(int(input())): a,b,c,d,e,f,g,h = map(float,input().split()) if a == c: print("YES" if e == g else "NO") elif e == g: print("NO") else: print("YES" if (b-d)/(a-c) == (f-h)/(e-g) else "NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s583615595
p00021
Wrong Answer
for i in range(int(input())): a,b,c,d,e,f,g,h = map(float,input().split()) if a == c: print("YES" if e == g else "NO") elif e == g: print("NO") else: print("YES" if (b-d)/(a-c) - (f-h)/(e-g) < 1e-10 else "NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s029611931
p00021
Wrong Answer
n = int(raw_input()) for i in range(n): x1,y1,x2,y2,x3,y3,x4,y4=map(float,raw_input().split()) if x2-x1 !=0 and x4-x3 !=0: if (y2-y1)/(x2-x1) == (y4-y3)/(x4-x3): print "YES" else: print "NO" elif x2-x1 ==0 and x4-x3 ==0: print "YES" else: print "NO"
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s414226199
p00021
Wrong Answer
n = int(raw_input()) for i in range(n): x1,y1,x2,y2,x3,y3,x4,y4=map(float,raw_input().split()) x1 = round(x1,5) x2 = round(x2,5) x3 = round(x3,5) x4 = round(x4,5) if x2-x1 !=0 and x4-x3 !=0: if (y2-y1)/(x2-x1) == (y4-y3)/(x4-x3): #print "aaaaaa" print "YES" else: print "NO" elif x2-x1 ==0 and x4-x3 ==0: print "bbbbb" print "YES" else: print "NO"
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s519628347
p00021
Wrong Answer
n = int(raw_input()) for i in range(n): x1,y1,x2,y2,x3,y3,x4,y4=map(float,raw_input().split()) if abs(x2-x1) >= 1e-5 and abs(x4-x3) >= 1e-5: if (y2-y1)/(x2-x1) == (y4-y3)/(x4-x3): #print "aaaaaa" print "YES" else: print "NO" elif abs(x2-x1) < 1e-5 and abs(x4-x3) <1e-5: print "YES" else: print "NO"
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s601203104
p00021
Wrong Answer
n = int(raw_input()) for i in range(n): x1,y1,x2,y2,x3,y3,x4,y4=map(float,raw_input().split()) if abs(x2-x1) >= 1e-10 and abs(x4-x3) >= 1e-10: if (y2-y1)/(x2-x1) == (y4-y3)/(x4-x3): #print "aaaaaa" print "YES" else: print "NO" elif abs(x2-x1) < 1e-10 and abs(x4-x3) <1e-10: print "YES" else: print "NO"
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s358035410
p00021
Wrong Answer
N = int(input()) for i in range(N): x1,y1,x2,y2,x3,y3,x4,y4 = [float(i) for i in input().split()] xn = x1-x2 yn = y1-y2 xm = x3-x4 ym = y3-y4 if xn*ym == xm*yn: print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s411789611
p00021
Wrong Answer
for _ in[0]*int(input()): a,b,c,d,e,f,g,h=map(float,input().split()) print(['NO','YES'][(a-c)*(f-h)-(e-g)*(b-d)==0])
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s368484484
p00021
Wrong Answer
for _ in[0]*int(input()): a,b,c,d,e,f,g,h=map(float,input().split()) print(['NO','YES'][int((a-c)*(f-h))==int((e-g)*(b-d))])
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s611645580
p00021
Wrong Answer
for _ in[0]*int(input()): a,b,c,d,e,f,g,h=map(float,input().split()) print(['NO','YES'][abs((a-c)*(f-h)-(e-g)*(b-d))<1e-5])
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s699181282
p00021
Wrong Answer
for _ in[0]*int(input()): a,b,c,d,e,f,g,h=map(float,input().split()) print(['NO','YES'][abs((a-c)*(f-h)-(e-g)*(b-d))<1e-6])
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s714895293
p00021
Wrong Answer
for _ in[0]*int(input()): a,b,c,d,e,f,g,h=map(float,input().split()) print(['NO','YES'][abs((a-c)*(f-h)-(e-g)*(b-d))<1e-9])
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> 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 "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>