s_id
stringlengths
10
10
p_id
stringlengths
6
6
u_id
stringlengths
10
10
date
stringlengths
10
10
language
stringclasses
1 value
original_language
stringclasses
11 values
filename_ext
stringclasses
1 value
status
stringclasses
1 value
cpu_time
int64
0
100
memory
stringlengths
4
6
code_size
int64
15
14.7k
code
stringlengths
15
14.7k
problem_id
stringlengths
6
6
problem_description
stringlengths
358
9.83k
input
stringlengths
2
4.87k
output
stringclasses
807 values
__index_level_0__
int64
1.1k
1.22M
s316939428
p00012
u995990363
1530852344
Python
Python3
py
Accepted
20
5592
1,214
import sys class P(object): def __init__(self, x, y): self.x = x self.y = y def __repr__(self): return 'P:{0:.3f} {1:.3f}'.format(self.x, self.y) class Line(object): def __init__(self, p1, p2): self.p1 = p1 self.p2 = p2 self.epsilon = 1e-8 def is_over(...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,502
s780464984
p00012
u244742296
1409835655
Python
Python3
py
Accepted
30
7000
1,354
# -*- coding: utf-8 -*- import sys import cmath import math class Point(object): def __init__(self, x, y): self.point = complex(x, y) def __str__(self): return "x = {0}, y = {1}".format(self.point.real, self.point.imag) class Triangle(Point): def __init__(self, a, b, c): self.a =...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,503
s998084633
p00012
u579833671
1410771055
Python
Python
py
Accepted
20
4476
848
import math def helon(x1, y1, x2, y2, x3, y3): a = math.sqrt((x2 - x1)**2 + (y2 - y1)**2) b = math.sqrt((x3 - x2)**2 + (y3 - y2)**2) c = math.sqrt((x1 - x3)**2 + (y1 - y3)**2) s = (a + b + c) / 2 return(math.sqrt(s * (s - a) * (s - b) * (s - c))) while(True): try: input = map(float,...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,504
s482319853
p00012
u912237403
1415708615
Python
Python
py
Accepted
20
4244
300
import sys def side(p1, p2, p3): return (p3[1]-p1[1])*(p2[0]-p1[0])-(p2[1]-p1[1])*(p3[0]-p1[0])>0 for s in sys.stdin: x = map(float, s.split()) p1 = x[0:2] p2 = x[2:4] p3 = x[4:6] p0 = x[6:] print ["NO","YES"][(side(p1, p2, p0)==side(p2, p3, p0) and side(p2, p3, p0)==side(p3, p1, p0))]
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,505
s588862989
p00012
u912237403
1415708888
Python
Python
py
Accepted
10
4244
279
import sys def side(p1, p2, p3): return (p3[1]-p1[1])*(p2[0]-p1[0])-(p2[1]-p1[1])*(p3[0]-p1[0])>0 for s in sys.stdin: x = map(float, s.split()) p1 = x[0:2] p2 = x[2:4] p3 = x[4:6] p0 = x[6:] print ["NO","YES"][(side(p1, p2, p0)==side(p2, p3, p0)==side(p3, p1, p0))]
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,506
s828433173
p00012
u506132575
1416116600
Python
Python
py
Accepted
10
4264
509
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys def dot_z(v1,v2): if v1[0]*v2[1]-v1[1]*v2[0] > 0: return 1 else: return -1 def diff_p(p1,p2): return [ p2[0]-p1[0], p2[1]-p1[1] ] for s in sys.stdin: d = map(float , s.split() ) a = [d[0],d[1]] b = [d[2],d[3]] c = [d[4],d[5]] p = [d[6]...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,507
s426844946
p00012
u633068244
1416815641
Python
Python
py
Accepted
20
4248
340
def S(x1,y1,x2,y2,x3,y3): return abs(x1*(y2-y3)+x2*(y3-y1)+x3*(y1-y2))/2.0 while True: try: x1,y1,x2,y2,x3,y3,xp,yp = map(float,raw_input().split()) flag = S(x1,y1,x2,y2,xp,yp)+S(x1,y1,x3,y3,xp,yp)+S(x3,y3,x2,y2,xp,yp)-S(x1,y1,x2,y2,x3,y3) > 0.0000001 print "NO" if flag else "YES" e...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,508
s768883549
p00012
u633068244
1416815845
Python
Python
py
Accepted
10
4240
307
while True: try: x1,y1,x2,y2,x3,y3,xp,yp = map(float,raw_input().split()) S = lambda x1,y1,x2,y2,x3=xp,y3=yp:abs(x1*(y2-y3)+x2*(y3-y1)+x3*(y1-y2))/2.0 print "NO" if S(x1,y1,x2,y2)+S(x1,y1,x3,y3)+S(x3,y3,x2,y2)-S(x1,y1,x2,y2,x3,y3) > 0.0000001 else "YES" except: break
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,509
s076235194
p00012
u567380442
1423055030
Python
Python3
py
Accepted
40
6756
473
import sys f = sys.stdin def take2(iterable): i = iter(iterable) while True: yield next(i), next(i) def cross(a, b): return a.real * b.imag - a.imag * b.real def in_triangle(a, b, c, p): v1 = cross(a - b, b - p) v2 = cross(b - c, c - p) v3 = cross(c - a, a - p) return 0 < v1 * v2 an...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,510
s853935513
p00012
u540744789
1426591895
Python
Python
py
Accepted
20
4256
395
def S(x1,y1,x2,y2,x3,y3): return ((x2-x1)*(y3-y1)-(x3-x1)*(y2-y1))/2.0 import sys for dataset in sys.stdin: x1,y1,x2,y2,x3,y3,xp,yp=map(float,dataset.split(" ")) ABP=S(x1,y1,x2,y2,xp,yp) BCP=S(x2,y2,x3,y3,xp,yp) CAP=S(x3,y3,x1,y1,xp,yp) if ABP>0 and BCP>0 and CAP>0: print 'YES' elif ...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,511
s118730724
p00012
u162387221
1431319110
Python
Python
py
Accepted
20
4240
435
def CrossProduct(x1, y1, x2, y2, xp, yp): x2 -= x1 xp -= x1 y2 -= y1 yp -= y1 vec = (x2*yp-xp*y2) return True if vec > 0 else False while True: try: x1, y1, x2, y2, x3, y3, xp, yp = map(float, raw_input().split()) except EOFError: break if CrossProduct(x1, y1, x2, y2, xp, yp) == Cross...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,512
s481792042
p00012
u879226672
1431605893
Python
Python
py
Accepted
20
4244
468
# coding: utf-8 while True: try: x1 ,y1, x2, y2, x3, y3, xp, yp = map(float,raw_input().split()) # ?????????z????????????????¨????????????? c1 = (x2-x1) * (yp-y2) - (y2-y1) * (xp-x2) c2 = (x3-x2) * (yp-y3) - (y3-y2) * (xp-x3) c3 = (x1-x3) * (yp-y1) - (y1-y3) * (xp-x1) ...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,513
s920877240
p00012
u067299340
1432879119
Python
Python
py
Accepted
10
4244
257
import sys for x0,y0,x1,y1,x2,y2,xp,yp in[map(float,l.split()) for l in sys.stdin]: a=(x1-x0)*(y1-yp)-(y1-y0)*(x1-xp) b=(x2-x1)*(y2-yp)-(y2-y1)*(x2-xp) c=(x0-x2)*(y0-yp)-(y0-y2)*(x0-xp) print "YES" if a<0 and b<0 and c<0 or a>0 and b>0 and c>0 else "NO"
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,514
s529335989
p00012
u067299340
1432879721
Python
Python
py
Accepted
20
4244
206
import sys for a,b,c,d,e,f,g,h in[map(float,l.split()) for l in sys.stdin]: A=(c-a)*(d-h)-(d-b)*(c-g) B=(e-c)*(f-h)-(f-d)*(e-g) C=(a-e)*(b-h)-(b-f)*(a-g) print "YES"if A*B>0 and B*C>0 and C*A>0 else"NO"
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,515
s666917270
p00012
u067299340
1432879731
Python
Python
py
Accepted
10
4244
206
import sys for a,b,c,d,e,f,g,h in[map(float,l.split()) for l in sys.stdin]: A=(c-a)*(d-h)-(d-b)*(c-g) B=(e-c)*(f-h)-(f-d)*(e-g) C=(a-e)*(b-h)-(b-f)*(a-g) print "YES"if A*B>0 and B*C>0 and C*A>0 else"NO"
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,516
s945368892
p00012
u067299340
1432880059
Python
Python
py
Accepted
10
4240
179
import sys for a,b,c,d,e,f,g,h in[map(float,l.split()) for l in sys.stdin]:print["NO","YES"][((c-a)*(d-h)-(d-b)*(c-g)>0)==((e-c)*(f-h)-(f-d)*(e-g)>0)==((a-e)*(b-h)-(b-f)*(a-g)>0)]
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,517
s702162953
p00012
u379956761
1434729024
Python
Python3
py
Accepted
30
6816
591
#!/usr/bin/env python #-*- coding:utf-8 -*- import sys import math for data in sys.stdin: x1, y1, x2, y2, x3, y3, xp, yp = list(map(float, data.split())) abV = (x1 - x2, y1 - y2) bpV = (x2 - xp, y2 - yp) bcV = (x2 - x3, y2 - y3) cpV = (x3 - xp, y3 - yp) caV = (x3 - x1, y3 - y1) apV = (x...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,518
s182523455
p00012
u140201022
1443020279
Python
Python
py
Accepted
10
6356
249
while 1: try: x1,y1,x2,y2,x3,y3,xp,yp=map(float,raw_input().split()) print 'YES' if ((x2-x1)*(y2-yp)-(y2-y1)*(x2-xp)>0)==((x3-x2)*(y3-yp)-(y3-y2)*(x3-xp)>0)==((x1-x3)*(y1-yp)-(y1-y3)*(x1-xp)>0) else 'NO' except: break
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,519
s272022408
p00012
u071010747
1445230312
Python
Python3
py
Accepted
30
7384
514
# -*- coding:utf-8 -*- def main(): while True: try: ax,ay,bx,by,cx,cy,px,py=map(float,input().split()) A=(bx-ax)*(py-ay)-(by-ay)*(px-ax) B=(cx-bx)*(py-by)-(cy-by)*(px-bx) C=(ax-cx)*(py-cy)-(ay-cy)*(px-cx) if ((A<=0)and(B<=0)and(C<=0))or((A>0)and(...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,520
s381603833
p00012
u489809100
1446481651
Python
Python
py
Accepted
0
6300
498
while True: try: point = map(float,raw_input().split()) z1 = (point[4] - point[2]) * (point[7] - point[3]) - (point[5] - point[3]) * (point[6] - point[2]) z2 = (point[0] - point[4]) * (point[7] - point[5]) - (point[1] - point[5]) * (point[6] - point[4]) z3 = (point[2] - point[0]) * (point[7] - point[1]) - (poi...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,521
s749966678
p00012
u777299405
1447733827
Python
Python3
py
Accepted
40
7340
423
while True: try: ax, ay, bx, by, cx, cy, px, py = map(float, input().split()) a = (bx - ax) * (py - ay) - (by - ay) * (px - ax) b = (cx - bx) * (py - by) - (cy - by) * (px - bx) c = (ax - cx) * (py - cy) - (ay - cy) * (px - cx) if (a < 0 and b < 0 and c < 0) or (a > 0 and b >...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,522
s601258296
p00012
u529386725
1454764748
Python
Python3
py
Accepted
30
7416
504
def cross(x, y): return (x.conjugate() * y).imag def inside_triangle(p, x, y, z): a = cross(y-x, p-y) b = cross(z-y, p-z) c = cross(x-z, p-x) if a*b > 0 and b*c > 0: return True return False import sys for line in sys.stdin: x1, y1, x2, y2, x3, y3, xp, yp = map(float, line.split()...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,523
s764194900
p00012
u512342660
1455277604
Python
Python
py
Accepted
10
6464
863
#! -*- coding:utf-8 -*- #????????????P????????????3???A,B,C????????£???????????????????§???¢??? #?????´?????????????????´???????????????????????????????????°????????? #????????????????????????????????¨????????? #?????????????????§?¨??????? import sys for line in sys.stdin: #1:A,2:B,3:C ax,ay,bx,by,cx,cy,px,py =...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,524
s094875621
p00012
u650459696
1458397103
Python
Python3
py
Accepted
20
7496
419
import sys def tri(x1,x2,y1,y2,z1,z2,p1,p2): a = (x1 - y1) * (y2 - p2) - (y1 - p1) * (x2 - y2) b = (y1 - z1) * (z2 - p2) - (z1 - p1) * (y2 - z2) c = (z1 - x1) * (x2 - p2) - (x1 - p1) * (z2 - x2) if(((a < 0) & (b < 0) & (c < 0)) | ((a > 0) & (b > 0) & (c > 0))): return 'YES' return 'NO' ans...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,525
s605766060
p00012
u148101999
1459238702
Python
Python
py
Accepted
10
6340
395
def S(x1,y1,x2,y2,x3,y3): return ((x2-x1)*(y3-y1)-(x3-x1)*(y2-y1))/2.0 import sys for dataset in sys.stdin: x1,y1,x2,y2,x3,y3,xp,yp=map(float,dataset.split(" ")) ABP=S(x1,y1,x2,y2,xp,yp) BCP=S(x2,y2,x3,y3,xp,yp) CAP=S(x3,y3,x1,y1,xp,yp) if ABP>0 and BCP>0 and CAP>0: print 'YES' elif ...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,526
s083674776
p00012
u915343634
1459591740
Python
Python3
py
Accepted
30
7440
421
def r(x1, y1, x2, y2, x3, y3): return x1*(y2-y3)+x2*(y3-y1)+x3*(y1-y2) > 0 while True: try: line = input() except: break x1, y1, x2, y2, x3, y3, xp, yp = map(float, line.strip().split()) abc = r(x1, y1, x2, y2, x3, y3) pab = r(xp, yp, x1, y1, x2, y2) pbc = r(xp, yp, x2, y2...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,527
s625963679
p00012
u130979865
1459909324
Python
Python
py
Accepted
10
6380
832
# -*- coding: utf-8 -*- import sys import math class Point_Class(): def __init__(self, x, y): self.x = x self.y = y def isIn(p1, p2, p3, pp): a = p2.y-p1.y b = p2.x-p1.x c = p2.x*p1.y-p1.x*p2.y d = p3.y-p2.y e = p3.x-p2.x f = p3.x*p2.y-p2.x*p3.y g = p1.y-p3.y h = p...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,528
s032965930
p00012
u572790226
1460287674
Python
Python3
py
Accepted
30
7544
544
import sys def crossMulti(p1, p2): return p1[0] * p2[1] - p1[1] * p2[0] lines = sys.stdin.readlines() for line in lines: Zd = [] x1, y1, x2, y2, x3, y3, xp, yp = map(float, line.split()) Ps = [(x2-x1, y2-y1),(x3-x2, y3-y2),(x1-x3, y1-y3)] Px = [(xp-x1, yp-y1),(xp-x2, yp-y2),(xp-x3, yp-y...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,529
s020511566
p00012
u766477342
1466207191
Python
Python3
py
Accepted
20
7724
933
import math class Triangle: def __init__(self, x1, y1, x2, y2, x3, y3): self.x1 = x1 self.x2 = x2 self.x3 = x3 self.y1 = y1 self.y2 = y2 self.y3 = y3 self.a = math.sqrt((x1-x2) ** 2 + (y1 - y2) ** 2) self.b = math.sqrt((x2-x3) ** 2 + (y2 - y3) ** 2) ...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,530
s113902479
p00012
u766477342
1466207581
Python
Python3
py
Accepted
20
7812
991
import math class Triangle: def __init__(self, x1, y1, x2, y2, x3, y3): self.x1 = x1 self.x2 = x2 self.x3 = x3 self.y1 = y1 self.y2 = y2 self.y3 = y3 self.a = math.sqrt((x1-x2) ** 2 + (y1 - y2) ** 2) self.b = math.sqrt((x2-x3) ** 2 + (y2 - y3) ** 2) ...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,531
s886649777
p00012
u617990214
1468244893
Python
Python3
py
Accepted
30
7456
507
out=[] while True: try: k=list(map(float,input().split(" "))) except: break O_x,O_y=k[0],k[1] A_x,A_y=k[2],k[3] B_x,B_y=k[4],k[5] P_x,P_y=k[6],k[7] # P in triangle OAB # iff s+t<1 and s>0 and t>0 (OP=sOA+tOB) OA=(A_x-O_x,A_y-O_y) OB=(B_x-O_x,B_y-O_y) OP=(P_x-O_x,P_y-O_y) keisuu=1/( OA[0]*OB[1] - OA[1...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,532
s011842495
p00012
u582608581
1470810409
Python
Python3
py
Accepted
40
7408
397
def Cramer(a11, a12, a13, a21, a22, a23): den = a11 * a22 - a12 * a21 return (a13 * a22 - a12 * a23) / den, (a11 * a23 - a13 * a21) / den while True: try: x1, y1, x2, y2, x3, y3, xp, yp = [eval(item) for item in input().split()] u, v = Cramer(x3 - x1, x2 - x1, xp - x1, y3 - y1, y2 - y1, yp - y1) print('YES' i...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,533
s420736150
p00012
u358919705
1471861408
Python
Python3
py
Accepted
30
7524
504
import math while True: try: x1, y1, x2, y2, x3, y3, xp, yp = map(float, input().split()) except: break x = [x1, x2, x3, x1] y = [y1, y2, y3, y1] x = list(map(lambda i: i - xp, x)) y = list(map(lambda i: i - yp, y)) s = lambda a1, a2, b1, b2: abs(a1 * b2 - a2 * b1) S3 = s...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,534
s786290216
p00012
u379499530
1472783104
Python
Python
py
Accepted
10
6380
748
class point: def __init__(self, x, y): self.x = x self.y = y def sub(self, p): return point(self.x - p.x, self.y - p.y) while 1: try: x1, y1, x2, y2, x3, y3, xp, yp = map(float, raw_input().split()) A = point(x1, y1) B = point(x2, y2) C = point(x3, y3...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,535
s841001928
p00012
u659302741
1477742238
Python
Python3
py
Accepted
20
7424
842
import sys def is_counter_clockwise(x1, y1, x2, y2, x3, y3): px = x2 - x1 py = y2 - y1 qx = x3 - x1 qy = y3 - y1 return px * qy - py * qx > 0 def is_in_triangle(x1, y1, x2, y2, x3, y3, xp, yp): if is_counter_clockwise(x1, y1, x2, y2, x3, y3): return is_counter_clockwise(x1, y1, x2, y2,...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,536
s237605038
p00012
u922871577
1479281359
Python
Python
py
Accepted
10
6408
467
import sys for line in sys.stdin: x1, y1, x2, y2, x3, y3, xp, yp = map(float, line.split()) AB = [x2-x1, y2-y1] BP = [xp-x2, yp-y2] BC = [x3-x2, y3-y2] CP = [xp-x3, yp-y3] CA = [x1-x3, y1-y3] AP = [xp-x1, yp-y1] c1 = AB[0] * BP[1] - AB[1] * BP[0] c2 = BC[0] * CP[1] - BC[1] * CP[0] ...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,537
s910359525
p00012
u301729341
1481013177
Python
Python3
py
Accepted
20
7488
543
def gai(a,b,c,d): S = a*d - b*c return(S) while True: try: x1,y1,x2,y2,x3,y3,xp,yp = map(float,input().split()) if gai(x1 - x2,y1 - y2,x1 - xp,y1 - yp) < 0 and gai(x2 - x3,y2 - y3,x2 - xp,y2 - yp) < 0 and gai(x3 - x1,y3 - y1,x3 - xp,y3 - yp) < 0: print("YES") elif gai(x1...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,538
s003777334
p00012
u123687446
1481109539
Python
Python3
py
Accepted
20
7376
345
while True: try: p = list(map(float,input().split())) except EOFError: break a = p[2] - p[0] b = p[4] - p[0] c = p[6] - p[0] d = p[3] - p[1] e = p[5] - p[1] f = p[7] - p[1] s = (c*e-b*f)/(a*e-b*d) t = (a*f-c*d)/(a*e-b*d) print("YES" if s>0 and s<1 and t>0 and...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,539
s710258224
p00012
u919202930
1481509365
Python
Python3
py
Accepted
20
7440
561
def getTriangleArea(x1, y1, x2, y2, x3, y3): # returns the area of triangle determined by provided 3 points ux = x2-x1 uy = y2-y1 vx = x3-x1 vy = y3-y1 return abs(ux*vy-vx*uy)/2 inputs=[] while True: try: inputs.append(list(map(float,input().split()))) except EOFError: break for i in inputs: x...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,540
s732955672
p00012
u957840591
1482720981
Python
Python3
py
Accepted
30
7744
2,477
class vector(object): def __init__(self,a,b): self.x=b.x-a.x self.y=b.y-a.y @staticmethod def cross_product(a,b): return a.x*b.y-a.y*b.x class vertex(object): def __init__(self,a): self.x=a[0] self.y=a[1] class circle(object): def __init__(self,p,r): s...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,541
s220131393
p00012
u711765449
1483968920
Python
Python3
py
Accepted
20
7376
423
while True: try: ax, ay, bx, by, cx, cy, px, py = map(float, input().split()) a = (bx - ax) * (py - ay) - (by - ay) * (px - ax) b = (cx - bx) * (py - by) - (cy - by) * (px - bx) c = (ax - cx) * (py - cy) - (ay - cy) * (px - cx) if (a < 0 and b < 0 and c < 0) or (a > 0 and b >...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,542
s382661667
p00012
u078042885
1485812880
Python
Python3
py
Accepted
30
7416
316
def f(a,b,c,d,e,f,g,h):return ((a-c)*(f-b)+(b-d)*(a-e))*((a-c)*(h-b)+(b-d)*(a-g)) while 1: try:x1,y1,x2,y2,x3,y3,xp,yp=map(float,input().split()) except:break x=(x1+x2+x3)/3 y=(y1+y2+y3)/3 print(['YES','NO'][f(x1,y1,x2,y2,xp,yp,x,y)<0 or f(x1,y1,x3,y3,xp,yp,x,y)<0 or f(x2,y2,x3,y3,xp,yp,x,y)<0])
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,543
s480418066
p00012
u252414452
1486039977
Python
Python
py
Accepted
10
6456
381
import sys def to_f(e): return float(e) while True: line = sys.stdin.readline() if not line: break x1, y1, x2, y2, x3, y3, xp, yp = map(to_f, line.split(" ")) a = (x2-x1)*(y3-y1)-(x3-x1)*(y2-y1) b = (xp-x1)*(y3-y1)-(x3-x1)*(yp-y1) c = (x2-x1)*(yp-y1)-(xp-x1)*(y2-y1) s = b/a t = c/a if s>0 and t>0 ...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,544
s222475124
p00012
u032662562
1486278491
Python
Python3
py
Accepted
30
7704
666
import math from sys import stdin def length(u,v): x0=u[0] y0=u[1] x1=v[0] y1=v[1] return(math.sqrt(((x1-x0)**2+(y1-y0)**2))) def s(a,b,c): l=length(a,b) m=length(b,c) n=length(c,a) o = (l+m+n)/2.0 p=o*(o-l)*(o-m)*(o-n) q=math.sqrt(p) return(q) if __name__ == "__main__...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,545
s395523189
p00012
u901080241
1488958305
Python
Python3
py
Accepted
20
7396
554
import sys def sameside(x1, y1, x2, y2, ax, ay, bx, by): if x1 != x2: aupper = (ay > (y1-y2)/(x1-x2) * (ax-x1) + y1) bupper = (by > (y1-y2)/(x1-x2) * (bx-x1) + y1) else: aupper = ax < x1 bupper = bx < x1 return aupper == bupper for line in sys.stdin: x1, y1, x2, y2, x3,...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,546
s745883357
p00012
u797673668
1490622513
Python
Python3
py
Accepted
30
7396
408
def check(x1, y1, x2, y2, xp, yp): return ((y1 > yp) != (y2 > yp)) and (xp - x1 < (x2 - x1) * (yp - y1) / (y2 - y1)) while True: try: x1, y1, x2, y2, x3, y3, xp, yp = map(float, input().split()) except: break print('YES' if (check(x1, y1, x2, y2, xp, yp) + check(x2,...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,547
s903089408
p00012
u462831976
1492707333
Python
Python3
py
Accepted
20
7516
670
# -*- coding: utf-8 -*- import sys import os import math def cross(a, b): ax = a[0] ay = a[1] bx = b[0] by = b[1] return ax * by - ay * bx for s in sys.stdin: s = s.strip() ax, ay, bx, by, cx, cy, px, py = map(float, s.split()) # point A, B, C, P AP = (px - ax, py - ay) BP = ...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,548
s610403554
p00012
u546285759
1492757978
Python
Python3
py
Accepted
30
7620
473
import math def tri(x1, y1, x2, y2, x3, y3): return math.fabs((x2-x1)*(y3-y1) - (y2-y1)*(x3-x1)) / 2 while True: try: x1, y1, x2, y2, x3, y3, xp, yp = map(float, input().split()) except: break abc = tri(x1, y1, x2, y2, x3, y3) abp = tri(x1, y1, x2, y2, xp, yp) acp = tri(x1, y1,...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,549
s355068457
p00012
u618637847
1494897726
Python
Python3
py
Accepted
30
7400
408
while 1: try: x1, y1, x2, y2, x3, y3, px, py = map(float, input().split()) a = (x2-x1) * (py-y1) - (y2-y1) * (px-x1) b = (x3-x2) * (py-y2) - (y3-y2) * (px-x2) c = (x1-x3) * (py-y3) - (y1-y3) * (px-x3) if (a < 0 and b < 0 and c < 0) or (a > 0 and b > 0 and c > 0): ...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,550
s584660784
p00012
u905313459
1496317108
Python
Python3
py
Accepted
30
7536
486
import math def tri(x1, y1, x2, y2, x3, y3): return math.fabs((x2 - x1) * (y3 - y1) - (y2 - y1) * (x3 - x1)) / 2 while True: try: x1, y1, x2, y2, x3, y3, x, y = map(float, input().split()) except: break abc = tri(x1, y1, x2, y2, x3, y3) abp = tri(x1, y1, x2, y2, x, y) acp = tr...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,551
s018916528
p00012
u371539389
1498110062
Python
Python3
py
Accepted
60
10064
574
from decimal import Decimal as D import sys def S(P,Q,R): # R # #P # Q PQ=[Q[0]-P[0],Q[1]-P[1]] PR=[R[0]-P[0],R[1]-P[1]] s=PQ[0]*PR[1]-PQ[1]*PR[0] return s while True: try: x1,y1,x2,y2,x3,y3,xp,yp=[D(i) for i in input().split(" ")] A=[x1,y1] B...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,552
s273927679
p00012
u354053070
1501927514
Python
Python3
py
Accepted
30
7424
558
import sys def isleft(ox, oy, ax, ay, px, py): oax, oay = ax - ox, ay - oy opx, opy = px - ox, py - oy if oax * opy > oay * opx: return 1 else: return 0 for line in sys.stdin: x1, y1, x2, y2, x3, y3, xp, yp = map(float, line.split()) # A, B, C, P = (x1, y1), (x2, y2), (x3, y3), ...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,553
s353144649
p00012
u187606290
1502047883
Python
Python3
py
Accepted
20
7416
730
import fileinput class Vector2D: def __init__(self, x, y): self.x = x self.y = y def dot(self, vec2d): return (self.x * vec2d.y) - (self.y * vec2d.x) for line in fileinput.input(): x1, y1, x2, y2, x3, y3, xp, yp = [float(r) for r in line.split()] v1To2 = Vector2D(x2 - x1, y2...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,554
s217698437
p00012
u957021183
1504763903
Python
Python3
py
Accepted
20
7520
657
# Aizu Problem 0012: Point in Triangle # import sys, math, os # read input: PYDEV = os.environ.get('PYDEV') if PYDEV=="True": sys.stdin = open("sample-input.txt", "rt") def point_in_triangle(trig, x, y): x1, y1, x2, y2, x3, y3 = trig[:] a = ((y2 - y3)*(x - x3) + (x3 - x2)*(y - y3)) / ((y2 - y3)*(x1 - x3)...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,555
s056290696
p00012
u811733736
1505371925
Python
Python3
py
Accepted
30
7744
6,982
# -*- coding: utf-8 -*- """ http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0012&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 ...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,556
s433291122
p00012
u299798926
1505392671
Python
Python3
py
Accepted
20
7628
604
length=[float(0) for i in range(3)] while 1: try: x1,y1,x2,y2,x3,y3,x4,y4=[float(i) for i in input().split( )] x12=x1-x2 y12=y1-y2 x23=x2-x3 y23=y2-y3 x31=x3-x1 y31=y3-y1 x14=x1-x4 y14=y1-y4 x24=x2-x4 y24=y2-y4 x34=x3-x4...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,557
s408606953
p00012
u197615397
1507558199
Python
Python3
py
Accepted
30
7620
627
import math import sys def get_triangle_area(x1, y1, x2, y2, x3, y3): l1 = math.sqrt(abs(x1-x2)**2+abs(y1-y2)**2) l2 = math.sqrt(abs(x2-x3)**2+abs(y2-y3)**2) l3 = math.sqrt(abs(x3-x1)**2+abs(y3-y1)**2) s = (l1+l2+l3)/2 return math.sqrt(s*(s-l1)*(s-l2)*(s-l3)) for l in sys.stdin: x1, y1, x2, ...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,558
s498197477
p00012
u548155360
1512397083
Python
Python3
py
Accepted
30
5608
1,174
# coding=utf-8 def direction_vector(p1: list, p2: list)->list: return [p2[0]-p1[0], p2[1]-p1[1]] def cross_product(v1: list, v2: list)->float: return v1[0]*v2[1] - v1[1]*v2[0] if __name__ == '__main__': while True: try: points_receive = list(map(float, input().split())) exc...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,559
s167547808
p00012
u203261375
1513257781
Python
Python3
py
Accepted
20
5596
751
import sys def outer(vec_a, vec_b): return vec_a[0] * vec_b[1] - vec_a[1] * vec_b[0] try: while True: x1, y1, x2, y2, x3, y3, xp, yp = map(float, input().split()) vec_12 = [x2-x1, y2-y1] vec_23 = [x3-x2, y3-y2] vec_31 = [x1-x3, y1-y3] vec_1p = [xp-x1, yp-y1] ve...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,560
s497159158
p00012
u273843182
1514991287
Python
Python3
py
Accepted
30
5588
460
def tri(x1, y1, x2, y2, x3, y3): return abs((x2-x1)*(y3-y1) - (y2-y1)*(x3-x1)) / 2 while True: try: x1, y1, x2, y2, x3, y3, xp, yp = map(float, input().split()) except: break abc = tri(x1, y1, x2, y2, x3, y3) abp = tri(x1, y1, x2, y2, xp, yp) acp = tri(x1, y1, x3, y3, xp, yp) ...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,561
s544729804
p00012
u024715419
1515131179
Python
Python3
py
Accepted
20
5648
440
import math while True: try: x1, y1, x2, y2, x3, y3, xp, yp = map(float, input().split()) s1 = (x2-x1)*(yp-y1) - (y2-y1)*(xp-x1) s2 = (x3-x2)*(yp-y2) - (y3-y2)*(xp-x2) s3 = (x1-x3)*(yp-y3) - (y1-y3)*(xp-x3) if math.copysign(1, s1) == math.copysign(1, s2) and math.copysign(1,...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,562
s931783267
p00012
u764789069
1515224479
Python
Python
py
Accepted
10
4716
821
def f(a,b,c,d): return a*d-b*c while True: try: x1,y1,x2,y2,x3,y3,xp,yp=map(float,raw_input().split()) AB=[x2-x1,y2-y1] AP=[xp-x1,yp-y1] BC=[x3-x2,y3-y2] BP=[xp-x2,yp-y2] CA=[x1-x3,y1-y3] CP=[xp-x3,yp-y3] #print AB #print BC #print...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,563
s086670847
p00012
u846136461
1516237105
Python
Python
py
Accepted
10
4724
1,702
# coding: utf-8 while True: try: x1, y1, x2, y2, x3, y3, xp, yp = map(float, raw_input().split()) # print(x1) # print(x2) # print(x3) # print(y1) # print(y2) # print(y3) xg = 1./3 * (x1 + x2 + x3) yg = 1./3 * (y1 + y2 + y3) # print("xg = {:}, yg = {:}".format(xg, yg)) def line(xi, yi, xj, yj, x, y)...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,564
s803969326
p00012
u546285759
1516367793
Python
Python3
py
Accepted
20
5592
440
while True: try: x1, y1, x2, y2, x3, y3, xp, yp = map(float, input().split()) except: break AB = [x2-x1, y2-y1] BC = [x3-x2, y3-y2] CA = [x1-x3, y1-y3] BP = [xp-x2, yp-y2] CP = [xp-x3, yp-y3] AP = [xp-x1, yp-y1] v1 = AB[0]*BP[1]-AB[1]*BP[0] v2 = BC[0]*CP[1]-BC[1]*...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,565
s908730113
p00012
u150984829
1516788351
Python
Python3
py
Accepted
20
5588
202
import sys for e in sys.stdin: p,q,r,s,t,u,x,y=map(float,e.split()) f=lambda h,i,j,k:(h-p)*(i-q)-(j-q)*(k-p) a,b=f(x,u,y,t)/f(r,u,s,t),f(x,s,y,r)/f(t,s,u,r) print(['NO','YES'][0<a<1-b and 0<b<1-a])
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,566
s011966953
p00012
u150984829
1516789291
Python
Python3
py
Accepted
20
5584
210
import sys def f(h,i,j,k): z=(j-h)*(y-k)-(k-i)*(x-j);return([-1,1][z>0],0)[z==0] for e in sys.stdin: p,q,r,s,t,u,x,y=map(float,e.split()) a,b,c=f(p,q,r,s),f(r,s,t,u),f(t,u,p,q) print(['NO','YES'][a==b==c])
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,567
s127391037
p00012
u150984829
1516789545
Python
Python3
py
Accepted
30
5588
219
import sys def f(h,i,j,k): z=(j-h)*(y-k)-(k-i)*(x-j);return([-1,1][z>0],0)[z==0] for e in sys.stdin: p,q,r,s,t,u,x,y=map(float,e.split()) g=[p,q,r,s,t,u] print(['NO','YES'][f(*g[:4])==f(*g[2:6])==f(*g[4:],*g[:2])])
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,568
s708872570
p00012
u150984829
1516789548
Python
Python3
py
Accepted
30
5592
219
import sys def f(h,i,j,k): z=(j-h)*(y-k)-(k-i)*(x-j);return([-1,1][z>0],0)[z==0] for e in sys.stdin: p,q,r,s,t,u,x,y=map(float,e.split()) g=[p,q,r,s,t,u] print(['NO','YES'][f(*g[:4])==f(*g[2:6])==f(*g[4:],*g[:2])])
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,569
s126693480
p00012
u150984829
1516789599
Python
Python3
py
Accepted
20
5588
197
import sys def f(h,i,j,k): z=(j-h)*(y-k)-(k-i)*(x-j);return([-1,1][z>0],0)[z==0] for e in sys.stdin: p,q,r,s,t,u,x,y=map(float,e.split()) print(['NO','YES'][f(p,q,r,s)==f(r,s,t,u)==f(t,u,p,q)])
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,570
s698503008
p00012
u150984829
1516789697
Python
Python3
py
Accepted
30
5584
195
import sys def f(h,i,j,k):z=(j-h)*(y-k)-(k-i)*(x-j);return([-1,1][z>0],0)[z==0] for e in sys.stdin: p,q,r,s,t,u,x,y=map(float,e.split()) print(['NO','YES'][f(p,q,r,s)==f(r,s,t,u)==f(t,u,p,q)])
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,571
s019741399
p00012
u150984829
1516789699
Python
Python3
py
Accepted
20
5584
195
import sys def f(h,i,j,k):z=(j-h)*(y-k)-(k-i)*(x-j);return([-1,1][z>0],0)[z==0] for e in sys.stdin: p,q,r,s,t,u,x,y=map(float,e.split()) print(['NO','YES'][f(p,q,r,s)==f(r,s,t,u)==f(t,u,p,q)])
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,572
s813099930
p00012
u150984829
1516789812
Python
Python3
py
Accepted
20
5584
195
import sys def f(a,b,c,d):z=(c-a)*(y-d)-(d-b)*(x-c);return([-1,1][z>0],0)[z==0] for e in sys.stdin: p,q,r,s,t,u,x,y=map(float,e.split()) print(['NO','YES'][f(p,q,r,s)==f(r,s,t,u)==f(t,u,p,q)])
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,573
s946444748
p00012
u069727578
1520821361
Python
Python3
py
Accepted
20
5592
510
def cross(x, y): return (x.conjugate() * y).imag def inside_triangle(p, x, y, z): a = cross(y-x, p-y) b = cross(z-y, p-z) c = cross(x-z, p-x) if a*b > 0 and b*c > 0: return True return False import sys for line in sys.stdin: x1, y1, x2, y2, x3, y3, xp, yp = map(float, line.spli...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,574
s126241024
p00012
u166871988
1523714513
Python
Python3
py
Accepted
20
5596
349
g=lambda a,b,c:(a[0]-b[0])*(b[1]-c[1])-(b[0]-c[0])*(a[1]-b[1]) while True: try:t=input() except:break l=[float(i) for i in t.split()] b=[g(l[0:2],l[2:4],l[6:8]),g(l[2:4],l[4:6],l[6:8]),g(l[4:6],l[0:2],l[6:8])] if len([i for i in b if i>0])==3 or len([i for i in b if i<0])==3: print("YES") ...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,575
s519282064
p00012
u150984829
1525319831
Python
Python3
py
Accepted
20
5588
192
import sys def f(a,b,c,d):z=(c-a)*(y-d)-(d-b)*(x-c);return[-1*(z==0),1][z>0] for e in sys.stdin: p,q,r,s,t,u,x,y=map(float,e.split()) print(['NO','YES'][f(p,q,r,s)==f(r,s,t,u)==f(t,u,p,q)])
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,576
s123124583
p00012
u724548524
1525745184
Python
Python3
py
Accepted
20
5588
379
import sys def calc(x, y, xp, yp): a = [(y[i] - y[i -1]) * (xp - x[i]) - (x[i] - x[i - 1]) * (yp - y[i]) for i in range(3)] print("YES" if (a[0] > 0 and a[1] > 0 and a[2] > 0) or (a[0] < 0 and a[1] < 0 and a[2] < 0) else "NO") for s in sys.stdin: x1, y1, x2, y2, x3, y3, xp, yp = map(float, s.split()) x ...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,577
s851826989
p00012
u536280367
1526129528
Python
Python3
py
Accepted
20
5592
767
import sys def cross_product(a, b): ax, ay = a bx, by = b return ax * by - ay * bx def sub(a, b): a1, a2 = a b1, b2 = b return b1 - a1, b2 - a2 def judge(p1, p2, p3, pp): cnt = 0 for a, b in ((p1, p2), (p2, p3), (p3, p1)): vec1 = sub(a, b) vec2 = sub(a, pp) ...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,578
s521204924
p00012
u043254318
1526483042
Python
Python3
py
Accepted
20
5648
802
import math class Point(): def __init__(self, x, y): self.x = x self.y = y def CP(p1, p2, p3): ax = p2.x-p1.x ay = p2.y-p1.y bx = p3.x-p1.x by = p3.y-p1.y return ax*by - ay*bx def Judge(a,b,c): if a > 0 and b > 0 and c > 0: print("YES") elif a < 0 and b < 0 and...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,579
s962841902
p00012
u458530128
1528466832
Python
Python3
py
Accepted
20
5584
458
def f(x): x1, y1, x2, y2, x3, y3, xp, yp = x ax = x3 - x1 ay = y3 - y1 bx = x2 - x1 by = y2 - y1 xp -= x1 yp -= y1 k = (by * xp - bx * yp) / (ax * by - ay * bx) l = (ay * xp - ax * yp) / (ay * bx - ax * by) if (k > 0 and l > 0 and k + l < 1): print('YES') else: ...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,580
s673714708
p00012
u847467233
1529210439
Python
Python3
py
Accepted
30
5592
901
# AOJ 0012 A Point in a Triangle # Python3 2018.6.17 bal4u EPS = 0.0001 # a, b, はラインの同一側にあるか def is_atSameSide(a, b, line): sa = (line[1].real-line[0].real)*(a.imag-line[0].imag) \ + (line[1].imag-line[0].imag)*(line[0].real-a.real); sb = (line[1].real-line[0].real)*(b.imag-line[0].imag) \ + (line[1].imag-lin...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,581
s394391868
p00012
u089116225
1529512320
Python
Python3
py
Accepted
20
5592
522
def vec(s,t): return [t[0]-s[0], t[1]-s[1]] def area(a,b): return a[0]*b[1] - a[1]*b[0] while True: try: l = [float(x) for x in input().split()] a = [l[0],l[1]] b = [l[2],l[3]] c = [l[4],l[5]] p = [l[6],l[7]] x = area(vec(p,a),vec(p,b)) y = area(ve...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,582
s074741759
p00012
u650035614
1530633557
Python
Python3
py
Accepted
30
5812
2,615
import math PI = math.pi EPS = 10**-10 def edge(a, b): return ((a[0]-b[0])**2+(a[1]-b[1])**2)**.5 def area(a, b, c): s = (a+b+c)/2 return (s*(s-a)*(s-b)*(s-c))**.5 def LawOfCosines(a, b, c): #余弦定理 return math.acos( (b*b+c*c-a*a) / (2.0*b*c) ); def is_same(x, y): return abs(x-y) < EPS class T...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,583
s969663379
p00012
u759949288
1351586129
Python
Python
py
Accepted
10
11000
757
import sys def cross(a, b): return (a.conjugate() * b).imag def dot(a, b): return (a.conjugate() * b).real def ccw(a, b, c): x = b - a y = c - a; if cross(x, y) > 0: return 1 if cross(x, y) < 0: return -1 if dot(x, y) < 0: return 2 if abs(x) < abs(y): return -2 return 0 def solve(l, p): x = ccw(l[0][0], l[...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,584
s790347556
p00012
u759949288
1351588164
Python
Python
py
Accepted
20
5300
588
import sys def cross(a, b): return (a.conjugate() * b).imag def dot(a, b): return (a.conjugate() * b).real def ccw(a, b, c): x = b - a y = c - a; cr = cross(x, y) if cr != 0: return cr if dot(x, y) < 0: return 2 if abs(x) < abs(y): return -2 return 0 def solve(l, p): x = cmp(ccw(l[0][0], l[0][1], p), 0) i...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,585
s038693780
p00012
u759949288
1351592042
Python
Python
py
Accepted
10
5300
569
import sys def cross(a, b): return (a.conjugate() * b).imag def dot(a, b): return (a.conjugate() * b).real def ccw(a, b, c): x = b - a y = c - a; cr = cross(x, y) if cr != 0: return cr if dot(x, y) < 0: return 2 if abs(x) < abs(y): return -2 return 0 def solve(l, p): x = cmp(ccw(l[0][0], l[0][1], p), 0) i...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,586
s315807957
p00012
u759949288
1351593213
Python
Python
py
Accepted
10
5300
542
import sys def cross(a, b): return (a.conjugate() * b).imag def dot(a, b): return (a.conjugate() * b).real def ccw(a, b, c): x = b - a y = c - a; cr = cross(x, y) if cr != 0: return cr if dot(x, y) < 0: return 2 if abs(x) < abs(y): return -2 return 0 for line in sys.stdin: t = map(float, line.split()) if len...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,587
s397190043
p00012
u647766105
1351612231
Python
Python
py
Accepted
10
4300
611
import sys for line in sys.stdin.readlines(): try: list=map(float,line.split()) x=list[0:6:2] y=list[1:6:2] xp=list[6] yp=list[7] xv=[x[a%3]-x[(a+1)%3] for a in xrange(4)] yv=[y[a%3]-y[(a+1)%3] for a in xrange(4)] xpv=[xp-x[a] for a in xrange(3)] ...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,588
s829678721
p00012
u779627195
1352549787
Python
Python
py
Accepted
20
5440
950
def dot(a, b): return (a.real*b.real - a.imag*b.imag) def cross(a, b): return (a.real*b.imag - a.imag*b.real) EPS = 10**(-7) def isIntersectedLS(a1, a2, b1, b2): return ((cross(a2-a1, b1-a1) * cross(a2-a1, b2-a1)) < EPS and (cross(b2-b1, a1-b1) * cross(b2-b1, a2-b1)) < EPS) while 1: try: ...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,589
s147811686
p00012
u280179677
1355388665
Python
Python
py
Accepted
10
4284
963
class Point: def __init__(self, x, y): self.x = x self.y = y class DirectedSegment: def __init__(self, s, e): self.start = s self.end = e LEFT = -1 ONLINE = 0 RIGHT = 1 def datasets(): import sys while True: s = sys.stdin.readline() if len(s) < 2: ...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,590
s039284885
p00012
u419407022
1356035187
Python
Python
py
Accepted
20
4308
849
class Point(object): x = 0.0 y = 0.0 def __init__(self, x, y): self.x = x self.y = y def __sub__(left, right): return Point(left.x - right.x, left.y - right.y) #cross def __mul__(left, right): return left.x * right.y - left.y * right.x while True: try: ...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,591
s279598691
p00012
u126791750
1357122247
Python
Python
py
Accepted
10
4272
537
if __name__ == '__main__': while True: try: x1,y1,x2,y2,x3,y3,xp,yp = map(float,raw_input().split()) r = 0 vec = (x2 - x1) * (yp - y1) - (y2 - y1) * (xp - x1) if vec > 0: r += 1 elif vec < 0: r -= 1 vec = (x3 - x2) * (yp - y2) - (y3 - y2) * (xp - x2) if vec > 0: r += 1 elif vec < ...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,592
s964238381
p00012
u126791750
1357122429
Python
Python
py
Accepted
20
4272
488
def checker(x1,y1,x2,y2,xp,yp): r = 0 vec = (x2 - x1) * (yp - y1) - (y2 - y1) * (xp - x1) if vec > 0: r = 1 elif vec < 0: r = -1 return r if __name__ == '__main__': while True: try: x1,y1,x2,y2,x3,y3,xp,yp = map(float,raw_input().split()) r = 0 r += int(checker(x1,y1,x2,y2,xp,yp)) r += int(chec...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,593
s736380858
p00012
u782850731
1362064510
Python
Python
py
Accepted
20
4804
1,067
from __future__ import (division, absolute_import, print_function, unicode_literals) from sys import stdin from operator import attrgetter from collections import namedtuple Point = namedtuple('Point', 'x y') def linear(p1, p2): gradient = (p1.y - p2.y) / (p1.x - p2.x) y_intercept = p1...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,594
s414463478
p00012
u894941280
1362610221
Python
Python
py
Accepted
20
4452
577
from math import sqrt dis = lambda x1,y1,x2,y2: sqrt((x1-x2)**2+(y1-y2)**2) def heron(a,b,c): s = (a+b+c)*1.0/2 return sqrt(s*(s-a)*(s-b)*(s-c)) while True: try: x1,y1,x2,y2,x3,y3,xp,yp = map(float,raw_input().split()) a,b,c = dis(x1,y1,x2,y2),dis(x1,y1,x3,y3),dis(x3,y3,x2,y2) d,e,f ...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,595
s633668595
p00012
u542421762
1368174357
Python
Python
py
Accepted
10
4276
763
import sys class Point: def __init__(self, x, y): self.x = x self.y = y def direction_of_rotation(p1, p2, p3): d = p1.x * (p2.y - p3.y) + p2.x * (p3.y - p1.y) + p3.x * (p1.y - p2.y) if d < 0: direction = 'right' else: direction = 'left' return direction #input...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,596
s868866965
p00012
u724947062
1369401633
Python
Python
py
Accepted
20
4324
1,335
import sys class Point(object): def __init__(self, x, y): self.x = x self.y = y def isLeft(self, vector): tmpVector = DirectedVector(vector.start, self) sin = tmpVector * vector if sin > 0: return True else: return False class DirectedVec...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,597
s483489160
p00012
u912237403
1377410752
Python
Python
py
Accepted
20
4260
410
def side(p1, p2, p3): return (p3[1]-p1[1])*(p2[0]-p1[0])-(p2[1]-p1[1])*(p3[0]-p1[0])>0 while True: try: x = map(float, raw_input().split()) p1 = x[0:2] p2 = x[2:4] p3 = x[4:6] p0 = x[6:] if (side(p1, p2, p0)==side(p2, p3, p0) and side(p2, p3, p0)==side(p3, p1, p0...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,598
s104570478
p00012
u813384600
1379496210
Python
Python
py
Accepted
20
4272
623
while True: try: x1,y1,x2,y2,x3,y3,xp,yp = map(float,raw_input().split()) r = 0 vec = (x2-x1) * (yp-y1) - (y2-y1) * (xp-x1) if vec > 0: r += 1 elif vec < 0: r -= 1 vec = (x3-x2) * (yp-y2) - (y3-y2) * (xp-x2) if vec > 0: r +=...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,599
s298954151
p00012
u230836528
1392286094
Python
Python
py
Accepted
10
4332
1,080
# -*- coding: utf-8 -*- import sys def prod2d(vec1, vec2): return vec1[0]*vec2[1] - vec1[1]*vec2[0] lineNumber = 0 #for line in [ "0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5", "0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0"]: for line in sys.stdin.readlines(): lineNumber += 1 # get data List = map(float, line.strip().spli...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,600
s083344752
p00012
u633068244
1393359838
Python
Python
py
Accepted
10
4468
802
import math while True: try: x1,y1,x2,y2,x3,y3,xp,yp = map(float, raw_input().split()) a = math.sqrt((x1-x2)**2+(y1-y2)**2) b = math.sqrt((x1-x3)**2+(y1-y3)**2) c = math.sqrt((x2-x3)**2+(y2-y3)**2) xa = math.sqrt((x3-xp)**2+(y3-yp)**2) xb = math.sqrt((x2-xp)**2+(y2-yp...
p00012
<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>A Point in a Triangle</H1> <p> There is a ...
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5 0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
YES NO
5,601