标签:存在 之间 统计 lse fine \n mes ios include
#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#define maxn 201
using namespace std;
inline int read(){
register int x(0),f(1); register char c(getchar());
while(c<'0'||'9'<c){ if(c=='-') f=-1; c=getchar(); }
while('0'<=c&&c<='9') x=(x<<1)+(x<<3)+(c^48),c=getchar();
return x*f;
}
int x[maxn],y[maxn],cnt;
double k[maxn*maxn];
int n,ans=1;
int main(){
n=read();
for(register int i=1;i<=n;i++) x[i]=read(),y[i]=read();
for(register int i=1;i<n;i++){
for(register int j=i+1;j<=n;j++){
if(x[i]==x[j]) k[++cnt]=9999;
else if(y[i]==y[j]) k[++cnt]=0;
else k[++cnt]=1.0*(y[i]-y[j])/(x[i]-x[j]);
}
}
sort(k+1,k+1+cnt);
for(register int i=2;i<=cnt;i++){
if(k[i]-k[i-1]>1e-9) ans++;
}
printf("%d\n",ans);
return 0;
}
标签:存在 之间 统计 lse fine \n mes ios include
原文地址:https://www.cnblogs.com/akura/p/10846431.html