用户输出
Yes
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#2581 | #1003. 凸多边形 | Accepted | 100 | 914 ms | 2920 K | Python 3 / 814 B | s230034061 | 2023-11-19 3:10:18 |
def is_convex_quad(Ax, Ay, Bx, By, Cx, Cy, Dx, Dy):
cross_product1 = (Bx - Ax) * (Cy - By) - (By - Ay) * (Cx - Bx)
cross_product2 = (Cx - Bx) * (Dy - Cy) - (Cy - By) * (Dx - Cx)
cross_product3 = (Dx - Cx) * (Ay - Dy) - (Dy - Cy) * (Ax - Dx)
cross_product4 = (Ax - Dx) * (By - Ay) - (Ay - Dy) * (Bx - Ax)
if (cross_product1 >= 0 and cross_product2 >= 0 and cross_product3 >= 0 and cross_product4 >= 0) or \
(cross_product1 <= 0 and cross_product2 <= 0 and cross_product3 <= 0 and cross_product4 <= 0):
return "Yes"
else:
return "No"
Ax, Ay = map(int, input().split())
Bx, By = map(int, input().split())
Cx, Cy = map(int, input().split())
Dx, Dy = map(int, input().split())
result = is_convex_quad(Ax, Ay, Bx, By, Cx, Cy, Dx, Dy)
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