UVa 11524 - In-Circle
2013-07-20 09:56
309 查看
不需要算法,几何计算题。方法如同Ac_coral http://www.cnblogs.com/Accoral/p/3142038.html
/************************************************************************* > File Name: UVa11524.cpp > Author: AcToy > Mail: ycsgldy@163.com > Created Time: 2013年07月20日 星期六 09时26分36秒 ************************************************************************/ #include <algorithm> #include <iostream> #include <cstring> #include <cstdlib> #include <climits> #include <cstdio> #include <string> #include <vector> #include <queue> #include <cmath> #include <stack> #include <map> #include <set> using namespace std; typedef unsigned int u32; typedef long long i64; typedef unsigned long long u64; typedef vector<int> IV; typedef vector<bool> BV; typedef pair<int,int> II; typedef vector<II> IIV; #define For(t,v,c) for(t::const_iterator v=c.begin(); v!=c.end(); ++v) const int INF = 0x7FFFFFFF; const double eps = 1E-10; const double PI = acos(-1); int main() { int Case; double R, m1, n1, m2, n2, m3, n3, x; scanf("%d", &Case); while(Case--) { scanf("%lf", &R); scanf("%lf%lf%lf%lf%lf%lf", &m1, &n1, &m2, &n2, &m3, &n3); double tmp1 = n1 / m1, tmp2 = m3 / n3; double ang1 = acos((tmp1 + tmp2 + 1 - tmp1 * tmp2) / ((tmp1 + 1) * (tmp2 + 1))); double ang2 = ang1 / 2; double x = R / tan(ang2); double C = x * 2 + 2 * x * n1 / m1 + 2 * x * m3 / n3; printf("%.4lf\n", R * C / 2); } return 0; }
相关文章推荐
- UVa 11524:In-Circle(解析几何)
- UVA-11167 Monkeys in the Emei Mountain(区间模型最大流+输出方案)
- uva 107 - The Cat in the Hat
- UVA Knights in FEN
- 大神Send to judge. 我们全部in queue!/UVA In judge queue
- UVA 438 - The Circumference of the Circle(计算几何)
- No. 14 - Last Number in a Circle
- Uva - 12657 - Boxes in a Line
- (intermediate) 网络流(时序模型+离散化) UVA 11167 - Monkeys in the Emei Mountain
- 算法竞赛入门经典(第2版)习题3-9 子序列(All in All) Uva10340
- UVA Tress in a Wood
- uva 11090 Going in Cycle!!
- Wine trading in Gergovia UVA - 11054
- UVa 12505 Searching in sqrt(n)
- 3.9 All in All UVa 10340
- UVA11880 Ball in a Rectangle
- uva10422 - Knights in FEN
- uva12657 Boxes in a Line 双向链表
- uva 10422 Knights in FEN
- uva 12657 Boxes in a Line