UVA10215The Largest/Smallest Box(小数精度)

本身很容易却因为评测机有毒的一道题,,,看网上题解说最后一个答案要加一个很小的数才能AC,据说是因为没有speci judge

 1 #include <iostream>
 2 #include <string.h>
 3 #include <cstdio>
 4 #include <math.h>
 5 
 6 #define SIGMA_SIZE 26
 7 #pragma warning ( disable : 4996 )
 8 using namespace std;
 9 
10 inline int Max(int a,int b) { return a>b?a:b; }
11 inline int Min(int a,int b) { return a>b?b:a; }
12 const int inf = 0x3f3f3f3f;
13 const int maxn = 1e3+5;
14 const int mod = 10056;
15 
16 double l, w, mm = 1e-7;
17 
18 int main()
19 {
20     while ( ~scanf("%lf%lf", &l, &w) )
21     {
22         double tmp = ( (l+w) - sqrt( l*l + w*w - l*w ) )/6;;
23         double m = (l>w?w:l)/2;
24         //ans = ( l-2*tmp )*( w-2*tmp )*tmp;
25         printf( "%.3lf %.3lf %.3lf\n", tmp, (double)0.0, m+mm );
26     }
27 }

 

转载于:https://www.cnblogs.com/chaoswr/p/8665895.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值