POJ 2606
#include<iostream>
#include<set>
#include<stdio.h>
#include<math.h>
#include<algorithm>
#define MAXN 705
using namespace std;
int num;
double p[MAXN][];
double a[MAXN*MAXN];
set<int> coll;
set<int>::iterator pos;
multiset<int> coll_main;
int main()
{
//freopen("acm.acm","r",stdin);
int i;
int max;
int j;
int k;
int t;
double value;
int num;
double s2;
scanf("%d",&num);
max = ;
for(i = ; i < num; ++ i)
{
scanf("%lf%lf",&p[i][],&p[i][]);
}
for(i = ; i < num; ++ i)
{
k = ;
for(j = ; j < num; ++ j)
{
if(i != j)
{
value = (p[i][] - p[j][]) / (p[i][] - p[j][]);
a[k] = value;
++ k;
}
}
sort(a,a + k);
s2 = a[];
j = ;
for(t = ; t < k; ++ t)
{
if(a[t] == s2)
++ j;
else
{
if(j > max)
{
max = j;
}
s2 = a[t];
-- t;
j = ;
}
}
if(j > max)
max = j;
}
++max;
cout<<max<<endl;
}
POJ 2606的更多相关文章
- 【同一直线最多点】 poj 1118+2606+2780
poj 1118 #include<iostream> using namespace std; #define N 700 struct point {int x,y;} pnt[N]; ...
- POJ 3370. Halloween treats 抽屉原理 / 鸽巢原理
Halloween treats Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 7644 Accepted: 2798 ...
- POJ 2356. Find a multiple 抽屉原理 / 鸽巢原理
Find a multiple Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7192 Accepted: 3138 ...
- POJ 2965. The Pilots Brothers' refrigerator 枚举or爆搜or分治
The Pilots Brothers' refrigerator Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 22286 ...
- POJ 1753. Flip Game 枚举or爆搜+位压缩,或者高斯消元法
Flip Game Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 37427 Accepted: 16288 Descr ...
- POJ 3254. Corn Fields 状态压缩DP (入门级)
Corn Fields Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 9806 Accepted: 5185 Descr ...
- POJ 2739. Sum of Consecutive Prime Numbers
Sum of Consecutive Prime Numbers Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 20050 ...
- POJ 2255. Tree Recovery
Tree Recovery Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 11939 Accepted: 7493 De ...
- POJ 2752 Seek the Name, Seek the Fame [kmp]
Seek the Name, Seek the Fame Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 17898 Ac ...
随机推荐
- Java基础语法学习知识
基础概念 标识符1.由字母,数字,下划线,美元符组成2.首字母不能是数字3.不能是关键字和保留字4.能反映其作用 关键字1.有特定含义2.用于特定地方3.用来命名标识符 常量1.程序执行时值不变的量2 ...
- C#重点内容之:委托(delegate)
为了记忆方便,提取了重点. 委托类似于指针,可以理解为函数指针的升级版,这是理解委托最关键的地方. Action和Func 系统自带的两种委托: Action Func Action型委托要求委托的目 ...
- 【2】C#读取文本文件
一.读取
- issubclass ,isinstance,反射
issubclass() 函数 issubclass() 方法用于判断参数 class 是否是类型参数 classinfo 的子类. 语法 以下是 issubclass() 方法的语法: issubc ...
- Warning:The /usr/local/mysql/data directory is not owned by the 'mysql' or '_mysql'
Mac OS X的升级或其他原因可能会导致MySQL启动或开机自动运行时 在MySQL操作面板上会提示“Warning:The /usr/local/mysql/data directory is ...
- (转)PHP5使用cookie时报错 cannot modify header information - headers already sent by (......)
转自:http://blog.csdn.net/buyingfei8888/article/details/8899797 运行有警告Warning: Cannot modify header inf ...
- 浮点型转整数型进行计算 - 移动GIS设备硬件的原因
在ArcGIS9.1之前桌面版ArcGIS都是采用整数存储的,是为了效率,将浮点型转为整数型存储,但9.2之后随着硬件的提升,浮点型的效率已经得到提高了,所以不再转换.但移动GIS设备还是要转整数型. ...
- 51nod 1239 欧拉筛模板
#include<iostream> #include<cmath> #include<cstring> #include<cstdio> #inclu ...
- poj1741(点分模板)
#include<iostream> #include<cstring> #include<cmath> #include<cstdio> #inclu ...
- C++ 中的异常机制分析
C++异常机制概述 异常处理是C++的一项语言机制,用于在程序中处理异常事件.异常事件在C++中表示为异常对象.异常事件发生时,程序使用throw关键字抛出异常表达式,抛出点称为异常出现点,由操作系统 ...