202006 csp认证
-1.
#include
#include
using namespace std;
int n;
int m;
class Point{
public:
int x;
int y;
char flag;
};
class Linear{
public:
int c;
int a;
int b;
};
//检查是否在一边
int isSame1(Point p1,Point p2,Linear l1){
if(l1.a*p1.x+l1.c>-l1.b*p1.y&&l1.a*p2.x+l1.c>-l1.b*p2.y) return 1;
else if(l1.a*p1.x+l1.c<-l1.b*p1.y&&l1.a*p2.x+l1.c<-l1.b*p2.y) return 1;
else return 0;
}
//检查类别是否相同
int isSame2(Point p1,Point p2){
if(p1.flag==p2.flag) return 1;
return 0;
}
int main(){
cin>>n>>m;
vector v1;
vector v2;
//输入
for(int i=0;i>x>>y>>flag;
Point p={x,y,flag};
v1.push_back(p);
}
for(int i=0;i>c>>a>>b;
Linear l = {c,a,b};
v2.push_back(l);
}
//检查两点之间的关系
for(int j=0;j
- 2
#include
#include
#include