結果

問題 No.1319 最強とんがりコーン
ユーザー tko919
提出日時 2020-12-16 02:16:12
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 1,290 bytes
コンパイル時間 1,359 ms
コンパイル使用メモリ 166,668 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-20 04:21:26
合計ジャッジ時間 2,842 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 69 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;

//template
#define rep(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define ALL(v) (v).begin(),(v).end()
typedef long long int ll;
const int inf = 0x3fffffff; const ll INF = 0x1fffffffffffffff; const double eps=1e-12;
template<typename T>inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<typename T>inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
//end

long double R,H,D,a;
long double inte(long double x){
   long double res;
   res=16*a*a*a*x*x*x*acos(D/2./a/x);
   res-=2*a*D*x*(a*x*sqrt(max((long double).0,4-D*D/a/a/x/x))+3*sqrt(max((long double).0,4*a*a*x*x-D*D)));
   res-=D*D*D*log(x*(sqrt(max((long double).0,4-D*D/a/a/x/x))+2));
   res+=3*D*D*D*log(a*(sqrt(max((long double).0,4*a*a*x*x-D*D))+2*a*x));
   return res/a/24.;
}
long double inte2(long double x){
   long double res;
   res=16*a*a*a*x*x*x*acos(D/2./a/x);
   res-=2*a*D*x*(a*x*sqrt(4-D*D/a/a/x/x)+3*sqrt(4*a*a*x*x-D*D));
   res-=D*D*D*log(x*(sqrt(4-D*D/a/a/x/x)+2));
   res+=3*D*D*D*log(a*(sqrt(4*a*a*x*x-D*D)+2*a*x));
   return res/a/24.;
}

int main(){
   cin>>R>>H>>D;
   long double res=0; a=R/H;
   res=inte(H)-inte(D/a/2.);
   chmin(res,inte2(H)-inte2(D/a/2.+1e-13));
   printf("%.12Lf\n",res);
   return 0;
}
0