L - Pyramids

L - Pyramids
Time Limit:1000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u

Description

Recently in Farland, a country in Asia, a famous scientist Mr. Log Archeo has discovered ancient pyramids. But unlike those in Egypt and Central America, they have triangular (not rectangular) foundation. That is, they are tetrahedrons in mathematical sense. In order to find out some important facts about the early society of the country (it is widely believed that the pyramid sizes are in tight connection with Farland ancient calendar), Mr. Archeo needs to know the volume of the pyramids. Unluckily, he has reliable data about their edge lengths only. Please, help him!

Input

The file contains six positive integer numbers not exceeding 1000 separated by spaces, each number is one of the edge lengths of the pyramid ABCD. The order of the edges is the following: AB, AC, AD, BC, BD, CD.

Output

A real number -- the volume printed accurate to four digits after decimal point.

Sample Input

1000 1000 1000 3 4 5

Sample Output

1999.9938

这个题就是公式,没有公式完全做不出,


#include <stdio.h>
#include <math.h>
double a,b,c,d,e,f;
double i1,i2,i3,i4;
int main(){
 while(scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f)!=EOF){
  i1=acos((a*a+b*b-d*d)/2/a/b);
  i2=acos((b*b+c*c-f*f)/2/c/b);
  i3=acos((a*a+c*c-e*e)/2/a/c);
  i4=1.0/2*(i1+i2+i3);
 printf("%.4f\n",1.0/3*a*b*c*sqrt(sin(i4)*sin(i4-i1)*sin(i4-i2)*sin(i4-i3)));
 }
  return 0;
}




### FPN (Feature Pyramid Network) 和 PAN (Path Aggregation Network) 架构解析 #### FPN架构详解 FPN是一种用于增强特征提取能力的网络结构,尤其适用于目标检测任务中的多尺度物体识别。该网络通过自底向上的路径构建多个层次的特征金字塔,并利用横向连接将低层高分辨率的语义信息传递给高层[^1]。 - **顶层到底层的信息流**:在FPN中,来自骨干网络(Backbone)的最后一层特征图作为最粗略但富含全局上下文信息的一环被选作起始点。 - **上采样与融合操作**:每一级都会经过一次或多次卷积处理后再进行2倍大小的最近邻插值放大;接着同相应位置处较浅层具有相同空间维度却更精细局部细节描述力强的特点相结合形成新的加强版表征形式。 ```mermaid graph TD; A[Input Image] --> B{Bottom-up Path}; B --> C[Layer 1]; C --> D[Layer 2]; D --> E[Layer 3]; E --> F[Layer 4]; F --> G[Layer 5]; G --> H{Top-down Path & Lateral Connections}; H --> I[C5 -> P5]; I --> J[P5 upsampled + C4 -> P4]; J --> K[P4 upsampled + C3 -> P3]; K --> L[P3 upsampled + C2 -> P2]; L --> M[Output Pyramids {P2, P3, P4, P5}]; ``` #### PAN架构详解 相较于传统的FPN设计思路,PAN不仅保留了前者由下至上再加权求和得到最终输出这一特性外还额外引入了一个反方向传播机制——即从底部到顶部逐层聚合各阶段产生的响应结果从而进一步强化模型对于小尺寸目标物捕捉精度的能力。 - **双向信息流动**:除了沿袭自FPN的自顶向下路径之外,在PAN里新增了一条自底而上的快速通道用来补充细粒度的空间定位线索并加速收敛速度。 - **改进后的性能表现**:这种独特的双通路设置使得整个框架能够更加高效地综合不同抽象级别的视觉模式进而达到更好的泛化效果以及更高的查准率/召回率指标水平。 ```mermaid graph TD; A[Input Image] --> B{Bottom-up Path}; B --> C[Layer 1]; C --> D[Layer 2]; D --> E[Layer 3]; E --> F[Layer 4]; F --> G[Layer 5]; G --> H{Top-down Path & Lateral Connections}; H --> I[C5 -> P5]; I --> J[P5 upsampled + C4 -> P4]; J --> K[P4 upsampled + C3 -> P3]; K --> L[P3 upsampled + C2 -> P2]; L --> N{Bottom-up Path of PAN}; N --> O[P2 downsampled + P3 -> FP3]; O --> P[FP3 downsampled + P4 -> FP4]; P --> Q[FP4 downsampled + P5 -> FP5]; Q --> R[Final Output Features {FP2, FP3, FP4, FP5}]; ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值