結果

問題 No.1319 最強とんがりコーン
ユーザー kotatsugame
提出日時 2020-12-17 02:12:42
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 347 bytes
コンパイル時間 753 ms
コンパイル使用メモリ 73,548 KB
実行使用メモリ 14,336 KB
最終ジャッジ日時 2024-09-20 06:02:08
合計ジャッジ時間 7,150 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample -- * 1
other TLE * 1 -- * 69
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    7 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
#include<iomanip>
#include<cmath>
using namespace std;
const int dx=1<<27;
double R,H,D;
main()
{
	cin>>R>>H>>D;
	double ans=0;
	for(int cnt=0;cnt<dx;cnt++)
	{
		double r=(1-(double)cnt/dx)*R;
		if(r+r<=D)break;
		double theta=2*acos(D/2/r);
		ans+=r*r*theta-r*r*sin(theta);
	}
	cout<<fixed<<setprecision(16)<<ans*H/dx<<endl;
}
0