# poj 1265 Area(pick 定理)

1、以格子点为顶点的线段。覆盖的点的个数为gcd(|dx|,|dy|)。当中，|dx|,|dy|分别为线段横向增量和纵向增量。

2、Pick定理：设平面上以格子点为顶点的多边形的内部点个数为a。边上点个数为b。面积为S,则 S = a + b/2 -1.

3、随意一个多边形的面积等于以多边形边上的某点为固定点。按顺序求其余点相邻两个点与该点组成的向量的叉积之和的一半。

```#include<stdio.h>
#include<stdlib.h>
int chaji(int x1,int y1,int x2,int y2)
{
return x1*y2-x2*y1;
}
int gcd(int a,int b)
{
return b==0?a:gcd(b,a%b);
}
int main()
{
int T,m,i,j,dx,dy,n,b,x,y;
float s;
scanf("%d",&T);
for(i=1;i<=T;i++){
scanf("%d",&m);
scanf("%d%d",&x,&y);
b=gcd(abs(x),abs(y));
s=0;
for(j=2;j<=m;j++){
scanf("%d%d",&dx,&dy);
b+=gcd(abs(dx),abs(dy));
s+=chaji(x,y,x+dx,y+dy);
x+=dx;
y+=dy;
}
if(s<0)
s=-s;
n=(s+2-b)/2;
printf("Scenario #%d:\n",i);
printf("%d %d %.1f\n\n",n,b,s/2);
}
return 0;
}
```

## POJ 1265 Area

Area Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 4713   Accepted: 2129 Description Being well known for its highly innovative products, Merck would definitely be a good target for industrial espionage. To protect its brand-new resear

## poj 1265 Area 面积+多边形内点数

Area Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 5861   Accepted: 2612 Description Being well known for its highly innovative products, Merck would definitely be a good target for industrial espionage. To protect its brand-new resear

## POJ1265——Area(Pick定理+多边形面积)

Area DescriptionBeing well known for its highly innovative products, Merck would definitely be a good target for industrial espionage. To protect its brand-new research and development facility the company has installed the latest system of surveilla

## POJ 1265 Area POJ 2954 Triangle Pick定理

Area Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 5227   Accepted: 2342 Description Being well known for its highly innovative products, Merck would definitely be a good target for industrial espionage. To protect its brand-new resear

## poj 1265 Area（Pick定理）

Area Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 5666   Accepted: 2533 Description Being well known for its highly innovative products, Merck would definitely be a good target for industrial espionage. To protect its brand-new resear