记录编号 |
204653 |
评测结果 |
AAAAAAAAAA |
题目名称 |
[SYOI 2015] Asm.Def找燃料 |
最终得分 |
100 |
用户昵称 |
dydxh |
是否通过 |
通过 |
代码语言 |
C++ |
运行时间 |
0.021 s |
提交时间 |
2015-11-04 15:34:50 |
内存使用 |
0.28 MiB |
显示代码纯文本
/*
Problem:cogs2090;
Language:c++;
by dydxh;
2015.11.04;
*/
#include<iostream>
#include<cstdio>
#include<set>
#include<map>
#include<queue>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<utility>
#include<ctime>
#include<cstdlib>
#include<bitset>
#include<string>
#define ll long long
#define ull unsigned long long
using namespace std;
const int oo=2000000000;
const int maxn=105;
const int mod=1000000007;
int n,cnt,ans;
struct Pointer{
int x,y,rp;
}p[maxn];
inline int read(){
int x=0;bool flag=0;char ch=getchar();
while(ch>'9' || ch<'0') {if(ch=='-') flag=1;ch=getchar();}
while(ch>='0' && ch<='9') {x=x*10+ch-'0';ch=getchar();}
return flag?-x:x;
}
inline Pointer operator - (Pointer a,Pointer b){
a.x-=b.x,a.y-=b.y;
return a;
}
inline int operator * (Pointer a,Pointer b){
return a.x*b.y-a.y*b.x;
}
bool mycmp(Pointer a,Pointer b){
return ((a.x<b.x) || (a.x==b.x && a.y<b.y));
}
int main()
{
//freopen("cc.in","r",stdin);
freopen("asm_fuel.in","r",stdin);
freopen("asm_fuel.out","w",stdout);
n=read();
for(int i=1;i<=n;i++){
p[i].x=read(),p[i].y=read();
p[i].rp=1;
}
sort(p+1,p+1+n,mycmp);
p[0].x=-oo;
for(int i=1;i<=n;i++){
if(p[i].x==p[i-1].x && p[i].y==p[i-1].y)
p[cnt].rp++;
else p[++cnt]=p[i];
}
if(cnt==1){
printf("%d\n",p[1].rp);
return 0;
}
for(int i=1;i<=cnt;i++)
for(int j=1;j<=cnt;j++){
if(i==j) continue;
int Digit=p[i].rp+p[j].rp;
for(int k=1;k<=cnt;k++){
if(k==i || k==j) continue;
if((p[i]-p[j])*(p[k]-p[i])==0)
Digit+=p[k].rp;
}
if(ans<Digit)
ans=Digit;
}
printf("%d\n",ans);
return 0;
}