问有多少个点在多边形内 求一遍叉积 小于零计数就好了~ #include<stdio.h> #include<iostream> #include<algorithm> #include<math.h> #include<string.h> #include<string> #include<map> #include<set> #include<vector> #include<queue&…
D - Bicycle Race Time Limit:1000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Submit Status Practice CodeForces 659D Description Maria participates in a bicycle race. The speedway takes place on the shores of Lake Lucerne, just repea…
题目链接: http://codeforces.com/contest/659/problem/D 题意: 若干条直线围城的湖,给定直线的端点,判断多少个转点会有危险?(危险是指直走的的话会掉进水里) 分析: 观察法:减去竖直水平的四条边,剩下的每两条边的交点就是答案. 求叉积:看两个向量夹角,如果夹角小于90度,则直走的话会掉进水里. 代码: #include<cstdio> #define sa(m) scanf("%d",&m) int main (void)…
题目链接 对相邻的三个点叉积判断一下就好. #include <iostream> #include <vector> #include <cstdio> #include <cstring> #include <algorithm> #include <complex> #include <cmath> #include <map> #include <set> #include <stri…
题目链接: D. Bicycle Race time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Maria participates in a bicycle race. The speedway takes place on the shores of Lake Lucerne, just repeating its contou…
http://codeforces.com/contest/659/problem/D     Maria participates in a bicycle race. The speedway takes place on the shores of Lake Lucerne, just repeating its contour. As you know, the lake shore consists only of straight sections, directed to the…
D. Bicycle Race 题目链接http://codeforces.com/contest/659/problem/D Description Maria participates in a bicycle race. The speedway takes place on the shores of Lake Lucerne, just repeating its contour. As you know, the lake shore consists only of straigh…
D. Bicycle Race 题目连接: http://www.codeforces.com/contest/659/problem/D Description Maria participates in a bicycle race. The speedway takes place on the shores of Lake Lucerne, just repeating its contour. As you know, the lake shore consists only of s…
Description Maria participates in a bicycle race. The speedway takes place on the shores of Lake Lucerne, just repeating its contour. As you know, the lake shore consists only of straight sections, directed to the north, south, east or west. Let's in…
题目传送门 传送点I 传送点II 传送点III 题目大意 给定$n$的平面上的直线,保证没有三条直线共点,两条直线平行.问随机选出3条直线交成的三角形面积的期望. 显然$S=\frac{1}{2}ah$是不可用的.(压根感觉不可优化) 考虑向量的做法:$S = \frac{1}{2}(A \times B + B \times C + C\times A)$.(相当于把一个三角形拆成了三个以原点作为其中一个顶点的"有向"三角形) 于是考虑利用向量叉积对向量加法的分配律进行优化. 枚举第…