摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1115计算多边形内心的模板题思路从第1个顶点出发,分别连接第i, i+1个顶点组成三角形Ti,1 struct node{ double x,y;}p[1000010];double area(int a,int b,int c){ return (p[b].x-p[a].x)*(p[c].y-p[a].y)-(p[b].y-p[a].y)*(p[c].x-p[a].x);}int main(){ int t,n,i; double sumx,sumy,ar,x,y,sumarea; ... 阅读全文
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1147套用模板,在链表中删掉与刚输入的这个相交的线段#include#includetypedef struct node{ int num; double x1,x2,y1,y2; struct node *next;}S;double x1[100010],x2[100010],y1[100010],y2[100010];S *l;int same(int a,int b)//这里是判断线段是否相交{ if(((x1[a]-x1[b])*(y2[b]-y1[b])-(y1[a]-y... 阅读全文
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=1276模拟的蛋疼。。。最蛋疼的是每一次都要报完,不能中途等于三个人就停下来#include#includetypedef struct node{ int num; struct node *next;}S;S *l;int n;void print(){ S *s=l->next,*q; while(s) { if(s->next==NULL) printf("%d\n",s->num); else printf("%d ",s->num); 阅读全文