搜索结果
查询Tags标签: sgn,共有 5条记录-
[Editorial] Codeforces Contest 1726
A. Mainak and Array 显然如果 \([l,r]\) 不包括两端那么就不会对答案有影响,那么直接枚举包括两端的情况即可。 /* author : Gemini date : September 6th, 2022 url : https://codeforces.com/contests/1726/A */ #include<bits/stdc++.h> using namespace std;…
2022/9/7 6:23:06 人评论 次浏览 -
[线段判交][最短路]The Doors POJ1556
You are to find the length of the shortest path through a chamber containing obstructing walls. The chamber will always have sides at x = 0, x = 10, y = 0, and y = 10. The initial and final points of the path are always (0, 5) and (10, 5). There will …
2021/10/25 23:12:21 人评论 次浏览 -
[线段判交][最短路]The Doors POJ1556
You are to find the length of the shortest path through a chamber containing obstructing walls. The chamber will always have sides at x = 0, x = 10, y = 0, and y = 10. The initial and final points of the path are always (0, 5) and (10, 5). There will …
2021/10/25 23:12:21 人评论 次浏览 -
计算几何2D
零. 三态函数 const double eps = 1e-8; const double Pi = acos(-1.0); int sgn(double x) { if(fabs(x) < eps) return 0;return x < 0 ? -1 : 1; }一. 点类及其常见操作 typedef struct Point {double x, y;Point(double x=0, double y=0): x(x), y(y) {}void…
2021/9/23 6:12:47 人评论 次浏览 -
计算几何2D
零. 三态函数 const double eps = 1e-8; const double Pi = acos(-1.0); int sgn(double x) { if(fabs(x) < eps) return 0;return x < 0 ? -1 : 1; }一. 点类及其常见操作 typedef struct Point {double x, y;Point(double x=0, double y=0): x(x), y(y) {}void…
2021/9/23 6:12:47 人评论 次浏览