UVA 10209 - Is This Integration
来源:互联网 发布:1024程序员节 编辑:程序博客网 时间:2024/06/05 05:17
本来以为用最简单的容斥原理就可以求出不同部分的面积,后来发现根本不能,看了一下题目:“要算积分吗?”我的回答差点是:要,不过后来明白了,不用积分就可以算,只需要做两条辅助线即可,CD边的中点下面正对的那条点记作E,连接AE,BE,便出现了一个三角形,然后就可以根据容斥原理求出来,
code:
#include<cstdio>
#include<cmath>
#define PI 3.141592653589
int main()
{
double a;
while(scanf(\"%lf\",&a)!=EOF)
{
double rest=4*(a*a-PI*a*a/6-sqrt(3.0)*a*a/4);
double dotted=4*(a*a-PI*a*a/4-2*(a*a-PI*a*a/6-sqrt(3.0)*a*a/4));
double striped=a*a-rest-dotted;
printf(\"%.3lf %.3lf %.3lf\\n\",striped,dotted,rest);
}
return 0;
}
- uva 10209 Is This Integration?
- [uva] 10209 - Is This Integration ?
- UVA 10209 - Is This Integration
- UVA 10209 Is This Integration ?
- UVa 10209 - Is This Integration ?
- UVa Problem 10209 Is This Integration? (需要积分吗?)
- UVA 10209(Is This Integration ?-容斥原理)
- uva 10209 Is This Integration ? (计算几何)
- UVa 10209 Is This Integration ?(计算几何)
- UVA 343 What Base Is This?
- UVa 11479 - Is this the easiest problem?
- UVa 343 - What Base Is This?
- uva 343 What Base Is This?
- maven Integration is disabled
- Materialized View Integration Is Over
- Continuous Integration is your best friend
- Integration
- This is a test
- UVA 10375 - Choose and divide
- UVA 10161-Ant on a Chessboard
- UVA 10177 - (234)-D SqrRectsCubesBoxes
- UVA 10182 - Bee Maja
- UVA 10195 - The Knights Of The Round Table
- UVA 10209 - Is This Integration
- UVA 10215 - The LargestSmallest Box ...
- UVA 10310 - Dog and Gopher
- UVA 439 - Knight Moves
- POJ 1979 - Red and Black
- POJ 3126 - Prime Path
- POJ 3278 - Catch That Cow
- POJ 2312 - Battle City
- POJ 2251 - Dungeon Master