UVA - 11186 Circum Triangle (几何)】的更多相关文章

题意:有N个点,分布于一个圆心在原点的圆的边缘上,问所形成的所有三角形面积之和. 分析: 1.sin的内部实现是泰勒展开式,复杂度较高,所以需预处理. 2.求出每两点的距离以及该边所在弧所对应的圆周角.一条弧所对圆周角等于它所对圆心角的一半. 3.S = 1/2*absinC求三角形面积即可. #include<cstdio> #include<cstring> #include<cstdlib> #include<cctype> #include<c…
链接: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2127 题意: 圆心在原点,半径为 R 的圆,其边上有 N 个点, 任意三点组成一个三角形, 求三角形面积和~ 思路: 利用叉积求面积~暴力求三角形~ #include <cstdio> #include <cmath> #include <iostrea…
题意:圆上有n个点,求出这n个点组成的所有三角形的面积之和 题解: 当我们要求出S(i,j,k)时,我们需要假设k在j的左侧,k在i与j之间,k在i的右侧. 如果k在 j的左侧  那么 S(i,j,k) = S(i,k,o)+s(i,j,o) - s(k,i,o); 显然 只要k在j的左侧  s(i,j,0) 在用来求 做和用的. 如果k在 的i右侧  那么 S(i,j,k) = S(i,k,o)+s(i,j,o) - s(k,j,o); 显然 只要k在i的右侧  s(i,j,0) 在用来求 做…
Time limit: 30.000 seconds限时30.000秒 Problem问题 A triangle is a basic shape of planar geometry. It consists of three straight lines and three angles in between. Figure 1 shows how the sides and angles are usually labeled. Figure: Triangle A look into a…
链接:https://www.nowcoder.com/acm/contest/104/A来源:牛客网 题目描述 Let  be a regualr triangle, and D is a point in the triangle. Given the angle of . Then let AD, CD and BD form a new triangle, what is the size of the three angles?     #include<math.h> #inclu…
Dog Distance [题目链接]Dog Distance [题目类型]几何 &题解: 蓝书的题,刘汝佳的代码,学习一下 &代码: // UVa11796 Dog Distance // Rujia Liu #include<cstdio> #include<cmath> #include<algorithm> using namespace std; const double eps = 1e-8; int dcmp(double x) { if(…
链接: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=3122 题意: 有一根长度为n的木条,随机选k个位置把它们切成k+1段小木条.求这些小木条能组成一个多边形的概率. 分析: 不难发现本题的答案与n无关.在一条直线上切似乎难以处理,可以把直线接成一个圆,多切一下,即在圆上随机选k+1个点,把圆周切成k+1段.根据对称性,两个问题的答案…
链接: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2321 题意: 在[-a,a]*[-b,b]区域内随机取一个点P,求以(0,0)和P为对角线的长方形面积大于S的概率(a,b>0,S≥0).例如a=10,b=5,S=20,答案为23.35%. 分析: 根据对称性,只需要考虑[0,a]*[0,b]区域取点即可.面积大于S,即xy…
Problem D Morley’s Theorem Input: Standard Input Output: Standard Output Morley’s theorem states that that the lines trisecting the angles of an arbitrary plane triangle meet at the vertices of an equilateral triangle. For example in the figure below…
UVA 11665 随便给12的找了一道我没做过的几何基础题.这题挺简单的,不过uva上通过率挺低,通过人数也不多. 题意是要求给出的若干多边形组成多少个联通块.做的时候要注意这题是不能用double浮点类型的,然后判多边形交只需要两个条件,存在边规范相交,或者存在一个多边形上的顶点在另一个多边形上或者在多边形内. 代码如下: #include <cstdio> #include <cstring> #include <iostream> #include <al…
Cool Points We have a circle of radius R and several line segments situated within the circumference of this circle. Let’s define a cool point to be a point on the circumference of this circle so that the line segment that is formed by this point and…
题 题意 求1到n长度的n根棍子(3≤n≤1000000)能组成多少不同三角形. 分析 我看大家的递推公式都是 a[i]=a[i-1]+ ((i-1)*(i-2)/2-(i-1)/2)/2; 以i 为最大边,第二边为i-1.i-2....2 的三角形分别有 i-2个.i-3.... .1个,总共就有(i-1)*(i-2)/2个.有(i-1)/2条边算到了两边相等,也就是要减去 (i-1)/2,因为第二边的在第三边出现了,所以算了两次,再除以2. 我的递推公式如代码,我想不起来怎么来的了~~~~(…
 Lining Up  ``How am I ever going to solve this problem?" said the pilot. Indeed, the pilot was not facing an easy task. She had to drop packages at specific points scattered in a dangerous area. Furthermore, the pilot could only fly over the area on…
https://vjudge.net/problem/UVA-11853 根据题意描述,相当于在一个正方形中有若干个圆形障碍物,问是否能从左边界走到右边界.判断是否有解需要一点创造性的思维:不妨把正方形当做一个湖,所有的圆形都是垫脚石,假设我们可以从上边界"踩着"垫脚石成功走到下边界,说明左右边界是不连通的:否则就是连通的.想到了这里,便不难用dfs或bfs来判断是否有解了:每次都从和上边界相交的圆开始进行dfs,如果遇到某个圆和下边界也相交,那么无解. 这样解的存在性只需要一次DFS…
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2432 题目大意: 如图,定义三角形ABC,在BC,CA,AB上分别取边D,E,F,使得CD=2BD,AE=2CE,BF=2AF,求三角形PQR的面积. 思路: 先求出D,E,F三点坐标,然后求出PQR三点坐标,最后对pr,pq进行叉乘,所得的一般即为答案. #include<cstdi…
题目传送门 题意:三角形三等分点连线组成的三角形面积 分析:入门题,先求三等分点,再求交点,最后求面积.还可以用梅涅劳斯定理来做 /************************************************ * Author :Running_Time * Created Time :2015/10/22 星期四 12:55:27 * File Name :UVA_11437.cpp *********************************************…
// uva 11401 Triangle Counting // // 题目大意: // // 求n范围内,任意选三个不同的数,能组成三角形的个数 // // 解题方法: // // 我们设三角巷的最长的长度是c(x),另外两边为y,z // 则由z + y > x得, x - y < z < x 当y = 1时,无解 // 当y = 2时,一个解,这样到y = x - 1 时 有 x - 2个 // 解,所以一共是0,1,2,3....x - 2,一共(x - 2) * (x - 1…
题目大意: 两题几何水题. 1.UVA 11646 - Athletics Track 如图,体育场的跑道一圈400米,其中弯道是两段半径相同的圆弧,已知矩形的长宽比例为a:b,求长和宽的具体数值. 2.UVA 11817 - Tunnelling the Earth 给出地球上起点和终点(均用度数的经纬度表示),从起点出发,可以沿着球面最短路径走.也可以钻隧道,走直线.求这两种方法的路程差. 题解: 1.UVA 11646 - Athletics Track http://uva.online…
https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=94&page=show_problem&problem=429 题目:每个例子输入2个数,一个是wave的幅度,一个是重复的个数. 例如:Input1 32 output:122333221 122333221 思路: 将1,22,333,···,999999999.字符串存在数组里.按照幅度打印输出就好.然后注意一…
Problem A Communist regime is trying to redistribute wealth in a village. They have have decided to sit everyone around a circular table. First, everyone has converted all of their properties to coins of equal value, such that the total number of coi…
Problem ATriangle Fun Input: Standard Input Output: Standard Output In the picture below you can see a triangle ABC. Point D, E and F divides the sides BC, CA and AB into ratio 1:2 respectively. That is CD=2BD, AE=2CE and BF=2AF. A, D; B, E and C, F…
You are given n rods of length 1,2, . . . , n. You have to pick any 3 of them and build a triangle. Howmany distinct triangles can you make? Note that, two triangles will be considered different if they haveat least 1 pair of arms with different length…
第六周A题 - 几何概型 Time Limit:1000MS     Memory Limit:0KB     64bit IO Format:%lld & %llu   Description You are going from Dhaka to Chittagong by train and you came to know one of your old friends is goingfrom city Chittagong to Sylhet. You also know that…
option=com_onlinejudge&Itemid=8&page=show_problem&category=109&problem=1064&mosmsg=Submission+received+with+ID+13620550">题目:uva :10123 - No Tipping 题目大意:给出l, m, n 分别表示 长度为l 的杠杆, 重量为 m, 有n个物体放在上方.问每次从上面挑选一个物品移除,能否使杠杆继续平衡.这个过程中都能…
Morley's Theorem [题目链接]Morley's Theorem [题目类型]几何 &题解: 蓝书P259 简单的几何模拟,但要熟练的应用模板,还有注意模板的适用范围和传参不要传混了 &代码: #include <bits/stdc++.h> using namespace std; #define INF 0x3f3f3f3f typedef long long ll; const int maxn= 1e3 +7; //蓝书P255 //1.点的定义 stru…
貌似是第一次接触几何题... 求时针与分针的夹角,这不是小学生的奥数题么.我小时候也想过这问题的. 每过一小时时针走1/12*360=30度,每过一分钟时针走1/60*30=0.5度,分针走1/60*360=6度,然后就很容易算了. 代码: #include <cstdio> #include <cmath> int main() { double h, m; while (scanf("%lf:%lf", &h, &m) &&…
版权声明:本文为博主原创文章.未经博主同意不得转载. https://blog.csdn.net/u011328934/article/details/35244875 题目链接:uva 12508 - Triangles in the Grid 题目大意:给出n,m.A和B.要求计算在(n+1)∗(m+1)的矩阵上.能够找出多少个三角形,面积在AB之间. 解题思路:首先枚举矩阵.然后计算有多少个三角形以该矩阵为外接矩阵.而且要满足体积在AB之间.然后对于每一个矩阵,要确定在大的范围内能够确定几…
题目链接:option=com_onlinejudge&Itemid=8&page=show_problem&problem=2321">https://uva.onlinejudge.org/index.php? option=com_onlinejudge&Itemid=8&page=show_problem&problem=2321 题目大意:在A是一个点集 A = {(x, y) | x ∈[-a, a],y∈[-b, b]},求取出…
题目链接:uva 1463 - Largest Empty Circle on a Segment 二分半径,对于每一个半径,用三分求出线段到线段的最短距离,依据最短距离能够确定当前R下每条线段在[0,L]上的可行区间,存在一个点被可行区间覆盖n次. #include <cstdio> #include <cstring> #include <cmath> #include <vector> #include <algorithm> using…
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=429 题目大意: 给你振幅A和频率F,让你画出波形. 如: 3 2 波形为: 1 22 333 22 1 1 22 333 22 1 思路: 水...直接输出即可..... 要注意的是每两个波形之间有空行..最后一个没有. 有人问我怎么时间快一点...我一开始300+MS,输出字符后就70MS…