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 ...
随机推荐
- OpenCV(2):视频
播放AVI视频 #include<iostream> #include<opencv2/core/core.hpp> #include<opencv2/highgui/h ...
- linux 下安装nginx
下载 下载版本 nginx-1.13.4.tar.gz 安装 1.解压 tar -zxvf nginx-1.13.4.tar.gz 2.配置安装目录 ./configure —prefix=/usr ...
- python code(1)
from collections import UserList class MthChianList(UserList): def filter(self,predicste): return Mt ...
- 引用限定符(c++11)
1.概念 1)下面这种情况将对一个右值调用成员函数.对右值赋值 string s1 = "abc", s2 = "def"; auto n = (s1 + s2 ...
- java.lang.ClassNotFoundException: org.apache.juli.logging.LogFactory的解决办法
Tomcat7早就出来正式版,但是一直都没有用过,尤其是针对于我还一直在用Myeclipse6.5的人来说,它在配置tomcat的时候没有tomcat7的选项,所以就报了错误信息. java.lang ...
- IntelliJ IDEA 2017版 编译器使用学习笔记(六) (图文详尽版);IDE快捷键使用
一.alter + enter使用 应用于很对场景不知道如何操作代码时使用 1.场景一:自动创建函数 调用一个没有的函数的时候,alter+enter,弹出自动创建函 ...
- 详细解读 :java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed,Java报错之Connection is read-only.
问题分析: 实际开发项目中,进行insert的时候,产生这个问题是Spring框架的一个安全权限保护方法,对于方法调用的事物保护,一般配置如下: <!-- 事务管理 属性 --> < ...
- reload maven project' has encountered a proble" 问题
由于重重原因,我取消maven的下载(可能是jar包没有公服镜像).导致重新打开sts 时发生异常. 在网上寻找到资料,发现需要删除${workspace}\.metadata\.plugins\or ...
- War Chess (hdu 3345)
http://acm.hdu.edu.cn/showproblem.php?pid=3345 Problem Description War chess is hh's favorite game:I ...
- centos设置服务开机自动启动的方法
centos安装好apache,mysql等服务器程序后,并没有设置成开机自动启动的,为避免重启后还要手动开启web等服务器,还是做下设置好,其实设置很简单,用chkconfig命令就行了. 例如要开 ...