結果

問題 No.1319 最強とんがりコーン
ユーザー 👑 Nachia
提出日時 2020-12-16 00:31:06
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 569 ms / 2,000 ms
コード長 499 bytes
コンパイル時間 7,312 ms
コンパイル使用メモリ 193,852 KB
最終ジャッジ日時 2025-01-17 01:22:56
ジャッジサーバーID
(参考情報)
judge3 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 70
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using LL=long long;
using ULL=unsigned long long;
#define rep(i,n) for(int i=0; i<(n); i++)

const double pi = acos(-1.);

double solve(double D){
	double res=0.;
	for(double i=1.e-12; i<1;){
		double r=1.-i; if(D>r) break;
		double d=i*1.e-6;
		double c=2.*sqrt(r*r-D*D);
		res += (2.*acos(D/r)*r*r - D*c) * d;
		i+=d;
	}
	return res;
}

int main(){
	double R,H,D; cin>>R>>H>>D;
	cout<<fixed<<setprecision(10)<<(solve(D/R/2.)*H*R*R)<<endl;
	return 0;
}
0