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
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
2직선의 교점을 구한다평면상의 2 직선의 위치 관계는, 교차점이 있다 평행(교점 없음) 겹치는(교점은 무한) 중 하나. 일반형의 형태로 표현된 2 직선, $a_1x+b_1y+c_1=0\\\및\\\a_2x+b_2y+c_2=0$ 의 교점을 ...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.