题目来源:
http://poj.org/problem?id=1654代码如下:
typedef long long LL ;const double EPS = 1e-10;const int Max_N = 1000005;char s[Max_N];int dx[10]={ 0,-1,0,1,-1,0,1,-1,0,1};int dy[10]={ 0,-1,-1,-1,0,0,0,1,1,1};struct Point{ int x,y;};int xmult(Point p1, Point p2){ return p1.x*p2.y-p1.y*p2.x;}Point p[Max_N];LL sum;int main(){ int n; scanf("%d",&n); while(n--){ scanf("%s",s); int len=strlen(s); if(len <3) {printf("0\n");continue;} p[0].x=0,p[0].y=0; for(int i=0; i