记录编号 |
300237 |
评测结果 |
RRRRRRRRRR |
题目名称 |
高速公路 |
最终得分 |
0 |
用户昵称 |
AntiLeaf |
是否通过 |
未通过 |
代码语言 |
C++ |
运行时间 |
0.009 s |
提交时间 |
2016-08-28 11:03:16 |
内存使用 |
0.57 MiB |
显示代码纯文本
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int maxn=110;
typedef struct Point{
double x,y;
Point(double x=0.0,double y=0.0):x(x),y(y){}
Point(const Point &A,const Point &B):x(B.x-A.x),y(B.y-A.y){}
Point operator-()const{
return Point(-x,-y);
}
Point operator+(const Point &A)const{
return Point(x+A.x,y+A.y);
}
Point operator-(const Point &A)const{
return *this+(-A);
}
Point operator*(double d)const{
return Point(x*d,y*d);
}
Point operator/(double d)const{
return Point(x/d,y/d);
}
}Vector;
struct Segment{
Point A,B;
Segment(const Point &A=Point(),const Point &B=Point()):A(A),B(B){}
};
double Dot(const Vector&,const Vector&);
double Cross(const Vector&,const Vector&);
bool Crossing(const Segment&,const Segment&);
Point Intersection(const Segment&,const Segment&);
void Bellman_Ford();
int N,n,m,s[maxn*maxn],t[maxn*maxn];
double dis[maxn*maxn],d[maxn*maxn];
Segment a[maxn];
int main(){
scanf("%d",&N);
n=m=0;
for(int i=1;i<=n;i++){
scanf("%lf%lf%lf%lf",&a[i].A.x,&a[i].A.y,&a[i].B.x,&a[i].B.y);
}
return 0;
}
double Dot(const Vector &A,const Vector &B){
return A.x*B.x+A.y*B.y;
}
double Cross(const Vector &A,const Vector &B){
return A.x*B.y-B.x*A.y;
}
bool Crossing(const Segment &A,const Segment &B){//mdzz,恶不恶心
return (Cross(Vector(A.A,B.A),Vector(A.A,A.B))*Cross(Vector(A.A,B.B),Vector(A.A,A.B))<=0)
&&(Cross(Vector(B.A,A.A),Vector(B.A,B.B))*Cross(Vector(B.A,A.B),Vector(B.A,B.B))<=0);
}
Point Insersection(const Segment &A,const Segment &B){
Vector C(A.A,B.A),P(A.A,A.B),Q(B.A,B.B);
return A.A+P*(Cross(Q,C)/Cross(P,Q));
}