#include #include #include #include #include using namespace std; typedef complex cplx; typedef pair edge; double epsilon = 0.00001; bool operator<(const cplx& a,const cplx& b){ if(real(a-b)) return real(a-b)<0; return imag(a-b)<0; } int adj(cplx a, cplx u, cplx b, cplx v){ if(norm(u)<=epsilon || norm(v)<=epsilon) return 0; cplx d = (b-a)/u; cplx z = v/u; if(abs(imag(d))>=epsilon || abs(imag(d+z)) >=epsilon) return 0; double x1 = min(real(d),real(d+z)); double x2 = max(real(d),real(d+z)); if(x1>=1 || x2 <=0) return 0; return 1; } bool adj_poly(vector a,vector b){ for(int i=0;i &hist,int cur) { if (cur==n) return true; for (int c=0;c hist(101,-1); for (int i=0;;i++){ if (rec(tbl,n,i,hist,0)) return i; } // maxtoru /* int m=0; for (int i=0;i> n; if(n==0)break; map > data; for(int i=0;i> name; vector vert; for(;;){ cin >> x; if(x<0) break; cin >> y; vert.push_back(cplx(x,y)); } for(int i=0;i >::iterator it=data.begin(); it!=data.end();it++,ii++){ jj=0; for(map >::iterator jt=data.begin(); jt!=data.end();jt++,jj++){ if(ii==jj) mat[ii][jj]=1; else mat[ii][jj]=adj_poly(it->second,jt->second); } } /* for(int y = 0;y