摘要:
http://poj.org/problem?id=1265题意:起始为(0,0),给出每个点的偏移量,求依次连接这些点形成的多边形边界上格点的个数。思路:先将各个点的坐标求出存入,由pick定理知:面积 =内部格点数目+边上格点数目/2-1;每条边边格点数目 = gcd(x2-x1,y2-y1);内部格点数目 = 面积+1-边界格点数目/2; 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 struct node 7 { 8 int x; 9 int y;10 } point[1... 阅读全文
posted @ 2013-10-15 21:16
N_ll
阅读(196)
评论(0)
推荐(0)

浙公网安备 33010602011771号