POJ1927 Area in Triangle
| Time Limit: 1000MS | Memory Limit: 30000K | |
| Total Submissions: 1458 | Accepted: 759 |
Description

Input
Output
Case i: X
Where i is the case number, and X is the largest area which is rounded to two digits after the decimal point.
Sample Input
12.0000 23.0000 17.0000 40.0000
84.0000 35.0000 91.0000 210.0000
100.0000 100.0000 100.0000 181.3800
0 0 0 0
Sample Output
Case 1: 89.35
Case 2: 1470.00
Case 3: 2618.00
Source
数学问题 计算几何
(物理题?)
画图太麻烦了,随便贴个别处的题解吧233 http://blog.csdn.net/xuechelingxiao/article/details/40707691
没加case傻傻WA了两次
/*by SilverN*/
#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<vector>
using namespace std;
const int mxn=;
int read(){
int x=,f=;char ch=getchar();
while(ch<'' || ch>''){if(ch=='-')f=-;ch=getchar();}
while(ch>='' && ch<=''){x=x*+ch-'';ch=getchar();}
return x*f;
}
double a,b,c,d;
inline double Sin(double a,double b,double c){
double Cos=(a*a+b*b-c*c)/(*a*b);
return sqrt(-Cos*Cos);
}
double calc(double a,double b,double c,double d){
double Pi=acos(-1.0);
double S=0.5*a*b*Sin(a,b,c);
if(d-(a+b+c)>=){return S;}
double h=S*/(a+b+c);
if(h**Pi>=d){return d*d//Pi;}
double Len=a+b+c;
double T=(Len-d)/(Len-*Pi*h);
return S-S*T*T+(h*T)*(h*T)*Pi;
}
int main(){
int i,j,cas=;
while(scanf("%lf%lf%lf%lf",&a,&b,&c,&d)!=EOF){
if(a== && b== && c== && d==)break;
printf("Case %d: %.2f\n",++cas,calc(a,b,c,d));
}
return ;
}
POJ1927 Area in Triangle的更多相关文章
- POJ 1927 Area in Triangle(计算几何)
Area in Triangle 博客原文地址:http://blog.csdn.net/xuechelingxiao/article/details/40707691 题目大意: 给你一个三角形的三 ...
- POJ 1927 Area in Triangle
Area in Triangle Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 1674 Accepted: 821 D ...
- hdu 1451 Area in Triangle(计算几何 三角形)
Given a triangle field and a rope of a certain length (Figure-1), you are required to use the rope t ...
- Area in Triangle /// oj10229
题目大意: 给出三角形的三个顶点 再给一条绳(绳长不超过三角形周长) 求绳子在三角形中能围出的最大面积 题解链接 http://blog.sina.com.cn/s/blog_6a46cc3f0100 ...
- POJ 1927 Area in Triangle 题解
link Description 给出三角形三边长,给出绳长,问绳在三角形内能围成的最大面积.保证绳长 \(\le\) 三角形周长. Solution 首先我们得知道,三角形的内切圆半径就是三角形面积 ...
- UVa 11437:Triangle Fun(计算几何综合应用,求直线交点,向量运算,求三角形面积)
Problem ATriangle Fun Input: Standard Input Output: Standard Output In the picture below you can see ...
- zoj 1010 Area【线段相交问题】
链接: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1010 http://acm.hust.edu.cn/vjudge/ ...
- Triangle 1.6 (A Two-Dimensional Quality Mesh Generator and Delaunay Triangulator)
Triangle 一个二维高质量网格(mesh)生成器和Delaunay三角化工具. PSLG(Planar Straight Line Graph)约束Delaunay三角网(CDT)与Delaun ...
- [ZJU 1010] Area
ZOJ Problem Set - 1010 Area Time Limit: 2 Seconds Memory Limit: 65536 KB Special Judge Jer ...
随机推荐
- Android驱动开发读书笔记六
第六章 Linux 驱动的工作和访问方式是 Linux 的亮点之一,Linux 系统将每一个驱动都映射成一个文件.这些文件称为设备文件或驱动文件,都保存在/dev目录中,由于大多数Linux驱动都有与 ...
- 1037: [ZJOI2008]生日聚会Party
Time Limit: 10 Sec Memory Limit: 162 MBSubmit: 3121 Solved: 1858[Submit][Status][Discuss] Descript ...
- 1005: [HNOI2008]明明的烦恼
Time Limit: 1 Sec Memory Limit: 162 MBSubmit: 6539 Solved: 2558[Submit][Status][Discuss] Descripti ...
- 同时启动多个tomcat的配置信息
同时启动多个tomcat的配置信息 下面把该配置文件中各端口的含义说明下. <Server port="8005" shutdown="SHUTDOWN" ...
- Android Studio 安装与使用ADB wifi 无线调试
首先,安装ADB WIFI File->Settings->Plugins 其次,用USB连接手机与电脑(并开启手机的调试模式) 任务栏若无提示,即可拔下USB线,开始无线调试 任务栏若是 ...
- JZOJ 5461. 【NOIP2017提高A组冲刺11.8】购物
5461. [NOIP2017提高A组冲刺11.8]购物 (File IO): input:shopping.in output:shopping.out Time Limits: 1000 ms ...
- Admin站点
使用admin站点 a.在settings.py中设置语言和时区 LANGUAGE_CODE = 'zh-hans' # 使用中国语言 TIME_ZONE = 'Asia/Shanghai' # 使用 ...
- Kilani and the Game CodeForces - 1105D (bfs)
Kilani is playing a game with his friends. This game can be represented as a grid of size n×mn×m, wh ...
- BFS:Nightmare(可返回路径)
解题心得: 1.point:关于可以返回路径的BFS的标记方法,并非是简单的0-1,而是可以用时间比较之后判断是否push. 2.queue创建的地点(初始化问题),在全局中创建queue在一次调用B ...
- P1101 单词方阵
题目描述 给一 n \times nn×n 的字母方阵,内可能蕴含多个"yizhong"单词.单词在方阵中是沿着同一方向连续摆放的.摆放可沿着 88 个方向的任一方向,同一单词摆放 ...