| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
hhh<set>大法#include<cstdio>
#include<cstdlib>
#include<set>
using namespace std;
int n,x[300],y[300];
set<double>ks;
int main()
{
scanf("%d",&n);
for(int i=1;i<=n;i++)
scanf("%d%d",&x[i],&y[i]);
for(int i=1;i<n;i++)
for(int j=i+1;j<=n;j++)
{
double k;
if(x[i]==x[j])k=999999999.0;
else k=(double)(y[i]-y[j])/(x[i]-x[j]);
ks.insert(k);
}
printf("%d",ks.size());
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator