ZOJ 1090 The Circumference of the Circle】的更多相关文章

原题链接 题目大意:已知三角形的三个顶点坐标,求其外接圆的周长. 解法:刚看到这道题时,马上拿出草稿纸画图,想推导出重心坐标,然后求出半径,再求周长.可是这个过程太复杂了,写到一半就没有兴致了,还是求助于Google.在Wiki百科找到一个已知三条边长度,求外接三角形周长的算法,diameter = abc/2*(sqrt(s(s-a)(s-b)(s-c)),s=(a+b+c)/2.问题瞬间简化了,求两点距离是很方便的一件事,然后套用这个公式就可以了. 参考代码: #include<iostre…
  ZOJ Problem Set - 1090 The Circumference of the Circle Time Limit: 2 Seconds      Memory Limit: 65536 KB To calculate the circumference of a circle seems to be an easy task - provided you know its diameter. But what if you don't? You are given the…
The Circumference of the Circle Time Limit: 2 Seconds      Memory Limit: 65536 KB To calculate the circumference of a circle seems to be an easy task - provided you know its diameter. But what if you don't? You are given the cartesian coordinates of…
Description To calculate the circumference of a circle seems to be an easy task - provided you know its diameter. But what if you don't?         You are given the cartesian coordinates of three non-collinear points in the plane.         Your job is t…
题目链接. 题目大意: 给定三个点,即一个任意三角形,求外接圆的周长. 分析: 外接圆的半径可以通过公式求得(2*r = a/sinA = b/sinB = c/sinC),然后直接求周长. 注意: C++AC,G++WA. #include <iostream> #include <cstdio> #include <cstring> #include <cstdlib> #include <cmath> using namespace std…
已知三点坐标,算圆面积. 使用初等几何知识,根据海伦公式s = sqrt(p(p - a)(p - b)(p - c)) 和 外接圆直径 d = a * b * c / (2s) 来直接计算. #include <iostream> #include <cstring> #include <cstdlib> #include <cstdio> #include <numeric> #include <cctype> #include…
做题回顾:用到海伦公式,还有注意数据类型,最好统一 p=(a+b+c)/2; s=sqrt(p*(p-a)*(p-b)*(p-c));//三角形面积,海伦公式 r=a*b*c/(4*s);//这是外接圆的半径 /* Sample Input 0.0 -0.5 0.5 0.0 0.0 0.5 0.0 0.0 0.0 1.0 1.0 1.0 5.0 5.0 5.0 7.0 4.0 6.0 0.0 0.0 -1.0 7.0 7.0 7.0 50.0 50.0 50.0 70.0 40.0 60.0 0…
acm之pku题目分类 对ACM有兴趣的同学们可以看看 DP:  1011   NTA                 简单题  1013   Great Equipment     简单题  1024   Calendar Game       简单题  1027   Human Gene Functions   简单题  1037   Gridland            简单题  1052   Algernon s Noxious Emissions 简单题  1409   Commun…
以下是poj百道水题,新手可以考虑从这里刷起 搜索1002 Fire Net1004 Anagrams by Stack1005 Jugs1008 Gnome Tetravex1091 Knight Moves1101 Gamblers1204 Additive equations 1221 Risk1230 Legendary Pokemon1249 Pushing Boxes 1364 Machine Schedule1368 BOAT1406 Jungle Roads1411 Annive…
Given the radius and x-y positions of the center of a circle, write a function randPoint which generates a uniform random point in the circle. Note: input and output values are in floating-point. radius and x-y position of the center of the circle is…