###### UESTC 802 E - Just a Line

Description
There are N$N$ points on a plane, among them N1$N-1$ points will form a line, your task is to find the point that is not on the line.

Input
The first line contains a single number N$N$, the number of points. (4N50000)$(4\leq N\leq 50000)$

Then come N$N$ lines each with two numbers (xi,yi)$(x_{i}, y_{i})$, giving the position of the points. The points are given in integers. No two points’ positions are the same. (109xi,yi109)$(-10^9\leq x_{i}, y_{i}\leq 109)$

Output
Output the position of the point that is not on the line.

Sample Input
5
0 0
1 1
3 4
2 2
4 4

Sample Output
3 4

（排序那一段没用的gg）

#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
using namespace std;
typedef struct
{
int x;int y;
}Node;
int Sort(const void * a,const void * b)
{
Node *p1=(Node *)a;
Node *p2=(Node *)b;
return p1->x>p2->x;
}
int main (void)
{
Node point[100000];
int t ;
cin>>t;
for(int i=0;i<t;i++)
{
scanf("%d %d",&point[i].x,&point[i].y);
//  printf("%d %d\n",point[i].x,point[i].y);
}

qsort(point,t,sizeof(Node),Sort);
//  printf("after\n");
//  for(int i=0;i<t;i++)
//  {
//      printf("%d %d\n",point[i].x,point[i].y);
//  }

//  printf("-------------\n");
int ans1,ans2;
int tmp1,tmp2;
for(int k=0;k<=3;k++)
{
for(int j=0;j<k;j++)
{
for(int i=0;i<j;i++)
{
if((point[j].y-point[i].y)*(point[k].x-point[i].x)==(point[k].y-point[i].y)*(point[j].x-point[i].x))
{
ans1=point[k].x-point[i].x;
ans2=point[k].y-point[i].y;
tmp1=point[i].x;
tmp2=point[i].y;
break;
}
}
}
}

for(int i=0;i<t;i++)
{
if((point[i].y-tmp2)*ans1!=ans2*(point[i].x-tmp1))

{
printf("%d %d\n",point[i].x,point[i].y);
break;
}
}

return 0;
}

#### UESTC 802—— Just a Line

2015-03-25 20:37:31

#### 训练之线段树Just a Hook

2016-07-26 16:35:16

#### 195 - Tenth Line

2016-03-15 09:10:40

#### HDU 1698 Just a Hook（线段树区间修改）

2016-01-01 20:24:42

#### ubuntu下安装gnuplot

2011-09-26 17:32:55

#### E - Just a Hook HDU 1698 （线段树+类似延迟标记）

2015-04-04 18:20:01

#### [Leetcode] 195. Tenth Line

2017-12-20 14:40:09

#### CF#202DIV2: A. Cinema Line

2013-09-28 02:56:56

#### Codeforces 180C Letter【dp】

2016-10-27 12:44:32

#### The 14th UESTC Programming Contest Final Warmup D - Cube

2016-04-03 12:31:40

## 不良信息举报

UESTC 802 E - Just a Line