题意: 给三个线段(每个线段的两个端点的坐标),问这三个线段能否组成字母A. 组成字母A的条件: 1.两个线段有公共端点. 2.这两个线段夹角小于等于90度. 3.第三个线段的两个端点分别在这两个线段上,且各自分割的大小比率不超过4:1 思路: 直接..... 应该开始积累计算几何的代码了,,,, 代码: struct Point{ double x,y; }; struct segment{ Point a,b; } S[5]; bool samePoint(Point a,Point b){…
CF13B Letter A 洛谷传送门 题目描述 Little Petya learns how to write. The teacher gave pupils the task to write the letter AA on the sheet of paper. It is required to check whether Petya really had written the letter AA . You are given three segments on the pl…
●赘述题目 10*10的房间内,有竖着的一些墙(不超过18个).问从点(0,5)到(10,5)的最短路. 按照输入样例,输入的连续5个数,x,y1,y2,y3,y4,表示(x,0--y1),(x,y2--y3),(x,y4--10)是墙壁. ●题解 方法:建图(用到简单计算几何)+最短路 ○记录下每个端点. ○包含起点,终点,以及每个墙的可以走的端点,如下图: ○然后枚举点,尝试两两组合连(线段)边,若该线不会撞在墙上,即不会与墙壁线段相交,就add_adge(). 效果图如下: 如何判断呢?…
Toy Storage Time Limit: 1000MS Memory Limit: 65536K Description Mom and dad have a problem: their child, Reza, never puts his toys away when he is finished playing with them. They gave Reza a rectangular box to put his toys in. Unfortunately, Reza is…
1007: [HNOI2008]水平可见直线 Time Limit: 1 Sec Memory Limit: 162 MB Description 在xoy直角坐标平面上有n条直线L1,L2,-Ln,若在y值为正无穷大处往下看,能见到Li的某个子线段,则称Li为可见的,否则Li为被覆盖的. 例如,对于直线:L1:y=x; L2:y=-x; L3:y=0则L1和L2是可见的,L3是被覆盖的. 给出n条直线,表示成y=Ax+B的形式(|A|,|B|<=500000),且n条直线两两不重合.求出所有可…
第三方库 pandas sklearn 数据集 来自于达观杯 训练:train.txt 测试:test.txt 概述 TF-IDF 模型提取特征值建立逻辑回归模型 代码 # _*_ coding:utf- _*_ # 简单文本分类实现 import time import pandas as pd from sklearn.linear_model import LogisticRegression from sklearn.feature_extraction.text import Coun…
题目大意就是说两个人掷飞镖,飞镖在所给定的图形内就记一分,现在给定N个图形(圆.三角形和矩形),问每一次比赛(没人分别掷三次)谁赢. #include <map> #include <set> #include <stack> #include <queue> #include <cmath> #include <ctime> #include <vector> #include <cstdio> #inclu…
国际惯例的题面: 这题让我爆肝啦......这种计数显然容斥,正好不含任何坏点的我们不会算,但是我们能算至少含零个坏点的,至少含一个坏点的,至少含两个坏点的......所以最终的答案就是(至少含零个坏点的-至少含一个坏点的+至少含两个坏点的-至少含三个坏点的+至少含四个坏点的).然后就是怎么计算的问题.对于至少含零个坏点的,我们不妨设定所有点都是好点.对于非正放的正方形,我们能找到一个正好包含它的最小的正放的正方形,显然这样的正方形是唯一的. 然后我们让四个点在这个正方形的边上滑动,显然这四个点…
Area Time Limit: 1000MS Memory Limit: 10000K Description You are going to compute the area of a special kind of polygon. One vertex of the polygon is the origin of the orthogonal coordinate system. From this vertex, you may go step by step to the fol…
Segments Time Limit: 1000MS Memory Limit: 65536K Description Given n segments in the two dimensional space, write a program, which determines if there exists a line such that after projecting these segments on it, all projected segments have at least…