Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
终于过了,写点注意事项吧In Reply To:旋转卡壳还真是卡人啊~~ Posted by:zdg102 at 2009-09-01 15:02:28 > 有没有哪位大牛提供点数据啊~ 1、貌似 g++ 不能用 scanf("%lf",&x), 2、我猜给出的多变形的点可能是打乱的,或者重点什么的,反正我不凸包就无论如何过不了 下面代码可以生成一些简单的数据,或许对大家有用,可以自己用暴力得出答案来对比 #include <stdio.h> struct point{double x,y;}; struct polygon { int n; point data[10]; }; #define N 16 polygon p[N]={ {4,{{0,0},{-1,0},{-1,-1},{0,-1}}}, {4,{{2,0},{2,-1},{3,-1},{3,0}}}, {4,{{247,208},{247,235},{375,235},{375,208}}}, {3,{{85 ,101},{116 ,168},{168 ,103}}}, {3,{{131 ,189},{216 ,148},{196 ,209}}}, {3,{{180 ,127},{246 ,127},{202 ,144}}}, {3,{{226 ,201},{297 ,201},{242 ,151}}}, {3,{{42 ,225},{61 ,261},{100,222}}}, {3,{{84 ,261},{99 ,246},{102,260}}}, {3,{{72,309},{157,224},{167,309}}}, {3,{{170,221},{229,221},{199,245}}}, {3,{{190,90},{153,47},{225,108}}}, {3,{{165,230},{168,242},{172,233}}}, {6,{{143,146},{133,156},{138,170},{150,173},{161,166},{161,152}}}, {5,{{109,208},{100,236},{111,253},{122,250},{161,206}}}, {6,{{177,273},{174,309},{202,377},{417,375},{490,270},{268,239}}} }; int main() { int i,j,k; for(i=0;i<N;i++) { for(j=0;j<N;j++) { if(i==j) continue; printf("%d %d\n",p[i].n,p[j].n); for(k=0;k<p[i].n;k++) printf("%lf %lf\n",p[i].data[k].x,p[i].data[k].y); for(k=0;k<p[j].n;k++) printf("%lf %lf\n",p[j].data[k].x,p[j].data[k].y); printf("\n\n"); } } printf("0 0\n"); return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator