Lightoj 1043
来源:互联网 发布:买别人的淘宝店铺 编辑:程序博客网 时间:2024/06/05 08:39
题意:给两个相似三角形求AD边的长度。
思路:找出一写公式推出来就行了。
AC代码:
#include <cstdio>#include <cstring>#include <algorithm>#include <iostream>#include <stack>#include <queue>#include <vector>#include <cmath>#include <map>#include <set>#define ll long long#define llu unsigned long longusing namespace std;const double eps = 1e-8;const double PI = 3.1415926;struct Point { double x,y; Point (double x = 0,double y = 0) : x(x),y(y) {}};Point p[100500],s[100500];struct Line{ Point a,b;};Line line[100];int indl,indp;bool dcmp(double x) { if(fabs(x)-0.0 <= eps) return true; return false;}int main(){ int t; scanf("%d",&t); for(int cas = 1; cas<=t; cas++){ double l1,l2,l3,r; scanf("%lf%lf%lf%lf",&l1,&l2,&l3,&r); double R = 1/(1+1/r); printf("Case %d: %.10lf\n",cas,l1/(sqrt(1/R))); } return 0;}
0 0
- LightOJ 1043
- Lightoj 1043
- LightOJ 1043 Triangle Partitioning
- LightOJ 1043 - Triangle Partitioning
- LIGHTOJ-1043 -Triangle Partitioning
- lightoj 1043 - Triangle Partitioning
- LightOJ 1043 - Triangle Partitioning
- Lightoj 1043 (Triangle Partitioning)
- LightOJ 1043 Triangle Partitioning
- 【LightOJ 1043 Triangle Partitioning】
- LightOJ
- LightOJ
- LightOJ
- LightOJ
- LightOJ
- [LightOJ
- LightOJ
- LightOJ
- 【Java学习笔记】——JDK与JRE的区别
- JAVA值传递和引用传递
- 关于JS中比较符==和===的判断不同解释
- 【数据结构与算法】——基数排序
- How can we double the data rate of 802.11a?
- Lightoj 1043
- 8大经典数据挖掘算法
- 十道海量数据处理面试题
- js中json与数组字符串的相互转化
- Two Sum(easy)
- Python删除列表元素不全
- 【数据结构与算法】——归并排序
- UCOS2系统内核讲述(三)_TCB任务控制块
- String165CompareVersionNumbers