比赛 |
“Asm.Def战记之拉格朗日点”杯 |
评测结果 |
AAAWWWWWWW |
题目名称 |
Asm.Def找燃料 |
最终得分 |
30 |
用户昵称 |
devil |
运行时间 |
0.005 s |
代码语言 |
C++ |
内存使用 |
0.32 MiB |
提交时间 |
2015-11-04 10:06:09 |
显示代码纯文本
#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=2;
k1=a[j]-a[i];
for(int k=j+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;
}