再思考一下好的方法,水过,数据太弱! 本来不想传的!

#include <iostream>
using namespace std;
#define MAX 702
/*284K 422MS*/
typedef struct _point
{
int x;
int y;
}point; point p[MAX]; bool judge(point a,point b,point c)
{
return (a.y-b.y)*(c.x-b.x)-(c.y-b.y)*(a.x-b.x);
} int main()
{
int n;
while(cin>>n)
{
if(n==0) break;
for(int i=0;i<n;i++)
cin>>p[i].x>>p[i].y;
int max=0;
//暴力搜索
for(int k=0;k<n;k++)
{
for(int i=k+1;i<n;i++)
{
int sum=0;
for(int j=i+1;j<n;j++)
{
if(!judge(p[k],p[i],p[j]))
++sum;
}
if(max<sum)
max=sum;
}
} cout<<max+2<<endl;
}
system("pause");
return 0;
}

poj 1118 Lining Up(水题)的更多相关文章

  1. POJ 1488 Tex Quotes --- 水题

    POJ 1488 题目大意:给定一篇文章,将它的左引号转成 ``(1的左边),右引号转成 ''(两个 ' ) 解题思路:水题,设置一个bool变量标记是左引号还是右引号即可 /* POJ 1488 T ...

  2. POJ 3641 Oulipo KMP 水题

    http://poj.org/problem?id=3461 直接KMP就好.水题 #include<cstdio> #include<cstring> const int M ...

  3. poj 1006:Biorhythms(水题,经典题,中国剩余定理)

    Biorhythms Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 110991   Accepted: 34541 Des ...

  4. poj 1002:487-3279(水题,提高题 / hash)

    487-3279 Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 236746   Accepted: 41288 Descr ...

  5. poj 1003:Hangover(水题,数学模拟)

    Hangover Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 99450   Accepted: 48213 Descri ...

  6. poj 2105 IP Address(水题)

    一.Description Suppose you are reading byte streams from any device, representing IP addresses. Your ...

  7. poj 2000 Gold Coins(水题)

    一.Description The king pays his loyal knight in gold coins. On the first day of his service, the kni ...

  8. POJ 1118 Lining Up 直线穿过最多的点数

    http://poj.org/problem?id=1118 直接枚举O(n^3) 1500ms能过...数据太水了...这个代码就不贴了... 斜率排序O(n^2logn)是更好的做法...枚举斜率 ...

  9. POJ 3673 Cow Multiplication (水题)

    题意:给你两个数,求所有的数位的积的和. 析:太水了,没的说,可以先输入边算,也可以最后再算,一样.. 代码如下: #include <cstdio> #include <strin ...

随机推荐

  1. Bug 的严重性的定义参考

    在代码测试中,通常一个 Bug 需要我们定义他们的优先级(即定义开发人员应该如何相应这个Bug) 和它的严重等级(即该 Bug 发生后对程序的影响). 专业的英文为 Priority -- 优先级:和 ...

  2. Elf 32

    [CentOS]安装软件:/ld-linux.so.2: ELF interpreter解决   环境: [orangle@localhost Downloads]$ uname -m&&am ...

  3. registered the JBDC driver [oracle.jdbc.OracleDriver] but failed to unregister it when the web application was stopped. (转)

    最近项目中遇见一问题,在开发环境没有问题的代码,到了生产环境就会报如下错误:   严重: A web application registered the JBDC driver [oracle.jd ...

  4. haproxy ssl相关配置

    ssl-default-bind-options [<option>]... This setting is only available when support for OpenSSL ...

  5. C语言的本质(21)——预处理之三:其它预处理特性及总结

    C标准规定了几个特殊的宏,在不同的地方使用可以自动展开成不同的值,预编译程序对于在源程序中出现的这些串将用合适的值进行替换.这些宏有下面这些: __FILE__ 展开为当前源文件的文件名,是一个字符串 ...

  6. User has no SELECT privilege on V$SESSION

         今天是2013-09-20,最近心情一直很差,但是也不能不学习啊,无论怎么样,自己学到 的东西永远都是自己的.加油! 使用dbms_xplan.display_cursor function ...

  7. Java面向对象面试案例

  8. HtmlTextWriter学习笔记

    本文来自:http://www.cnblogs.com/tonyqus/archive/2005/02/15/104576.html 这两天正好在研究asp.net自定义控件制作,HtmlTextWr ...

  9. SQLServer中临时表与表变量的区别分析【转】

    在实际使用的时候,我们如何灵活的在存储过程中运用它们,虽然它们实现的功能基本上是一样的,可如何在一个存储过程中有时候去使用临时表而不使用表变量,有时候去使用表变量而不使用临时表呢? 临时表 临时表与永 ...

  10. 【简单项目框架一】Fragment实现的底部导航

    流行的应用的导航一般分为两种,一种是底部导航,一种是侧边栏. 我所做的项目涉及到比较多的是底部导航,今天我就把项目中使用的一种实现方式分享一下. 主要实现思路是:在一个Activity里面底部添加四个 ...