原题链接:
4309. 消灭老鼠 - AcWing题库https://www.acwing.com/problem/content/4312/
#include<iostream>
#include<set>
using namespace std;
typedef pair<int,int> PII;
int n,x0,y0;
int gcd(int a,int b)
{
return b==0 ? a : gcd(b,a%b);
}
int main()
{
cin>>n>>x0>>y0;
set<PII> k;
while(n--){
int x,y;
cin>>x>>y;
x -= x0,y -= y0;
int d = gcd(x,y);
x /= d, y /= d;
if(x<0) x = -x,y = -y;
k.insert({x,y});
}
cout<<k.size()<<endl;
return 0;
}