poj 1696

1523 단어 기하학
욕심+계산기하학(포크점적)
개인적으로 본체를 욕심으로 해석하는 것이 가장 합리적이라고 생각하는데, 나는 바로 욕심으로 생각하는 이 문제이다
코드가 너무 낮아요.
#include 
#include 
#include 
#include 
#include  
using namespace std;
const int maxn=55;
int m,n;
int vis[maxn];
int path[maxn];
struct Point
{
	int x,y;
	Point(int x=0,int y=0):x(x),y(y) { }
};
struct Plant
{
	Point po;
	int ind;
};
struct seg
{
	Point u,v;
};
Plant pla[maxn];
int cross(Point a,Point b,Point c,Point d)
{
   return (b.x-a.x)*(d.y-c.y)-(b.y-a.y)*(d.x-c.x);	
}
int judge(Point a,Point b,Point c,Point d)
{
	int c1=cross(a,b,a,c),c2=cross(a,b,a,d),
		c3=cross(c,d,c,a),c4=cross(c,d,c,b);
	if(c1*c2<0&&c3*c4<0) return 1;
	else return 0;
}
int dot(Point a,Point b,Point c,Point d) { return (b.x-a.x)*(d.x-c.x)+(b.y-a.y)*(d.y-c.y); }
double length(Point a,Point b) { return sqrt(double(dot(a,b,a,b))); }
double Angle(Point a,Point b,Point c)
{
	return acos(dot(a,b,b,c)/length(a,b)/length(b,c));
}
int main()
{
	scanf("%d",&m);
	while(m--)
	{
		scanf("%d",&n);
		int i;
		int miny=1000,minx=1000,start;
		seg s[maxn];
		int top=0;
		for(i=0;i

좋은 웹페이지 즐겨찾기