问题描述
试题编号: | 202006-1 |
试题名称: | 线性分类器 |
时间限制: | 1.0s |
内存限制: | 512.0MB |
问题描述: |
|
n,m=map(int,input().split())
x=[]
y=[]
label=[]
for i in range(n):
a,b,c=input().split()
x.append(int(a))
y.append(int(b))
label.append(c)
for i in range(m):
a,b,c=map(int, input().split())
A_class=[]
B_class=[]
for j in range(n):
if a+x[j]*b+y[j]*c<0:
A_class.append(label[j])
elif a+x[j]*b+y[j]*c>0:
B_class.append(label[j])
if len(list(set(A_class)))==1 and len(list(set(B_class)))==1:
print('Yes')
else:
print('No')