神经网络相关
int fun(int a,int b,int c,int x,int y)
{
int tmp = (a+b*x+c*y);
if(tmp<0) tmp=-1;
else if(tmp>0) tmp=1;
return tmp;
}
void solve()
{
int n,m;cin>>n>>m;
vector<pair<int,int>> A,B;
rpp(i,n)
{
int x,y;
string c;
cin>>x>>y>>c;
if(c=="A") A.push_back(make_pair(x,y));
else B.push_back(make_pair(x,y));
}
rpp(i,m)
{
int a,b,c;cin>>a>>b>>c;
int flag =true;
int Atag = 0,Btag = 0;
for(auto x:A)
{
int tmp = fun(a,b,c,x.first,x.second);
if(tmp==0||(Atag&&tmp!=Atag))
{
flag = false;
break;
}
Atag = tmp;
}
for(auto x:B)
{
int tmp = fun(a,b,c,x.first,x.second);
if(tmp==0||(Btag&&tmp!=Btag)||(Atag&&Btag&&Atag==Btag))
{
flag = false;
break;
}
Btag = tmp;
if((Atag&&Btag&&Atag==Btag))
{
flag = false;
break;
}
}
if(flag) cout<<"Yes\n";
else cout<<"No\n";
}
}