用户输出
Yes
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#2329 | #1003. 凸多边形 | Accepted | 100 | 871 ms | 3156 K | Python 3 / 804 B | harkerbest | 2023-11-17 10:49:47 |
def cross_product(a, b, c):
return (b[0] - a[0]) * (c[1] - a[1]) - (b[1] - a[1]) * (c[0] - a[0])
def is_convex_quad(x1, y1, x2, y2, x3, y3, x4, y4):
cross1 = cross_product((x1, y1), (x2, y2), (x3, y3))
cross2 = cross_product((x2, y2), (x3, y3), (x4, y4))
cross3 = cross_product((x3, y3), (x4, y4), (x1, y1))
cross4 = cross_product((x4, y4), (x1, y1), (x2, y2))
if (cross1 > 0 and cross2 > 0 and cross3 > 0 and cross4 > 0) or \
(cross1 < 0 and cross2 < 0 and cross3 < 0 and cross4 < 0):
return "Yes"
else:
return "No"
x1, y1 = map(int, input().split())
x2, y2 = map(int, input().split())
x3, y3 = map(int, input().split())
x4, y4 = map(int, input().split())
result = is_convex_quad(x1, y1, x2, y2, x3, y3, x4, y4)
print(result)
用户输出
Yes
系统信息
Exited with return code 0
用户输出
Yes
系统信息
Exited with return code 0
用户输出
Yes
系统信息
Exited with return code 0
用户输出
Yes
系统信息
Exited with return code 0
用户输出
Yes
系统信息
Exited with return code 0
用户输出
Yes
系统信息
Exited with return code 0
用户输出
Yes
系统信息
Exited with return code 0
用户输出
Yes
系统信息
Exited with return code 0
用户输出
Yes
系统信息
Exited with return code 0
用户输出
Yes
系统信息
Exited with return code 0
用户输出
Yes
系统信息
Exited with return code 0
用户输出
Yes
系统信息
Exited with return code 0
用户输出
Yes
系统信息
Exited with return code 0
用户输出
Yes
系统信息
Exited with return code 0
用户输出
Yes
系统信息
Exited with return code 0
用户输出
Yes
系统信息
Exited with return code 0
用户输出
No
系统信息
Exited with return code 0
用户输出
No
系统信息
Exited with return code 0
用户输出
No
系统信息
Exited with return code 0
用户输出
No
系统信息
Exited with return code 0
用户输出
No
系统信息
Exited with return code 0
用户输出
No
系统信息
Exited with return code 0
用户输出
No
系统信息
Exited with return code 0
用户输出
No
系统信息
Exited with return code 0
用户输出
No
系统信息
Exited with return code 0
用户输出
No
系统信息
Exited with return code 0
用户输出
No
系统信息
Exited with return code 0
用户输出
No
系统信息
Exited with return code 0
用户输出
No
系统信息
Exited with return code 0
用户输出
No
系统信息
Exited with return code 0
用户输出
No
系统信息
Exited with return code 0