結果
| 問題 | 
                            No.1319 最強とんがりコーン
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2020-12-17 02:13:06 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 347 bytes | 
| コンパイル時間 | 532 ms | 
| コンパイル使用メモリ | 73,552 KB | 
| 実行使用メモリ | 6,948 KB | 
| 最終ジャッジ日時 | 2024-09-20 06:02:53 | 
| 合計ジャッジ時間 | 37,419 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 62 WA * 8 | 
コンパイルメッセージ
main.cpp:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    7 | main()
      | ^~~~
            
            ソースコード
#include<iostream>
#include<iomanip>
#include<cmath>
using namespace std;
const int dx=1<<25;
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;
}