比赛 |
“Asm.Def战记之拉格朗日点”杯 |
评测结果 |
AAAAAAAAAA |
题目名称 |
Asm.Def找燃料 |
最终得分 |
100 |
用户昵称 |
Skyo |
运行时间 |
0.041 s |
代码语言 |
C++ |
内存使用 |
0.20 MiB |
提交时间 |
2015-11-04 08:40:38 |
显示代码纯文本
#include <cstdio>
#include <algorithm>
#include <cstring>
#define X first
#define Y second
using namespace std;
typedef pair<int,int> PII;
int n, ans; PII p[105];
int main()
{
freopen("asm_fuel.in", "r", stdin);
freopen("asm_fuel.out", "w", stdout);
scanf("%d", &n);
for(int i = 1; i <= n; i++)
scanf("%d %d", &p[i].X, &p[i].Y);
for(int i = 1; i < n; i++)
for(int j = i+1; j <= n; j++)
{
int x1 = p[i].X, y1 = p[i].Y, x2 = p[j].X, y2 = p[j].Y;
if(x1==x2 && y1==y2) continue;
int res = 0, t1 = y1-y2, t2 = x1-x2;
for(int k = 1; k <= n; k++)
res += (t1*(p[k].X-x1)==t2*(p[k].Y-y1));
ans = max(ans, res);
}
printf("%d", ans);
return 0;
}