计算几何
invoKer-
这个作者很懒,什么都没留下…
展开
-
CodeForces - 32E Hide-and-Seek【计算几何】
题目链接:https://codeforces.com/contest/32/problem/E先判两点之间是否被墙和镜子挡,再用相似三角形找入射点,乱搞判断一下。这题有点卡精度,EPS用1e-6能过,1e-8过不了。#include <iostream>#include <cstdio>#include <cstdlib>#include <cctype>#include <cmath>#include <climits&g原创 2021-05-01 16:25:51 · 174 阅读 · 0 评论 -
CodeForces - 31D Chocolate【几何】【连通块】
题目链接:https://codeforces.com/contest/31/problem/D#include <iostream>#include <cstdio>#include <cstdlib>#include <cctype>#include <cmath>#include <climits>#include <cstring>#include <vector>#include &l原创 2021-04-29 17:03:06 · 145 阅读 · 0 评论 -
CodeForces - 23D Tetragon【计算几何】
题目链接:https://codeforces.com/contest/23/problem/C奇妙的构造,不过2500似乎是有点高了#include <iostream>#include <algorithm>using namespace std;static const int MAXN=1e5+10;inline int read(){ int s=0,w=1; char ch=getchar(); while(ch<'0'||ch>'9'){if(c原创 2020-11-02 22:46:32 · 153 阅读 · 0 评论 -
CodeForces - 21B Intersection【计算几何】
题目链接:https://codeforces.com/contest/21/problem/B#include <iostream>using namespace std;int a1,b1,c1,a2,b2,c2;int main(){ scanf("%d%d%d%d%d%d",&a1,&b1,&c1,&a2,&b2,&c2); if(a1*b2==a2*b1) { if(!a1 &&a原创 2020-10-27 14:20:40 · 99 阅读 · 0 评论 -
CodeForces - 18A Triangle【计算几何】
题目链接:https://codeforces.com/contest/18/problem/A#include <iostream>using namespace std;bool check(int x1,int y1,int x2,int y2,int x3,int y3){ int dis1=(x1-x2)*(x1-x2)+(y1-y2)*(y1-y2); int dis2=(x1-x3)*(x1-x3)+(y1-y3)*(y1-y3); int dis3原创 2020-10-13 21:10:32 · 122 阅读 · 0 评论 -
CodeForces - 14C Four Segments【水题】【计算几何】
题目链接:https://codeforces.com/contest/14/problem/C给出4条线段判断是否构成矩形。判断是否平行于坐标轴,是否平行x轴y轴的各2条,重合点个数是否为4个即可。#include <iostream>#include <map>using namespace std;int main(){ bool flag=true; map<pair<int,int>,int> _hash; in原创 2020-09-29 09:18:40 · 108 阅读 · 0 评论 -
CodeForces - 13D Triangles【计算几何】
题目链接:https://codeforces.com/contest/13/problem/D#include <iostream>#include <algorithm>using namespace std;typedef long long ll;static const int MAXN=500+10;int cnt[MAXN][MAXN];struct Point{ int x,y; Point(){} Point(int _x,in原创 2020-09-24 18:31:35 · 148 阅读 · 0 评论 -
CodeForces - 13B Letter A【计算几何】
题目链接:https://codeforces.com/contest/13/problem/B思路来自quailty代码先找到A的左右两边去掉共线和钝角情况判断第三条边的两个端点是否在左右两条边上再判断截得一段边是否介于1/5到4/5的总边长之间#include <iostream>#include <cmath>#include <cstdio>using namespace std;typedef double db;static const原创 2020-09-24 12:30:43 · 224 阅读 · 0 评论 -
CodeForces - 8D Two Friends【基础计算几何】
【题目描述】Two neighbours, Alan and Bob, live in the city, where there are three buildings only: a cinema, a shop and the house, where they live. The rest is a big asphalt square.Once they went to the ci...原创 2019-10-13 02:50:16 · 156 阅读 · 0 评论 -
CodeForces - 2C Commentator problem【基础计算几何】
【题目描述】The Olympic Games in Bercouver are in full swing now. Here everyone has their own objectives: sportsmen compete for medals, and sport commentators compete for more convenient positions to give ...原创 2019-09-29 12:49:24 · 99 阅读 · 0 评论 -
CodeForces - 1C Ancient Berland Circus【基础计算几何】
【题目描述】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 shaped as a regular (equiangular) ...原创 2019-09-26 13:27:20 · 199 阅读 · 0 评论 -
UVA - 378 Intersecting Lines【基础计算几何】
【题目描述】We all know that a pair of distinct points on a plane defines a line and that a pair of lines on a planewill intersect in one of three ways: 1) no intersection because they are parallel, 2) in...原创 2019-09-07 19:51:04 · 176 阅读 · 0 评论 -
UVA - 191 Intersection【基础计算几何】
【题目描述】You are to write a program that has to decide whether a given line segment intersects a given rectangle.您要编写一个程序,确定给定的线段是否与给定的矩形相交。An example:一个例子:line: start point: (4,9)线:起点:(4,9)end po...原创 2019-09-06 22:44:57 · 140 阅读 · 0 评论 -
UVA - 152 Tree's a Crowd【基础计算几何】【水题】
【题目描述】Dr William Larch, noted plant psychologist and inventor of the phrase “Think like a tree — Think Fig” has invented a new classification system for trees. This is a complicated system involving ...原创 2019-09-03 23:54:42 · 93 阅读 · 0 评论