結果
| 問題 |
No.1319 最強とんがりコーン
|
| コンテスト | |
| ユーザー |
tko919
|
| 提出日時 | 2020-12-16 02:23:46 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 1,129 bytes |
| コンパイル時間 | 1,350 ms |
| コンパイル使用メモリ | 165,920 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-20 04:23:47 |
| 合計ジャッジ時間 | 2,873 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 70 |
ソースコード
#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)))+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-=D*D*D*log(x*2);
res+=3*D*D*D*log(a*2*a*x);
return res/a/24.;
}
int main(){
cin>>R>>H>>D;
long double res=0; a=R/H;
res=inte(H)-inte2(D/a/2.);
printf("%.12Lf\n",res);
return 0;
}
tko919