File tree Expand file tree Collapse file tree 1 file changed +33
-1
lines changed
ABCクラス/AtCoder Beginner Contest 266 Expand file tree Collapse file tree 1 file changed +33
-1
lines changed Original file line number Diff line number Diff line change 1
1
"""
2
2
https://atcoder.jp/contests/abc266/tasks/abc266_c
3
- """
3
+ """
4
+ from typing import List , Tuple
5
+
6
+
7
+ class Solution :
8
+ @staticmethod
9
+ def is_valid (x , y , z ):
10
+ x1 = y [0 ] - x [0 ]
11
+ y1 = y [1 ] - x [1 ]
12
+ x2 = z [0 ] - x [0 ]
13
+ y2 = z [1 ] - x [1 ]
14
+
15
+ if x1 * y2 - x2 * y1 > 0 :
16
+ return True
17
+ else :
18
+ return False
19
+
20
+ @staticmethod
21
+ def check_convex_quadrilateral (a_b_c_d : List [Tuple [int ]]) -> str :
22
+ a , b , c , d = a_b_c_d
23
+
24
+ if Solution .is_valid (a , b , d ) \
25
+ and Solution .is_valid (b , c , a ) \
26
+ and Solution .is_valid (c , d , b ) \
27
+ and Solution .is_valid (d , a , c ):
28
+ return 'Yes'
29
+ else :
30
+ return 'No'
31
+
32
+
33
+ if __name__ == '__main__' :
34
+ A_B_C_D = [tuple (int (i ) for i in input ().split ()) for i in range (4 )]
35
+ print (Solution .check_convex_quadrilateral (A_B_C_D ))
You can’t perform that action at this time.
0 commit comments