n, m = map(int, input().split())
list1 = []
list2 = []
for i in range(n):
x, y, dot_type = input().split()
x = int(x)
y = int(y)
list1.append((x, y, dot_type))
for j in range(m):
a1, a2, a3 = map(int, input().split())
list2.append((a1, a2, a3))
list3 = []
list4 = []
for j in range(m):
for i in range(n):
num = list2[j][0] + list2[j][1] * list1[i][0] + list2[j][2] * list1[i][1]
if num > 0:
list3.append(list1[i][2])
if num < 0:
list4.append(list1[i][2])
if ('A' in list3 and 'B' in list3) or ('A' in list4 and 'B' in list4):
print("No")
list3.clear()
list4.clear()
else:
print("Yes")
list3.clear()
list4.clear()
CCF python 线性分类器
最新推荐文章于 2024-07-02 19:55:45 发布

845

被折叠的 条评论
为什么被折叠?



