题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4082 题目大意: 给你n个点,问能最多构成多少个相似三角形. 用余弦定理,计算三个角度,然后暴力数有多少个,更新答案. 代码: #include <cstdio> #include <cmath> #include <algorithm> #include <cstring> #include <vector> #include <set>…
Hou Yi's secret Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1881    Accepted Submission(s): 450 Problem Description Long long ago, in the time of Chinese emperor Yao, ten suns rose into the…
题意: 给n个点,问最多有多少个相似三角形(三个角对应相等). 解法: O(n^3)枚举点,形成三角形,然后记录三个角,最后按三个角度依次排个序,算一下最多有多少个连续相等的三元组就可以了. 注意:在同一个坐标的两点只算一次,所以要判一下. 代码: #include <iostream> #include <cstdio> #include <cstring> #include <cstdlib> #include <cmath> #includ…
直接6重循环就行了吧...判三角形相似直接从小到大枚举两向量夹角是否相等就行了.注意去重点跟三点共线就行了... #include<algorithm> #include<iostream> #include<cstring> #include<cstdlib> #include<fstream> #include<sstream> #include<bitset> #include<vector> #incl…
题意:射箭落在n个点,任取三点可构成一个三角形,问最大的相似三角形集(一组互相相似的三角形)的个数. 分析: 1.若n个点中有相同的点,要去重,题目中说射箭会形成洞,任选三个洞构成三角形,因此射在同一点只形成一个洞. 2.二进制枚举子集选出三个点,判断能否构成三角形. 3.因为边长可能为小数,因此用边长的平方判断相似. (1)将比较的两个三角形三边分别排序 (2)tmpx[0] / tmpy[0] = tmpx[1] / tmpy[1] = tmpx[2] / tmpy[2],即若满足tmpx[…
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…
p.MsoNormal { margin: 0pt; margin-bottom: .0001pt; text-align: justify; font-family: Calibri; font-size: 10.5000pt } h1 { margin-top: 5.0000pt; margin-bottom: 5.0000pt; text-align: center; font-family: 宋体; color: rgb(26,92,200); font-weight: bold; fo…
HDU 5073 Galaxy (2014 Anshan D简单数学) 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=5073 Description Good news for us: to release the financial pressure, the government started selling galaxies and we can buy them from now on! The first one who bought…
●赘述题目 10*10的房间内,有竖着的一些墙(不超过18个).问从点(0,5)到(10,5)的最短路. 按照输入样例,输入的连续5个数,x,y1,y2,y3,y4,表示(x,0--y1),(x,y2--y3),(x,y4--10)是墙壁. ●题解 方法:建图(用到简单计算几何)+最短路 ○记录下每个端点. ○包含起点,终点,以及每个墙的可以走的端点,如下图: ○然后枚举点,尝试两两组合连(线段)边,若该线不会撞在墙上,即不会与墙壁线段相交,就add_adge(). 效果图如下: 如何判断呢?…
Naive and Silly Muggles Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 24    Accepted Submission(s): 17 Problem Description Three wizards are doing a experiment. To avoid from bothering, a spec…