Codeforces 350D(计算几何)】的更多相关文章

要点 用A.B.C一般式确定每条直线 将合法的圆心中点存到每条直线所属的vector中 枚举所有线段,二分后\(O(1)\)得到其中存在多少答案,累加 #include <cstdio> #include <cmath> #include <cstring> #include <iostream> #include <algorithm> #include <iomanip> #include <vector> #incl…
原文链接https://www.cnblogs.com/zhouzhendong/p/CF-Gym100543B.html 题目传送门 - CF-Gym100543B 题意 给定一个折线图,对于每一条折线,问沿着这条折线往右看第一个看到的线段的编号(如果视线恰好看到上端点,则当没看见) 放张图片助于理解: 折线图用 $n$ 个点来描述. $n\leq 100000,\ \ \ \ 坐标范围:(x,y)|0\leq x,y\leq 10^9$ 题解 这题好妙啊. 首先一个结论:如果射线与一段区间的…
C. Freelancer's Dreams Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://www.codeforces.com/contest/605/problem/C Description Mikhail the Freelancer dreams of two things: to become a cool programmer and to buy a flat in Moscow. To become a cool pro…
http://codeforces.com/problemset/problem/749/B 题意:已知平行四边形三个顶点,求另外一个顶点可能的位置. 思路:用向量来做. #include <cstdio> #include <algorithm> #include <iostream> #include <cstring> #include <string> #include <cmath> #include <queue&g…
A. Peter and Snow Blower 题目连接: http://www.codeforces.com/contest/613/problem/A Description Peter got a new snow blower as a New Year present. Of course, Peter decided to try it immediately. After reading the instructions he realized that it does not…
传送门 https://www.cnblogs.com/violet-acmer/p/10146350.html 题意: 有一块 n*m 的棋盘,初始,黑白块相间排列,且左下角为白块. 给出两个区间[ (x1,y1) , (x2,y2) ] 和 [ (x3,y3) , (x4,y4) ],第一个区间全部涂成白色,第二个区间全部涂成黑色,且颜色会覆盖. 求两块区间按照要求涂完后白块和黑快的个数? 题解: 我的想法如下: 先求出初始的黑块个数,然后,求出第一个区间减少的黑块个数,再求出第二个区间增加…
题目传送门 传送点I 传送点II 传送点III 题目大意 给定$n$的平面上的直线,保证没有三条直线共点,两条直线平行.问随机选出3条直线交成的三角形面积的期望. 显然$S=\frac{1}{2}ah$是不可用的.(压根感觉不可优化) 考虑向量的做法:$S = \frac{1}{2}(A \times B + B \times C + C\times A)$.(相当于把一个三角形拆成了三个以原点作为其中一个顶点的"有向"三角形) 于是考虑利用向量叉积对向量加法的分配律进行优化. 枚举第…
A. Crazy Town 题目连接: http://codeforces.com/contest/498/problem/A Description Crazy Town is a plane on which there are n infinite line roads. Each road is defined by the equation aix + biy + ci = 0, where ai and bi are not both equal to the zero. The r…
E. Runaway to a Shadow 题目连接: http://www.codeforces.com/contest/681/problem/E Description Dima is living in a dormitory, as well as some cockroaches. At the moment 0 Dima saw a cockroach running on a table and decided to kill it. Dima needs exactly T…
C. Ancient Berland Circus 题目连接: http://www.codeforces.com/contest/1/problem/C Description Nowadays all circuses in Berland have a round arena with diameter 13 meters, but in the past things were different. In Ancient Berland arenas in circuses were s…