比赛 |
Asm_Def战记之透明计算网络 |
评测结果 |
AAAATTTTTA |
题目名称 |
Asm_Def的模拟赛 |
最终得分 |
50 |
用户昵称 |
fyb |
运行时间 |
10.315 s |
代码语言 |
C++ |
内存使用 |
0.29 MiB |
提交时间 |
2015-11-01 10:23:53 |
显示代码纯文本
#include <cstdio>
#include <cmath>
using namespace std;
#define NMAX 300
struct poi{
int x,y;
};
poi ps[NMAX];
int m[6][3]={
{1,1,2},
{1,2,3},
{1,3,1},
{-1,3,2},
{-1,1,3},
{-1,2,1}
};
int you_xiang_mian_ji(int p1,int p2,int p3){
int s=0;
int p[4];
int i;
p[1]=p1;
p[2]=p2;
p[3]=p3;
for(i=0;i<6;i++)
s+=m[i][0]*ps[p[m[i][1]]].x*ps[p[m[i][2]]].y;
return s;
}
int main(){
int n;
int s0,s1,s2,s3;
int tmp,mx=0,mxnum=0;
int i,j,k,l;
freopen("trib.in","r",stdin);
freopen("trib.out","w",stdout);
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d%d",&ps[i].x,&ps[i].y);
for(i=0;i<n;i++)
for(j=i+1;j<n;j++)
for(k=j+1;k<n;k++){
tmp=0;
for(l=0;l<n;l++){
s0=abs(you_xiang_mian_ji(i,j,k));
s1=abs(you_xiang_mian_ji(l,i,j));
s2=abs(you_xiang_mian_ji(l,j,k));
s3=abs(you_xiang_mian_ji(l,k,i));
if(s1+s2+s3==s0)tmp++;
}
if(tmp>mx){
mx=tmp;
mxnum=1;
}else if(mx==tmp)mxnum++;
}
printf("%d\n%d\n",mx,mxnum);
return 0;
}