import java.util.Scanner;
class zb{
long x;
long y;
char type;
}
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
zb[] zb = new zb[n];
for(int i=0;i<n;i++) {
zb[i] = new zb();
zb[i].x = sc.nextLong();
zb[i].y = sc.nextLong();
zb[i].type = sc.next().charAt(0);
}
int kA = 0;
int kB = 0;
long sum;
for(int j=0;j<m;j++) {
long a=sc.nextLong();
long b=sc.nextLong();
long c=sc.nextLong();
for(int z=0;z<n;z++) {
sum = a+(b*zb[z].x)+(c*zb[z].y);
if(zb[z].type=='A'&&sum<0) {
kA++;
}else if(zb[z].type=='B'&&sum>0) {
kA++;
}else if(zb[z].type=='A'&&sum>0) {
kB++;
}else if(zb[z].type=='B'&&sum<0) {
kB++;
}
}
if(kA==n||kB==n) {
System.out.print("Yes");
}else {
System.out.print("No");
}
kA=0;
kB=0;
}
sc.close();
}
}
你好,我是有问必答小助手。为了技术专家团更好地为您解答问题,烦请您补充下(1)问题背景详情,(2)您想解决的具体问题,(3)问题相关代码图片或者报错信息。便于技术专家团更好地理解问题,并给出解决方案。
您可以点击问题下方的【编辑】,进行补充修改问题。