记录编号 204541 评测结果 AAAAAAAAAA
题目名称 [SYOI 2015] Asm.Def找燃料 最终得分 100
用户昵称 Gravatardevil 是否通过 通过
代码语言 C++ 运行时间 0.007 s
提交时间 2015-11-04 14:14:00 内存使用 0.32 MiB
显示代码纯文本
#include <cstdlib>
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <map>
#include <stack>
#include <vector>
#include <map>
#include <queue>
#include <ctime>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef unsigned int uint;
const int inf=1061109567;
const int maxn=1010;
const int maxm=100010;
const int mod=998244353;
const double pi=3.14;

struct point
{
    int x,y;
} a[maxn];

point operator - (point a,point b) {point c;c.x=a.x-b.x;c.y=a.y-b.y;return c;}

int Cross(point a,point b) {return a.x*b.y-a.y*b.x;}

int main()
{
    freopen("asm_fuel.in","r",stdin);
    freopen("asm_fuel.out","w",stdout);
    //clock_t st=clock();
    int n,cnt,ans=0;scanf("%d",&n);
    point k1,k2;
    for(int i=1;i<=n;i++) scanf("%d%d",&a[i].x,&a[i].y);
    for(int i=1;i<=n;i++)
    {
        for(int j=i+1;j<=n;j++)
        {
            cnt=0;
            k1=a[j]-a[i];
            if(k1.x==0&&k1.y==0) continue;
            for(int k=1;k<=n;k++)
            {
                k2=a[k]-a[j];
                if(Cross(k1,k2)==0) cnt++;
            }
            ans=max(ans,cnt);
        }
    }
    printf("%d\n",ans);
    //clock_t ed=clock();
    //printf("\nTime used : %.5lf Ms\n",double(ed-st)/CLOCKS_PER_SEC);
    return 0;
}